优化聊天

This commit is contained in:
haomingming
2023-03-30 11:33:45 +08:00
parent 9859b0cbea
commit 75c9d6cae2
18 changed files with 140 additions and 72 deletions
+12 -1
View File
@@ -26,7 +26,12 @@ Page({
console.log("wenzhen onload");
let usertype = wx.getStorageSync('usertype');
let userID = wx.getStorageSync('user_id_'+usertype);
wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived, this);
if(wx.$TUIKit){
wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived, this);
}else{
app.imInit();
wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived, this);
}
setInterval(() => {
let system_notice_unreadnnum = wx.getStorageSync(userID+"_system_notice_unreadnnum");
let service_notice_unreadnnum = wx.getStorageSync(userID+"_service_notice_unreadnnum");
@@ -70,6 +75,11 @@ Page({
}).then(() => {
console.log("开始查询订单状态")
this.formatStatus();
}).catch(error => {
console.log(error)
// 补偿登录操作
app.imInit();
this.getConversationList();
});
},
go(e){
@@ -302,6 +312,7 @@ Page({
})
if(wenzhen_info == 0) wenzhen_info = "";
if(wenzhen_info > 99) wenzhen_info = "99+";
wx.setStorageSync(userID+'_wenzhen_info', wenzhen_info);
this.setData({