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

提交代码~

release/210823_需求对对碰
王饶冀 3 лет назад
Родитель
Сommit
504b447b2c
4 измененных файлов: 75 добавлений и 6 удалений
  1. 14
    3
      pages/msgModule/index.js
  2. 12
    1
      pages/msgModule/index.wxml
  3. 41
    0
      pages/msgModule/index.wxss
  4. 8
    2
      pages/msgModule/wechat2/wechat2.js

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

@@ -28,18 +28,29 @@ Page({
topShow: false
})
},
// 聊一聊
goToChat(e) {

let item = e.currentTarget.dataset.item;
wx.navigateTo({
url: "/pages/msgModule/wechat2/wechat2",
success: function (res) {
// 通过eventChannel向被打开页面传送数据
res.eventChannel.emit('customerid', { customerid: item.businessCommunicationCustomerVO.customerId, chatHeads: item.businessCommunicationCustomerVO.chatHeads })
}
})
},
getMsgData() {
let { page, size } = this.data;
$request.get('/businessCommunicationDemand/getChatRecordTable.action', { page, size }).then(res => {
console.log(res);
let tempListData = this.data.msgData;
if (res.status == 0) {
let datas = res.data;
console.log(datas, 'datas')
// 先push数据
tempListData.push(...datas.chatRecordTable);
tempListData.forEach(el => {
el.createdOn = $util.formatTime(new Date(el.createdOn), true);
el.lastContentDate = $util.formatTime(new Date(el.lastContentDate));
el.lastContentDate = el.lastContentDate.replaceAll('/', '-');
if (typeof el.type == 'string') {
el.type = el.type.split(',');
}

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

@@ -14,7 +14,18 @@
<image class="not-msg-data-img " src="/images/home/not-msg-data.png"/>
<view class="not-data-msg-info">暂无消息记录</view>
</view>
<view wx:else class="msg-box-view {{ topShow ? 'topShow' : '' }}"></view>
<view wx:else class="msg-box-view {{ topShow ? 'topShow' : '' }}">
<view class="msg-li-item" wx:for="{{msgData}}" wx:key="index" bindtap="goToChat" data-item="{{ item }}">
<view class="chatheads-view fl">
<image class='other-head-img' src='{{item.businessCommunicationCustomerVO.chatHeads }}'></image>
</view>
<view class="msg-content fl">
<view class="msg-nickName fl yichu">{{ item.businessCommunicationCustomerVO.nickName }}</view>
<view class="msg-last-content fl yichu">{{ item.lastContent }}</view>
<view class="msg-last-content-date fr yichu">{{ item.lastContentDate }}</view>
</view>
</view>
</view>
</view>
<tabBar currentIndex="{{currentIndex}}"></tabBar>
</view>

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

@@ -61,4 +61,45 @@
font-size: 24rpx;
color: #b3bfcb;
margin-top: 20rpx;
}

.msg-li-item {
height: 140rpx;
border-bottom: 1rpx solid #d9dde5;
box-sizing: border-box;
/* padding: 26rpx 0; */
padding-top: 20rpx;
}

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

.msg-li-item .msg-content .msg-last-content-date {
margin-right: 20rpx;
}
.msg-li-item .msg-content .msg-last-content {
max-width: calc(100% - 270rpx);
}

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

@@ -140,7 +140,13 @@ Page({
// 获取历史记录
getHistory() {
var { sendMemberId,businessCommunicationDemandId } = this.data;
$request.get('/businessCommunicationDemand/getChatRecordById/' + businessCommunicationDemandId + '/' + sendMemberId + '.action').then(res => {
let url = "";
if(businessCommunicationDemandId){
url = '/businessCommunicationDemand/getChatRecordById/' + businessCommunicationDemandId + '/' + sendMemberId + '.action'
}else{
url = '/businessCommunicationDemand/getChatRecordById/' + sendMemberId + '.action'
}
$request.get(url).then(res => {
console.log(`------------聊一聊获取历史记录-----------------`)
console.log(res);
console.log(`------------聊一聊获取历史记录-----------------`)
@@ -228,7 +234,7 @@ Page({
// 设置滚动区域的高度
setScrollHeight: function () {
const client = wx.getSystemInfoSync().windowHeight // 获取当前窗口的高度
var scrollHeight = (client - 36) + 'px'
var scrollHeight = (client - 136) + 'px'
this.setData({
scrollHeight
})

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