update: 处理聊天im图片适配问题

This commit is contained in:
mixtan 2025-09-29 19:25:23 +08:00
parent 8dd4b5c084
commit 24b1e33bbb
4 changed files with 7 additions and 7 deletions

View File

@ -53,11 +53,11 @@ export default {
if ('chatimg' == this.node.attr.class) if ('chatimg' == this.node.attr.class)
{ {
this.newStyleStr = `${styleStr}; width: 100%; padding: 0 ${+padding}px;`; this.newStyleStr = `${styleStr}; max-width: 100%; padding: 0 ${+padding}px;`;
} }
else else
{ {
this.newStyleStr = `${styleStr}; ${imageHeightStyle}; width: ${imageWidth}px; padding: 0 ${+padding}px;`; this.newStyleStr = `${styleStr}; ${imageHeightStyle}; max-width: ${imageWidth}px; padding: 0 ${+padding}px;`;
} }
}, },
// //

View File

@ -324,7 +324,7 @@ class apiconfig {
.replace(/img\[([^\s]+?)\]/g, function(img){ //转义图片 .replace(/img\[([^\s]+?)\]/g, function(img){ //转义图片
//return '<img class="layui-layim-photos" style="width: 100%;height: 100%;" src="' + img.replace(/(^img\[)|(\]$)/g, '') + '">'; //return '<img class="layui-layim-photos" style="width: 100%;height: 100%;" src="' + img.replace(/(^img\[)|(\]$)/g, '') + '">';
return '<div><img class="chatimg single-img" src="' + img.replace(/(^img\[)|(\]$)/g, '') + '" /><span style="min-width: 240px;">&nbsp;</span></div>'; return '<div><img class="chatimg single-img" style="max-width:100%" src="' + img.replace(/(^img\[)|(\]$)/g, '') + '" /><span style="min-width: 240px;">&nbsp;</span></div>';
}) })
.replace(/file\([\s\S]+?\)\[[\s\S]*?\]/g, function(str){ //转义文件 .replace(/file\([\s\S]+?\)\[[\s\S]*?\]/g, function(str){ //转义文件
var href = (str.match(/file\(([\s\S]+?)\)\[/)||[])[1]; var href = (str.match(/file\(([\s\S]+?)\)\[/)||[])[1];

View File

@ -855,7 +855,7 @@ export default {
data.item_row.item_id; data.item_row.item_id;
let imgstr = let imgstr =
'<img class="chatimg" src="' + '<img class="chatimg aaa1" style="max-width:100%" src="' +
data.item_row.product_image + data.item_row.product_image +
'">'; '">';
let content = let content =
@ -886,7 +886,7 @@ export default {
// //
if (options.text) { if (options.text) {
let msg = { let msg = {
text: options.text, text: options.text+'aaa1',
}; };
that.sendMsg(msg, "text"); that.sendMsg(msg, "text");
} }
@ -1226,7 +1226,7 @@ export default {
} }
console.info(data); console.info(data);
console.info("msgList", this.msgList); console.info("msgList1111", this.msgList);
if (callback) { if (callback) {
callback(); callback();

View File

@ -851,7 +851,7 @@ export default {
data.item_row.item_id */ data.item_row.item_id */
let imgstr = let imgstr =
'<img class="chatimg" src="' + '<img class="chatimg" style="max-width:100%" src="' +
data.info.product_image + data.info.product_image +
'">'; '">';
let content = let content =