This commit is contained in:
haomingming
2023-05-06 10:18:46 +08:00
parent 97a504c6d2
commit 7b9b80be8d
18 changed files with 318 additions and 164 deletions
+9 -9
View File
@@ -9,7 +9,7 @@ Page({
baseInfo: {}
},
onLoad(option) {
console.log("chat onload", option);
// console.log("chat onload", option);
let order_inquiry_id = option.order_inquiry_id;
this.setData({
order_inquiry_id: order_inquiry_id,
@@ -17,22 +17,22 @@ Page({
this.getInquiryMessageBasic();
},
onUnload() {
console.log("chat onUnload");
// console.log("chat onUnload");
},
onShow(){
console.log("chat onShow");
console.log("app.globalData.scene from chat: ", app.globalData.scene);
// console.log("chat onShow");
// console.log("app.globalData.scene from chat: ", app.globalData.scene);
},
$onMessageReceived(value) {
const message = value.data[0];
console.log("message from chat: ",message)
// console.log("message from chat: ",message)
},
initChat(){
let _this = this;
let count = 0;
let interval = setInterval(() => {
console.log("chat init count: ", count);
console.log("app.globalData.chat_sdk_ready: ", app.globalData.chat_sdk_ready);
// console.log("chat init count: ", count);
// console.log("app.globalData.chat_sdk_ready: ", app.globalData.chat_sdk_ready);
if(app.globalData.chat_sdk_ready){
const TUIChat = _this.selectComponent('#TUIChat');
TUIChat.init();
@@ -48,9 +48,9 @@ Page({
},
//获取问诊订单消息内页基础数据
getInquiryMessageBasic() {
console.log("order_inquiry_id: ", this.data.order_inquiry_id);
// console.log("order_inquiry_id: ", this.data.order_inquiry_id);
api.getInquiryMessageBasic({order_inquiry_id: this.data.order_inquiry_id}).then(response => {
console.log(response);
// console.log(response);
this.setData({
baseInfo: response.data
})
+20 -20
View File
@@ -110,8 +110,8 @@ Page({
let top = 0;
top = wx.getMenuButtonBoundingClientRect().top - stateHeight; // 获取top值
console.log('navHeight', navHeight);
console.log('top', top);
// console.log('navHeight', navHeight);
// console.log('top', top);
this.setData({
// navHeight: navHeight + top * 2, // 导航栏高度
@@ -120,10 +120,10 @@ Page({
});
},
getFunboxHeight(){
console.log("109: ", rpxTopx(109))
console.log("113: ", rpxTopx(113))
// console.log("109: ", rpxTopx(109))
// console.log("113: ", rpxTopx(113))
const { statusBarHeight } = wx.getSystemInfoSync();
console.log("statusBarHeight: ", rpxTopx(statusBarHeight));
// console.log("statusBarHeight: ", rpxTopx(statusBarHeight));
let funbox_height = wx.getSystemInfoSync().windowHeight - (this.data.stateHeight + this.data.navHeight + 10) - 55;//减去底部空白
funbox_height = rpxTopx(funbox_height);
// 147 userinfo的高度
@@ -174,26 +174,26 @@ Page({
})
},
cancelContactDialog(){
console.log("cancelContactDialogcancelContactDialogcancelContactDialog");
// console.log("cancelContactDialogcancelContactDialogcancelContactDialog");
this.setData({
contactKeFu: false
})
},
onPullDownRefresh(){
console.log("用户下拉动作")
// console.log("用户下拉动作")
this.onShow();
},
onLoad(){
},
onUnload(){
console.log("index onUnload() onUnload() ");
// console.log("index onUnload() onUnload() ");
this.setData({
swiperList: []
})
},
onHide(){
console.log("index onHide() onHide() ");
// console.log("index onHide() onHide() ");
wx.offCopyUrl(this.Copylistener) // 需传入与监听时同一个的函数对象
@@ -233,7 +233,7 @@ Page({
this.getMenuButtonBound();
api.yiShiIndex().then(response => {
console.log(response);
// console.log(response);
let avatar = response.data.info.avatar;
this.setData({
"info.user_name": response.data.info.user_name,
@@ -323,7 +323,7 @@ Page({
},
onTapAD(e) {
let item = e.currentTarget.dataset.item;
console.log(item);
// console.log(item);
let open_with = item.open_with;
let banner_link = item.banner_link;
if(open_with == 1){//小程序页面
@@ -338,10 +338,10 @@ Page({
},
go(e){
let checkDialog = this.checkDialog(e);
console.log("checkDialog: ", checkDialog);
// console.log("checkDialog: ", checkDialog);
if(checkDialog){
let url = e.currentTarget.dataset.url;
console.log(url);
// console.log(url);
if(url.indexOf("wenzhen") > -1){
wx.switchTab({
url: url,
@@ -381,9 +381,9 @@ Page({
app.go(e.currentTarget.dataset.url);
},
confirmDialog(e){
console.log(e)
// console.log(e)
let url = e.currentTarget.dataset.url;
console.log("confirmDialog: ", url)
// console.log("confirmDialog: ", url)
this.setData({
dialog_visible: false
})
@@ -637,11 +637,11 @@ Page({
let checkDialog = this.checkDialog(e);
if(checkDialog){
console.log("concatKeFu");
// console.log("concatKeFu");
wx.requestSubscribeMessage({
tmplIds: ['JMPmlYGh1HcUSuEfJCVQUIsZv4H5ar3QvXZfrNYNFuc'],
success (res) {
console.log(res);
// console.log(res);
_this.setData({
contactKeFu: true
})
@@ -700,15 +700,15 @@ Page({
let now_case = this.data.mycase.find(item => {
return item.case_status == status;
});
console.log("now_case: ", now_case);
// console.log("now_case: ", now_case);
//所属模块
let moudle = e.currentTarget.dataset.moudle;
console.log("moudle: ", moudle);
// console.log("moudle: ", moudle);
if(now_case){
let now_moudle = now_case.case_module.find(item => {
return item == moudle;
})
console.log("now_moudle: ", now_moudle);
// console.log("now_moudle: ", now_moudle);
if(now_moudle != undefined){
this.setData({
dialog_content: now_case.case_text,
+2 -1
View File
@@ -481,8 +481,9 @@ Page({
console.log(response);
this.setData({
doctor_advice: response.data.prescription.doctor_advice,
pharmacist_audit_status: response.data.prescription.pharmacist_audit_status,
zhenduan_list: response.data.prescription_icd,
drugs_box_item_list: response.data.prescription_product,
drugs_box_item_list: response.data.prescription_product
})
}).catch(errors => {console.error(errors);})
}
+5 -1
View File
@@ -63,12 +63,16 @@
<form bindsubmit="{{ order_prescription_id == ''?'postDoctorPrescription':'putDoctorPrescription' }}">
<view class="txt_title">医嘱</view>
<view class="doctors_advice" bindtap="onDoctorsAdviceFocus">
<textarea auto-height focus="{{doctors_advice_focus}}" maxlength="1000" bindblur="getAdvice" style="width: 100%;" placeholder-style="font-size:24rpx; color:#999" placeholder="请输入医嘱(5-200字)" name="doctors_advice" value="{{doctor_advice}}"></textarea>
<textarea disabled="{{from == 'chat'}}" auto-height focus="{{doctors_advice_focus}}" maxlength="1000" bindblur="getAdvice" style="width: 100%;" placeholder-style="font-size:24rpx; color:#999" placeholder="请输入医嘱(5-200字)" name="doctors_advice" value="{{doctor_advice}}"></textarea>
</view>
<!-- 从聊天页面过来的不显示按钮 -->
<view class="sub_btn" wx:if="{{from != 'chat'}}">
<van-button disabled="{{sub_disabled}}" form-type="submit" color="#3CC7C0; font-size:30rpx; border-radius: 10rpx;" type="primary" block>{{ order_prescription_id == ''?'提交审核':'重开处方' }}</van-button>
</view>
<!-- 0:审核中 1:审核成功 2:审核驳回 -->
<view class="sub_btn" wx:if="{{from == 'chat'}}">
<van-button disabled color="#3CC7C0; font-size:30rpx; border-radius: 10rpx;" type="primary" block>{{ pharmacist_audit_status == 0?'审核中':pharmacist_audit_status==1?'审核成功':pharmacist_audit_status==2?'审核驳回':'审核中' }}</van-button>
</view>
</form>
+19 -5
View File
@@ -11,10 +11,10 @@ Page({
height: app.globalData.height,
license_cert: [],
qualification_cert: [],
work_cert: []
work_cert: [],
license_cert_visible: false
},
onLoad(){
api.getDoctorCret().then(response => {
console.log(response);
this.setData({
@@ -23,7 +23,21 @@ Page({
work_cert: response.data.work_cert,
})
}).catch(errors => {console.error(errors);})
}
},
show_license_cert(){
console.log("show_license_cert")
this.setData({
license_cert_visible: true
})
},
close_license_cert(e) {
const {
detail: { trigger },
} = e;
console.log("trigger: ", trigger);
console.log("close_license_cert")
this.setData({
license_cert_visible: false,
});
},
})
+2 -1
View File
@@ -2,6 +2,7 @@
"component": true,
"usingComponents": {
"te-nav-bar": "/commpents/te_navbar",
"t-image": "tdesign-miniprogram/image/image"
"t-image": "tdesign-miniprogram/image/image",
"t-image-viewer": "tdesign-miniprogram/image-viewer/image-viewer"
}
}
+12 -1
View File
@@ -11,7 +11,8 @@
mode="heightFix"
style="margin: 0 50rpx 0 20rpx;"
width="220rpx" height="220rpx"
aria-label="img" wx:for="{{license_cert}}" />
aria-label="img" wx:for="{{license_cert}}"
bindtap="show_license_cert" />
</view>
</view>
<view class="imgbox_item">
@@ -40,4 +41,14 @@
</view>
</view>
</view>
<!-- <t-image-viewer
deleteBtn="{{false}}"
close-btn="{{true}}"
show-index="{{true}}"
visible="{{license_cert_visible}}"
images="{{license_cert}}"
bind:close="close_license_cert"
></t-image-viewer> -->
</view>
+32 -31
View File
@@ -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,