From e36267066f18e4ecde705afd1b456e5a39cca852 Mon Sep 17 00:00:00 2001 From: zengBin Date: Sun, 29 Sep 2024 13:54:43 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=BE=AE=E6=A0=87=E6=95=B0=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/dynamicList.wpy | 2 +- src/mixins/base.js | 2 +- src/pages/tabBar/news.wpy | 9 +++++--- src/utils/im.js | 38 +++++++++++++++++----------------- src/utils/util.js | 3 ++- 5 files changed, 29 insertions(+), 25 deletions(-) diff --git a/src/components/dynamicList.wpy b/src/components/dynamicList.wpy index c3b6af6..6ef65a5 100644 --- a/src/components/dynamicList.wpy +++ b/src/components/dynamicList.wpy @@ -274,7 +274,7 @@ scroll-view { {{ item.liker_count }} - + diff --git a/src/mixins/base.js b/src/mixins/base.js index 2d9f432..7f63981 100644 --- a/src/mixins/base.js +++ b/src/mixins/base.js @@ -10,7 +10,7 @@ export default { methods: { // 跳转事件校验是否已经完善注册资料 $signInVerify() { - return wx.getStorageSync('userInfo') + return wx.getStorageSync('userInfo').is_base_profile }, $callPhone(mobile) { wx.makePhoneCall({ diff --git a/src/pages/tabBar/news.wpy b/src/pages/tabBar/news.wpy index 2aa7e29..eac4406 100644 --- a/src/pages/tabBar/news.wpy +++ b/src/pages/tabBar/news.wpy @@ -309,7 +309,10 @@ wepy.page({ let vm = this vm.$get({url: `${service.host}/notice/count`}).then(({code, data}) => { if (code === 0) { - let {new_count} = data + vm.menuList[0].count = data.system_count + vm.menuList[1].count = data.friend_count + vm.menuList[2].count = data.follow_count + data.visit_count + let {notice_count} = data let groupCountList = wx.getStorageSync('teamsSessionsCount') || [] let groupCount = 0 if (groupCountList.length > 0) { @@ -317,10 +320,10 @@ wepy.page({ groupCount += groupCountList[i].unread } } - if ((new_count + groupCount) > 0) { + if ((notice_count + groupCount) > 0) { wx.setTabBarBadge({ index: 0, - text: `${new_count + groupCount}` + text: `${notice_count + groupCount}` }) } else { wx.removeTabBarBadge({ diff --git a/src/utils/im.js b/src/utils/im.js index 5db3b2d..aae35bf 100644 --- a/src/utils/im.js +++ b/src/utils/im.js @@ -83,20 +83,20 @@ const IM = (account, token) => { notiTypeData = wx.getStorageSync('nuteNotList').find((item) => item.teamId == e.to) } // 如果是开启了免打扰的群消息,自动调用群消息已读接口 - if (notiTypeData.muteTeam) { - wx.request({ - url: `${service.host}/chat/group/read`, - header: { - 'Authorization': 'Bearer ' + wx.getStorageSync('token'), - 'X-Requested-With': 'XMLHttpRequest' - }, - method: 'post', - data: {team_id: notiTypeData.teamId}, - success: ({data}) => { - console.log(data, '已读') - } - }) - } + // if (notiTypeData.muteTeam) { + // wx.request({ + // url: `${service.host}/chat/group/read`, + // header: { + // 'Authorization': 'Bearer ' + wx.getStorageSync('token'), + // 'X-Requested-With': 'XMLHttpRequest' + // }, + // method: 'post', + // data: {team_id: notiTypeData.teamId}, + // success: ({data}) => { + // console.log(data, '已读') + // } + // }) + // } if (e.scene == 'team') { // 判断是否是@功能 if (e.apns) { @@ -130,15 +130,15 @@ const IM = (account, token) => { } if (currentPage.route == 'pages/tabBar/home') { wx.request({ - url: `${service.host}/new/message/count`, + url: `${service.host}/notice/count`, header: { 'Authorization': 'Bearer ' + wx.getStorageSync('token'), 'X-Requested-With': 'XMLHttpRequest' }, method: 'get', success: ({data}) => { - let { new_count } = data.data - console.log(new_count, '新的未读数') + let { notice_count } = data.data + console.log(notice_count, '新的未读数') let groupCountList = wx.getStorageSync('teamsSessionsCount') || [] let groupCount = 0 if (groupCountList.length > 0) { @@ -146,10 +146,10 @@ const IM = (account, token) => { groupCount += groupCountList[i].unread } } - if ((new_count + groupCount) > 0) { + if ((notice_count + groupCount) > 0) { wx.setTabBarBadge({ index: 0, - text: `${new_count + groupCount}` + text: `${notice_count + groupCount}` }) } else { wx.removeTabBarBadge({ diff --git a/src/utils/util.js b/src/utils/util.js index c37f821..85e6570 100644 --- a/src/utils/util.js +++ b/src/utils/util.js @@ -53,11 +53,12 @@ const wx_login = () => { wx.setStorageSync('user_id', data.user.id) // 用户id wx.setStorageSync('mobile', data.user.mobile) // 用户手机号 let userInfo = { + is_moment_admin: data.is_moment_admin, + is_base_profile: data.is_base_profile, name: data.user.nickname, avatar: data.user.photo || 'https://image.fulllinkai.com/202203/09/cc1c73eb1a4941fef25a15cd1ff2f9df.png', showId: data.user.id, is_real_approved: data.user.is_real_approved, - is_base_profile: data.user.is_base_profile, rank_id: data.user.rank_id, sex: data.user.sex, id: data.user.id,