|
|
@@ -152,21 +152,19 @@ Page({ |
|
|
|
let _data = JSON.parse(res.data); |
|
|
|
console.log(_data, '_data'); |
|
|
|
if (_data.readMessageCode) { |
|
|
|
// list.forEach(el=>{ |
|
|
|
// el.isRead = true; |
|
|
|
// }) |
|
|
|
// historyList.forEach(el=>{ |
|
|
|
// el.isRead = true; |
|
|
|
// }) |
|
|
|
// _this.setData({ |
|
|
|
// newsList: list, |
|
|
|
// historyList |
|
|
|
// }) |
|
|
|
list.forEach(el=>{ |
|
|
|
el.isRead = true; |
|
|
|
}) |
|
|
|
historyList.forEach(el=>{ |
|
|
|
el.isRead = true; |
|
|
|
}) |
|
|
|
_this.setData({ |
|
|
|
newsList: list, |
|
|
|
historyList |
|
|
|
}) |
|
|
|
} else { |
|
|
|
|
|
|
|
_data.chatRecord = JSON.parse(_data.chatRecord); |
|
|
|
|
|
|
|
|
|
|
|
let msgData = {}; |
|
|
|
// type 0 自己 1 对方 |
|
|
|
if (_data.chatRecord.chatRecord.sender != _this.data.receiveMemberId) { |
|
|
@@ -185,7 +183,7 @@ Page({ |
|
|
|
sendno: _this.data.receiveMemberId+'', |
|
|
|
userno: _this.data.sendMemberId+'', |
|
|
|
messageModule : "010", |
|
|
|
readMessageCode: _this.data.currentGuid, |
|
|
|
readMessageCode: _data.chatRecord.chatRecord.chatRecordCode, |
|
|
|
}; |
|
|
|
wx.sendSocketMessage({ |
|
|
|
data: JSON.stringify(d), |
|
|
@@ -428,8 +426,6 @@ Page({ |
|
|
|
temp.messageType = msgType; |
|
|
|
temp.transactionId = transactionId; |
|
|
|
temp.isRead = false; |
|
|
|
let tempGuid = this.guid(); |
|
|
|
temp.code = tempGuid; |
|
|
|
if (msgType == 1) { |
|
|
|
temp.object = {}; |
|
|
|
temp.object.info = this.data.productInfo; |
|
|
@@ -532,13 +528,6 @@ Page({ |
|
|
|
current: url, // 当前显示图片的http链接 |
|
|
|
urls: [url] // 需要预览的图片http链接列表 |
|
|
|
}) |
|
|
|
}, |
|
|
|
guid() { |
|
|
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { |
|
|
|
var r = Math.random() * 16 | 0, |
|
|
|
v = c == 'x' ? r : (r & 0x3 | 0x8); |
|
|
|
return v.toString(16); |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
|