浏览代码

提交代码~

release/210823_需求对对碰
王饶冀 3 年前
父节点
当前提交
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 查看文件

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

+ 10
- 11
pages/msgModule/wechat2/wechat2.js 查看文件

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


let d = {
let param = {
sendno: _this.data.receiveMemberId+'', sendno: _this.data.receiveMemberId+'',
userno: _this.data.sendMemberId+'', userno: _this.data.sendMemberId+'',
messageModule : "010", messageModule : "010",
readMessageCode: _data.chatRecord.chatRecord.chatRecordCode, 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 = utils.formatTime(new Date(_data.chatRecord.chatRecord.sendTime));
msgData.date = msgData.date.replaceAll('/', '-'); msgData.date = msgData.date.replaceAll('/', '-');
list.push(msgData); list.push(msgData);

正在加载...
取消
保存