2 处理消息页公众号组件因场景值问题导致公众号组件不展示X还展示的问题。hotfix/210830_二组需求分支
| @@ -79,7 +79,6 @@ Page({ | |||
| this.setData({ | |||
| currentIndex: 0 | |||
| }) | |||
| this.toSearch(); | |||
| const businessCommunicationCustomer = wx.getStorageSync('businessCommunicationCustomer') || null; | |||
| if (businessCommunicationCustomer) { | |||
| let attentionTypeIds = businessCommunicationCustomer.attentionTypeIds; | |||
| @@ -93,9 +92,26 @@ Page({ | |||
| customerId: businessCommunicationCustomer.customerId | |||
| }) | |||
| } | |||
| this.toSearch(); | |||
| }, | |||
| onShow() { | |||
| if(this.data.currentTab == 'my'){ | |||
| const businessCommunicationCustomer = wx.getStorageSync('businessCommunicationCustomer') || null; | |||
| if (businessCommunicationCustomer) { | |||
| let attentionTypeIds = businessCommunicationCustomer.attentionTypeIds; | |||
| if (attentionTypeIds) { | |||
| attentionTypeIds = attentionTypeIds.split(','); | |||
| } else { | |||
| attentionTypeIds = []; | |||
| } | |||
| this.setData({ | |||
| attentionTypeIds, | |||
| customerId: businessCommunicationCustomer.customerId | |||
| }) | |||
| } | |||
| console.log(`刷新页面`); | |||
| this.toSearch(); | |||
| } | |||
| }, | |||
| toggleMore() { | |||
| this.selectComponent('#item').toggle(); | |||
| @@ -9,7 +9,8 @@ Page({ | |||
| pageLoading: true, | |||
| customerId: "", | |||
| // 前往关注公众号 | |||
| topShow: true, | |||
| topShow: false, | |||
| showAccount:true, | |||
| msgData: [], | |||
| page: 1, | |||
| size: 10, | |||
| @@ -132,7 +133,8 @@ Page({ | |||
| // 关闭顶部关注 | |||
| closeTopShow() { | |||
| this.setData({ | |||
| topShow: false | |||
| topShow: false, | |||
| showAccount:false, | |||
| }) | |||
| }, | |||
| // 聊一聊 | |||
| @@ -267,6 +269,23 @@ Page({ | |||
| app.globalData.isOnSocketOpen = false; | |||
| } | |||
| }, | |||
| // 公众号组件加载成功 | |||
| bindload(e){ | |||
| if(e.detail.status == 0){ | |||
| this.setData({ | |||
| topShow:true | |||
| }) | |||
| } | |||
| }, | |||
| // 公众号没有显示原因 | |||
| binderror(e){ | |||
| console.log(e); | |||
| if(e.detail.status != 0){ | |||
| this.setData({ | |||
| topShow:false | |||
| }) | |||
| } | |||
| }, | |||
| /** | |||
| * 用户点击右上角分享给朋友 | |||
| */ | |||
| @@ -4,14 +4,11 @@ | |||
| <van-loading size="24px">加载中...</van-loading> | |||
| </view> | |||
| <view wx:else class="body-view"> | |||
| <view class="top-view" wx:if="{{ topShow }}"> | |||
| <!-- <image class="msg-top-img fl" src="/images/home/msg-top-icon.png" /> | |||
| <view class="msg-text fl">关注公众号可随时接收离线消息~</view> | |||
| <van-button color="#5e73e5" round class="msg-btn-go fl" size="small" bindtap="followApplets"> | |||
| 前往关注 | |||
| </van-button> --> | |||
| <official-account></official-account> | |||
| <image class="msg-colse-img" src="/images/home/close.png" bind:tap="closeTopShow" /> | |||
| <view class="top-view {{ topShow ? 'topShow' : '' }}"> | |||
| <view wx:if="{{ showAccount }}"> | |||
| <official-account bindload="bindload" binderror="binderror"></official-account> | |||
| </view> | |||
| <image class="msg-colse-img" src="/images/home/close.png" bind:tap="closeTopShow" wx:if="{{ topShow }}"/> | |||
| </view> | |||
| <view class="msg-box-view {{ topShow ? 'topShow' : '' }} not-msg-data" wx:if="{{ msgData.length < 1 }}"> | |||
| <image class="not-msg-data-img " src="/images/home/not-msg-data.png" /> | |||
| @@ -1,21 +1,15 @@ | |||
| /* pages/msgPage/msgPage.wxss */ | |||
| .msg-page { | |||
| box-sizing: border-box; | |||
| min-height: calc(100vh - 150rpx); | |||
| } | |||
| .top-view { | |||
| /* background: #fff; | |||
| box-sizing: border-box; | |||
| padding: 0 20rpx; | |||
| height: 88rpx; | |||
| line-height: 88rpx; | |||
| box-shadow: -1px 3px 12px 4px rgba(186, 186, 186, 0.1); | |||
| border-radius: 20rpx; | |||
| margin-bottom: 20rpx; */ | |||
| position: relative; | |||
| } | |||
| .top-view.topShow { | |||
| margin-bottom: 20rpx; | |||
| } | |||
| .top-view .msg-colse-img{ | |||
| .top-view .msg-colse-img { | |||
| position: absolute; | |||
| width: 30rpx; | |||
| height: 30rpx; | |||
| @@ -29,21 +23,21 @@ | |||
| border-radius: 20rpx; | |||
| min-height: calc(100vh - 150rpx); | |||
| } | |||
| .msg-box-view.topShow{ | |||
| min-height: calc(100vh - 258rpx); | |||
| .msg-box-view.topShow { | |||
| min-height: calc(100vh - 320rpx); | |||
| } | |||
| .msg-box-view.not-msg-data{ | |||
| .msg-box-view.not-msg-data { | |||
| text-align: center; | |||
| box-sizing: border-box; | |||
| padding-top: 140rpx; | |||
| } | |||
| .msg-box-view.not-msg-data .not-msg-data-img{ | |||
| .msg-box-view.not-msg-data .not-msg-data-img { | |||
| width: 302rpx; | |||
| height: 224rpx; | |||
| } | |||
| .msg-box-view.not-msg-data .not-data-msg-info{ | |||
| .msg-box-view.not-msg-data .not-data-msg-info { | |||
| font-size: 24rpx; | |||
| color: #b3bfcb; | |||
| margin-top: 20rpx; | |||
| @@ -56,7 +50,7 @@ | |||
| border-top: 1rpx solid #d9dde5; | |||
| } | |||
| .msg-li-item-first{ | |||
| .msg-li-item-first { | |||
| border-top: 0; | |||
| } | |||
| @@ -64,7 +58,7 @@ | |||
| border-bottom: 1rpx solid #d9dde5; | |||
| } | |||
| .msg-li-item .chatheads-view{ | |||
| .msg-li-item .chatheads-view { | |||
| width: 88rpx; | |||
| height: 88rpx; | |||
| margin: 0 20rpx; | |||
| @@ -72,7 +66,7 @@ | |||
| margin-top: 7rpx; | |||
| position: relative; | |||
| } | |||
| .msg-li-item .chatheads-view .other-head-img{ | |||
| .msg-li-item .chatheads-view .other-head-img { | |||
| width: 100%; | |||
| height: 100%; | |||
| border-radius: 50%; | |||
| @@ -80,13 +74,13 @@ | |||
| .msg-li-item .msg-content { | |||
| width: calc(100% - 140rpx); | |||
| } | |||
| .msg-li-item .msg-content .msg-nickName{ | |||
| .msg-li-item .msg-content .msg-nickName { | |||
| font-size: 30rpx; | |||
| line-height: 56rpx; | |||
| width: 100%; | |||
| } | |||
| .msg-li-item .msg-content .msg-last-content, | |||
| .msg-li-item .msg-content .msg-last-content-date{ | |||
| .msg-li-item .msg-content .msg-last-content-date { | |||
| font-size: 24rpx; | |||
| color: #999; | |||
| } | |||
| @@ -111,4 +105,4 @@ | |||
| height: 30rpx; | |||
| line-height: 30rpx; | |||
| text-align: center; | |||
| } | |||
| } | |||