fix:im表情显示修复,删除用户中心已完成红点
This commit is contained in:
parent
4391347b87
commit
fedecba65c
@ -51,12 +51,10 @@
|
|||||||
<view class="left">
|
<view class="left">
|
||||||
<!-- 文字消息 -->
|
<!-- 文字消息 -->
|
||||||
<view v-if="row.msg.type == 'text'" class="bubble">
|
<view v-if="row.msg.type == 'text'" class="bubble">
|
||||||
<u-parse
|
<rich-text
|
||||||
:content="row.msg.content.text + ''"
|
:nodes="row.msg.content.text + ''"
|
||||||
@navigate="navigate"
|
|
||||||
:imageProp="{ lazyLoad: true }"
|
|
||||||
class="white"
|
class="white"
|
||||||
></u-parse>
|
></rich-text>
|
||||||
</view>
|
</view>
|
||||||
<!-- 语言消息 -->
|
<!-- 语言消息 -->
|
||||||
<view
|
<view
|
||||||
@ -179,12 +177,12 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 文字消息 -->
|
<!-- 文字消息 -->
|
||||||
<view v-if="row.msg.type == 'text'" class="bubble">
|
<view v-if="row.msg.type == 'text'" class="bubble">
|
||||||
<u-parse
|
<rich-text
|
||||||
:content="row.msg.content.text + ''"
|
:nodes="row.msg.content.text + ''"
|
||||||
@navigate="navigate"
|
class="white"
|
||||||
:imageProp="{ lazyLoad: true }"
|
></rich-text>
|
||||||
></u-parse> </view
|
</view>
|
||||||
><br />
|
<br />
|
||||||
<view
|
<view
|
||||||
v-if="false && row.msg.type == 'text'"
|
v-if="false && row.msg.type == 'text'"
|
||||||
@click="translate(row.msg.content.text, index)"
|
@click="translate(row.msg.content.text, index)"
|
||||||
@ -814,6 +812,7 @@ export default {
|
|||||||
let that = this;
|
let that = this;
|
||||||
|
|
||||||
this.emojiList = emojiData.imgArr[1].emojiList;
|
this.emojiList = emojiData.imgArr[1].emojiList;
|
||||||
|
this.emojiPath = emojiData.imgArr[1].emojiPath;
|
||||||
|
|
||||||
/*that.$Socket.listenlist[this.chattype+this.chat_to_puid]=true;
|
/*that.$Socket.listenlist[this.chattype+this.chat_to_puid]=true;
|
||||||
if(that.$Socket.listenlist[this.chattype+this.chat_to_puid]){
|
if(that.$Socket.listenlist[this.chattype+this.chat_to_puid]){
|
||||||
@ -958,6 +957,7 @@ export default {
|
|||||||
|
|
||||||
screenMsg(msg) {
|
screenMsg(msg) {
|
||||||
console.info("screenMsg");
|
console.info("screenMsg");
|
||||||
|
console.log("收到消息原始内容:", msg.msg.content.text); // 未处理的原始内容
|
||||||
console.info(msg);
|
console.info(msg);
|
||||||
//从长连接处转发给这个方法,进行筛选处理
|
//从长连接处转发给这个方法,进行筛选处理
|
||||||
|
|
||||||
@ -1445,6 +1445,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 发送大表情
|
// 发送大表情
|
||||||
sendBigEmoji(url) {
|
sendBigEmoji(url) {
|
||||||
|
console.log("发送表情,图片路径:", this.emojiPath + url);
|
||||||
this.hideDrawer(); //隐藏抽屉
|
this.hideDrawer(); //隐藏抽屉
|
||||||
if (!url) {
|
if (!url) {
|
||||||
return;
|
return;
|
||||||
@ -1487,32 +1488,22 @@ export default {
|
|||||||
this.sendMsg(msg, "text");
|
this.sendMsg(msg, "text");
|
||||||
this.textMsg = ""; //清空输入框
|
this.textMsg = ""; //清空输入框
|
||||||
},
|
},
|
||||||
//替换表情符号为图片
|
|
||||||
replaceEmoji(str) {
|
replaceEmoji(str) {
|
||||||
// 正则表达式匹配内容
|
|
||||||
let replacedStr = str.replace(/\[([^(\]|\[)]*)\]/g, (item, index) => {
|
let replacedStr = str.replace(/\[([^(\]|\[)]*)\]/g, (item, index) => {
|
||||||
// console.log("item: " + item);
|
console.log("匹配到的表情符号:", item);
|
||||||
for (let i = 0; i < this.emojiList.length; i++) {
|
for (let i = 0; i < this.emojiList.length; i++) {
|
||||||
let row = this.emojiList[i];
|
let row = this.emojiList[i];
|
||||||
for (let j = 0; j < row.length; j++) {
|
for (let j = 0; j < row.length; j++) {
|
||||||
let EM = row[j];
|
let EM = row[j];
|
||||||
if (EM.alt == item) {
|
if (EM.alt == item) {
|
||||||
// 在线表情路径,图文混排必须使用网络路径,请上传一份表情到你的服务器后再替换此路径
|
// 在线表情路径,图文混排必须使用网络路径,请上传一份表情到你的服务器后再替换此路径
|
||||||
//比如你上传服务器后,你的100.gif路径为https://www.xxx.com/emoji/100.gif 则替换onlinePath填写为https://www.xxx.com/emoji/
|
|
||||||
// let onlinePath = 'https://s2.ax1x.com/2019/04/12/'
|
|
||||||
// let imgstr = '<image src="'+onlinePath+this.onlineEmoji[EM.url]+'">';
|
|
||||||
|
|
||||||
let onlinePath = this.emojiPath;
|
let onlinePath = this.emojiPath;
|
||||||
let imgstr =
|
let imgstr = `<img style="width:24px;height:24px;" src="${onlinePath}${EM.url}">`;
|
||||||
'<img style="width:24px;height:24px;" src="' +
|
|
||||||
onlinePath +
|
|
||||||
EM.url +
|
|
||||||
'">';
|
|
||||||
// console.log("imgstr: " + imgstr);
|
|
||||||
return imgstr;
|
return imgstr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return item;
|
||||||
});
|
});
|
||||||
return replacedStr;
|
return replacedStr;
|
||||||
},
|
},
|
||||||
@ -1523,7 +1514,10 @@ export default {
|
|||||||
console.info(content.text);
|
console.info(content.text);
|
||||||
console.info(type);
|
console.info(type);
|
||||||
console.info(needload);
|
console.info(needload);
|
||||||
|
if (type === "text" && content.text) {
|
||||||
|
// 用<div>包裹文字,确保 rich-text 能识别
|
||||||
|
content.text = `<div style="word-wrap: break-word;">${content.text}</div>`;
|
||||||
|
}
|
||||||
let message_id = 1001;
|
let message_id = 1001;
|
||||||
var mine = {
|
var mine = {
|
||||||
username: this.userInfo.user_nickname,
|
username: this.userInfo.user_nickname,
|
||||||
@ -1660,6 +1654,7 @@ export default {
|
|||||||
addTextMsg(msg) {
|
addTextMsg(msg) {
|
||||||
console.info("addTextMsg");
|
console.info("addTextMsg");
|
||||||
console.info(msg);
|
console.info(msg);
|
||||||
|
msg.msg.content.text = this.replaceEmoji(msg.msg.content.text);
|
||||||
this.msgList.push(msg);
|
this.msgList.push(msg);
|
||||||
},
|
},
|
||||||
// 添加语音消息到列表
|
// 添加语音消息到列表
|
||||||
@ -1991,4 +1986,27 @@ export default {
|
|||||||
height: 90%;
|
height: 90%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 针对文字消息的气泡样式,强制文字可见
|
||||||
|
.bubble {
|
||||||
|
padding: 12rpx 16rpx !important;
|
||||||
|
background-color: #ffffff !important;
|
||||||
|
|
||||||
|
.white {
|
||||||
|
color: #333333 !important;
|
||||||
|
opacity: 1 !important;
|
||||||
|
visibility: visible !important;
|
||||||
|
font-size: 32rpx !important;
|
||||||
|
line-height: 1.5 !important;
|
||||||
|
|
||||||
|
word-wrap: break-word !important;
|
||||||
|
white-space: normal !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
rich-text {
|
||||||
|
display: inline-block !important;
|
||||||
|
min-width: 20rpx !important;
|
||||||
|
vertical-align: middle !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -87,7 +87,8 @@
|
|||||||
"NSMicrophoneUsageDescription" : "此APP会在使用声音识别服务中使用您的麦克风权限",
|
"NSMicrophoneUsageDescription" : "此APP会在使用声音识别服务中使用您的麦克风权限",
|
||||||
"NSLocationAlwaysUsageDescription" : "此App会在使用导航服务中使用您的定位权限",
|
"NSLocationAlwaysUsageDescription" : "此App会在使用导航服务中使用您的定位权限",
|
||||||
"NSLocationWhenInUseUsageDescription" : "此App会在使用导航服务中使用您的定位权限"
|
"NSLocationWhenInUseUsageDescription" : "此App会在使用导航服务中使用您的定位权限"
|
||||||
}
|
},
|
||||||
|
"dSYMs" : false
|
||||||
},
|
},
|
||||||
/* ios打包配置 */
|
/* ios打包配置 */
|
||||||
"sdkConfigs" : {
|
"sdkConfigs" : {
|
||||||
@ -138,7 +139,7 @@
|
|||||||
},
|
},
|
||||||
"icons" : {
|
"icons" : {
|
||||||
"ios" : {
|
"ios" : {
|
||||||
"appstore" : "unpackage/icon.png",
|
"appstore" : "unpackage/res/icons/1024x1024.png",
|
||||||
"ipad" : {
|
"ipad" : {
|
||||||
"app" : "unpackage/res/icons/76x76.png",
|
"app" : "unpackage/res/icons/76x76.png",
|
||||||
"app@2x" : "unpackage/res/icons/152x152.png",
|
"app@2x" : "unpackage/res/icons/152x152.png",
|
||||||
|
|||||||
@ -468,12 +468,6 @@
|
|||||||
url="/member/order/list?type=2060&sl=4"
|
url="/member/order/list?type=2060&sl=4"
|
||||||
class="m-cell m-cell-access"
|
class="m-cell m-cell-access"
|
||||||
>
|
>
|
||||||
<uni-badge
|
|
||||||
v-if="orders.fin_num_entity > 0"
|
|
||||||
:text="orders.fin_num_entity"
|
|
||||||
type="red"
|
|
||||||
class="badge"
|
|
||||||
></uni-badge>
|
|
||||||
<view class="m-cell-hd" style="color: #f30213">
|
<view class="m-cell-hd" style="color: #f30213">
|
||||||
<label class="iconfont zc zc-yiwancheng"></label>
|
<label class="iconfont zc zc-yiwancheng"></label>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user