From 807698b89f751ddcf8fee8c7d0582c8f1e45ab5b Mon Sep 17 00:00:00 2001 From: haomingming Date: Tue, 9 May 2023 15:04:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Pages/agreement_page/index.js | 18 +++ Pages/agreement_page/index.json | 3 + Pages/agreement_page/index.wxml | 2 + Pages/agreement_page/index.wxss | 1 + Pages/login/index.wxml | 2 +- Pages/yishi/cash/index.js | 55 +++++-- Pages/yishi/cash/index.json | 3 +- Pages/yishi/cash/index.wxml | 18 ++- Pages/yishi/cash/index.wxss | 15 +- Pages/yishi/index/index.js | 48 ++++-- Pages/yishi/index/index.wxml | 13 ++ Pages/yishi/index/index.wxss | 1 + Pages/yishi/kuaisusetup/index.js | 39 ++++- Pages/yishi/kuaisusetup/index.json | 3 +- Pages/yishi/kuaisusetup/index.wxml | 13 ++ Pages/yishi/kuaisusetup/index.wxss | 14 ++ Pages/yishi/myaccount/index.wxml | 2 +- Pages/yishi/onlinechufang/index.js | 46 ++++++ Pages/yishi/onlinechufang/index.json | 3 +- Pages/yishi/onlinechufang/index.wxml | 8 +- Pages/yishi/onlinesetup/index.js | 38 ++++- Pages/yishi/onlinesetup/index.json | 3 +- Pages/yishi/onlinesetup/index.wxml | 13 ++ Pages/yishi/onlinesetup/index.wxss | 14 ++ Pages/yishi/wenzhen_v2/wenzhen.js | 14 +- Pages/yishi/wenzhen_v2/wenzhen.json | 3 +- Pages/yishi/wenzhen_v3/wenzhen.js | 24 +-- Pages/yishi/yizhensetup/index.js | 37 ++++- Pages/yishi/yizhensetup/index.json | 3 +- Pages/yishi/yizhensetup/index.wxml | 13 ++ Pages/yishi/yizhensetup/index.wxss | 14 ++ Pages/yishi/yizhensetupprice/index.js | 37 ++++- Pages/yishi/yizhensetupprice/index.json | 3 +- Pages/yishi/yizhensetupprice/index.wxml | 13 ++ Pages/yishi/yizhensetupprice/index.wxss | 14 ++ Pages/yishi/zhiye_identity/index.js | 142 +++++++++------- Pages/yishi/zhiye_identity/index.json | 3 +- Pages/yishi/zhiye_identity/index.wxml | 13 ++ Pages/yishi/zhiye_identity/index.wxss | 14 ++ .../TUIChat/components/MessageInput/index.js | 76 ++++++--- .../components/MessageInput/index.wxml | 21 ++- .../components/MessageInput/index.wxss | 2 +- .../TUIChat/components/MessageList/index.js | 7 +- TUIKit/components/TUIChat/index.js | 151 ++++++++++++++---- TUIKit/components/TUIChat/index.wxml | 19 +-- app.js | 10 +- app.json | 3 +- commpents/myprofile/index.js | 16 +- custom-tab-bar/index.js | 9 +- project.private.config.json | 2 +- utils/network/request.js | 4 +- utils/requestSubscribeUtil.js | 68 ++++++++ utils/util.js | 8 +- 53 files changed, 896 insertions(+), 222 deletions(-) create mode 100644 Pages/agreement_page/index.js create mode 100644 Pages/agreement_page/index.json create mode 100644 Pages/agreement_page/index.wxml create mode 100644 Pages/agreement_page/index.wxss create mode 100644 utils/requestSubscribeUtil.js diff --git a/Pages/agreement_page/index.js b/Pages/agreement_page/index.js new file mode 100644 index 0000000..aa5596d --- /dev/null +++ b/Pages/agreement_page/index.js @@ -0,0 +1,18 @@ +// Pages/webpage/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + src: "" + }, + + onLoad(options) { + console.log(options.agreement_id) + this.setData({ + src: "https://img.applets.igandanyiyuan.com/basic/file/agreement.htm?id="+options.agreement_id + }) + }, + +}) \ No newline at end of file diff --git a/Pages/agreement_page/index.json b/Pages/agreement_page/index.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/Pages/agreement_page/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/Pages/agreement_page/index.wxml b/Pages/agreement_page/index.wxml new file mode 100644 index 0000000..22a9b46 --- /dev/null +++ b/Pages/agreement_page/index.wxml @@ -0,0 +1,2 @@ + + diff --git a/Pages/agreement_page/index.wxss b/Pages/agreement_page/index.wxss new file mode 100644 index 0000000..12b229e --- /dev/null +++ b/Pages/agreement_page/index.wxss @@ -0,0 +1 @@ +/* Pages/webpage/index.wxss */ \ No newline at end of file diff --git a/Pages/login/index.wxml b/Pages/login/index.wxml index 5f9724f..c577cf5 100644 --- a/Pages/login/index.wxml +++ b/Pages/login/index.wxml @@ -26,7 +26,7 @@ 我已阅读并同意协议 - 《肝胆相照用户服务协议》 + 《肝胆相照用户服务协议》 diff --git a/Pages/yishi/cash/index.js b/Pages/yishi/cash/index.js index b3e9c2a..1b33f6c 100644 --- a/Pages/yishi/cash/index.js +++ b/Pages/yishi/cash/index.js @@ -1,4 +1,5 @@ import { API } from './../../../utils/network/api' +import { requestSubscribeMessage } from './../../../utils/requestSubscribeUtil'; const api = new API() const app = getApp() @@ -17,8 +18,10 @@ Page({ withdrawal_amount: "xxxx", income_tax: "xx", contactKeFu: false, + sub_visible: false, skeleton_loading: true, - order_inquiry_ids: [] + order_inquiry_ids: [], + sub_btn_disabled: false }, onLoad(option){ let order_inquiry_ids = option.order_inquiry_ids; @@ -33,29 +36,50 @@ Page({ this.postDoctorWithdrawalInfo(params); }, onShow(){ - + this.setData({ + sub_btn_disabled: false + }) }, go(e){ let url = e.currentTarget.dataset.url; app.go(url); }, contactKeFu(e){ - let _this = this; - console.log("concatKeFu"); - wx.requestSubscribeMessage({ - tmplIds: ['JMPmlYGh1HcUSuEfJCVQUIsZv4H5ar3QvXZfrNYNFuc'], - success (res) { - console.log(res); - _this.setData({ - contactKeFu: true + let tmplIds = ['JMPmlYGh1HcUSuEfJCVQUIsZv4H5ar3QvXZfrNYNFuc'] + let sub_promise = requestSubscribeMessage(tmplIds) + sub_promise.then(res => { + console.log("订阅成功") + this.setData({ + contactKeFu: true + }) + }).catch(err => { + console.log(err) + let errCode = err.errCode + if(errCode == 20004){ + this.setData({ + sub_visible: true, }) - } }) - + }, + subcancelDialog(){ + this.setData({ + sub_visible: false + }) + }, + subconfirmDialog(){ + this.setData({ + sub_visible: false + }) + wx.openSetting({ + success (res) { + console.log(res.authSetting) + } + }) }, postDoctorWithdrawalInfo(params){ + //获取提现数据 api.postDoctorWithdrawalInfo(params).then(response => { console.log(response); @@ -74,9 +98,13 @@ Page({ } }).catch(errors => { console.error(errors); + }) }, postDoctorWithdrawal(){ + this.setData({ + sub_btn_disabled: true + }) let params = {}; params.order_inquiry_id = this.data.order_inquiry_ids.join(","); params.withdrawal_amount_total = this.data.withdrawal_amount; @@ -94,6 +122,9 @@ Page({ }) }).catch(errors => { console.error(errors); + this.setData({ + sub_btn_disabled: false + }) }) } }) \ No newline at end of file diff --git a/Pages/yishi/cash/index.json b/Pages/yishi/cash/index.json index ae3c221..de018e6 100644 --- a/Pages/yishi/cash/index.json +++ b/Pages/yishi/cash/index.json @@ -6,6 +6,7 @@ "van-icon": "@vant/weapp/icon/index", "van-button": "@vant/weapp/button/index", "van-dialog": "@vant/weapp/dialog/index", - "t-skeleton": "tdesign-miniprogram/skeleton/skeleton" + "t-skeleton": "tdesign-miniprogram/skeleton/skeleton", + "t-dialog": "tdesign-miniprogram/dialog/dialog" } } \ No newline at end of file diff --git a/Pages/yishi/cash/index.wxml b/Pages/yishi/cash/index.wxml index 35d59b6..315ab96 100644 --- a/Pages/yishi/cash/index.wxml +++ b/Pages/yishi/cash/index.wxml @@ -3,7 +3,7 @@ 结算银行卡 - 提现规则 + 提现规则 @@ -58,7 +58,7 @@ --> - 提取 + 提取 联系客服 @@ -71,4 +71,18 @@ confirm-button-color="#3CC7C0" confirm-button-open-type="contact" /> + + + + 取消 + + + 确定 + + + diff --git a/Pages/yishi/cash/index.wxss b/Pages/yishi/cash/index.wxss index 8f6696b..fb7a38c 100644 --- a/Pages/yishi/cash/index.wxss +++ b/Pages/yishi/cash/index.wxss @@ -139,5 +139,18 @@ page{ color: #3CC7C0; margin: 30rpx; } - +.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; +} diff --git a/Pages/yishi/index/index.js b/Pages/yishi/index/index.js index fdf9afa..feffe85 100644 --- a/Pages/yishi/index/index.js +++ b/Pages/yishi/index/index.js @@ -1,6 +1,8 @@ // Pages/yishi/index/index.js import { API } from './../../../utils/network/api' -import { rpxTopx } from './../../../utils/util' +import { pxTorpx } from './../../../utils/util' +import { requestSubscribeMessage } from './../../../utils/requestSubscribeUtil'; + const api = new API() const app = getApp() Page({ @@ -92,6 +94,7 @@ Page({ }, ], contactKeFu: false, + sub_visible: false, jiesuan_dialog_show: false, jiesuan_dialog_visible: false, funbox_height: 100, @@ -125,7 +128,7 @@ Page({ const { statusBarHeight } = wx.getSystemInfoSync(); // console.log("statusBarHeight: ", rpxTopx(statusBarHeight)); let funbox_height = wx.getSystemInfoSync().windowHeight - (this.data.stateHeight + this.data.navHeight + 10) - 55;//减去底部空白 - funbox_height = rpxTopx(funbox_height); + funbox_height = pxTorpx(funbox_height); // 147 userinfo的高度 // 80 info_note // 155 认证部分的高度 @@ -424,6 +427,8 @@ Page({ }); } this.setData({ + "info.info_shiming_status_txt": "未认证", + "info.info_shiming_status": "info_shiming_status_no", dialog_content: "请您先完成实名认证", shiming_status_url: "/Pages/yishi/identity/index", dialog_url: "/Pages/yishi/identity/index", @@ -637,20 +642,41 @@ Page({ let checkDialog = this.checkDialog(e); if(checkDialog){ - // console.log("concatKeFu"); - wx.requestSubscribeMessage({ - tmplIds: ['JMPmlYGh1HcUSuEfJCVQUIsZv4H5ar3QvXZfrNYNFuc'], - success (res) { - // console.log(res); - _this.setData({ - contactKeFu: true + + let tmplIds = ['JMPmlYGh1HcUSuEfJCVQUIsZv4H5ar3QvXZfrNYNFuc'] + let sub_promise = requestSubscribeMessage(tmplIds) + sub_promise.then(res => { + console.log("订阅成功") + this.setData({ + contactKeFu: true + }) + }).catch(err => { + console.log(err) + let errCode = err.errCode + if(errCode == 20004){ + this.setData({ + sub_visible: true, }) - } }) - } }, + subcancelDialog(){ + this.setData({ + sub_visible: false, + contactKeFu: true + }) + }, + subconfirmDialog(){ + this.setData({ + sub_visible: false + }) + wx.openSetting({ + success (res) { + console.log(res.authSetting) + } + }) + }, checkDialog(e){ //实名认证 let idcard_status = this.data.info.idcard_status; diff --git a/Pages/yishi/index/index.wxml b/Pages/yishi/index/index.wxml index 2bda114..60e6f93 100644 --- a/Pages/yishi/index/index.wxml +++ b/Pages/yishi/index/index.wxml @@ -233,6 +233,19 @@ 我知道了 + + + 取消 + + + 确定 + + + diff --git a/Pages/yishi/index/index.wxss b/Pages/yishi/index/index.wxss index 441b6e1..5fe6670 100644 --- a/Pages/yishi/index/index.wxss +++ b/Pages/yishi/index/index.wxss @@ -167,6 +167,7 @@ page{ margin: 0 auto; background-color: #fff; padding: 20rpx 20rpx 0 20rpx; + box-shadow: 0px 2px 10px 0px rgba(0,0,0,0.1); } .swiper{ height:168rpx; diff --git a/Pages/yishi/kuaisusetup/index.js b/Pages/yishi/kuaisusetup/index.js index 62f295c..787faa7 100644 --- a/Pages/yishi/kuaisusetup/index.js +++ b/Pages/yishi/kuaisusetup/index.js @@ -1,5 +1,6 @@ import { API } from './../../../utils/network/api' -import Toast from '@vant/weapp/toast/toast'; +import { requestSubscribeMessage } from './../../../utils/requestSubscribeUtil'; + let api = new API() const app = getApp() Page({ @@ -32,7 +33,8 @@ Page({ "5", "10" ] - } + }, + sub_visible: false, }, onLoad(){ @@ -78,16 +80,41 @@ Page({ console.log(response); }).then(()=>{ if(detail){ - wx.requestSubscribeMessage({ - tmplIds: ['G1RIs0RYqsTQ2CuPQWalIMyb6_deuEEbJfajfhGvNzc'], - success (res) { - console.log(res);//同意授权 + + let tmplIds = ['G1RIs0RYqsTQ2CuPQWalIMyb6_deuEEbJfajfhGvNzc'] + let sub_promise = requestSubscribeMessage(tmplIds) + sub_promise.then(res => { + console.log("订阅成功") + + }).catch(err => { + console.log(err) + let errCode = err.errCode + if(errCode == 20004){ + this.setData({ + sub_visible: true, + }) } }) + } }).catch(errors => {console.error(errors);}) }, + subcancelDialog(){ + this.setData({ + sub_visible: false + }) + }, + subconfirmDialog(){ + this.setData({ + sub_visible: false + }) + wx.openSetting({ + success (res) { + console.log(res.authSetting) + } + }) + }, putDoctorInquiryConfig(){ wx.switchTab({ url: "/Pages/yishi/wenzhen_v2/wenzhen" diff --git a/Pages/yishi/kuaisusetup/index.json b/Pages/yishi/kuaisusetup/index.json index 71178ef..cc9281e 100644 --- a/Pages/yishi/kuaisusetup/index.json +++ b/Pages/yishi/kuaisusetup/index.json @@ -7,6 +7,7 @@ "van-stepper": "@vant/weapp/stepper/index", "van-switch": "@vant/weapp/switch/index", "van-button": "@vant/weapp/button/index", - "van-toast": "@vant/weapp/toast/index" + "van-toast": "@vant/weapp/toast/index", + "t-dialog": "tdesign-miniprogram/dialog/dialog" } } \ No newline at end of file diff --git a/Pages/yishi/kuaisusetup/index.wxml b/Pages/yishi/kuaisusetup/index.wxml index 1563a9f..960c705 100644 --- a/Pages/yishi/kuaisusetup/index.wxml +++ b/Pages/yishi/kuaisusetup/index.wxml @@ -46,4 +46,17 @@ + + + + 取消 + + + 确定 + + \ No newline at end of file diff --git a/Pages/yishi/kuaisusetup/index.wxss b/Pages/yishi/kuaisusetup/index.wxss index d556c43..83437f4 100644 --- a/Pages/yishi/kuaisusetup/index.wxss +++ b/Pages/yishi/kuaisusetup/index.wxss @@ -123,4 +123,18 @@ page{ .price{ text-align: center; flex: 1; +} +.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/Pages/yishi/myaccount/index.wxml b/Pages/yishi/myaccount/index.wxml index 541a1e6..43ffae7 100644 --- a/Pages/yishi/myaccount/index.wxml +++ b/Pages/yishi/myaccount/index.wxml @@ -23,7 +23,7 @@ - + { + this.setData({ + save_durg_prescription_product_num: "" + }) + }); + return + } let save_durg = {}; save_durg.product_name = this.data.product_name; save_durg.product_id = this.data.save_durg_product_id; save_durg.prescription_product_num = this.data.save_durg_prescription_product_num; + save_durg.single_unit = this.data.save_durg_single_unit; save_durg.single_use = this.data.save_durg_single_use; save_durg.packaging_unit = this.data.save_durg_packaging_unit; @@ -394,6 +409,37 @@ Page({ }) }) }, + get_save_durg_prescription_product_num(e){ + console.log("get_save_durg_prescription_product_num") + let save_durg_prescription_product_num = e.detail + console.log(typeof save_durg_prescription_product_num) + save_durg_prescription_product_num = Number.parseInt(save_durg_prescription_product_num) + console.log(save_durg_prescription_product_num) + if(isNaN(save_durg_prescription_product_num)){ + Dialog.alert({ + message: '请输入正确数字', + }).then(() => { + this.setData({ + save_durg_prescription_product_num: "" + }) + }); + return + } + + if(save_durg_prescription_product_num > 5){ + Dialog.alert({ + message: '每个药品数量不允许添加超过5个', + }).then(() => { + this.setData({ + save_durg_prescription_product_num: "" + }) + }); + return + } + this.setData({ + save_durg_prescription_product_num: save_durg_prescription_product_num + }) + }, putDoctorPrescription(){//修改处方 let sub_disabled = this.data.sub_disabled; if(sub_disabled) return diff --git a/Pages/yishi/onlinechufang/index.json b/Pages/yishi/onlinechufang/index.json index 705f3c9..03447a9 100644 --- a/Pages/yishi/onlinechufang/index.json +++ b/Pages/yishi/onlinechufang/index.json @@ -11,6 +11,7 @@ "van-search": "@vant/weapp/search/index", "van-image": "@vant/weapp/image/index", "van-toast": "@vant/weapp/toast/index", - "van-icon": "@vant/weapp/icon/index" + "van-icon": "@vant/weapp/icon/index", + "van-dialog": "@vant/weapp/dialog/index" } } \ No newline at end of file diff --git a/Pages/yishi/onlinechufang/index.wxml b/Pages/yishi/onlinechufang/index.wxml index 0a9c015..1d809fe 100644 --- a/Pages/yishi/onlinechufang/index.wxml +++ b/Pages/yishi/onlinechufang/index.wxml @@ -187,7 +187,8 @@ - - \ No newline at end of file + + + \ No newline at end of file diff --git a/Pages/yishi/onlinesetup/index.js b/Pages/yishi/onlinesetup/index.js index df3f035..d8a1200 100644 --- a/Pages/yishi/onlinesetup/index.js +++ b/Pages/yishi/onlinesetup/index.js @@ -1,5 +1,7 @@ import { API } from './../../../utils/network/api' import Toast from 'tdesign-miniprogram/toast/index'; +import { requestSubscribeMessage } from './../../../utils/requestSubscribeUtil'; + let api = new API() const app = getApp() Page({ @@ -32,7 +34,8 @@ Page({ "5", "10" ] - } + }, + sub_visible: false, }, onLoad(){ @@ -72,16 +75,41 @@ Page({ console.log(response); }).then(()=>{ if(detail){ - wx.requestSubscribeMessage({ - tmplIds: ['G1RIs0RYqsTQ2CuPQWalIMyb6_deuEEbJfajfhGvNzc'], - success (res) { - console.log(res);//同意授权 + + let tmplIds = ['G1RIs0RYqsTQ2CuPQWalIMyb6_deuEEbJfajfhGvNzc'] + let sub_promise = requestSubscribeMessage(tmplIds) + sub_promise.then(res => { + console.log("订阅成功") + + }).catch(err => { + console.log(err) + let errCode = err.errCode + if(errCode == 20004){ + this.setData({ + sub_visible: true, + }) } }) + } }).catch(errors => {console.error(errors);}) }, + subcancelDialog(){ + this.setData({ + sub_visible: false + }) + }, + subconfirmDialog(){ + this.setData({ + sub_visible: false + }) + wx.openSetting({ + success (res) { + console.log(res.authSetting) + } + }) + }, putDoctorInquiryConfig(){ //修改医生问诊配置 // let params = {}; diff --git a/Pages/yishi/onlinesetup/index.json b/Pages/yishi/onlinesetup/index.json index fb84336..932d65d 100644 --- a/Pages/yishi/onlinesetup/index.json +++ b/Pages/yishi/onlinesetup/index.json @@ -7,6 +7,7 @@ "van-stepper": "@vant/weapp/stepper/index", "van-switch": "@vant/weapp/switch/index", "van-button": "@vant/weapp/button/index", - "t-toast": "tdesign-miniprogram/toast/toast" + "t-toast": "tdesign-miniprogram/toast/toast", + "t-dialog": "tdesign-miniprogram/dialog/dialog" } } \ No newline at end of file diff --git a/Pages/yishi/onlinesetup/index.wxml b/Pages/yishi/onlinesetup/index.wxml index 617493d..5d257f7 100644 --- a/Pages/yishi/onlinesetup/index.wxml +++ b/Pages/yishi/onlinesetup/index.wxml @@ -51,4 +51,17 @@ + + + + 取消 + + + 确定 + + \ No newline at end of file diff --git a/Pages/yishi/onlinesetup/index.wxss b/Pages/yishi/onlinesetup/index.wxss index 17d1bd2..bb62421 100644 --- a/Pages/yishi/onlinesetup/index.wxss +++ b/Pages/yishi/onlinesetup/index.wxss @@ -137,4 +137,18 @@ page{ } .cell_value{ color: #000; +} +.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/Pages/yishi/wenzhen_v2/wenzhen.js b/Pages/yishi/wenzhen_v2/wenzhen.js index 55e19b1..b3cb159 100644 --- a/Pages/yishi/wenzhen_v2/wenzhen.js +++ b/Pages/yishi/wenzhen_v2/wenzhen.js @@ -118,6 +118,8 @@ Page({ if(wx.$TUIKit){ wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived, this); + wx.$TUIKit.off(wx.$TUIKitTIM.EVENT.SDK_READY, this.onSDKReady); + wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.SDK_READY, this.onSDKReady, this); }else{ app.imInit().then(res => { // console.log("wenzhen onload imInit"); @@ -152,6 +154,7 @@ Page({ dot_4: false, }) wx.$TUIKit.off(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived); + wx.$TUIKit.off(wx.$TUIKitTIM.EVENT.SDK_READY, this.onSDKReady); }, onUnload(){ // console.log("onUnload from wenzhen") @@ -161,6 +164,9 @@ Page({ now_message_inquiry_type: 5, }) }, + onSDKReady(){ + console.log("onSDKReady from wenzhen") + }, getConversationList(){ // console.log("getConversationListgetConversationListgetConversationList"); app.imInit().then(res => { @@ -294,6 +300,9 @@ Page({ if(!cloudCustomData) return; let cloudCustomDataJson; try { + if(!cloudCustomData){ + return + } cloudCustomDataJson = JSON.parse(cloudCustomData); } catch (error) { // console.log(error); @@ -316,6 +325,9 @@ Page({ if(!cloudCustomData) return; let cloudCustomDataJson; try { + if(!item.lastMessage.cloudCustomData){ + return + } cloudCustomDataJson = JSON.parse(item.lastMessage.cloudCustomData); } catch (error) { return; @@ -394,7 +406,7 @@ Page({ if(lastMessage.messageForShow == "[自定义消息]"){ let text = "自定义消息"; let payload = lastMessage.payload; - if(payload) { + if(payload && payload.data) { // console.log("payload: ",payload.data); let payloadJson = JSON.parse(payload.data); text = payloadJson.title.replaceAll(/—/g, ""); diff --git a/Pages/yishi/wenzhen_v2/wenzhen.json b/Pages/yishi/wenzhen_v2/wenzhen.json index e566533..f52e3e5 100644 --- a/Pages/yishi/wenzhen_v2/wenzhen.json +++ b/Pages/yishi/wenzhen_v2/wenzhen.json @@ -13,7 +13,8 @@ "van-tabs": "@vant/weapp/tabs/index", "t-dialog": "tdesign-miniprogram/dialog/dialog", "van-divider": "@vant/weapp/divider/index", - "van-loading": "@vant/weapp/loading/index" + "van-loading": "@vant/weapp/loading/index", + "van-dialog": "@vant/weapp/dialog/index" }, "enablePullDownRefresh": true, "onReachBottomDistance": 100 diff --git a/Pages/yishi/wenzhen_v3/wenzhen.js b/Pages/yishi/wenzhen_v3/wenzhen.js index 90abf7e..f66f287 100644 --- a/Pages/yishi/wenzhen_v3/wenzhen.js +++ b/Pages/yishi/wenzhen_v3/wenzhen.js @@ -469,18 +469,18 @@ Page({ show: false }) - console.log("开始订阅消息"); - wx.requestSubscribeMessage({ - tmplIds: ['jhYUf91ULCTX_f69hazqAYwImdFf8ELasRAwB6X-MTM'], - success (res) { - console.log(res); - 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; - let url = e.currentTarget.dataset.url+"?from_account="+from_account+"&order_inquiry_id="+order_inquiry_id+"&inquiry_type="+inquiry_type; - app.go(url); - } - }) + // console.log("开始订阅消息"); + // wx.requestSubscribeMessage({ + // tmplIds: ['jhYUf91ULCTX_f69hazqAYwImdFf8ELasRAwB6X-MTM'], + // success (res) { + // console.log(res); + // } + // }) + 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; + let url = e.currentTarget.dataset.url+"?from_account="+from_account+"&order_inquiry_id="+order_inquiry_id+"&inquiry_type="+inquiry_type; + app.go(url); }, postDoctorInquiry(e){ this.setData({ diff --git a/Pages/yishi/yizhensetup/index.js b/Pages/yishi/yizhensetup/index.js index 6102dfe..900c5dd 100644 --- a/Pages/yishi/yizhensetup/index.js +++ b/Pages/yishi/yizhensetup/index.js @@ -1,5 +1,6 @@ import { API } from './../../../utils/network/api' import Toast from '@vant/weapp/toast/toast'; +import { requestSubscribeMessage } from './../../../utils/requestSubscribeUtil'; let api = new API() const app = getApp() Page({ @@ -35,7 +36,8 @@ Page({ "5", "10" ] - } + }, + sub_visible: false, }, onLoad(){ @@ -96,10 +98,19 @@ Page({ console.log(response); }).then(()=>{ if(detail){ - wx.requestSubscribeMessage({ - tmplIds: ['G1RIs0RYqsTQ2CuPQWalIMyb6_deuEEbJfajfhGvNzc'], - success (res) { - console.log(res);//同意授权 + + let tmplIds = ['G1RIs0RYqsTQ2CuPQWalIMyb6_deuEEbJfajfhGvNzc'] + let sub_promise = requestSubscribeMessage(tmplIds) + sub_promise.then(res => { + console.log("订阅成功") + + }).catch(err => { + console.log(err) + let errCode = err.errCode + if(errCode == 20004){ + this.setData({ + sub_visible: true, + }) } }) } @@ -112,7 +123,21 @@ Page({ this.setData({ "info.is_open": detail }); }).catch(errors => {console.error(errors);}) }, - + subcancelDialog(){ + this.setData({ + sub_visible: false + }) + }, + subconfirmDialog(){ + this.setData({ + sub_visible: false + }) + wx.openSetting({ + success (res) { + console.log(res.authSetting) + } + }) + }, putDoctorInquiryConfig(){ //修改医生问诊配置 let params = {}; diff --git a/Pages/yishi/yizhensetup/index.json b/Pages/yishi/yizhensetup/index.json index 24c14a6..8291c87 100644 --- a/Pages/yishi/yizhensetup/index.json +++ b/Pages/yishi/yizhensetup/index.json @@ -9,6 +9,7 @@ "van-stepper": "@vant/weapp/stepper/index", "van-switch": "@vant/weapp/switch/index", "van-button": "@vant/weapp/button/index", - "van-toast": "@vant/weapp/toast/index" + "van-toast": "@vant/weapp/toast/index", + "t-dialog": "tdesign-miniprogram/dialog/dialog" } } \ No newline at end of file diff --git a/Pages/yishi/yizhensetup/index.wxml b/Pages/yishi/yizhensetup/index.wxml index 2767d8f..00a86fd 100644 --- a/Pages/yishi/yizhensetup/index.wxml +++ b/Pages/yishi/yizhensetup/index.wxml @@ -73,4 +73,17 @@ + + + + 取消 + + + 确定 + + \ No newline at end of file diff --git a/Pages/yishi/yizhensetup/index.wxss b/Pages/yishi/yizhensetup/index.wxss index 592ac88..8bfbb3a 100644 --- a/Pages/yishi/yizhensetup/index.wxss +++ b/Pages/yishi/yizhensetup/index.wxss @@ -121,4 +121,18 @@ page{ } .price{ color: red; +} +.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/Pages/yishi/yizhensetupprice/index.js b/Pages/yishi/yizhensetupprice/index.js index 411201f..d928480 100644 --- a/Pages/yishi/yizhensetupprice/index.js +++ b/Pages/yishi/yizhensetupprice/index.js @@ -1,5 +1,6 @@ import { API } from './../../../utils/network/api' import Toast from '@vant/weapp/toast/toast'; +import { requestSubscribeMessage } from './../../../utils/requestSubscribeUtil'; let api = new API() const app = getApp() Page({ @@ -35,7 +36,8 @@ Page({ "5", "10" ] - } + }, + sub_visible: false, }, onShow(){ @@ -98,16 +100,39 @@ Page({ console.log(response); }).then(()=>{ if(detail){ - wx.requestSubscribeMessage({ - tmplIds: ['G1RIs0RYqsTQ2CuPQWalIMyb6_deuEEbJfajfhGvNzc'], - success (res) { - console.log(res);//同意授权 + + let tmplIds = ['G1RIs0RYqsTQ2CuPQWalIMyb6_deuEEbJfajfhGvNzc'] + let sub_promise = requestSubscribeMessage(tmplIds) + sub_promise.then(res => { + console.log("订阅成功") + + }).catch(err => { + console.log(err) + let errCode = err.errCode + if(errCode == 20004){ + this.setData({ + sub_visible: true, + }) } }) } }).catch(errors => {console.error(errors);}) }, - + subcancelDialog(){ + this.setData({ + sub_visible: false + }) + }, + subconfirmDialog(){ + this.setData({ + sub_visible: false + }) + wx.openSetting({ + success (res) { + console.log(res.authSetting) + } + }) + }, putDoctorInquiryConfig(){ //修改医生问诊配置 let params = {}; diff --git a/Pages/yishi/yizhensetupprice/index.json b/Pages/yishi/yizhensetupprice/index.json index 7ebfd9b..e57194f 100644 --- a/Pages/yishi/yizhensetupprice/index.json +++ b/Pages/yishi/yizhensetupprice/index.json @@ -8,6 +8,7 @@ "van-cell-group": "@vant/weapp/cell-group/index", "van-stepper": "@vant/weapp/stepper/index", "van-button": "@vant/weapp/button/index", - "van-toast": "@vant/weapp/toast/index" + "van-toast": "@vant/weapp/toast/index", + "t-dialog": "tdesign-miniprogram/dialog/dialog" } } \ No newline at end of file diff --git a/Pages/yishi/yizhensetupprice/index.wxml b/Pages/yishi/yizhensetupprice/index.wxml index 4259805..df87a1c 100644 --- a/Pages/yishi/yizhensetupprice/index.wxml +++ b/Pages/yishi/yizhensetupprice/index.wxml @@ -46,4 +46,17 @@ + + + + 取消 + + + 确定 + + \ No newline at end of file diff --git a/Pages/yishi/yizhensetupprice/index.wxss b/Pages/yishi/yizhensetupprice/index.wxss index 8d256c4..d41f1c7 100644 --- a/Pages/yishi/yizhensetupprice/index.wxss +++ b/Pages/yishi/yizhensetupprice/index.wxss @@ -120,4 +120,18 @@ page{ .van-cell__value{ font-size: 32rpx !important; color: red !important; +} +.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/Pages/yishi/zhiye_identity/index.js b/Pages/yishi/zhiye_identity/index.js index 75b3009..49b2a2d 100644 --- a/Pages/yishi/zhiye_identity/index.js +++ b/Pages/yishi/zhiye_identity/index.js @@ -1,5 +1,6 @@ import { API } from './../../../utils/network/api' import { FileUtil } from './../../../utils/fileutil' +import { requestSubscribeMessage } from './../../../utils/requestSubscribeUtil'; const api = new API() const app = getApp() Page({ @@ -15,7 +16,8 @@ Page({ btn_txt: "提交", multi_point_status: "", btn_disabled: true, - sfz_show: false + sfz_show: false, + sub_visible: false, }, onLoad(){ @@ -99,66 +101,88 @@ Page({ }) } }, - add(){ - let _this = this; - wx.requestSubscribeMessage({ - tmplIds: ['XWfEQYtb8_ubz8pCs3GoCG6TFxpDz9jn52895yvDm3s','bGGoKtDZC23GZtrrxuy6i5V7OhHgRgwXWx4yoDO1tlA'], - success (res) { - console.log(res); - console.log(_this.data.id_card_front); - console.log(_this.data.id_card_back); - - if(_this.data.id_card_front.length == 0){ - wx.showToast({ - title: '身份证正面为空', - icon: "error" - }) - return; - } - - if(_this.data.id_card_back.length == 0){ - wx.showToast({ - title: '身份证反面为空', - icon: "error" - }) - return; - } - let id_card_front = _this.data.id_card_front[0].url; - let id_card_back = _this.data.id_card_back[0].url; - let sign_image = _this.data.sign_image[0].url; - console.log("id_card_front: ", id_card_front); - console.log("id_card_back: ", id_card_back); - console.log("sign_image: ", sign_image); - if(sign_image == ""){ - wx.showToast({ - title: '手写签名为空', - icon: "error" - }) - return; - } - let params = {}; - params.id_card_front = id_card_front; - params.id_card_back = id_card_back; - params.sign_image = sign_image; - api.postDoctorAuthMulti(params).then(response => { - console.log("postDoctorAuthMulti: ",response); - wx.showToast({ - title: '提交成功', - icon: "success" - }) - _this.setData({ - btn_txt: "审核中", - btn_disabled: true - }) - }).catch(errors => { - console.error(errors); - }) - }, - fail (res) { console.log(res) }, - complete (res) { console.log(res) }, + subcancelDialog(){ + this.setData({ + sub_visible: false }) - + this.goadd() + }, + subconfirmDialog(){ + this.setData({ + sub_visible: false + }) + wx.openSetting({ + success (res) { + console.log(res.authSetting) + } + }) + }, + add(){ + let tmplIds = ['XWfEQYtb8_ubz8pCs3GoCG6TFxpDz9jn52895yvDm3s','bGGoKtDZC23GZtrrxuy6i5V7OhHgRgwXWx4yoDO1tlA'] + let sub_promise = requestSubscribeMessage(tmplIds) + sub_promise.then(res => { + console.log("订阅成功") + this.goadd() + }).catch(err => { + console.log(err) + let errCode = err.errCode + if(errCode == 20004){ + this.setData({ + sub_visible: true, + }) + } + }) + }, + goadd(){ + let _this = this; + console.log(_this.data.id_card_front); + console.log(_this.data.id_card_back); + if(_this.data.id_card_front.length == 0){ + wx.showToast({ + title: '身份证正面为空', + icon: "error" + }) + return; + } + + if(_this.data.id_card_back.length == 0){ + wx.showToast({ + title: '身份证反面为空', + icon: "error" + }) + return; + } + let id_card_front = _this.data.id_card_front[0].url; + let id_card_back = _this.data.id_card_back[0].url; + let sign_image = _this.data.sign_image[0].url; + console.log("id_card_front: ", id_card_front); + console.log("id_card_back: ", id_card_back); + console.log("sign_image: ", sign_image); + if(sign_image == ""){ + wx.showToast({ + title: '手写签名为空', + icon: "error" + }) + return; + } + let params = {}; + params.id_card_front = id_card_front; + params.id_card_back = id_card_back; + params.sign_image = sign_image; + api.postDoctorAuthMulti(params).then(response => { + console.log("postDoctorAuthMulti: ",response); + wx.showToast({ + title: '提交成功', + icon: "success" + }) + _this.setData({ + btn_txt: "审核中", + btn_disabled: true + }) + }).catch(errors => { + console.error(errors); + }) }, doUploadFile(event) { console.log("index douploadFIle: ", event); diff --git a/Pages/yishi/zhiye_identity/index.json b/Pages/yishi/zhiye_identity/index.json index 42ec431..0e9bd46 100644 --- a/Pages/yishi/zhiye_identity/index.json +++ b/Pages/yishi/zhiye_identity/index.json @@ -9,6 +9,7 @@ "van-divider": "@vant/weapp/divider/index", "van-button": "@vant/weapp/button/index", "van-popup": "@vant/weapp/popup/index", - "van-image": "@vant/weapp/image/index" + "van-image": "@vant/weapp/image/index", + "t-dialog": "tdesign-miniprogram/dialog/dialog" } } \ No newline at end of file diff --git a/Pages/yishi/zhiye_identity/index.wxml b/Pages/yishi/zhiye_identity/index.wxml index 60d18ee..a062790 100644 --- a/Pages/yishi/zhiye_identity/index.wxml +++ b/Pages/yishi/zhiye_identity/index.wxml @@ -97,4 +97,17 @@ + + + 取消 + + + 确定 + + + \ No newline at end of file diff --git a/Pages/yishi/zhiye_identity/index.wxss b/Pages/yishi/zhiye_identity/index.wxss index eb1d61d..a433484 100644 --- a/Pages/yishi/zhiye_identity/index.wxss +++ b/Pages/yishi/zhiye_identity/index.wxss @@ -54,4 +54,18 @@ } .zhiye_popup_img{ margin-top: 30rpx; +} +.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/components/MessageInput/index.js b/TUIKit/components/TUIChat/components/MessageInput/index.js index 2146c7e..c6e7118 100644 --- a/TUIKit/components/TUIChat/components/MessageInput/index.js +++ b/TUIKit/components/TUIChat/components/MessageInput/index.js @@ -1,6 +1,7 @@ import logger from '../../../../utils/logger'; import constant from '../../../../utils/constant'; import { API } from '../../../../../utils/network/api'; +import { requestSubscribeMessage } from '../../../../../utils/requestSubscribeUtil'; const api = new API() let app = getApp() @@ -79,7 +80,7 @@ Component({ notShow: false, isShow: true, commonFunction: [ - { name: '查看完整病例', key: '10' }, + { name: '查看完整病历', key: '10' }, { name: '在线开处方', key: '11' }, ], displayServiceEvaluation: false, @@ -95,6 +96,7 @@ Component({ showChangYongYu: false, ChangYongYu: [], dialog_visible: false, + sub_visible: false, dialog_message: "在线开处方需先进行多点执业认证", message_rounds: 0, networkstatus: "wifi" @@ -456,7 +458,7 @@ Component({ }, handleCommonFunctions(e) { - // console.log("handleCommonFunctions: ", e) + console.log("handleCommonFunctions: ", e) switch (e.target.dataset.key) { case '0': this.setData({ @@ -478,26 +480,19 @@ Component({ break; case '11'://在线开方 let _this = this; - // console.log("开始订阅消息"); - wx.requestSubscribeMessage({ - tmplIds: ['kUy70xHlr7ADo4aIHiictM4Te7MSec3E5kHsYvFQu40'], - success (res) { - // console.log(res); - let order_inquiry_id = _this.data.order_inquiry_id - api.getDoctorPrescriptionCheck({order_inquiry_id: order_inquiry_id}).then(response => { - let status = response.data.status - if(status == 1){ - app.go("/Pages/yishi/onlinechufang/index?order_inquiry_id="+order_inquiry_id) - }else{ - _this.setData({ - dialog_visible: true, - dialog_message: response.data.message - }) - } - }).catch(errors => { - console.error(errors); + console.log("开始订阅消息"); + let tmplIds = ['kUy70xHlr7ADo4aIHiictM4Te7MSec3E5kHsYvFQu40'] + let sub_promise = requestSubscribeMessage(tmplIds) + sub_promise.then(res => { + console.log("订阅成功") + this.goCase() + }).catch(err => { + console.log(err) + let errCode = err.errCode + if(errCode == 20004){ + _this.setData({ + sub_visible: true, }) - } }) break; @@ -505,6 +500,23 @@ Component({ break; } }, + goCase(){ + + let order_inquiry_id = this.data.order_inquiry_id + api.getDoctorPrescriptionCheck({order_inquiry_id: order_inquiry_id}).then(response => { + let status = response.data.status + if(status == 1){ + app.go("/Pages/yishi/onlinechufang/index?order_inquiry_id="+order_inquiry_id) + }else{ + this.setData({ + dialog_visible: true, + dialog_message: response.data.message + }) + } + }).catch(errors => { + console.error(errors); + }) + }, cancelDialog(){ this.setData({ dialog_visible: false @@ -516,6 +528,22 @@ Component({ dialog_visible: false }) }, + subcancelDialog(){ + this.setData({ + sub_visible: false + }) + this.goCase() + }, + subconfirmDialog(){ + this.setData({ + sub_visible: false + }) + wx.openSetting({ + success (res) { + console.log(res.authSetting) + } + }) + }, handleSendOrder() { this.setData({ displayOrderList: true, @@ -849,7 +877,11 @@ Component({ event, }); }, - + inputBindLinechange(event){ + this.triggerEvent('inputBindLinechange', { + event, + }); + }, $handleSendTextMessage(event) { this.sendTextMessage(event.detail.message, true); this.setData({ diff --git a/TUIKit/components/TUIChat/components/MessageInput/index.wxml b/TUIKit/components/TUIChat/components/MessageInput/index.wxml index 3511119..784a9a5 100644 --- a/TUIKit/components/TUIChat/components/MessageInput/index.wxml +++ b/TUIKit/components/TUIChat/components/MessageInput/index.wxml @@ -1,18 +1,20 @@ - 查看完整病例 + 查看完整病历 在线开处方 -