diff --git a/Pages/yaoshi/home/home.json b/Pages/yaoshi/home/home.json index 648cc19..a8a0021 100644 --- a/Pages/yaoshi/home/home.json +++ b/Pages/yaoshi/home/home.json @@ -5,6 +5,7 @@ "van-tab": "@vant/weapp/tab/index", "van-tabs": "@vant/weapp/tabs/index", "t-avatar": "tdesign-miniprogram/avatar/avatar", - "van-button": "@vant/weapp/button/index" + "van-button": "@vant/weapp/button/index", + "van-empty": "@vant/weapp/empty/index" } } \ No newline at end of file diff --git a/Pages/yaoshi/home/home.wxml b/Pages/yaoshi/home/home.wxml index f4164e1..bbb1af0 100644 --- a/Pages/yaoshi/home/home.wxml +++ b/Pages/yaoshi/home/home.wxml @@ -39,73 +39,77 @@ - + - + - 处方订单号:2023010510324649 - + 处方订单号:{{item.prescription_code}} + 查看病例 - 开方时间:2023-01-16 08:52 + 开方时间:{{item.created_at}} 通过 - 张三/男/45岁 + {{item.patient_name}}/{{item.patient_sex==1?'男':'女'}}/{{item.patient_age}}岁 + - + - 处方订单号:2023010510324649 - + 处方订单号:{{item.prescription_code}} + 查看病例 - 开方时间:2023-01-16 08:52 + 开方时间:{{item.created_at}} 驳回 - 张三/男/45岁 + {{item.patient_name}}/{{item.patient_sex==1?'男':'女'}}/{{item.patient_age}}岁 + + - + - 处方订单号:2023010510324649 - + 处方订单号:{{item.prescription_code}} + 查看病例 - 开方时间:2023-01-16 08:52 + 开方时间:{{item.created_at}} 驳回 - 张三/男/45岁 + {{item.patient_name}}/{{item.patient_sex==1?'男':'女'}}/{{item.patient_age}}岁 + diff --git a/Pages/yishi/chat/index.js b/Pages/yishi/chat/index.js index d958605..b240c87 100644 --- a/Pages/yishi/chat/index.js +++ b/Pages/yishi/chat/index.js @@ -1,41 +1,60 @@ +import { API } from './../../../utils/network/api' +const api = new API() const app = getApp() Page({ data: { - patient_account: "", title: '', height: app.globalData.height, order_inquiry_id: "", - inquiry_type: "", + baseInfo: {} }, onLoad(option) { console.log("chat onload", option); - let from_account = option.from_account; let order_inquiry_id = option.order_inquiry_id; - let inquiry_type = option.inquiry_type; this.setData({ - patient_account: from_account, order_inquiry_id: order_inquiry_id, - inquiry_type: inquiry_type, }) }, onUnload() { console.log("chat onUnload"); }, onShow(){ - let _this = this; - let interval = setInterval(() => { - console.log("chat init ,"); - 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(); - wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, _this.$onMessageReceived, _this); - clearInterval(interval); - } - }, 1000); + console.log("chat onShow"); + this.getInquiryMessageBasic(); }, $onMessageReceived(value) { const message = value.data[0]; 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); + if(app.globalData.chat_sdk_ready){ + const TUIChat = _this.selectComponent('#TUIChat'); + TUIChat.init(); + // wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, _this.$onMessageReceived, _this); + clearInterval(interval); + } + count = count + 1; + if(count > 5){//如果尝试5次不成功就去主动调用IM初始化 + app.imInit(); + count = 0; + } + }, 1000); + }, + //获取问诊订单消息内页基础数据 + getInquiryMessageBasic() { + 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); + this.setData({ + baseInfo: response.data + }) + }).then(res => { + this.initChat(); + }).catch(errors => {console.error(errors);}) + }, }) diff --git a/Pages/yishi/chat/index.wxml b/Pages/yishi/chat/index.wxml index 36e8586..d2bcb23 100644 --- a/Pages/yishi/chat/index.wxml +++ b/Pages/yishi/chat/index.wxml @@ -1,5 +1,5 @@ - diff --git a/Pages/yishi/chufangsetup/index.js b/Pages/yishi/chufangsetup/index.js index 86eb7f4..e474089 100644 --- a/Pages/yishi/chufangsetup/index.js +++ b/Pages/yishi/chufangsetup/index.js @@ -1,5 +1,4 @@ import { API } from './../../../utils/network/api' - const api = new API() const app = getApp() Page({ @@ -84,4 +83,9 @@ Page({ console.log(url); app.go(url); }, + gochat(e){ + let order_inquiry_id = e.currentTarget.dataset.order_inquiry_id; + let url = "/Pages/yishi/chat/index?order_inquiry_id="+order_inquiry_id; + app.go(url); + } }) \ No newline at end of file diff --git a/Pages/yishi/chufangsetup/index.wxml b/Pages/yishi/chufangsetup/index.wxml index 23bcd32..1a887c4 100644 --- a/Pages/yishi/chufangsetup/index.wxml +++ b/Pages/yishi/chufangsetup/index.wxml @@ -47,7 +47,7 @@ - + 问诊记录 diff --git a/Pages/yishi/onlinechufang/index.js b/Pages/yishi/onlinechufang/index.js index e9d32dc..3725107 100644 --- a/Pages/yishi/onlinechufang/index.js +++ b/Pages/yishi/onlinechufang/index.js @@ -35,6 +35,7 @@ Page({ doctors_advice_focus: false, case_detail: {}, sub_disabled: false, + from: "" }, onDoctorsAdviceFocus(){ this.setData({ @@ -42,6 +43,7 @@ Page({ }) }, onLoad(options){ + let from = options.from; let order_inquiry_id = options.order_inquiry_id; let order_prescription_id = options.order_prescription_id ; //获取患者问诊病例 @@ -59,6 +61,7 @@ Page({ this.setData({ order_inquiry_id: order_inquiry_id, order_prescription_id: order_prescription_id, + from: from }) }, select_drug(e){ @@ -360,6 +363,9 @@ Page({ title: '提交成功', icon: "success" }) + setTimeout(() => { + wx.navigateBack(); + }, 1000); }).catch(errors => { console.error(errors); this.setData({ @@ -430,13 +436,15 @@ Page({ return; } - api.putDoctorPrescription(params).then(response => { console.log(response); wx.showToast({ title: '提交成功', icon: "success" }) + setTimeout(() => { + wx.navigateBack(); + }, 1000); }).catch(errors => { console.error(errors); this.setData({ diff --git a/Pages/yishi/onlinechufang/index.wxml b/Pages/yishi/onlinechufang/index.wxml index 347fd9e..a479048 100644 --- a/Pages/yishi/onlinechufang/index.wxml +++ b/Pages/yishi/onlinechufang/index.wxml @@ -30,7 +30,7 @@ - +添加诊断 + +添加诊断 {{item.icd_name}} @@ -48,14 +48,14 @@ {{ drugs.product_name }}(数量{{ drugs.prescription_product_num}}) 用法用量:{{ drugs.single_use }};{{ drugs.frequency_use }};{{ drugs.single_unit }} - + 编辑 删除 - + +添加药品
@@ -63,7 +63,8 @@ - + + {{ order_prescription_id == ''?'提交审核':'重开处方' }} diff --git a/Pages/yishi/wenzhen_v2/wenzhen.js b/Pages/yishi/wenzhen_v2/wenzhen.js index 08a9265..6e422f2 100644 --- a/Pages/yishi/wenzhen_v2/wenzhen.js +++ b/Pages/yishi/wenzhen_v2/wenzhen.js @@ -26,7 +26,12 @@ Page({ console.log("wenzhen onload"); let usertype = wx.getStorageSync('usertype'); let userID = wx.getStorageSync('user_id_'+usertype); - wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived, this); + if(wx.$TUIKit){ + wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived, this); + }else{ + app.imInit(); + wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived, this); + } setInterval(() => { let system_notice_unreadnnum = wx.getStorageSync(userID+"_system_notice_unreadnnum"); let service_notice_unreadnnum = wx.getStorageSync(userID+"_service_notice_unreadnnum"); @@ -70,6 +75,11 @@ Page({ }).then(() => { console.log("开始查询订单状态") this.formatStatus(); + }).catch(error => { + console.log(error) + // 补偿登录操作 + app.imInit(); + this.getConversationList(); }); }, go(e){ @@ -302,6 +312,7 @@ Page({ }) if(wenzhen_info == 0) wenzhen_info = ""; + if(wenzhen_info > 99) wenzhen_info = "99+"; wx.setStorageSync(userID+'_wenzhen_info', wenzhen_info); this.setData({ diff --git a/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.js b/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.js index 2775311..9ea98bd 100644 --- a/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.js +++ b/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.js @@ -1,5 +1,6 @@ import formateTime from '../../../../../utils/formate-time'; import constant from '../../../../../utils/constant'; +const app = getApp() // eslint-disable-next-line no-undef Component({ /** @@ -144,6 +145,7 @@ Component({ const renderDom = [{ type: 'prescribe', product_name: data.product_name, + order_inquiry_id: data.order_inquiry_id, order_prescription_id: data.order_prescription_id, pharmacist_verify_time: data.pharmacist_verify_time.substring(0,10), }]; @@ -209,5 +211,9 @@ Component({ }); } }, + go(e){ + let url = e.currentTarget.dataset.url; + app.go(url); + } }, }); diff --git a/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.wxml b/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.wxml index 429e9f5..11b5ad9 100644 --- a/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.wxml +++ b/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.wxml @@ -54,7 +54,10 @@ 点击评价 - + 处方已开具 diff --git a/TUIKit/components/TUIChat/components/MessageList/index.js b/TUIKit/components/TUIChat/components/MessageList/index.js index 825afa2..e1e1aca 100644 --- a/TUIKit/components/TUIChat/components/MessageList/index.js +++ b/TUIKit/components/TUIChat/components/MessageList/index.js @@ -86,7 +86,6 @@ Component({ errorMessage: {}, errorMessageID: '', typingMessage: {}, - }, lifetimes: { diff --git a/TUIKit/components/TUIChat/components/MessageList/index.wxss b/TUIKit/components/TUIChat/components/MessageList/index.wxss index 3464198..34e0b61 100644 --- a/TUIKit/components/TUIChat/components/MessageList/index.wxss +++ b/TUIKit/components/TUIChat/components/MessageList/index.wxss @@ -16,6 +16,8 @@ .t-message{ position: relative; z-index: -9; + width: calc(100vw - 20rpx); + padding: 0 10rpx; } .t-recieve-message { display: flex; @@ -35,7 +37,6 @@ display: flex; flex-direction: row; justify-content: flex-end; - width: 100vw; word-break: break-all; } .t-self-message-body { diff --git a/TUIKit/components/TUIChat/index.js b/TUIKit/components/TUIChat/index.js index 50ca53d..eb913dd 100644 --- a/TUIKit/components/TUIChat/index.js +++ b/TUIKit/components/TUIChat/index.js @@ -60,6 +60,15 @@ Component({ }); }, }, + baseInfo: { + type: Object, + value: {}, + observer(baseInfo) { + this.setData({ + "navbarData.title": baseInfo.patient_family_name + }); + }, + } }, lifetimes: { @@ -92,7 +101,8 @@ Component({ }, ready() { - this.getInquiryMessageBasic() + //修改为组件传值 + // this.getInquiryMessageBasic() } }, /** @@ -127,7 +137,6 @@ Component({ showCapsule: 2, //是否显示左上角图标 1表示显示 0表示不显示 title: '', //导航栏 中间的标题 }, - baseInfo: {}, navbar_height: 0, dialog_visible: false, @@ -151,7 +160,7 @@ Component({ confirmDialog(){ api.putDoctorInquiryFinish({order_inquiry_id: this.data.order_inquiry_id}).then(response => { console.log(response); - + this.getInquiryMessageBasic() }).catch(errors => {console.error(errors);}) this.setData({ dialog_visible: false @@ -164,7 +173,6 @@ Component({ console.log(response); this.setData({ baseInfo: response.data, - "navbarData.title": response.data.patient_name }) }).catch(errors => {console.error(errors);}) }, @@ -263,7 +271,7 @@ Component({ setNewInputStyle(event.detail.event.detail.height); this.setData({ 'viewData.style': newInputStyle, - input_area_style: "position: absolute; bottom: 30px;" + input_area_style: "position: absolute; bottom: 45rpx;" }); }, // 监听键盘,失去焦点时收起键盘 diff --git a/TUIKit/components/TUIChat/index.wxml b/TUIKit/components/TUIChat/index.wxml index 943f9f6..34faedb 100644 --- a/TUIKit/components/TUIChat/index.wxml +++ b/TUIKit/components/TUIChat/index.wxml @@ -3,12 +3,12 @@ - {{baseInfo.patient_name}} - {{baseInfo.patient_sex==1?'男':'女'}}|{{baseInfo.patient_age}}岁 - {{baseInfo.inquiry_status==1?'待支付':baseInfo.inquiry_status==2?'待分配':baseInfo.inquiry_status==3?'待接诊':baseInfo.inquiry_status==4?'已接诊':baseInfo.inquiry_status==5?'已完成':baseInfo.inquiry_status==6?'已结束':baseInfo.inquiry_status==7?'已取消':'未知'}} + {{baseInfo.patient_family_name}} + {{baseInfo.patient_family_sex==1?'男':'女'}}|{{baseInfo.patient_family_age}}岁 + {{baseInfo.inquiry_status==1?'待支付':baseInfo.inquiry_status==2?'待分配':baseInfo.inquiry_status==3?'待接诊':baseInfo.inquiry_status==4?'已接诊':baseInfo.inquiry_status==5?'已完成':baseInfo.inquiry_status==6?'已结束':baseInfo.inquiry_status==7?'已取消':'未知'}} - 结束问诊 + 结束问诊 @@ -30,20 +30,20 @@ - - - + + + + - - + 取消 diff --git a/TUIKit/components/TUIChat/index.wxss b/TUIKit/components/TUIChat/index.wxss index 8a9e3ac..9dbc119 100644 --- a/TUIKit/components/TUIChat/index.wxss +++ b/TUIKit/components/TUIChat/index.wxss @@ -2,6 +2,7 @@ width: 100vw; height: 100vh; background-color: #F4F4F4; + z-index: 0; } .safetytips-box{ background: rgba(255, 149, 0, 0.1); @@ -97,7 +98,8 @@ } .input-area { position: relative; - z-index: 999999; + z-index: 2; + /* z-index: 999999; */ /* position: absolute; bottom: 20px; */ } @@ -111,7 +113,7 @@ width: 100%; padding-bottom: var(--padding); background-color: #ffffff; - z-index: 999999; + /* z-index: 999999; */ } .calling { position: fixed; @@ -173,6 +175,9 @@ color: #FA541C; padding: 10rpx 20rpx; } +.status_complete{ + color: #C5C5C5; +} .dialog{ width: 50%; text-align: center; diff --git a/commpents/wenzhen_data/index.js b/commpents/wenzhen_data/index.js index 34528c0..c3118ed 100644 --- a/commpents/wenzhen_data/index.js +++ b/commpents/wenzhen_data/index.js @@ -1,5 +1,6 @@ import { API } from "../../utils/network/api"; const api = new API() +const app = getApp() // commpents/wenzhen_data/index.js Component({ /** @@ -81,9 +82,7 @@ Component({ */ methods: { go(e){ - wx.navigateTo({ - url: e.currentTarget.dataset.url - }) + app.go(e.currentTarget.dataset.url); }, goChat(e){ this.setData({ @@ -98,9 +97,8 @@ Component({ let from_account = e.currentTarget.dataset.from_account; let order_inquiry_id = e.currentTarget.dataset.order_inquiry_id; let inquiry_type = e.currentTarget.dataset.inquiry_type; - wx.navigateTo({ - url: e.currentTarget.dataset.url+"?from_account="+from_account+"&order_inquiry_id="+order_inquiry_id+"&inquiry_type="+inquiry_type - }) + let url = e.currentTarget.dataset.url+"?from_account="+from_account+"&order_inquiry_id="+order_inquiry_id+"&inquiry_type="+inquiry_type; + app.go(url); } }) }, diff --git a/commpents/wenzhen_data/index.wxml b/commpents/wenzhen_data/index.wxml index cbc83b3..39f3739 100644 --- a/commpents/wenzhen_data/index.wxml +++ b/commpents/wenzhen_data/index.wxml @@ -24,7 +24,7 @@ 温馨提示 - 为保障服务质量,请您查看患者病历信息在选择是否接诊。 + 为保障服务质量,请您查看患者病历信息再选择是否接诊。 去查看 去接诊