This commit is contained in:
haomingming
2023-04-04 09:04:29 +08:00
parent df9a526b7b
commit a1d691367e
32 changed files with 228 additions and 87 deletions
+16 -10
View File
@@ -29,8 +29,10 @@ Page({
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);
app.imInit().then(res => {
console.log("wenzhen onload imInit");
wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived, this);
});
}
setInterval(() => {
let system_notice_unreadnnum = wx.getStorageSync(userID+"_system_notice_unreadnnum");
@@ -78,8 +80,12 @@ Page({
}).catch(error => {
console.log(error)
// 补偿登录操作
app.imInit();
this.getConversationList();
app.imInit().then(res => {
this.getConversationList();
}).catch(error => {
console.log(error)
this.getConversationList();
});
});
},
go(e){
@@ -264,14 +270,14 @@ Page({
let usertype = wx.getStorageSync('usertype');
let userID = wx.getStorageSync('user_id_'+usertype);
let wenzhen_info = 0;
let totalUnreadCount = 0;
let message_inquiry_type = this.data.message_inquiry_type;
this.data.conversationList.forEach(item => {
let conversationID = item.conversationID;
if(conversationID == "C2Cadministrator") return;//如果是管理员消息直接跳过
let type = item.type;
let lastMessage = item.lastMessage;
let type = lastMessage.type;
let userProfile = item.userProfile;
if(!lastMessage) return;
let cloudCustomData = lastMessage.cloudCustomData;
@@ -303,7 +309,7 @@ Page({
session_item.from_account = userProfile.userID;
let unreadCount = item.unreadCount;
if(unreadCount > 0){
wenzhen_info = wenzhen_info + unreadCount;
totalUnreadCount = totalUnreadCount + unreadCount;
session_item.message_dot = true;
}else{
session_item.message_dot = false;
@@ -311,9 +317,9 @@ Page({
session_list[inquiry_type - 1].push(session_item);
})
if(wenzhen_info == 0) wenzhen_info = "";
if(wenzhen_info > 99) wenzhen_info = "99+";
wx.setStorageSync(userID+'_wenzhen_info', wenzhen_info);
if(totalUnreadCount == 0){
app.formatUnReadNum(userID+"_wenzhen_info", totalUnreadCount);
}
this.setData({
data_list_1: session_data_list_1,
+3
View File
@@ -151,4 +151,7 @@
</view>
<view style="height: 200rpx;"></view>
</view>