Просмотр исходного кода

1 处理我关注的页面返回后不刷新页面导致查询数据问题。

2 处理消息页公众号组件因场景值问题导致公众号组件不展示X还展示的问题。
hotfix/210830_二组需求分支
王饶冀 4 лет назад
Родитель
Сommit
3c60aa09db
4 измененных файлов: 59 добавлений и 33 удалений
  1. 18
    2
      pages/index/index.js
  2. 21
    2
      pages/msgModule/index.js
  3. 5
    8
      pages/msgModule/index.wxml
  4. 15
    21
      pages/msgModule/index.wxss

+ 18
- 2
pages/index/index.js Просмотреть файл

this.setData({ this.setData({
currentIndex: 0 currentIndex: 0
}) })
this.toSearch();
const businessCommunicationCustomer = wx.getStorageSync('businessCommunicationCustomer') || null; const businessCommunicationCustomer = wx.getStorageSync('businessCommunicationCustomer') || null;
if (businessCommunicationCustomer) { if (businessCommunicationCustomer) {
let attentionTypeIds = businessCommunicationCustomer.attentionTypeIds; let attentionTypeIds = businessCommunicationCustomer.attentionTypeIds;
customerId: businessCommunicationCustomer.customerId customerId: businessCommunicationCustomer.customerId
}) })
} }
this.toSearch();
}, },
onShow() { 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() { toggleMore() {
this.selectComponent('#item').toggle(); this.selectComponent('#item').toggle();

+ 21
- 2
pages/msgModule/index.js Просмотреть файл

pageLoading: true, pageLoading: true,
customerId: "", customerId: "",
// 前往关注公众号 // 前往关注公众号
topShow: true,
topShow: false,
showAccount:true,
msgData: [], msgData: [],
page: 1, page: 1,
size: 10, size: 10,
// 关闭顶部关注 // 关闭顶部关注
closeTopShow() { closeTopShow() {
this.setData({ this.setData({
topShow: false
topShow: false,
showAccount:false,
}) })
}, },
// 聊一聊 // 聊一聊
app.globalData.isOnSocketOpen = false; 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
})
}
},
/** /**
* 用户点击右上角分享给朋友 * 用户点击右上角分享给朋友
*/ */

+ 5
- 8
pages/msgModule/index.wxml Просмотреть файл

<van-loading size="24px">加载中...</van-loading> <van-loading size="24px">加载中...</van-loading>
</view> </view>
<view wx:else class="body-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>
<view class="msg-box-view {{ topShow ? 'topShow' : '' }} not-msg-data" wx:if="{{ msgData.length < 1 }}"> <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" /> <image class="not-msg-data-img " src="/images/home/not-msg-data.png" />

+ 15
- 21
pages/msgModule/index.wxss Просмотреть файл

/* pages/msgPage/msgPage.wxss */ /* pages/msgPage/msgPage.wxss */
.msg-page { .msg-page {
box-sizing: border-box;
min-height: calc(100vh - 150rpx); min-height: calc(100vh - 150rpx);
} }
.top-view { .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; position: relative;
}
.top-view.topShow {
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }

.top-view .msg-colse-img{
.top-view .msg-colse-img {
position: absolute; position: absolute;
width: 30rpx; width: 30rpx;
height: 30rpx; height: 30rpx;
border-radius: 20rpx; border-radius: 20rpx;
min-height: calc(100vh - 150rpx); 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; text-align: center;
box-sizing: border-box; box-sizing: border-box;
padding-top: 140rpx; 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; width: 302rpx;
height: 224rpx; 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; font-size: 24rpx;
color: #b3bfcb; color: #b3bfcb;
margin-top: 20rpx; margin-top: 20rpx;
border-top: 1rpx solid #d9dde5; border-top: 1rpx solid #d9dde5;
} }


.msg-li-item-first{
.msg-li-item-first {
border-top: 0; border-top: 0;
} }


border-bottom: 1rpx solid #d9dde5; border-bottom: 1rpx solid #d9dde5;
} }


.msg-li-item .chatheads-view{
.msg-li-item .chatheads-view {
width: 88rpx; width: 88rpx;
height: 88rpx; height: 88rpx;
margin: 0 20rpx; margin: 0 20rpx;
margin-top: 7rpx; margin-top: 7rpx;
position: relative; position: relative;
} }
.msg-li-item .chatheads-view .other-head-img{
.msg-li-item .chatheads-view .other-head-img {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 50%; border-radius: 50%;
.msg-li-item .msg-content { .msg-li-item .msg-content {
width: calc(100% - 140rpx); width: calc(100% - 140rpx);
} }
.msg-li-item .msg-content .msg-nickName{
.msg-li-item .msg-content .msg-nickName {
font-size: 30rpx; font-size: 30rpx;
line-height: 56rpx; line-height: 56rpx;
width: 100%; width: 100%;
} }
.msg-li-item .msg-content .msg-last-content, .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; font-size: 24rpx;
color: #999; color: #999;
} }
height: 30rpx; height: 30rpx;
line-height: 30rpx; line-height: 30rpx;
text-align: center; text-align: center;
}
}

Загрузка…
Отмена
Сохранить