优化
This commit is contained in:
@@ -38,22 +38,22 @@ Page({
|
||||
dot_4: false,
|
||||
},
|
||||
onLoad() {
|
||||
console.log("wenzhen onloadddd");
|
||||
// console.log("wenzhen onloadddd");
|
||||
|
||||
// if(wx.$TUIKit){
|
||||
// wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived, this);
|
||||
// }else{
|
||||
// app.imInit().then(res => {
|
||||
// console.log("wenzhen onload imInit");
|
||||
// // console.log("wenzhen onload imInit");
|
||||
// wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived, this);
|
||||
// });
|
||||
// }
|
||||
|
||||
//监听网络状态变化事件
|
||||
wx.onNetworkStatusChange(function (res) {
|
||||
console.log("onNetworkStatusChange from wenzhen: ")
|
||||
console.log(res.isConnected)
|
||||
console.log(res.networkType)
|
||||
// console.log("onNetworkStatusChange from wenzhen: ")
|
||||
// console.log(res.isConnected)
|
||||
// console.log(res.networkType)
|
||||
wx.showToast({
|
||||
title: '网络类型'+res.networkType,
|
||||
})
|
||||
@@ -89,10 +89,10 @@ Page({
|
||||
this.setData({
|
||||
unreadnnum_inter: unreadnnum_inter
|
||||
})
|
||||
console.log("app.globalData.unreadnnum_inter: ", app.globalData.unreadnnum_inter);
|
||||
// console.log("app.globalData.unreadnnum_inter: ", app.globalData.unreadnnum_inter);
|
||||
},
|
||||
onShow: function () {
|
||||
console.log("onShow from wenzhen V2")
|
||||
// console.log("onShow from wenzhen V2")
|
||||
if(this.data.hasOnShow){
|
||||
wx.stopPullDownRefresh()
|
||||
return;
|
||||
@@ -120,13 +120,13 @@ Page({
|
||||
wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived, this);
|
||||
}else{
|
||||
app.imInit().then(res => {
|
||||
console.log("wenzhen onload imInit");
|
||||
// console.log("wenzhen onload imInit");
|
||||
wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived, this);
|
||||
});
|
||||
}
|
||||
},
|
||||
onHide(){
|
||||
console.log("onHideonHide from wenzhen")
|
||||
// console.log("onHideonHide from wenzhen")
|
||||
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
|
||||
this.getTabBar().stopInterval()
|
||||
}
|
||||
@@ -154,7 +154,7 @@ Page({
|
||||
wx.$TUIKit.off(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived);
|
||||
},
|
||||
onUnload(){
|
||||
console.log("onUnload from wenzhen")
|
||||
// console.log("onUnload from wenzhen")
|
||||
this.setData({
|
||||
hasOnShow: false,
|
||||
message_inquiry_type: 9999,
|
||||
@@ -162,19 +162,19 @@ Page({
|
||||
})
|
||||
},
|
||||
getConversationList(){
|
||||
console.log("getConversationListgetConversationListgetConversationList");
|
||||
// console.log("getConversationListgetConversationListgetConversationList");
|
||||
app.imInit().then(res => {
|
||||
console.log("wenzhen onload imInit: ", res);
|
||||
// console.log("wenzhen onload imInit: ", res);
|
||||
wx.$TUIKit.getConversationList().then((imResponse) => {
|
||||
console.log("imResponse.data.conversationList from wenzhen_v2: ", imResponse.data.conversationList);
|
||||
// console.log("imResponse.data.conversationList from wenzhen_v2: ", imResponse.data.conversationList);
|
||||
this.setData({
|
||||
conversationList: imResponse.data.conversationList,
|
||||
});
|
||||
}).then(() => {
|
||||
console.log("开始查询订单状态")
|
||||
// console.log("开始查询订单状态")
|
||||
this.formatStatus();
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
console.error(error)
|
||||
});
|
||||
});
|
||||
},
|
||||
@@ -189,7 +189,7 @@ Page({
|
||||
},
|
||||
$onMessageReceived(value) {
|
||||
const message = value.data[0];
|
||||
console.log("message from wenzhen: ",message)
|
||||
// console.log("message from wenzhen: ",message)
|
||||
this.getConversationList();
|
||||
// let cloudCustomData = JSON.parse(message.cloudCustomData);
|
||||
// let inquiry_type = cloudCustomData.inquiry_type;
|
||||
@@ -286,6 +286,7 @@ Page({
|
||||
order_inquiry_id_list.push("");//初始化一个,防止失败
|
||||
this.data.conversationList.forEach(item => {
|
||||
let conversationID = item.conversationID;
|
||||
console.warn("conversationID: ", conversationID)
|
||||
if(conversationID == "C2Cadministrator") return;//如果是管理员消息直接跳过
|
||||
let lastMessage = item.lastMessage;
|
||||
if(!lastMessage) return;
|
||||
@@ -295,7 +296,7 @@ Page({
|
||||
try {
|
||||
cloudCustomDataJson = JSON.parse(cloudCustomData);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
// console.log(error);
|
||||
return;
|
||||
}
|
||||
let order_inquiry_id = cloudCustomDataJson.order_inquiry_id;
|
||||
@@ -341,7 +342,7 @@ Page({
|
||||
conversationList: new_conversationList
|
||||
})
|
||||
}).then(() => {
|
||||
console.log("开始格式化formatConversationList")
|
||||
// console.log("开始格式化formatConversationList")
|
||||
this.formatConversationList();
|
||||
}).catch(errors => {console.error(errors);})
|
||||
},
|
||||
@@ -386,7 +387,7 @@ Page({
|
||||
if(index > -1) return;
|
||||
let patient_family_data = cloudCustomDataJson.patient_family_data;
|
||||
if(patient_family_data == undefined) return;
|
||||
console.log("patient_family_data: ", patient_family_data);
|
||||
// console.log("patient_family_data: ", patient_family_data);
|
||||
let session_item = {};
|
||||
session_item.inquiry_status = item.inquiry_status;//订单状态暂无
|
||||
let txt = {};
|
||||
@@ -394,7 +395,7 @@ Page({
|
||||
let text = "自定义消息";
|
||||
let payload = lastMessage.payload;
|
||||
if(payload) {
|
||||
console.log("payload: ",payload.data);
|
||||
// console.log("payload: ",payload.data);
|
||||
let payloadJson = JSON.parse(payload.data);
|
||||
text = payloadJson.title.replaceAll(/—/g, "");
|
||||
}
|
||||
@@ -462,7 +463,7 @@ Page({
|
||||
return index;
|
||||
},
|
||||
onTabsChange(e){
|
||||
console.log(e);
|
||||
// console.log(e);
|
||||
},
|
||||
goChat(e){
|
||||
this.setData({
|
||||
@@ -487,13 +488,13 @@ Page({
|
||||
this.setData({
|
||||
show: false
|
||||
})
|
||||
console.log("order_inquiry_id: ", e.currentTarget.dataset.order_inquiry_id);
|
||||
// console.log("order_inquiry_id: ", e.currentTarget.dataset.order_inquiry_id);
|
||||
let params = {};
|
||||
params.order_inquiry_id = e.currentTarget.dataset.order_inquiry_id;
|
||||
console.log("params: ",params)
|
||||
// console.log("params: ",params)
|
||||
api.postDoctorInquiry(params).then(response => {
|
||||
console.log("开始接诊");
|
||||
console.log(response);
|
||||
// console.log("开始接诊");
|
||||
// console.log(response);
|
||||
}).then(() => {
|
||||
this.goChat(e);
|
||||
}).catch(errors => {
|
||||
@@ -517,7 +518,7 @@ Page({
|
||||
let show_dialog_from_account = e.currentTarget.dataset.show_dialog_from_account;
|
||||
let show_dialog_order_inquiry_id = e.currentTarget.dataset.show_dialog_order_inquiry_id;
|
||||
let show_dialog_inquiry_type = e.currentTarget.dataset.show_dialog_inquiry_type;
|
||||
console.log("tabShowtabShowtabShowtabShow");
|
||||
// console.log("tabShowtabShowtabShowtabShow");
|
||||
this.setData({
|
||||
show_dialog_from_account: show_dialog_from_account,
|
||||
show_dialog_order_inquiry_id: show_dialog_order_inquiry_id,
|
||||
@@ -526,24 +527,24 @@ Page({
|
||||
})
|
||||
},
|
||||
onClose(){
|
||||
console.log("onCloseonCloseonCloseonClose")
|
||||
// console.log("onCloseonCloseonCloseonClose")
|
||||
this.setData({
|
||||
show: false
|
||||
})
|
||||
},
|
||||
vanTabsChange(e){
|
||||
console.log(e)
|
||||
// // console.log(e)
|
||||
this.setData({
|
||||
now_message_inquiry_type: e.detail.name
|
||||
})
|
||||
},
|
||||
onPullDownRefresh(){
|
||||
console.log("用户下拉动作")
|
||||
// console.log("用户下拉动作")
|
||||
this.onHide();
|
||||
this.onShow();
|
||||
},
|
||||
onReachBottom() {
|
||||
console.log('===触底了!!===');
|
||||
// console.log('===触底了!!===');
|
||||
let now_message_inquiry_type = this.data.now_message_inquiry_type;
|
||||
if(now_message_inquiry_type == 5){
|
||||
if(this.data.current_page < this.data.last_page){//最后一页时停止分页
|
||||
@@ -557,7 +558,7 @@ Page({
|
||||
params.page = this.data.current_page + 1;
|
||||
this.setData({data_list_5_loading: true})
|
||||
api.getDoctorInquiryFinishMessage(params).then(response => {
|
||||
console.log(response);
|
||||
// console.log(response);
|
||||
this.setData({
|
||||
"data_list_5": data_list_5.concat(response.data.data),
|
||||
current_page: response.data.current_page,
|
||||
|
||||
Reference in New Issue
Block a user