From eab9fbcb915215dcbdb011f03ab423c7cb71af9d Mon Sep 17 00:00:00 2001 From: zoujiandong <10130823232@qq.com> Date: Tue, 19 Sep 2023 09:36:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TUIKit/components/TUIChat/index.wxss | 4 ++-- app.js | 15 ++++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/TUIKit/components/TUIChat/index.wxss b/TUIKit/components/TUIChat/index.wxss index 271b13d..dab6632 100644 --- a/TUIKit/components/TUIChat/index.wxss +++ b/TUIKit/components/TUIChat/index.wxss @@ -134,7 +134,7 @@ height: 100rpx; background-color: rgb(255, 255, 255); display: flex; - padding:0 20rpx; + padding:0 10rpx; justify-content: space-between; align-items: center; box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.08); @@ -162,7 +162,7 @@ .time_desc .item{ color:#E34D59; - display:inline-flex; + display:flex; white-space: nowrap; align-items: center; font-size: 32rpx; diff --git a/app.js b/app.js index f241bc4..aa8d1e7 100644 --- a/app.js +++ b/app.js @@ -131,7 +131,7 @@ App({ }); - wx.$TUIKit.off(wx.$TUIKitTIM.EVENT.SDK_READY, this.onSDKReady); + //wx.$TUIKit.off(wx.$TUIKitTIM.EVENT.SDK_READY, this.onSDKReady); wx.$TUIKit.setLogLevel(3);//设置日志级别 wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.SDK_READY, this.onSDKReady, this); wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED, this.onTotalUnreadMessageCountUpdated); @@ -165,7 +165,7 @@ App({ // console.log("未读消息数量:", totalUnreadCount) }, onSDKReady(){ - // console.log("onSDKReady from app.js"); + console.log("onSDKReady from app.js"); this.globalData.chat_sdk_ready = true; // let promise = wx.$TUIKit.deleteConversation('C2C500318318078251008'); @@ -196,11 +196,16 @@ App({ if(!index_info) wx.setStorageSync(userID+'_index_info',""); if(!my_info) wx.setStorageSync(userID+'_my_info', ""); this.formatWenZhenInfo(); - - wx.$TUIKit.off(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onSystemPushReceived); wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onSystemPushReceived, this); //互踢 - wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.KICKED_OUT, this.onKickedOut); + console.log("互踢"); + wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.KICKED_OUT, this.onKickedOut,this); + }, + onUnload(){ + wx.$TUIKit.off(wx.$TUIKitTIM.EVENT.SDK_READY, this.onSDKReady); + wx.$TUIKit.off(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onSystemPushReceived); + wx.$TUIKit.off(wx.$TUIKitTIM.EVENT.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED, this.onTotalUnreadMessageCountUpdated); + wx.$TUIKit.off(wx.$TUIKitTIM.EVENT.KICKED_OUT,this.$onKickedOut); }, onKickedOut(){ // console.log("onKickedOutonKickedOutonKickedOutonKickedOut");