Przeglądaj źródła

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

2 修复【需求对对碰】导航栏文案显示错误
3 修复【需求对对碰】未登录-我的页面文案错误
release/210823_需求对对碰
王饶冀 4 lat temu
rodzic
commit
a3878843a0

+ 1
- 1
pages/index/components/listDetails/Details.wxml Wyświetl plik

@@ -4,7 +4,7 @@
<van-loading size="24px">加载中...</van-loading>
</view>
<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 }}" />
</view>
<view wx:if="{{ userCustomerId != currentData.customerId }}">

+ 3
- 0
pages/index/components/listDetails/Details.wxss Wyświetl plik

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

+ 7
- 7
pages/index/index.js Wyświetl plik

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

+ 1
- 1
pages/index/index.wxml Wyświetl plik

@@ -22,7 +22,7 @@
</view>
<!-- tab块 -->
<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 }}">
{{item.text}}
</view>

+ 3
- 1
pages/index/index.wxss Wyświetl plik

@@ -113,7 +113,9 @@
height: 70rpx;
padding: 0 15rpx;
}

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

+ 66
- 23
pages/msgModule/index.js Wyświetl plik

@@ -70,25 +70,54 @@ Page({
// 接收服务器的消息事件
wx.onSocketMessage(function (res) {
// 接收到的消息{date,message,type} type类型为 1 是对方的消息 为 0 是自己的消息
console.log(res, '消息页----收到新消息')
// _this.initData();
let _data = JSON.parse(res.data);
_data.chatRecord = JSON.parse(_data.chatRecord);
console.log(_data, '消息页----收到新消息')
let msgData = _this.data.msgData;
// 初始化新消息
let isNewMsg = true;
// 循环数据,检测发送人ID是否存在,如果不存在就是新消息。
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({
msgData
})
@@ -181,24 +210,38 @@ Page({
},
// 左滑删除
slideButtonTap(e) {
console.log(`执行了删除`)
// wx.showLoading({
// title: '操作中',
// mask: true
// })
let item = e.currentTarget.dataset.item;
let customerId = item.businessCommunicationCustomerVO.customerId;
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 => {
// 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 => {
// wx.hideLoading()
console.log(err);
})
},

+ 1
- 1
pages/myModule/index.wxml Wyświetl plik

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

Ładowanie…
Anuluj
Zapisz