|
@@ -163,7 +163,7 @@
|
|
|
|
|
|
|
|
<!-- 底部输入和操作区域 -->
|
|
<!-- 底部输入和操作区域 -->
|
|
|
<view class="input-actions-container" :class="{ 'input-actions-focused': isFocus }">
|
|
<view class="input-actions-container" :class="{ 'input-actions-focused': isFocus }">
|
|
|
- <view class="input-container" :class="{
|
|
|
|
|
|
|
+ <view class="input-container" :class="{
|
|
|
'input-container-focused': isFocus,
|
|
'input-container-focused': isFocus,
|
|
|
'input-container-normal': !isFocus
|
|
'input-container-normal': !isFocus
|
|
|
}">
|
|
}">
|
|
@@ -190,8 +190,8 @@
|
|
|
src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/more-icon.png"
|
|
src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/more-icon.png"
|
|
|
class="action-icon" /> -->
|
|
class="action-icon" /> -->
|
|
|
|
|
|
|
|
- <image :src="liveItem.showType == 1
|
|
|
|
|
- ? '/static/images/more2.png'
|
|
|
|
|
|
|
+ <image :src="liveItem.showType == 1
|
|
|
|
|
+ ? '/static/images/more2.png'
|
|
|
:'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/more-icon.png'"
|
|
:'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/more-icon.png'"
|
|
|
class="action-icon" />
|
|
class="action-icon" />
|
|
|
</view>
|
|
</view>
|
|
@@ -1214,7 +1214,7 @@
|
|
|
this.isLogin = true
|
|
this.isLogin = true
|
|
|
this.haveLogin()
|
|
this.haveLogin()
|
|
|
// console.log("TOKEN_KEYAuto",TOKEN_KEYAuto)
|
|
// console.log("TOKEN_KEYAuto",TOKEN_KEYAuto)
|
|
|
- // this.getIsAddKf()
|
|
|
|
|
|
|
+ // this.getIsAddKf()
|
|
|
} else {
|
|
} else {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: res.msg,
|
|
title: res.msg,
|
|
@@ -3694,6 +3694,8 @@
|
|
|
|
|
|
|
|
// 给消息添加唯一ID
|
|
// 给消息添加唯一ID
|
|
|
message.uniqueId = ++this.messageIdCounter;
|
|
message.uniqueId = ++this.messageIdCounter;
|
|
|
|
|
+ let msgdata = JSON.parse(message.data);
|
|
|
|
|
+ message.msgId = msgdata.msgId;
|
|
|
this.talklist.push(message);
|
|
this.talklist.push(message);
|
|
|
|
|
|
|
|
// 当消息超过限制时,批量删除旧消息
|
|
// 当消息超过限制时,批量删除旧消息
|
|
@@ -3904,7 +3906,10 @@
|
|
|
status: true
|
|
status: true
|
|
|
};
|
|
};
|
|
|
} else if (socketMessage.cmd == 'deleteMsg') {
|
|
} else if (socketMessage.cmd == 'deleteMsg') {
|
|
|
-
|
|
|
|
|
|
|
+ const index = this.talklist.findIndex(item => item.msgId == socketMessage.msg);
|
|
|
|
|
+ if (index !== -1) {
|
|
|
|
|
+ this.talklist.splice(index, 1);
|
|
|
|
|
+ }
|
|
|
}else if (socketMessage.cmd == 'LotteryDetail') {
|
|
}else if (socketMessage.cmd == 'LotteryDetail') {
|
|
|
try {
|
|
try {
|
|
|
this.prizeInfo = Array.isArray(JSON.parse(socketMessage.data || '[]')) ? JSON.parse(
|
|
this.prizeInfo = Array.isArray(JSON.parse(socketMessage.data || '[]')) ? JSON.parse(
|
|
@@ -3984,34 +3989,32 @@
|
|
|
};
|
|
};
|
|
|
// 发送socket消息
|
|
// 发送socket消息
|
|
|
try {
|
|
try {
|
|
|
- if (this.myselfFlag) {
|
|
|
|
|
- this.addToTalkList(data);
|
|
|
|
|
- } else {
|
|
|
|
|
- this.socket.send({
|
|
|
|
|
- data: JSON.stringify(data),
|
|
|
|
|
- success: () => {
|
|
|
|
|
- this.value = '';
|
|
|
|
|
- // 发送成功后强制滚动到底部,无论当前滚动位置如何
|
|
|
|
|
- this.forceScrollToBottomOnSend();
|
|
|
|
|
- },
|
|
|
|
|
- fail: (err) => {
|
|
|
|
|
- console.error('消息发送失败:', err);
|
|
|
|
|
- if (retries > 0) {
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: `发送失败,正在重试(${retries}次)`,
|
|
|
|
|
- icon: 'none'
|
|
|
|
|
- });
|
|
|
|
|
- setTimeout(() => this.sendMsg(retries - 1), 500);
|
|
|
|
|
- } else {
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: '发送失败,请稍后再试',
|
|
|
|
|
- icon: 'none'
|
|
|
|
|
- });
|
|
|
|
|
- this.value = text; // 恢复输入框内容
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ this.socket.send({
|
|
|
|
|
+ data: JSON.stringify(data),
|
|
|
|
|
+ success: () => {
|
|
|
|
|
+ this.value = '';
|
|
|
|
|
+ // 发送成功后强制滚动到底部,无论当前滚动位置如何
|
|
|
|
|
+ this.forceScrollToBottomOnSend();
|
|
|
|
|
+ },
|
|
|
|
|
+ fail: (err) => {
|
|
|
|
|
+ console.error('消息发送失败:', err);
|
|
|
|
|
+ if (retries > 0) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: `发送失败,正在重试(${retries}次)`,
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ setTimeout(() => this.sendMsg(retries - 1), 500);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '发送失败,请稍后再试',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ this.value = text; // 恢复输入框内容
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
|
|
|
} catch (err) {
|
|
} catch (err) {
|
|
|
console.error('发送消息异常:', err);
|
|
console.error('发送消息异常:', err);
|
|
@@ -5676,4 +5679,4 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-</style>
|
|
|
|
|
|
|
+</style>
|