This commit is contained in:
mixtan 2025-09-20 09:14:51 +08:00
commit 02f9fcbf5c
3 changed files with 48 additions and 35 deletions

View File

@ -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.gifhttps://www.xxx.com/emoji/100.gif onlinePathhttps://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%;
} }
} }
</style> //
.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>

View File

@ -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",

View File

@ -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>