| el.lastContentDate = $util.formatTime(new Date(_data.chatRecord.sendTime)); | el.lastContentDate = $util.formatTime(new Date(_data.chatRecord.sendTime)); | ||||
| el.lastContentDate = el.lastContentDate.replaceAll('/', '-'); | el.lastContentDate = el.lastContentDate.replaceAll('/', '-'); | ||||
| } | } | ||||
| el.size + 1; | |||||
| el.size += 1; | |||||
| }) | }) | ||||
| _this.setData({ | _this.setData({ | ||||
| msgData | msgData | ||||
| page: 1, | page: 1, | ||||
| size: 10, | size: 10, | ||||
| msgData: [], | msgData: [], | ||||
| pageLoading: true, | |||||
| }) | }) | ||||
| this.getMsgData(); | this.getMsgData(); | ||||
| }, | }, | ||||
| this.getListData(); | this.getListData(); | ||||
| } | } | ||||
| }, | }, | ||||
| onHide(){ | |||||
| // 去关注 | |||||
| followApplets(){ | |||||
| wx.navigateTo({ | |||||
| url: "/pages/outLink/outLink?followApplets=true", //跳转页面的路径,可带参数 ?隔开,不同参数用 & 分隔;相对路径,不需要.wxml后缀 | |||||
| success: function () {}, //成功后的回调; | |||||
| fail: function () {}, //失败后的回调; | |||||
| complete: function () {} //结束后的回调(成功,失败都会执行) | |||||
| }) | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面隐藏 | |||||
| */ | |||||
| onHide: function () { | |||||
| wx.closeSocket(); | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面卸载 | |||||
| */ | |||||
| onUnload: function () { | |||||
| wx.closeSocket(); | wx.closeSocket(); | ||||
| }, | }, | ||||
| }) | }) |
| <view class="top-view" wx:if="{{ topShow }}"> | <view class="top-view" wx:if="{{ topShow }}"> | ||||
| <image class="msg-top-img fl" src="/images/home/msg-top-icon.png" /> | <image class="msg-top-img fl" src="/images/home/msg-top-icon.png" /> | ||||
| <view class="msg-text fl">关注公众号可随时接收离线消息~</view> | <view class="msg-text fl">关注公众号可随时接收离线消息~</view> | ||||
| <van-button color="#5e73e5" round class="msg-btn-go fl" size="small">前往关注</van-button> | |||||
| <van-button color="#5e73e5" round class="msg-btn-go fl" size="small" bindtap="followApplets">前往关注</van-button> | |||||
| <image class="msg-colse-img fl" src="/images/home/close.png" bind:tap="closeTopShow" /> | <image class="msg-colse-img fl" src="/images/home/close.png" bind:tap="closeTopShow" /> | ||||
| </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 }}"> |
| * 生命周期函数--监听页面卸载 | * 生命周期函数--监听页面卸载 | ||||
| */ | */ | ||||
| onUnload: function () { | onUnload: function () { | ||||
| wx.closeSocket(); | |||||
| }, | }, | ||||
| /** | /** |
| * 页面的初始数据 | * 页面的初始数据 | ||||
| */ | */ | ||||
| data: { | data: { | ||||
| htmlUrl:"", | |||||
| htmlUrl: "", | |||||
| }, | }, | ||||
| /** | /** | ||||
| * 生命周期函数--监听页面加载 | * 生命周期函数--监听页面加载 | ||||
| */ | */ | ||||
| onLoad: function (options) { | onLoad: function (options) { | ||||
| let htmlUrl = `${app.mangerUrl}/customerService/dist/mobileClient.html?entryType=0&miniUrl=` + options.url + `&customerId=` + app.globalData.customerId; | |||||
| // 如果是去关注 | |||||
| if (options.followApplets == "true") { | |||||
| htmlUrl = "https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzIwNDEzNzk5MA==&scene=124#wechat_redirect"; | |||||
| } | |||||
| this.setData({ | this.setData({ | ||||
| htmlUrl: `${app.mangerUrl}/customerService/dist/mobileClient.html?entryType=0&miniUrl=` + options.url + `&customerId=` + app.globalData.customerId | |||||
| htmlUrl | |||||
| }) | }) | ||||
| }, | }, | ||||