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

提交代码~

release/210823_需求对对碰
王饶冀 3 лет назад
Родитель
Сommit
ae02a17c10
2 измененных файлов: 12 добавлений и 12 удалений
  1. 2
    1
      pages/index/components/homepage/homepage.js
  2. 10
    11
      pages/msgModule/wechat2/wechat2.js

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

@@ -47,7 +47,6 @@ Page({
loginCustomerId: businessCommunicationCustomer.customerId
})
}
console.log(options, 'options')
const eventChannel = this.getOpenerEventChannel()
// console.log(eventChannel)
if (eventChannel.on) {
@@ -58,6 +57,7 @@ Page({
pageLoading: true,
isOther: data.customerid != app.globalData.customerId
})
console.log(`进这里`)
})
} else {
this.setData({
@@ -65,6 +65,7 @@ Page({
pageLoading: true,
isOther: options.customerId != app.globalData.customerId
})
console.log(`进这里2`)
}
// 记录浏览量
if (this.data.isOther) {

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

@@ -144,13 +144,13 @@ Page({
})
// 接收服务器的消息事件
wx.onSocketMessage(function (res) {
console.log(res, '消息发送页接受---------------------------------');
// console.log(res, '消息发送页接受---------------------------------');
// 接收到的消息{date,message,type} type类型为 1 是对方的消息 为 0 是自己的消息
let list = [];
list = _this.data.newsList;
let historyList = _this.data.historyList;
let _data = JSON.parse(res.data);
console.log(_data, '_data');
// console.log(_data, '_data');
if (_data.readMessageCode) {
list.forEach(el=>{
el.isRead = true;
@@ -179,23 +179,22 @@ Page({
msgData.object = _data.chatRecord.chatRecord.object;
}

let d = {
let param = {
sendno: _this.data.receiveMemberId+'',
userno: _this.data.sendMemberId+'',
messageModule : "010",
readMessageCode: _data.chatRecord.chatRecord.chatRecordCode,
};
wx.sendSocketMessage({
data: JSON.stringify(d),
success: (res) => {
console.log(`发送成功`)
console.log(res)
},
fail: (err) => {
console.log('sendSocketMessage', '失败')

$request.post('/businessCommunicationDemand/readChatRecord.action', param).then(res => {
if (res.status == 0) {
console.log(res.data,'res');
}
}).catch(err => {
console.log(err)
})


msgData.date = utils.formatTime(new Date(_data.chatRecord.chatRecord.sendTime));
msgData.date = msgData.date.replaceAll('/', '-');
list.push(msgData);

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