"use strict"; var common_vendor = require("../common/vendor.js"); var store_index = require("../store/index.js"); var api_inquiryOrder = require("../api/inquiryOrder.js"); var api_common = require("../api/common.js"); require("../store/modules.js"); require("../store/modules/timStore.js"); require("../common/request.js"); const _sfc_main = { data() { return { report: null, patient: null, hospital: null, department: null, doctor: null, order: null, orderId: null, orderStatusOptions: [], orderTypeOptions: [], inquiryTypeOptions: [], reportImages: [], tongueImages: [], faceImages: [] }; }, onLoad(options) { this.orderId = options.orderId; this.getDictByKey("sys_inquiry_order_type"); this.getDictByKey("sys_inquiry_type"); this.getDictByKey("sys_inquiry_status"); }, onShow() { this.getMyInquiryOrderById(); }, methods: { cancel() { var that = this; common_vendor.index.showModal({ title: "\u63D0\u793A", content: "\u786E\u8BA4\u53D6\u6D88\u8BA2\u5355\u5417?", showCancel: true, cancelText: "\u53D6\u6D88", confirmText: "\u786E\u5B9A", success: (res) => { if (res.confirm) { var data = { orderId: this.orderId }; api_inquiryOrder.cancel(data).then((res2) => { if (res2.code == 200) { that.getMyInquiryOrderById(); common_vendor.index.showToast({ icon: "success", title: "\u64CD\u4F5C\u6210\u529F" }); } else { common_vendor.index.showToast({ icon: "none", title: res2.msg }); } }, (rej) => { }); } } }); }, ping() { common_vendor.index.navigateTo({ url: "/pages_order/pingOrder?orderId=" + this.orderId + "&doctorId=" + this.order.doctorId }); }, pay() { common_vendor.index.navigateTo({ url: "/pages_order/inquiryPay?orderId=" + this.orderId }); }, toIM() { var that = this; var id = "C2CD-" + this.doctor.doctorId; store_index.store.commit("timStore/setType", "startInquiry"); store_index.store.commit("timStore/setOrderType", this.order.orderType); store_index.store.commit("timStore/setOrderId", this.order.orderId); store_index.store.commit("timStore/setFollowId", 0); store_index.store.commit("timStore/setImType", 1); store_index.store.commit("timStore/setConversationID", id); common_vendor.index.$TUIKit.TUIConversationServer.setMessageRead(id); common_vendor.index.$TUIKit.TUIConversationServer.getConversationProfile(id).then((res) => { var _a; common_vendor.index.$TUIKit.TUIConversationServer.setConversationValue(id, that.orderId).then((res2) => { console.log("\u66F4\u65B0order"); }).catch((err) => { }); console.log(res); const { conversation } = res.data; store_index.store.commit("timStore/setConversation", conversation); let url = "/pages/TUIKit/TUIPages/TUIChat/index"; conversation.userProfile; url = `${url}?conversationName=${((_a = conversation.userProfile.nick) == null ? void 0 : _a.nick) || conversation.userProfile.userID}`; common_vendor.index.redirectTo({ url }); }).catch((err) => { console.warn("\u83B7\u53D6 group profile \u5F02\u5E38 = ", err); }); }, navTo(url) { common_vendor.index.navigateTo({ url }); }, copyOrderSn() { common_vendor.index.setClipboardData({ data: this.order.orderSn, success: function() { common_vendor.index.showToast({ title: "\u590D\u5236\u6210\u529F", icon: "none" }); } }); }, getMyInquiryOrderById() { var that = this; var data = { orderId: this.orderId }; api_inquiryOrder.getMyInquiryOrderById(data).then((res) => { if (res.code == 200) { this.order = res.data.order; this.report = res.data.report; this.patient = JSON.parse(res.data.order.patientJson); if (that.patient.reportImages != null) { that.reportImages = that.patient.reportImages.split(","); } if (that.patient.tongueImages != null) { that.tongueImages = that.patient.tongueImages.split(","); } if (that.patient.faceImages != null) { that.faceImages = that.patient.faceImages.split(","); } this.doctor = res.data.doctor; this.department = res.data.department; this.hospital = res.data.hospital; } }, (err) => { }); }, getDictByKey(key) { var data = { key }; api_common.getDictByKey(data).then((res) => { if (res.code == 200) { if (key == "sys_inquiry_order_type") { this.orderTypeOptions = res.data; } if (key == "sys_inquiry_type") { this.inquiryTypeOptions = res.data; } if (key == "sys_inquiry_status") { this.orderStatusOptions = res.data; } } }, (err) => { }); }, navTo(url) { common_vendor.index.navigateTo({ url }); } } }; if (!Array) { const _easycom_u_rate2 = common_vendor.resolveComponent("u-rate"); const _easycom_u_album2 = common_vendor.resolveComponent("u-album"); (_easycom_u_rate2 + _easycom_u_album2)(); } const _easycom_u_rate = () => "../uni_modules/uview-plus/components/u-rate/u-rate.js"; const _easycom_u_album = () => "../uni_modules/uview-plus/components/u-album/u-album.js"; if (!Math) { (_easycom_u_rate + _easycom_u_album)(); } function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { return common_vendor.e({ a: $data.order != null }, $data.order != null ? common_vendor.e({ b: common_vendor.t(_ctx.$getDictLabelName($data.inquiryTypeOptions, $data.order.inquiryType)), c: common_vendor.t(_ctx.$getDictLabelName($data.orderTypeOptions, $data.order.orderType)), d: $data.order.status == 1 }, $data.order.status == 1 ? { e: common_vendor.t(_ctx.$getDictLabelName($data.orderStatusOptions, $data.order.status)) } : {}, { f: $data.order.status == 2 }, $data.order.status == 2 ? { g: common_vendor.t(_ctx.$getDictLabelName($data.orderStatusOptions, $data.order.status)) } : {}, { h: $data.order.status == 3 }, $data.order.status == 3 ? { i: common_vendor.t(_ctx.$getDictLabelName($data.orderStatusOptions, $data.order.status)) } : {}, { j: $data.order.status == 4 }, $data.order.status == 4 ? { k: common_vendor.t(_ctx.$getDictLabelName($data.orderStatusOptions, $data.order.status)) } : {}, { l: $data.order.status < 0 }, $data.order.status < 0 ? { m: common_vendor.t(_ctx.$getDictLabelName($data.orderStatusOptions, $data.order.status)) } : {}) : {}, { n: $data.doctor != null }, $data.doctor != null ? { o: common_vendor.t($data.doctor.doctorName), p: common_vendor.o(($event) => $data.doctor.pingStar = $event), q: common_vendor.p({ activeColor: "#ffc603", count: "5", readonly: true, modelValue: $data.doctor.pingStar }), r: common_vendor.t($data.department.deptName), s: common_vendor.t($data.doctor.position), t: common_vendor.t($data.hospital.hospitalName), v: common_vendor.t($data.doctor.speciality), w: common_vendor.o(($event) => $options.navTo("/pages_doctor/doctorDetails?doctorId=" + $data.doctor.doctorId)) } : {}, { x: $data.patient != null && $data.order.inquiryType == 1 }, $data.patient != null && $data.order.inquiryType == 1 ? { y: common_vendor.t($data.patient.patientName), z: common_vendor.t($data.patient.sex == 1 ? "\u7537" : "\u5973"), A: common_vendor.t($data.patient.age), B: common_vendor.t($data.patient.title), C: common_vendor.t($data.patient.duration), D: common_vendor.t($data.patient.isVisit) } : {}, { E: $data.patient != null && $data.order.inquiryType == 2 }, $data.patient != null && $data.order.inquiryType == 2 ? { F: common_vendor.t($data.patient.patientName), G: common_vendor.t($data.patient.sex == 1 ? "\u7537" : "\u5973"), H: common_vendor.t($data.patient.age), I: common_vendor.t($data.patient.title), J: common_vendor.p({ urls: $data.reportImages }) } : {}, { K: $data.patient != null && $data.order.inquiryType == 3 }, $data.patient != null && $data.order.inquiryType == 3 ? { L: common_vendor.t($data.patient.patientName), M: common_vendor.t($data.patient.sex == 1 ? "\u7537" : "\u5973"), N: common_vendor.t($data.patient.age), O: common_vendor.t($data.patient.title), P: common_vendor.t($data.patient.drugs), Q: common_vendor.t($data.patient.duration), R: common_vendor.t($data.patient.isVisit), S: common_vendor.p({ urls: $data.reportImages }), T: common_vendor.p({ urls: $data.tongueImages }), U: common_vendor.p({ urls: $data.faceImages }) } : {}, { V: $data.order != null }, $data.order != null ? { W: common_vendor.t($data.order.orderSn), X: common_vendor.o((...args) => $options.copyOrderSn && $options.copyOrderSn(...args)), Y: common_vendor.t($data.order.createTime), Z: common_vendor.t($data.order.money.toFixed(2)), aa: common_vendor.t($data.order.discountMoney.toFixed(2)), ab: common_vendor.t($data.order.payMoney.toFixed(2)) } : {}, { ac: $data.order != null }, $data.order != null ? common_vendor.e({ ad: $data.report != null && $data.order.status >= 3 }, $data.report != null && $data.order.status >= 3 ? { ae: common_vendor.o(($event) => $options.navTo("/pages_order/inquiryOrderReport?orderId=" + $data.order.orderId)) } : {}, { af: $data.order.status == 3 }, $data.order.status == 3 ? { ag: common_vendor.o(($event) => $options.toIM()) } : {}, { ah: $data.order.status == 1 }, $data.order.status == 1 ? { ai: common_vendor.o(($event) => $options.pay()) } : {}, { aj: $data.order.status == 2 }, $data.order.status == 2 ? { ak: common_vendor.o(($event) => $options.cancel()) } : {}, { al: $data.order.status == 4 && $data.order.isPing == 0 }, $data.order.status == 4 && $data.order.isPing == 0 ? { am: common_vendor.o(($event) => $options.ping()) } : {}) : {}); } var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-f9fa3e3e"], ["__file", "E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_order/inquiryOrderDetails.vue"]]); wx.createPage(MiniProgramPage);