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

1 修复【需求对对碰】会话列表未实现左滑删除会话列表

2 修复【需求对对碰】导航栏文案显示错误
3 修复【需求对对碰】未登录-我的页面文案错误
release/210823_需求对对碰
王饶冀 4 лет назад
Родитель
Сommit
a3878843a0

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

<van-loading size="24px">加载中...</van-loading> <van-loading size="24px">加载中...</van-loading>
</view> </view>
<view wx:else> <view wx:else>
<view class="list-view" style="padding-bottom: 300rpx;">
<view class="list-view {{ customerId != currentData.customerId ? 'have-hot' : '' }}">
<listItem item="{{ currentData }}" pageStatus="detatil" isCollect="{{ isCollect }}" isShowCollect="{{ customerId != currentData.customerId }}" bind:changeCollect="changeCollect" customerId="{{ userCustomerId }}" /> <listItem item="{{ currentData }}" pageStatus="detatil" isCollect="{{ isCollect }}" isShowCollect="{{ customerId != currentData.customerId }}" bind:changeCollect="changeCollect" customerId="{{ userCustomerId }}" />
</view> </view>
<view wx:if="{{ userCustomerId != currentData.customerId }}"> <view wx:if="{{ userCustomerId != currentData.customerId }}">

+ 3
- 0
pages/index/components/listDetails/Details.wxss Просмотреть файл

/* pages/index/components/listDetails/Details.wxss */ /* pages/index/components/listDetails/Details.wxss */
.have-hot{
padding-bottom: 300rpx;
}

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

value: "财税类" value: "财税类"
}, },
{ {
text: "资质类",
value: "资质类"
text: "公司转让",
value: "公司转让"
}, },
], ],
currentTab: "all", currentTab: "all",
// 更多tab // 更多tab
moreTabOption: [ moreTabOption: [
{ {
text: "公司转让",
value: "公司转让"
text: "资质类",
value: "资质类"
}, },
{ {
text: "知识产权", text: "知识产权",
}, },
], ],
moreTab: "gengduo", moreTab: "gengduo",
moreTitle: "更多分类",
moreTitle: "更多",
// list数据加载 // list数据加载
// list块加载 // list块加载
listLoading: true, listLoading: true,
} }
this.setData({ this.setData({
currentTab: dataset.value, currentTab: dataset.value,
moreTitle: "更多分类",
moreTitle: "更多",
moreTab: "gengduo" moreTab: "gengduo"
}) })
this.toSearch(); this.toSearch();
} }
this.setData({ this.setData({
currentTab: 'my', currentTab: 'my',
moreTitle: "更多分类",
moreTitle: "更多",
moreTab: "gengduo" moreTab: "gengduo"
}) })
let customerid = app.globalData.customerId; let customerid = app.globalData.customerId;

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

</view> </view>
<!-- tab块 --> <!-- tab块 -->
<view class="tab-view"> <view class="tab-view">
<view wx:for="{{tabData}}" class="tab-li" wx:key="index">
<view wx:for="{{tabData}}" class="tab-li {{ moreTitle.length > 2 ? 'more' : '' }}" wx:key="index">
<view class="tab-span {{currentTab == item.value ? 'isActive' : ''}}" bindtap="tabChange" data-value="{{ item.value }}"> <view class="tab-span {{currentTab == item.value ? 'isActive' : ''}}" bindtap="tabChange" data-value="{{ item.value }}">
{{item.text}} {{item.text}}
</view> </view>

+ 3
- 1
pages/index/index.wxss Просмотреть файл

height: 70rpx; height: 70rpx;
padding: 0 15rpx; padding: 0 15rpx;
} }

