d96bfccf by simon

默认提交

1 parent d943f54c
......@@ -300,7 +300,7 @@ Page({
socketStatus: 'connected',
waitingResponse: false
})
this.refreshView();
// this.refreshView();
})
wx.onSocketClose(() => {
......@@ -321,10 +321,40 @@ Page({
// 监听服务器推送消息
wx.onSocketMessage(message => {
console.log('socket message:', message);
this.setData({
loading: false
let socketData = message && message.data || "";
let result = null;
if (socketData) {
let parseData = JSON.parse(socketData);
result = parseData && parseData.content || null;
}
console.log("result:", result);
if (!result) return;
let priceInfo = result.list || [];
priceInfo.forEach(element => {
element.recordTime = new Date(element.recordTime).toString("yyyy.MM.dd hh:mm:ss");
element.memberPhone = element.memberPhone.substr(0, 3) + '****' + element.memberPhone.substr(7);
});
this.refreshView();
this.setData({
priceInfo: priceInfo,
maxPrice: result.maxPrice || 0,
priceTotal: result.total || 0
})
// 重置倒计时
let productInfo = this.data.productInfo;
let endTime = result.endTime || 0;
productInfo.endTime = endTime
this.setData({
isTimeEnd: endTime <= 0,
productInfo
})
this.removeTimer();
this.startTimer();
// this.setData({
// loading: false
// });
// this.refreshView();
})
// 打开信道
......