From 9859b0cbeaa972e9e8c134edf81c41a31449d725 Mon Sep 17 00:00:00 2001 From: haomingming Date: Thu, 30 Mar 2023 08:49:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=81=8A=E5=A4=A9=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Pages/login/index.js | 4 +- Pages/mobile_login/index.js | 6 +- Pages/yaoshi/my/my.js | 4 +- Pages/yishi/index/index.js | 8 +- Pages/yishi/index/index.json | 3 +- Pages/yishi/index/index.wxml | 49 +++++--- Pages/yishi/my/index.js | 8 +- Pages/yishi/myinfo/index.js | 13 +- Pages/yishi/wenzhen_v2/wenzhen.js | 40 ++++++- .../MessageElements/CustomMessage/index.js | 31 +++++ .../MessageElements/CustomMessage/index.json | 4 +- .../MessageElements/CustomMessage/index.wxml | 28 +++++ .../MessageElements/CustomMessage/index.wxss | 113 ++++++++++++++++++ .../TUIChat/components/MessageInput/index.js | 7 +- .../components/MessageInput/index.wxss | 3 + .../TUIChat/components/MessageList/index.js | 50 ++++---- .../TUIChat/components/MessageList/index.json | 3 +- .../TUIChat/components/MessageList/index.wxml | 17 +-- .../TUIChat/components/MessageList/index.wxss | 14 --- TUIKit/components/TUIChat/index.js | 58 ++++++++- TUIKit/components/TUIChat/index.json | 3 +- TUIKit/components/TUIChat/index.wxml | 22 +++- TUIKit/components/TUIChat/index.wxss | 23 +++- TUIKit/utils/constant.js | 9 ++ app.js | 5 +- commpents/wenzhen_data/index.wxml | 6 +- custom-tab-bar/index.js | 9 +- utils/network/api.js | 6 +- 28 files changed, 422 insertions(+), 124 deletions(-) diff --git a/Pages/login/index.js b/Pages/login/index.js index 9407e64..f0c734b 100644 --- a/Pages/login/index.js +++ b/Pages/login/index.js @@ -47,8 +47,8 @@ Page({ api.wechatMobileLogin(params).then(response => { console.log(response); wx.setStorageSync('AUTH_TOKEN_'+usertype, response.data.token); - wx.setStorageSync('user_id', response.data.user_id); - wx.setStorageSync('client_user_id', response.data.client_user_id); + wx.setStorageSync('user_id_'+usertype, response.data.user_id); + wx.setStorageSync('client_user_id_'+usertype, response.data.client_user_id); app.globalData.config.userID = response.data.user_id; app.imInit(); //跳转页面 diff --git a/Pages/mobile_login/index.js b/Pages/mobile_login/index.js index 0b9409c..9641266 100644 --- a/Pages/mobile_login/index.js +++ b/Pages/mobile_login/index.js @@ -12,7 +12,7 @@ Page({ sms: "", btn_msg: "获取验证码", btn_disabled: false, - login_disabled: true, + login_disabled: false, btn_color: "#ccc" }, onChange(event) { @@ -115,8 +115,8 @@ Page({ api.mobileLogin(params).then(response => { console.log(response); wx.setStorageSync('AUTH_TOKEN_'+usertype, response.data.token); - wx.setStorageSync('user_id', response.data.user_id); - wx.setStorageSync('client_user_id', response.data.client_user_id); + wx.setStorageSync('user_id_'+usertype, response.data.user_id); + wx.setStorageSync('client_user_id_'+usertype, response.data.client_user_id); app.globalData.config.userID = response.data.user_id; app.imInit(); wx.switchTab({ diff --git a/Pages/yaoshi/my/my.js b/Pages/yaoshi/my/my.js index a140602..df59c91 100644 --- a/Pages/yaoshi/my/my.js +++ b/Pages/yaoshi/my/my.js @@ -36,8 +36,8 @@ Page({ if (res.confirm) { console.log('用户点击确定') wx.setStorageSync('AUTH_TOKEN_'+usertype, ""); - wx.setStorageSync('user_id', ""); - wx.setStorageSync('client_user_id', ""); + wx.setStorageSync('user_id_'+usertype, ""); + wx.setStorageSync('client_user_id_'+usertype, ""); app.go("/Pages/index/index"); } else if (res.cancel) { console.log('用户点击取消') diff --git a/Pages/yishi/index/index.js b/Pages/yishi/index/index.js index 0fa641b..44a7b2c 100644 --- a/Pages/yishi/index/index.js +++ b/Pages/yishi/index/index.js @@ -90,11 +90,11 @@ Page({ case_text: "请您先多点执业认证" }, ], - skeleton_loading: true, contactKeFu: false, jiesuan_dialog_show: false, jiesuan_dialog_visible: false, - aa: 0 + funbox_height: 100, + skeleton_loading: true }, // 获取状态栏信息 getMenuButtonBound() { @@ -316,8 +316,8 @@ Page({ let multi_point_status = this.data.info.multi_point_status; //绑定结算银行卡 var is_bind_bank = this.data.info.is_bind_bank; - - let userID = wx.getStorageSync('user_id'); + let usertype = wx.getStorageSync('usertype'); + let userID = wx.getStorageSync('user_id_'+usertype); wx.setStorageSync(userID+'_idcard_status', idcard_status); wx.setStorageSync(userID+'_iden_auth_status', iden_auth_status); wx.setStorageSync(userID+'_multi_point_status', multi_point_status); diff --git a/Pages/yishi/index/index.json b/Pages/yishi/index/index.json index 73081fe..6ff3411 100644 --- a/Pages/yishi/index/index.json +++ b/Pages/yishi/index/index.json @@ -7,6 +7,7 @@ "t-swiper": "tdesign-miniprogram/swiper/swiper", "t-badge": "tdesign-miniprogram/badge/badge", "t-dialog": "tdesign-miniprogram/dialog/dialog", - "van-image": "@vant/weapp/image/index" + "van-image": "@vant/weapp/image/index", + "t-skeleton": "tdesign-miniprogram/skeleton/skeleton" } } \ No newline at end of file diff --git a/Pages/yishi/index/index.wxml b/Pages/yishi/index/index.wxml index 8849dbd..e89bb69 100644 --- a/Pages/yishi/index/index.wxml +++ b/Pages/yishi/index/index.wxml @@ -1,5 +1,3 @@ - - @@ -8,39 +6,57 @@ style="top:0;padding-top: {{stateHeight}}px;height: {{navHeight + 10}}px;line-height: {{navHeight}}px;">{{ title }} + + - + + + - {{info.user_name}} + {{info.user_name}} + - {{info.info_shiming_status_txt}} + {{info.info_shiming_status_txt}} + - 新问诊:{{info.not_accepted_inquiry_num}} - 接诊中:{{info.accepting_inquiry_num}} + + + + + 新问诊:{{info.not_accepted_inquiry_num}} + + + 接诊中:{{info.accepting_inquiry_num}} - + + + + 好评率 {{info.praise_rate}}% - + 响应时间 {{info.avg_response_time}} 分钟 - - + + + + 医师身份认证 @@ -56,8 +72,10 @@ /> - - + + + + 多点执业认证 @@ -85,6 +103,7 @@ bind:click="onTapAD" bind:change="onChangeAD" data-url="123" + wx:if="{{!skeleton_loading}}" > @@ -179,4 +198,6 @@ confirm-button-color="#3CC7C0" confirm-button-open-type="contact" /> - \ No newline at end of file + + + diff --git a/Pages/yishi/my/index.js b/Pages/yishi/my/index.js index da2eba8..30bc02c 100644 --- a/Pages/yishi/my/index.js +++ b/Pages/yishi/my/index.js @@ -27,8 +27,8 @@ Page({ }, }); 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, // 导航栏高度 navHeight, // 导航栏高度 @@ -37,7 +37,7 @@ Page({ }, onShow: function () { - console.log("onshow "); + // console.log("onshow "); if (typeof this.getTabBar === 'function' && this.getTabBar()) { this.getTabBar().setData({ active: 2 //数字是当前页面在tabbar的索引,如我的查询页索引是2,因此这边为2,同理首页就为0,审批页面为1 @@ -46,7 +46,7 @@ Page({ this.getMenuButtonBound(); }, onLoad(){ - console.log("my onLoad"); + // console.log("my onLoad"); //获取个人中心数据 api.getDoctorCenter().then(response => { this.setData({ diff --git a/Pages/yishi/myinfo/index.js b/Pages/yishi/myinfo/index.js index 3cbd0b3..b39512e 100644 --- a/Pages/yishi/myinfo/index.js +++ b/Pages/yishi/myinfo/index.js @@ -35,7 +35,8 @@ Page({ }).catch(errors => {console.error(errors);}) }, onShow(){ - let user_id = wx.getStorageSync("user_id"); + let usertype = wx.getStorageSync('usertype'); + let user_id = wx.getStorageSync("user_id_"+usertype); let is_bind_bank = wx.getStorageSync(user_id+'_is_bind_bank'); this.setData({ is_bind_bank: is_bind_bank @@ -51,8 +52,14 @@ Page({ if (res.confirm) { console.log('用户点击确定') wx.setStorageSync('AUTH_TOKEN_'+usertype, ""); - wx.setStorageSync('user_id', ""); - wx.setStorageSync('client_user_id', ""); + wx.setStorageSync('user_id_'+usertype, ""); + wx.setStorageSync('client_user_id_'+usertype, ""); + let promise = wx.$TUIKit.logout(); + promise.then(function(imResponse) { + console.log(imResponse.data); // 登出成功 + }).catch(function(imError) { + console.warn('logout error:', imError); + }); app.go("/Pages/index/index"); } else if (res.cancel) { console.log('用户点击取消') diff --git a/Pages/yishi/wenzhen_v2/wenzhen.js b/Pages/yishi/wenzhen_v2/wenzhen.js index 2d5039b..08a9265 100644 --- a/Pages/yishi/wenzhen_v2/wenzhen.js +++ b/Pages/yishi/wenzhen_v2/wenzhen.js @@ -19,11 +19,14 @@ Page({ conversationList: [], message_inquiry_type: 1, system_notice_unreadnnum: "", - service_notice_unreadnnum: "" + service_notice_unreadnnum: "", + hasOnShow: false }, onLoad() { console.log("wenzhen onload"); - let userID = wx.getStorageSync('user_id'); + let usertype = wx.getStorageSync('usertype'); + let userID = wx.getStorageSync('user_id_'+usertype); + 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"); @@ -35,13 +38,28 @@ Page({ }, onShow: function () { console.log("onShow from wenzhen V2") + if(this.data.hasOnShow){ + return; + } if (typeof this.getTabBar === 'function' && this.getTabBar()) { this.getTabBar().setData({ active: 1 //数字是当前页面在tabbar的索引,如我的查询页索引是2,因此这边为2,同理首页就为0,审批页面为1 }) } this.getConversationList(); - wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived, this); + //避免onshow加载多次 + this.setData({ + hasOnShow: true + }) + }, + onHide(){ + console.log("onHideonHide from wenzhen") + this.setData({hasOnShow: false}) + }, + onUnload(){ + console.log("onUnload from wenzhen") + this.setData({hasOnShow: false}) + // wx.$TUIKit.off(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived); }, getConversationList(){ wx.$TUIKit.getConversationList().then((imResponse) => { @@ -234,6 +252,11 @@ Page({ session_list.push(session_data_list_4); session_list.push(session_data_list_5); + let usertype = wx.getStorageSync('usertype'); + let userID = wx.getStorageSync('user_id_'+usertype); + let wenzhen_info = 0; + let message_inquiry_type = this.data.message_inquiry_type; + this.data.conversationList.forEach(item => { let conversationID = item.conversationID; if(conversationID == "C2Cadministrator") return;//如果是管理员消息直接跳过 @@ -249,8 +272,11 @@ Page({ let inquiry_type = cloudCustomDataJson.inquiry_type; if(!inquiry_type) return; if(inquiry_type > 4) return; + if(inquiry_type < message_inquiry_type){ + message_inquiry_type = inquiry_type; + } let patient_family_data = cloudCustomDataJson.patient_family_data; - if(!patient_family_data) return; + if(patient_family_data == undefined) return; console.log("patient_family_data: ", patient_family_data); let session_item = {}; session_item.inquiry_status = item.inquiry_status;//订单状态暂无 @@ -267,17 +293,23 @@ Page({ session_item.from_account = userProfile.userID; let unreadCount = item.unreadCount; if(unreadCount > 0){ + wenzhen_info = wenzhen_info + unreadCount; session_item.message_dot = true; }else{ session_item.message_dot = false; } session_list[inquiry_type - 1].push(session_item); }) + + if(wenzhen_info == 0) wenzhen_info = ""; + wx.setStorageSync(userID+'_wenzhen_info', wenzhen_info); + this.setData({ data_list_1: session_data_list_1, data_list_2: session_data_list_2, data_list_3: session_data_list_3, data_list_4: session_data_list_4, + message_inquiry_type: message_inquiry_type }) if(this.data.data_list_1.length == 0 && this.data.data_list_2.length == 0 && this.data.data_list_3.length == 0 && this.data.data_list_4.length == 0 && this.data.data_list_5.length == 0){ diff --git a/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.js b/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.js index ec64037..2775311 100644 --- a/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.js +++ b/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.js @@ -78,6 +78,7 @@ Component({ }, parseCustom(message) { const { BUSINESS_ID_TEXT } = constant; + const { GDXZ_CUSTOM_MSEEAGE } = constant; // 群消息解析 if (message.payload.data === BUSINESS_ID_TEXT.CREATE_GROUP) { const renderDom = [{ @@ -118,6 +119,36 @@ Component({ }]; return renderDom; } + // 1:消息内页横条 + if (customMessage.message_type === GDXZ_CUSTOM_MSEEAGE.TRABECULA) { + const renderDom = [{ + type: 'trabecula', + title: customMessage.title, + desc: customMessage.desc, + }]; + return renderDom; + } + // 2:订单结束评价弹出 + if (customMessage.message_type === GDXZ_CUSTOM_MSEEAGE.ORDER_EVALUATION) { + let data = customMessage.data; + const renderDom = [{ + type: 'order_evaluation', + order_inquiry_id: data.order_inquiry_id + }]; + return renderDom; + } + // 6:处方开具成功 + if (customMessage.message_type === GDXZ_CUSTOM_MSEEAGE.PRESCRIBE) { + console.log("处方"); + let data = customMessage.data; + const renderDom = [{ + type: 'prescribe', + product_name: data.product_name, + order_prescription_id: data.order_prescription_id, + pharmacist_verify_time: data.pharmacist_verify_time.substring(0,10), + }]; + return renderDom; + } } catch (error) { } // 客服咨询 diff --git a/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.json b/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.json index e8cfaaf..785d068 100644 --- a/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.json +++ b/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.json @@ -1,4 +1,6 @@ { "component": true, - "usingComponents": {} + "usingComponents": { + "van-rate": "@vant/weapp/rate/index" + } } \ No newline at end of file diff --git a/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.wxml b/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.wxml index 383a5c5..429e9f5 100644 --- a/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.wxml +++ b/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.wxml @@ -40,5 +40,33 @@ {{renderDom[0].text}} + + + {{renderDom[0].title}} + {{renderDom[0].desc}} + + + + 请您对本次问诊服务进行评价 + + + + 点击评价 + + + + + 处方已开具 + + + + RP:{{renderDom[0].product_name}} + 开方日期: {{renderDom[0].pharmacist_verify_time}} + + + 去查看 + + + diff --git a/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.wxss b/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.wxss index 135fe44..ad4da67 100644 --- a/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.wxss +++ b/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.wxss @@ -120,3 +120,116 @@ line-height: 42rpx; letter-spacing: 0; margin-bottom: 12rpx; } + +/* 自定义评价样式 */ +/* 横条样式 */ +.gdxz_custom_trabecula_message{ + display: flex; + flex-direction: column; + align-items: center; + width: 100vw; +} +.gdxz_custom_message_title{ + flex: 1; + display: flex; + max-width: 92vw; + justify-content: center; + background-color: #E1E1E1; + padding: 5rpx 40rpx; + font-size: 28rpx; + border-radius: 5rpx; +} +.gdxz_custom_message_desc{ + margin-top: 30rpx; + display: flex; + max-width: 92vw; + letter-spacing: 2rpx; + justify-content: center; + color: #666666; + font-size: 24rpx; +} +/* 评价样式 */ +.gdxz_custom_order_evaluation_message{ + display: flex; + justify-content: center; + flex-direction: column; + width: 80vw; + margin-right: 10vw; + border-radius: 10px; + background-color: #ffffff; + height: 250rpx; + overflow: hidden; + box-shadow: 0 0 10px 10px rgba(143, 142, 142, 0.2); +} +.evaluation_title{ + flex: 1; + display: flex; + align-items: center; + justify-content: center; + font-size: 28rpx; +} +.evaluation_ratebox{ + flex: 1; + display: flex; + justify-content: center; + align-items:baseline; +} +.evaluation_button{ + flex: 1; + background-color: rgb(226, 247, 247); + color: #3CC7C0; + display: flex; + align-items: center; + justify-content: center; + font-size: 34rpx; +} +/* 开具处方样式 */ +.gdxz_custom_order_prescribe_message{ + width: 60vw; + position: relative; + border-radius: 10px 10px 10px 10px; + background: rgb(212, 239, 241); + border: 1rpx solid #1ACAD3; + /* background: rgb(255, 255, 255); + border: 1rpx solid #E7E7E7; */ +} +.gdxz_custom_order_prescribe_message::after{ + content:''; + position: absolute; + top: 35rpx; + right: -19rpx; + transform: translate(-50%,-50%) rotate(-135deg); + width: 16rpx; + height: 16rpx; + background: rgb(212, 239, 241); + border: 1rpx solid #1ACAD3; + /* background: rgb(255, 255, 255); + border: 1rpx solid #E7E7E7; */ + border-style: none none solid solid; +} +.prescribe_title{ + font-size: 34rpx; + border-bottom: 1px solid #E7E7E7; + margin: 0 20rpx; + padding: 20rpx 0; +} +.prescribe_box{ + margin: 0 20rpx; + padding: 20rpx 0; + font-size: 28rpx; +} +.prescribe_box_top_pharmacist_verify_time{ + margin-top: 20rpx; +} +.prescribe_box_bottom{ + display: flex; + justify-content: center; +} +.prescribe_box_buy{ + margin: 20rpx 20rpx 0 20rpx; + background-color: #3CC7C0; + color: #fff; + padding: 15rpx 30rpx; + border-radius: 40rpx; + font-size: 30rpx; +} \ No newline at end of file diff --git a/TUIKit/components/TUIChat/components/MessageInput/index.js b/TUIKit/components/TUIChat/components/MessageInput/index.js index e0348d3..34e63f4 100644 --- a/TUIKit/components/TUIChat/components/MessageInput/index.js +++ b/TUIKit/components/TUIChat/components/MessageInput/index.js @@ -250,6 +250,10 @@ Component({ this.setData({ displayFlag: targetFlag, }); + var myEventDetail = {} // detail对象,提供给事件监听函数 + myEventDetail.displayFlag = targetFlag; + var myEventOption = {} // 触发事件的选项 + this.triggerEvent('myhandleExtensions', myEventDetail, myEventOption) }, error(e) { @@ -392,7 +396,8 @@ Component({ app.go("/Pages/yishi/case/index?order_inquiry_id="+this.data.order_inquiry_id) break; case '11'://在线开方 - let userID = wx.getStorageSync('user_id'); + let usertype = wx.getStorageSync('usertype'); + let userID = wx.getStorageSync('user_id_'+usertype); let multi_point_status = wx.getStorageSync(userID+'_multi_point_status'); if(multi_point_status == 1){ app.go("/Pages/yishi/onlinechufang/index?order_inquiry_id="+this.data.order_inquiry_id) diff --git a/TUIKit/components/TUIChat/components/MessageInput/index.wxss b/TUIKit/components/TUIChat/components/MessageInput/index.wxss index f40509b..ecb46f7 100644 --- a/TUIKit/components/TUIChat/components/MessageInput/index.wxss +++ b/TUIKit/components/TUIChat/components/MessageInput/index.wxss @@ -43,6 +43,7 @@ flex: 2; display: flex; justify-content: center; + align-items: center; } .TUI-message-input-main { min-height: 78rpx; @@ -108,6 +109,8 @@ justify-content: center; border-radius: 10rpx; color: #fff; + max-height: 200rpx; + padding: 20rpx 0; } .TUI-sendMessage-btn-input{ background-color: #3CC7C0; diff --git a/TUIKit/components/TUIChat/components/MessageList/index.js b/TUIKit/components/TUIChat/components/MessageList/index.js index c700ff8..825afa2 100644 --- a/TUIKit/components/TUIChat/components/MessageList/index.js +++ b/TUIKit/components/TUIChat/components/MessageList/index.js @@ -1,8 +1,7 @@ import dayjs from '../../../../utils/dayjs'; import logger from '../../../../utils/logger'; import constant from '../../../../utils/constant'; -import { API } from './../../../../../utils/network/api' -const api = new API() +const { GDXZ_CUSTOM_MSEEAGE } = constant; // eslint-disable-next-line no-undef const app = getApp(); Component({ @@ -87,7 +86,6 @@ Component({ errorMessage: {}, errorMessageID: '', typingMessage: {}, - dialog_visible: false, }, @@ -133,26 +131,7 @@ Component({ }, methods: { - //结束问诊 - putDoctorInquiryFinish() { - this.setData({ - dialog_visible: true - }) - }, - cancelDialog(){ - this.setData({ - dialog_visible: false - }) - }, - confirmDialog(){ - api.putDoctorInquiryFinish({order_inquiry_id: this.data.order_inquiry_id}).then(response => { - console.log(response); - - }).catch(errors => {console.error(errors);}) - this.setData({ - dialog_visible: false - }) - }, + // 刷新消息列表 refresh() { if (this.data.isCompleted) { @@ -171,6 +150,8 @@ Component({ }, // 获取消息列表 getMessageList(conversation) { + + if (!this.data.isCompleted) { wx.$TUIKit.getMessageList({ conversationID: conversation.conversationID, @@ -183,7 +164,12 @@ Component({ let HMM_messageList = HMM_data.messageList; HMM_messageList.forEach(item => { let HMM_type = item.type; - if(HMM_type == "TIMCustomElem") return; + console.log(item) + //去除自定义消息 + // if(HMM_type == "TIMCustomElem") return; + let show_avatar = this.checkShowAvatar(item); + item.show_avatar = show_avatar; + HMM_messageList_del.push(item); }) HMM_data.messageList = HMM_messageList_del; @@ -200,6 +186,18 @@ Component({ }); } }, + checkShowAvatar(message){ + + let type = message.type; + let show_avatar = true; + if(type == "TIMCustomElem"){ + const customMessage = JSON.parse(message.payload.data); + if(customMessage.message_type != GDXZ_CUSTOM_MSEEAGE.PRESCRIBE){ + show_avatar = false; + } + } + return show_avatar; + }, // 历史消息渲染 $handleMessageRender(messageList, currentMessageList) { this.showHistoryMessageTime(currentMessageList); @@ -246,6 +244,7 @@ Component({ // 收到的消息 $onMessageReceived(value) { const message = value.data[0]; + message.show_avatar = this.checkShowAvatar(message); wx.$TUIKit.setMessageRead({ conversationID: this.data.conversation.conversationID }).then(() => { logger.log('| MessageList | setMessageRead | ok'); }); @@ -315,6 +314,9 @@ Component({ }, // 自己的消息上屏 updateMessageList(message) { + + //自己的消息有头像 + message.show_avatar = this.checkShowAvatar(message); if (message.conversationID !== this.data.conversation.conversationID) return; wx.$TUIKit.setMessageRead({ conversationID: this.data.conversation.conversationID }).then(() => { logger.log('| MessageList | setMessageRead | ok'); diff --git a/TUIKit/components/TUIChat/components/MessageList/index.json b/TUIKit/components/TUIChat/components/MessageList/index.json index 097c754..2bd9367 100644 --- a/TUIKit/components/TUIChat/components/MessageList/index.json +++ b/TUIKit/components/TUIChat/components/MessageList/index.json @@ -12,7 +12,6 @@ "FaceMessage": "../MessageElements/FaceMessage/index", "FileMessage": "../MessageElements/FileMessage/index", "MergerMessage": "../MessageElements/MergerMessage/index", - "RevokeMessage": "../MessageElements/RevokeMessage/index", - "t-dialog": "tdesign-miniprogram/dialog/dialog" + "RevokeMessage": "../MessageElements/RevokeMessage/index" } } \ No newline at end of file diff --git a/TUIKit/components/TUIChat/components/MessageList/index.wxml b/TUIKit/components/TUIChat/components/MessageList/index.wxml index 5a18336..4786f9f 100644 --- a/TUIKit/components/TUIChat/components/MessageList/index.wxml +++ b/TUIKit/components/TUIChat/components/MessageList/index.wxml @@ -34,7 +34,7 @@ - + @@ -52,7 +52,7 @@ - + @@ -80,15 +80,4 @@ - - - 取消 - - - 确定 - - + diff --git a/TUIKit/components/TUIChat/components/MessageList/index.wxss b/TUIKit/components/TUIChat/components/MessageList/index.wxss index fea4021..3464198 100644 --- a/TUIKit/components/TUIChat/components/MessageList/index.wxss +++ b/TUIKit/components/TUIChat/components/MessageList/index.wxss @@ -252,17 +252,3 @@ padding-left: 5px; color: blue; } -.dialog{ - width: 50%; - text-align: center; - height: 100rpx; - line-height: 100rpx; -} -.dialog_cancel_btn{ - border-top: 1px solid #E9E9E9; - border-right: 1px solid #E9E9E9; -} -.dialog_confirm_btn{ - border-top: 1px solid #E9E9E9; - color: #3CC7C0; -} \ No newline at end of file diff --git a/TUIKit/components/TUIChat/index.js b/TUIKit/components/TUIChat/index.js index 60cf663..50ca53d 100644 --- a/TUIKit/components/TUIChat/index.js +++ b/TUIKit/components/TUIChat/index.js @@ -8,11 +8,11 @@ const app = getApp(); const inputStyle = ` --padding: 0px; - z-index: 9999999; `; let newInputStyle = ` ---padding: 0px +--padding: 0px; +position: absolute; `; const setNewInputStyle = (number) => { @@ -118,6 +118,7 @@ Component({ viewData: { style: inputStyle, }, + input_area_style:"", KeyboardHeight: 0, showTips: false, showGroupTips: false, @@ -127,13 +128,35 @@ Component({ title: '', //导航栏 中间的标题 }, baseInfo: {}, - navbar_height: 0 + navbar_height: 0, + dialog_visible: false, + }, /** * 组件的方法列表 */ methods: { + //结束问诊 + putDoctorInquiryFinish() { + this.setData({ + dialog_visible: true + }) + }, + cancelDialog(){ + this.setData({ + dialog_visible: false + }) + }, + confirmDialog(){ + api.putDoctorInquiryFinish({order_inquiry_id: this.data.order_inquiry_id}).then(response => { + console.log(response); + + }).catch(errors => {console.error(errors);}) + this.setData({ + dialog_visible: false + }) + }, //获取问诊订单消息内页基础数据 getInquiryMessageBasic() { console.log("order_inquiry_id: ", this.data.order_inquiry_id); @@ -222,18 +245,41 @@ Component({ resendMessage(event) { this.selectComponent('#MessageInput').onInputValueChange(event); }, + myhandleExtensions(e){ + console.log("myhandleExtensionsmyhandleExtensions: ", e); + let displayFlag = e.detail.displayFlag; + if(displayFlag){ + this.setData({ + input_area_style: "position: absolute; bottom: 30px;" + }) + }else{ + this.setData({ + input_area_style: "" + }) + } + }, // 监听键盘,获取焦点时将输入框推到键盘上方 pullKeysBoards(event) { setNewInputStyle(event.detail.event.detail.height); this.setData({ 'viewData.style': newInputStyle, + input_area_style: "position: absolute; bottom: 30px;" }); }, // 监听键盘,失去焦点时收起键盘 downKeysBoards(event) { - this.setData({ - 'viewData.style': inputStyle, - }); + console.log(event) + let value = event.detail.event.detail.value; + if(value){ + this.setData({ + 'viewData.style': inputStyle, + }); + }else{ + this.setData({ + 'viewData.style': inputStyle, + input_area_style: "" + }); + } }, typing(event) { const { STRING_TEXT, FEAT_NATIVE_CODE } = constant; diff --git a/TUIKit/components/TUIChat/index.json b/TUIKit/components/TUIChat/index.json index 664d8ba..261ad03 100644 --- a/TUIKit/components/TUIChat/index.json +++ b/TUIKit/components/TUIChat/index.json @@ -4,7 +4,8 @@ "MessageList": "./components/MessageList/index", "MessageInput": "./components/MessageInput/index", "TUIGroup": "../TUIGroup/index", - "te-nav-bar": "/commpents/te_navbar" + "te-nav-bar": "/commpents/te_navbar", + "t-dialog": "tdesign-miniprogram/dialog/dialog" }, "disableScroll":true } \ No newline at end of file diff --git a/TUIKit/components/TUIChat/index.wxml b/TUIKit/components/TUIChat/index.wxml index 8c5557a..943f9f6 100644 --- a/TUIKit/components/TUIChat/index.wxml +++ b/TUIKit/components/TUIChat/index.wxml @@ -23,20 +23,32 @@ 点此投诉 --> - + - + - + - - + + + + 取消 + + + 确定 + + \ No newline at end of file diff --git a/TUIKit/components/TUIChat/index.wxss b/TUIKit/components/TUIChat/index.wxss index 070f9ca..8a9e3ac 100644 --- a/TUIKit/components/TUIChat/index.wxss +++ b/TUIKit/components/TUIChat/index.wxss @@ -96,10 +96,10 @@ top: 246rpx; } .input-area { - position: absolute; - bottom: 20px; + position: relative; z-index: 999999; - /* height: 200rpx; */ + /* position: absolute; + bottom: 20px; */ } .message-list { width: 100%; @@ -157,10 +157,13 @@ .name{ font-size: 34rpx; color: #3CC7C0; + flex: 1; + text-align: center; } .age{ font-size: 34rpx; color: #666666; + flex: 1; } .status{ background: #FFF2E8; @@ -169,4 +172,18 @@ font-size: 24rpx; color: #FA541C; padding: 10rpx 20rpx; +} +.dialog{ + width: 50%; + text-align: center; + height: 100rpx; + line-height: 100rpx; +} +.dialog_cancel_btn{ + border-top: 1px solid #E9E9E9; + border-right: 1px solid #E9E9E9; +} +.dialog_confirm_btn{ + border-top: 1px solid #E9E9E9; + color: #3CC7C0; } \ No newline at end of file diff --git a/TUIKit/utils/constant.js b/TUIKit/utils/constant.js index 5125093..e7dd6fc 100644 --- a/TUIKit/utils/constant.js +++ b/TUIKit/utils/constant.js @@ -39,6 +39,15 @@ const constant = { DIRTY_MEDIA: '您发送的消息包含违禁内容!', RESEND_SUCCESS: '重发成功', }, + //自定义消息 + GDXZ_CUSTOM_MSEEAGE: { + TRABECULA: 1,//1:消息内页横条 + ORDER_EVALUATION: 2,//2:订单结束评价弹出 + DOCTOR_SYSTEM_NOTIFICATION: 3,//3:医生端系统通知 + DOCTOR_SERVICE_NOTIFICATION: 4,//4:医生端服务通知 + PATIENT_SYSTEM_MESSAGES: 5,//5:患者端系统消息 + PRESCRIBE: 6,//6:处方开具成功 + }, OPERATING_ENVIRONMENT: 'imWxTuikit' }; diff --git a/app.js b/app.js index 1441b59..22e19d6 100644 --- a/app.js +++ b/app.js @@ -57,8 +57,8 @@ App({ }, imInit(){ - let userID = wx.getStorageSync('user_id'); let usertype = wx.getStorageSync('usertype'); + let userID = wx.getStorageSync('user_id_'+usertype); if(usertype != 2){//只登录医师端 return; } @@ -121,7 +121,8 @@ App({ $onSystemPushReceived(e){ console.log("onSystemPushReceived from app.js"); console.log(e) - let userID = wx.getStorageSync('user_id'); + let usertype = wx.getStorageSync('usertype'); + let userID = wx.getStorageSync('user_id_'+usertype); let message = e.data[0]; console.log(message) diff --git a/commpents/wenzhen_data/index.wxml b/commpents/wenzhen_data/index.wxml index 136f992..cbc83b3 100644 --- a/commpents/wenzhen_data/index.wxml +++ b/commpents/wenzhen_data/index.wxml @@ -10,11 +10,11 @@ {{ status_text }} - 查看病历 - 去接诊 + 查看病历 + 去接诊 - 问诊详情 + 问诊详情 diff --git a/custom-tab-bar/index.js b/custom-tab-bar/index.js index e99326d..fffb97a 100644 --- a/custom-tab-bar/index.js +++ b/custom-tab-bar/index.js @@ -73,7 +73,7 @@ Component({ }) } let _this = this; - let userID = wx.getStorageSync('user_id'); + let userID = wx.getStorageSync('user_id_'+usertype); setInterval(() => { let index_info = wx.getStorageSync(userID+'_index_info'); let wenzhen_info = wx.getStorageSync(userID+'_wenzhen_info'); @@ -103,12 +103,12 @@ Component({ // }, onChange(e) { console.log("custom tab bar onChange"); - let userID = wx.getStorageSync('user_id'); + const usertype = wx.getStorageSync('usertype'); + let userID = wx.getStorageSync('user_id_'+usertype); let idcard_status = wx.getStorageSync(userID+'_idcard_status'); let iden_auth_status = wx.getStorageSync(userID+'_iden_auth_status'); let multi_point_status = wx.getStorageSync(userID+'_multi_point_status'); let is_bind_bank = wx.getStorageSync(userID+'_is_bind_bank'); - const usertype = wx.getStorageSync('usertype'); console.log("idcard_status: ", idcard_status); console.log("iden_auth_status: ", iden_auth_status); @@ -123,7 +123,6 @@ Component({ }) return; } - console.log(111); if(iden_auth_status != 1 && usertype != 3){ this.setData({ dialog_visible: true, @@ -132,7 +131,6 @@ Component({ }) return; } - console.log(222); if(is_bind_bank != 1 && usertype != 3){ this.setData({ dialog_visible: true, @@ -141,7 +139,6 @@ Component({ }) return; } - console.log(333); let url = this.data.items[e.detail].pagePath; console.log(url); wx.switchTab({ diff --git a/utils/network/api.js b/utils/network/api.js index 03217ac..274933f 100644 --- a/utils/network/api.js +++ b/utils/network/api.js @@ -616,9 +616,7 @@ class API extends HTTP { } //医生接诊 postDoctorInquiry(params) { - console.log("params from api: ", params); - let order_inquiry_id = params.order_inquiry_id; - console.log("order_inquiry_id: ", order_inquiry_id); + let order_inquiry_id = params.order_inquiry_id; delete params['order_inquiry_id']; return this.request({ url: `${this.baseUrl}/doctor/inquiry/`+order_inquiry_id, @@ -631,7 +629,6 @@ class API extends HTTP { //结束问诊 putDoctorInquiryFinish(params) { let order_inquiry_id = params.order_inquiry_id; - console.log("order_inquiry_id: ", order_inquiry_id); params = {} return this.request({ url: `${this.baseUrl}/doctor/inquiry/finish/`+order_inquiry_id, @@ -644,7 +641,6 @@ class API extends HTTP { //获取问诊订单消息内页基础数据 getInquiryMessageBasic(params) { let order_inquiry_id = params.order_inquiry_id; - console.log("order_inquiry_id: ", order_inquiry_id); params = {} return this.request({ url: `${this.baseUrl}/inquiry/message/basic/`+order_inquiry_id,