update: 处理聊天im图片适配问题
This commit is contained in:
parent
8dd4b5c084
commit
24b1e33bbb
@ -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;`;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 计算视觉优先的图片宽高
|
// 计算视觉优先的图片宽高
|
||||||
|
|||||||
@ -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;"> </span></div>';
|
return '<div><img class="chatimg single-img" style="max-width:100%" src="' + img.replace(/(^img\[)|(\]$)/g, '') + '" /><span style="min-width: 240px;"> </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];
|
||||||
|
|||||||
@ -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();
|
||||||
|
|||||||
@ -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 =
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user