inquiryOrderDetails.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. "use strict";
  2. var common_vendor = require("../common/vendor.js");
  3. var store_index = require("../store/index.js");
  4. var api_inquiryOrder = require("../api/inquiryOrder.js");
  5. var api_common = require("../api/common.js");
  6. require("../store/modules.js");
  7. require("../store/modules/timStore.js");
  8. require("../common/request.js");
  9. const _sfc_main = {
  10. data() {
  11. return {
  12. report: null,
  13. patient: null,
  14. hospital: null,
  15. department: null,
  16. doctor: null,
  17. order: null,
  18. orderId: null,
  19. orderStatusOptions: [],
  20. orderTypeOptions: [],
  21. inquiryTypeOptions: [],
  22. reportImages: [],
  23. tongueImages: [],
  24. faceImages: []
  25. };
  26. },
  27. onLoad(options) {
  28. this.orderId = options.orderId;
  29. this.getDictByKey("sys_inquiry_order_type");
  30. this.getDictByKey("sys_inquiry_type");
  31. this.getDictByKey("sys_inquiry_status");
  32. },
  33. onShow() {
  34. this.getMyInquiryOrderById();
  35. },
  36. methods: {
  37. cancel() {
  38. var that = this;
  39. common_vendor.index.showModal({
  40. title: "\u63D0\u793A",
  41. content: "\u786E\u8BA4\u53D6\u6D88\u8BA2\u5355\u5417?",
  42. showCancel: true,
  43. cancelText: "\u53D6\u6D88",
  44. confirmText: "\u786E\u5B9A",
  45. success: (res) => {
  46. if (res.confirm) {
  47. var data = { orderId: this.orderId };
  48. api_inquiryOrder.cancel(data).then((res2) => {
  49. if (res2.code == 200) {
  50. that.getMyInquiryOrderById();
  51. common_vendor.index.showToast({
  52. icon: "success",
  53. title: "\u64CD\u4F5C\u6210\u529F"
  54. });
  55. } else {
  56. common_vendor.index.showToast({
  57. icon: "none",
  58. title: res2.msg
  59. });
  60. }
  61. }, (rej) => {
  62. });
  63. }
  64. }
  65. });
  66. },
  67. ping() {
  68. common_vendor.index.navigateTo({
  69. url: "/pages_order/pingOrder?orderId=" + this.orderId + "&doctorId=" + this.order.doctorId
  70. });
  71. },
  72. pay() {
  73. common_vendor.index.navigateTo({
  74. url: "/pages_order/inquiryPay?orderId=" + this.orderId
  75. });
  76. },
  77. toIM() {
  78. var that = this;
  79. var id = "C2CD-" + this.doctor.doctorId;
  80. store_index.store.commit("timStore/setType", "startInquiry");
  81. store_index.store.commit("timStore/setOrderType", this.order.orderType);
  82. store_index.store.commit("timStore/setOrderId", this.order.orderId);
  83. store_index.store.commit("timStore/setFollowId", 0);
  84. store_index.store.commit("timStore/setImType", 1);
  85. store_index.store.commit("timStore/setConversationID", id);
  86. common_vendor.index.$TUIKit.TUIConversationServer.setMessageRead(id);
  87. common_vendor.index.$TUIKit.TUIConversationServer.getConversationProfile(id).then((res) => {
  88. var _a;
  89. common_vendor.index.$TUIKit.TUIConversationServer.setConversationValue(id, that.orderId).then((res2) => {
  90. console.log("\u66F4\u65B0order");
  91. }).catch((err) => {
  92. });
  93. console.log(res);
  94. const { conversation } = res.data;
  95. store_index.store.commit("timStore/setConversation", conversation);
  96. let url = "/pages/TUIKit/TUIPages/TUIChat/index";
  97. conversation.userProfile;
  98. url = `${url}?conversationName=${((_a = conversation.userProfile.nick) == null ? void 0 : _a.nick) || conversation.userProfile.userID}`;
  99. common_vendor.index.redirectTo({ url });
  100. }).catch((err) => {
  101. console.warn("\u83B7\u53D6 group profile \u5F02\u5E38 = ", err);
  102. });
  103. },
  104. navTo(url) {
  105. common_vendor.index.navigateTo({
  106. url
  107. });
  108. },
  109. copyOrderSn() {
  110. common_vendor.index.setClipboardData({
  111. data: this.order.orderSn,
  112. success: function() {
  113. common_vendor.index.showToast({
  114. title: "\u590D\u5236\u6210\u529F",
  115. icon: "none"
  116. });
  117. }
  118. });
  119. },
  120. getMyInquiryOrderById() {
  121. var that = this;
  122. var data = { orderId: this.orderId };
  123. api_inquiryOrder.getMyInquiryOrderById(data).then((res) => {
  124. if (res.code == 200) {
  125. this.order = res.data.order;
  126. this.report = res.data.report;
  127. this.patient = JSON.parse(res.data.order.patientJson);
  128. if (that.patient.reportImages != null) {
  129. that.reportImages = that.patient.reportImages.split(",");
  130. }
  131. if (that.patient.tongueImages != null) {
  132. that.tongueImages = that.patient.tongueImages.split(",");
  133. }
  134. if (that.patient.faceImages != null) {
  135. that.faceImages = that.patient.faceImages.split(",");
  136. }
  137. this.doctor = res.data.doctor;
  138. this.department = res.data.department;
  139. this.hospital = res.data.hospital;
  140. }
  141. }, (err) => {
  142. });
  143. },
  144. getDictByKey(key) {
  145. var data = { key };
  146. api_common.getDictByKey(data).then((res) => {
  147. if (res.code == 200) {
  148. if (key == "sys_inquiry_order_type") {
  149. this.orderTypeOptions = res.data;
  150. }
  151. if (key == "sys_inquiry_type") {
  152. this.inquiryTypeOptions = res.data;
  153. }
  154. if (key == "sys_inquiry_status") {
  155. this.orderStatusOptions = res.data;
  156. }
  157. }
  158. }, (err) => {
  159. });
  160. },
  161. navTo(url) {
  162. common_vendor.index.navigateTo({
  163. url
  164. });
  165. }
  166. }
  167. };
  168. if (!Array) {
  169. const _easycom_u_rate2 = common_vendor.resolveComponent("u-rate");
  170. const _easycom_u_album2 = common_vendor.resolveComponent("u-album");
  171. (_easycom_u_rate2 + _easycom_u_album2)();
  172. }
  173. const _easycom_u_rate = () => "../uni_modules/uview-plus/components/u-rate/u-rate.js";
  174. const _easycom_u_album = () => "../uni_modules/uview-plus/components/u-album/u-album.js";
  175. if (!Math) {
  176. (_easycom_u_rate + _easycom_u_album)();
  177. }
  178. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  179. return common_vendor.e({
  180. a: $data.order != null
  181. }, $data.order != null ? common_vendor.e({
  182. b: common_vendor.t(_ctx.$getDictLabelName($data.inquiryTypeOptions, $data.order.inquiryType)),
  183. c: common_vendor.t(_ctx.$getDictLabelName($data.orderTypeOptions, $data.order.orderType)),
  184. d: $data.order.status == 1
  185. }, $data.order.status == 1 ? {
  186. e: common_vendor.t(_ctx.$getDictLabelName($data.orderStatusOptions, $data.order.status))
  187. } : {}, {
  188. f: $data.order.status == 2
  189. }, $data.order.status == 2 ? {
  190. g: common_vendor.t(_ctx.$getDictLabelName($data.orderStatusOptions, $data.order.status))
  191. } : {}, {
  192. h: $data.order.status == 3
  193. }, $data.order.status == 3 ? {
  194. i: common_vendor.t(_ctx.$getDictLabelName($data.orderStatusOptions, $data.order.status))
  195. } : {}, {
  196. j: $data.order.status == 4
  197. }, $data.order.status == 4 ? {
  198. k: common_vendor.t(_ctx.$getDictLabelName($data.orderStatusOptions, $data.order.status))
  199. } : {}, {
  200. l: $data.order.status < 0
  201. }, $data.order.status < 0 ? {
  202. m: common_vendor.t(_ctx.$getDictLabelName($data.orderStatusOptions, $data.order.status))
  203. } : {}) : {}, {
  204. n: $data.doctor != null
  205. }, $data.doctor != null ? {
  206. o: common_vendor.t($data.doctor.doctorName),
  207. p: common_vendor.o(($event) => $data.doctor.pingStar = $event),
  208. q: common_vendor.p({
  209. activeColor: "#ffc603",
  210. count: "5",
  211. readonly: true,
  212. modelValue: $data.doctor.pingStar
  213. }),
  214. r: common_vendor.t($data.department.deptName),
  215. s: common_vendor.t($data.doctor.position),
  216. t: common_vendor.t($data.hospital.hospitalName),
  217. v: common_vendor.t($data.doctor.speciality),
  218. w: common_vendor.o(($event) => $options.navTo("/pages_doctor/doctorDetails?doctorId=" + $data.doctor.doctorId))
  219. } : {}, {
  220. x: $data.patient != null && $data.order.inquiryType == 1
  221. }, $data.patient != null && $data.order.inquiryType == 1 ? {
  222. y: common_vendor.t($data.patient.patientName),
  223. z: common_vendor.t($data.patient.sex == 1 ? "\u7537" : "\u5973"),
  224. A: common_vendor.t($data.patient.age),
  225. B: common_vendor.t($data.patient.title),
  226. C: common_vendor.t($data.patient.duration),
  227. D: common_vendor.t($data.patient.isVisit)
  228. } : {}, {
  229. E: $data.patient != null && $data.order.inquiryType == 2
  230. }, $data.patient != null && $data.order.inquiryType == 2 ? {
  231. F: common_vendor.t($data.patient.patientName),
  232. G: common_vendor.t($data.patient.sex == 1 ? "\u7537" : "\u5973"),
  233. H: common_vendor.t($data.patient.age),
  234. I: common_vendor.t($data.patient.title),
  235. J: common_vendor.p({
  236. urls: $data.reportImages
  237. })
  238. } : {}, {
  239. K: $data.patient != null && $data.order.inquiryType == 3
  240. }, $data.patient != null && $data.order.inquiryType == 3 ? {
  241. L: common_vendor.t($data.patient.patientName),
  242. M: common_vendor.t($data.patient.sex == 1 ? "\u7537" : "\u5973"),
  243. N: common_vendor.t($data.patient.age),
  244. O: common_vendor.t($data.patient.title),
  245. P: common_vendor.t($data.patient.drugs),
  246. Q: common_vendor.t($data.patient.duration),
  247. R: common_vendor.t($data.patient.isVisit),
  248. S: common_vendor.p({
  249. urls: $data.reportImages
  250. }),
  251. T: common_vendor.p({
  252. urls: $data.tongueImages
  253. }),
  254. U: common_vendor.p({
  255. urls: $data.faceImages
  256. })
  257. } : {}, {
  258. V: $data.order != null
  259. }, $data.order != null ? {
  260. W: common_vendor.t($data.order.orderSn),
  261. X: common_vendor.o((...args) => $options.copyOrderSn && $options.copyOrderSn(...args)),
  262. Y: common_vendor.t($data.order.createTime),
  263. Z: common_vendor.t($data.order.money.toFixed(2)),
  264. aa: common_vendor.t($data.order.discountMoney.toFixed(2)),
  265. ab: common_vendor.t($data.order.payMoney.toFixed(2))
  266. } : {}, {
  267. ac: $data.order != null
  268. }, $data.order != null ? common_vendor.e({
  269. ad: $data.report != null && $data.order.status >= 3
  270. }, $data.report != null && $data.order.status >= 3 ? {
  271. ae: common_vendor.o(($event) => $options.navTo("/pages_order/inquiryOrderReport?orderId=" + $data.order.orderId))
  272. } : {}, {
  273. af: $data.order.status == 3
  274. }, $data.order.status == 3 ? {
  275. ag: common_vendor.o(($event) => $options.toIM())
  276. } : {}, {
  277. ah: $data.order.status == 1
  278. }, $data.order.status == 1 ? {
  279. ai: common_vendor.o(($event) => $options.pay())
  280. } : {}, {
  281. aj: $data.order.status == 2
  282. }, $data.order.status == 2 ? {
  283. ak: common_vendor.o(($event) => $options.cancel())
  284. } : {}, {
  285. al: $data.order.status == 4 && $data.order.isPing == 0
  286. }, $data.order.status == 4 && $data.order.isPing == 0 ? {
  287. am: common_vendor.o(($event) => $options.ping())
  288. } : {}) : {});
  289. }
  290. 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"]]);
  291. wx.createPage(MiniProgramPage);