transferPage.js 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. "use strict";
  2. const common_vendor = require("../../../../common/vendor.js");
  3. const hook_useOnLoad_index = require("../../../../hook/use-on-load/index.js");
  4. const utils_index = require("../../../../utils/index.js");
  5. require("../../../../config/globalData.js");
  6. const config_menu = require("../../../../config/menu.js");
  7. const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  8. __name: "transferPage",
  9. setup(__props) {
  10. const app = getApp();
  11. const main = async (options = {}) => {
  12. var _a, _b;
  13. let menuList = common_vendor.isEmpty(common_vendor.index.getStorageSync("menuList")) ? await common_vendor.useSetMenuList(config_menu.menu) : common_vendor.index.getStorageSync("menuList");
  14. let skipWay = "redirectTo";
  15. let url = "";
  16. if (options.q) {
  17. let url_q = decodeURIComponent(options.q);
  18. url_q.replace(/([^?&=]+)=([^&]+)/g, (_, k, v) => options[k] = v);
  19. if (url_q && ((_a = url_q == null ? void 0 : url_q.split("?")[1]) == null ? void 0 : _a.split("=")[0]) == "OrderId") {
  20. options.type = "pay";
  21. options.orderId = (_b = url_q == null ? void 0 : url_q.split("?")[1]) == null ? void 0 : _b.split("=")[1];
  22. }
  23. }
  24. if (common_vendor.isNotEmpty(options.type)) {
  25. if (options.type == 0) {
  26. skipWay = "reLaunch";
  27. url = `/pages/st1/business/tabbar/homePage/homePage`;
  28. options.isViewMenu && await common_vendor.useLoadViewMenu();
  29. } else if (options.type == 1) {
  30. skipWay = "reLaunch";
  31. url = `/pages/st1/business/tabbar/netHosIndex/netHosIndex`;
  32. } else if (options.type == 2) {
  33. skipWay = "reLaunch";
  34. url = `/pages/st1/business/tabbar/MsgContent/MsgContent`;
  35. } else if (options.type == 3) {
  36. skipWay = "reLaunch";
  37. url = `/pages/st1/business/tabbar/personalCenter/personalCenter`;
  38. } else if (options.type == 4) {
  39. url = `/pagesPatient/st1/business/pay/payState/payState?orderId=${options.orderId}`;
  40. } else if (options.type == 5) {
  41. let queryBean2 = {
  42. DeptCode: options.deptCode,
  43. DeptName: decodeURIComponent(options.deptName)
  44. };
  45. url = `/pagesPatient/st1/business/yygh/yyghDoctorList/yyghDoctorList?queryBean=${JSON.stringify(
  46. queryBean2
  47. )}`;
  48. } else if (options.type == "satisfactionQuestions") {
  49. url = `/pagesAdmin/satisfaction/satisfactionQuestions/satisfactionQuestions?subjectId=${options.subjectId}`;
  50. } else if (options.type == "articleDetail") {
  51. url = `/pagesAdmin/article/business/article/detail/detail?id=${options.articleId}&msgId=${options.msgId}`;
  52. } else if (options.type == "fuchat") {
  53. const chatData = await this.getMemberChatList(options);
  54. if (!chatData)
  55. return;
  56. app.globalData.currentUser = { memberId: chatData.MemberId };
  57. url = `/pagesCrm/st1/business/myFollowUp/followUpList/followUpList?type=${chatData.Type}&roomId=${chatData.Id}&deptName=${chatData.DeptName}&doctorSn=${chatData.Doctorsn}`;
  58. } else if (options.type == "fuvisit") {
  59. const roomIdData = await this.getRoomId(options);
  60. options.roomId = roomIdData.RoomId;
  61. const chatData = await this.getMemberChatList(options);
  62. if (!chatData)
  63. return;
  64. app.globalData.currentUser = { memberId: chatData.MemberId };
  65. url = `/pagesCrm/st1/business/myFollowUp/followUpList/followUpList?type=${chatData.Type}&roomId=${chatData.Id}&deptName=${chatData.DeptName}&doctorSn=${chatData.Doctorsn}`;
  66. } else if (options.type == "article") {
  67. url = `/pagesAdmin/teamYy/st1/business/disease/articlenInfo/articlenInfo?heaId=${ata.heaId}`;
  68. } else if (options.type == "pay") {
  69. url = `/pagesPatient/st1/business/pay/payMent/payMent?orderId=${options.orderId}`;
  70. } else if (options.type == "myddc") {
  71. let subjectId = options.subjectId;
  72. let taskId = options.taskId;
  73. url = `/pagesAdmin/satisfaction/business/satisfactionQuestions/satisfactionQuestions?subjectId=${subjectId}&taskId=${taskId}`;
  74. } else if (options.type == "overduePerson") {
  75. let overdueOptions = common_vendor.isJSON(common_vendor.index.getStorageSync("overdueOptions")) ? JSON.parse(common_vendor.index.getStorageSync("overdueOptions")) : common_vendor.index.getStorageSync("overdueOptions");
  76. const options2 = overdueOptions.options;
  77. if (overdueOptions.route.indexOf("yyghClinicMsg") != -1) {
  78. app.globalData.queryBean = overdueOptions.options.queryBean;
  79. }
  80. overdueOptions.options.queryBean = common_vendor.isJSON(overdueOptions.options.queryBean) ? overdueOptions.options.queryBean : JSON.stringify(overdueOptions.options.queryBean);
  81. const queryString = Object.keys(options2).map((key) => `${key}=${options2[key]}`).join("&");
  82. url = `/${overdueOptions.route}?${queryString}`;
  83. await checkAuthAndDefaultMember(url);
  84. common_vendor.index.setStorageSync("overdueOptions", "");
  85. } else {
  86. const childArray = this.getAllChildren(menuList.map((item) => item.Children));
  87. let menuItem = childArray.filter((item) => item.MenuName == options.type);
  88. if (common_vendor.isNotEmpty(menuItem)) {
  89. menuItem = menuItem[0];
  90. utils_index.menuClick(menuItem, this, skipWay);
  91. return;
  92. }
  93. }
  94. }
  95. if (common_vendor.isEmpty(url)) {
  96. common_vendor.showModal(`<<${options.type}>>跳转地址为空,请联系管理员`, () => {
  97. common_vendor.goToUrl(`/pages/st1/business/tabbar/homePage/homePage`, {
  98. skipWay: "reLaunch"
  99. });
  100. });
  101. return;
  102. }
  103. common_vendor.goToUrl(url, {
  104. skipWay
  105. });
  106. };
  107. const checkAuthAndDefaultMember = async (url) => {
  108. if (common_vendor.useIsToAuthPage()) {
  109. return;
  110. }
  111. let lastOperatorResp = await common_vendor.useGetDefaultMember({
  112. cardType: "1",
  113. url,
  114. isKeepPage: true,
  115. pageType: "doctorYygh"
  116. //个性化预约挂号
  117. });
  118. if (lastOperatorResp === null)
  119. return;
  120. if (common_vendor.isEmpty(lastOperatorResp)) {
  121. app.globalData.toUrl = url;
  122. app.globalData.cardType = app.globalData.withoutCard ? "" : "1";
  123. url = `/pagesPersonal/st1/business/patientManagement/addMember/addMember`;
  124. }
  125. };
  126. hook_useOnLoad_index.useOnLoad((options) => {
  127. common_vendor.index.showLoading();
  128. main(options);
  129. });
  130. return (_ctx, _cache) => {
  131. return {};
  132. };
  133. }
  134. });
  135. wx.createPage(_sfc_main);
  136. //# sourceMappingURL=../../../../../.sourcemap/mp-weixin/pages/business/tabbar/transferPage/transferPage.js.map