.tab-view .tab-li.more{
padding: 0 14rpx;
}
.tab-view .tab-span { .tab-view .tab-span {
display: inline-block; display: inline-block;
box-sizing: border-box; box-sizing: border-box;

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

// 接收服务器的消息事件 // 接收服务器的消息事件
wx.onSocketMessage(function (res) { wx.onSocketMessage(function (res) {
// 接收到的消息{date,message,type} type类型为 1 是对方的消息 为 0 是自己的消息 // 接收到的消息{date,message,type} type类型为 1 是对方的消息 为 0 是自己的消息
console.log(res, '消息页----收到新消息')
// _this.initData(); // _this.initData();
let _data = JSON.parse(res.data); let _data = JSON.parse(res.data);
_data.chatRecord = JSON.parse(_data.chatRecord); _data.chatRecord = JSON.parse(_data.chatRecord);
console.log(_data, '消息页----收到新消息')
let msgData = _this.data.msgData; let msgData = _this.data.msgData;
// 初始化新消息
let isNewMsg = true;
// 循环数据,检测发送人ID是否存在,如果不存在就是新消息。
msgData.forEach(el => { msgData.forEach(el => {
// 如果当前消息的 customerId = 发送人的ID
if (el.businessCommunicationCustomerVO.customerId == _data.chatRecord.sender) {
el.lastContent = _data.chatRecord.content;
el.lastContentDate = $util.formatTime(new Date(_data.chatRecord.sendTime));
el.lastContentDate = el.lastContentDate.replaceAll('/', '-');
el.size += 1;
if (el.businessCommunicationCustomerVO.customerId == _data.sendno) {
isNewMsg = false;
} }
if (el.customer) {
if (el.customer.paidByMonth) {
el.businessCommunicationCustomerVO.nickName = el.customer.nickName
})
console.log(`是已存在列表框的还是不存在列表框`, isNewMsg)
// 如果是新消息
if (isNewMsg) {
let obj = {};
obj.lastContent = _data.chatRecord.chatRecord.content;
obj.lastContentDate = $util.formatTime(new Date(_data.chatRecord.chatRecord.sendTime));
obj.lastContentDate = obj.lastContentDate.replaceAll('/', '-');
obj.size = 1;
obj.customer = _data.chatRecord.senderCustomer;
obj.businessCommunicationCustomerVO = _data.chatRecord.senderBusinessCommunicationCustomer;
obj.messageType = _data.chatRecord.messageType;
if (obj.customer) {
if (obj.customer.paidByMonth) {
obj.businessCommunicationCustomerVO.nickName = obj.customer.nickName;
} }
} }
})
msgData.unshift(obj);
} else {
msgData.forEach(el => {
// 如果当前消息的 customerId = 发送人的ID
if (el.businessCommunicationCustomerVO.customerId == _data.chatRecord.chatRecord.sender) {
el.lastContent = _data.chatRecord.chatRecord.content;
el.lastContentDate = $util.formatTime(new Date(_data.chatRecord.chatRecord.sendTime));
el.lastContentDate = el.lastContentDate.replaceAll('/', '-');
el.size += 1;
}
if (el.customer) {
if (el.customer.paidByMonth) {
el.businessCommunicationCustomerVO.nickName = el.customer.nickName
}
}
})
}

_this.setData({ _this.setData({
msgData msgData
}) })
}, },
// 左滑删除 // 左滑删除
slideButtonTap(e) { slideButtonTap(e) {
console.log(`执行了删除`)
// wx.showLoading({
// title: '操作中',
// mask: true
// })
let item = e.currentTarget.dataset.item; let item = e.currentTarget.dataset.item;
let customerId = item.businessCommunicationCustomerVO.customerId; let customerId = item.businessCommunicationCustomerVO.customerId;
let lastChatRecordCode = item.lastChatRecordCode; let lastChatRecordCode = item.lastChatRecordCode;
let msgData = this.data.msgData;
msgData.forEach((el, inx) => {
if (el.businessCommunicationCustomerVO.customerId == customerId) {
msgData.splice(inx, 1);
}
})
this.setData({
msgData: msgData
})
$request.post('/businessCommunicationDemand/delChatRecordTable/' + customerId + '/' + lastChatRecordCode + '.action').then(res => { $request.post('/businessCommunicationDemand/delChatRecordTable/' + customerId + '/' + lastChatRecordCode + '.action').then(res => {
// console.log() // console.log()
if (res.status == 0) {
let msgData = this.data.msgData;
msgData.forEach((el, inx) => {
if (el.businessCommunicationCustomerVO.customerId == customerId) {
msgData.splice(inx, 1);
}
})
this.setData({
msgData: msgData
})
}
// if (res.status == 0) {
// let msgData = this.data.msgData;
// msgData.forEach((el, inx) => {
// if (el.businessCommunicationCustomerVO.customerId == customerId) {
// msgData.splice(inx, 1);
// }
// })
// this.setData({
// msgData: msgData
// })
// }
// wx.hideLoading()
}).catch(err => { }).catch(err => {
// wx.hideLoading()
console.log(err); console.log(err);
}) })
}, },

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

<view class="header card-view clearfix" wx:else> <view class="header card-view clearfix" wx:else>
<image class="not-login-img fl" src="/images/home/not-login.png" /> <image class="not-login-img fl" src="/images/home/not-login.png" />
<view class="not-login-view fl"> <view class="not-login-view fl">
<view class="not-login-info">您尚未登录,请登陆后操作</view>
<view class="not-login-info">您尚未登录,请登录后操作</view>
<view class="login-btn-view"> <view class="login-btn-view">
<button class="login-btn fl" bindtap="goLogin">立即登录</button> <button class="login-btn fl" bindtap="goLogin">立即登录</button>
</view> </view>

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