followDetails.js 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. "use strict";
  2. var common_vendor = require("../common/vendor.js");
  3. var store_index = require("../store/index.js");
  4. var api_follow = require("../api/follow.js");
  5. require("../store/modules.js");
  6. require("../store/modules/timStore.js");
  7. require("../common/request.js");
  8. const _sfc_main = {
  9. data() {
  10. return {
  11. followId: null,
  12. follow: null,
  13. doctor: null,
  14. form: null
  15. };
  16. },
  17. onLoad(options) {
  18. this.followId = options.followId;
  19. },
  20. onShow() {
  21. this.getFollowById();
  22. },
  23. methods: {
  24. toIM() {
  25. var id = "C2CD-" + this.follow.doctorId;
  26. console.log(common_vendor.index.$TUIKit.TUIConversationServer);
  27. store_index.store.commit("timStore/setType", "startFollow");
  28. store_index.store.commit("timStore/setOrderId", this.follow.orderId);
  29. store_index.store.commit("timStore/setFollowId", this.follow.followId);
  30. store_index.store.commit("timStore/setImType", 2);
  31. store_index.store.commit("timStore/setConversationID", id);
  32. common_vendor.index.$TUIKit.TUIConversationServer.setMessageRead(id);
  33. common_vendor.index.$TUIKit.TUIConversationServer.getConversationProfile(id).then((res) => {
  34. var _a;
  35. console.log(res);
  36. const { conversation } = res.data;
  37. store_index.store.commit("timStore/setConversation", conversation);
  38. let url = "/pages/TUIKit/TUIPages/TUIChat/index";
  39. conversation.userProfile;
  40. url = `${url}?conversationName=${((_a = conversation.userProfile.nick) == null ? void 0 : _a.nick) || conversation.userProfile.userID}`;
  41. common_vendor.index.redirectTo({ url });
  42. }).catch((err) => {
  43. console.warn("\u83B7\u53D6 group profile \u5F02\u5E38 = ", err);
  44. });
  45. },
  46. doFollow() {
  47. common_vendor.index.showModal({
  48. title: "\u63D0\u793A",
  49. content: "\u786E\u8BA4\u63D0\u4EA4\u5417\u5417?",
  50. showCancel: true,
  51. cancelText: "\u53D6\u6D88",
  52. confirmText: "\u786E\u5B9A",
  53. success: (res) => {
  54. if (res.confirm) {
  55. var data = {
  56. followId: this.followId,
  57. formJson: JSON.stringify(this.form)
  58. };
  59. api_follow.doFollow(data).then((res2) => {
  60. if (res2.code == 200) {
  61. common_vendor.index.showToast({
  62. icon: "success",
  63. title: "\u64CD\u4F5C\u6210\u529F"
  64. });
  65. setTimeout(function() {
  66. common_vendor.index.$emit("refreshFollowList");
  67. common_vendor.index.navigateBack({
  68. delta: 1
  69. });
  70. }, 500);
  71. } else {
  72. common_vendor.index.showToast({
  73. icon: "none",
  74. title: res2.msg
  75. });
  76. }
  77. }, (rej) => {
  78. });
  79. }
  80. }
  81. });
  82. },
  83. getFollowById() {
  84. var data = { followId: this.followId };
  85. api_follow.getFollowById(data).then((res) => {
  86. if (res.code == 200) {
  87. this.follow = res.follow;
  88. this.doctor = res.doctor;
  89. this.form = JSON.parse(this.follow.formJson);
  90. }
  91. }, (err) => {
  92. });
  93. }
  94. }
  95. };
  96. if (!Array) {
  97. const _easycom_u_alert2 = common_vendor.resolveComponent("u-alert");
  98. const _easycom_u_radio2 = common_vendor.resolveComponent("u-radio");
  99. const _easycom_u_radio_group2 = common_vendor.resolveComponent("u-radio-group");
  100. const _easycom_u_checkbox2 = common_vendor.resolveComponent("u-checkbox");
  101. const _easycom_u_checkbox_group2 = common_vendor.resolveComponent("u-checkbox-group");
  102. const _easycom_u__textarea2 = common_vendor.resolveComponent("u--textarea");
  103. (_easycom_u_alert2 + _easycom_u_radio2 + _easycom_u_radio_group2 + _easycom_u_checkbox2 + _easycom_u_checkbox_group2 + _easycom_u__textarea2)();
  104. }
  105. const _easycom_u_alert = () => "../uni_modules/uview-plus/components/u-alert/u-alert.js";
  106. const _easycom_u_radio = () => "../uni_modules/uview-plus/components/u-radio/u-radio.js";
  107. const _easycom_u_radio_group = () => "../uni_modules/uview-plus/components/u-radio-group/u-radio-group.js";
  108. const _easycom_u_checkbox = () => "../uni_modules/uview-plus/components/u-checkbox/u-checkbox.js";
  109. const _easycom_u_checkbox_group = () => "../uni_modules/uview-plus/components/u-checkbox-group/u-checkbox-group.js";
  110. const _easycom_u__textarea = () => "../uni_modules/uview-plus/components/u--textarea/u--textarea.js";
  111. if (!Math) {
  112. (_easycom_u_alert + _easycom_u_radio + _easycom_u_radio_group + _easycom_u_checkbox + _easycom_u_checkbox_group + _easycom_u__textarea)();
  113. }
  114. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  115. return common_vendor.e({
  116. a: common_vendor.p({
  117. fontSize: "13",
  118. type: "info",
  119. description: "\u4E3A\u4E86\u7ED9\u60A8\u63D0\u4F9B\u66F4\u597D\u7684\u670D\u52A1\uFF0C\u5E0C\u671B\u60A8\u80FD\u7528\u51E0\u5206\u949F\u65F6\u95F4\uFF0C\u5C06\u60A8\u7684\u611F\u53D7\u548C\u5EFA\u8BAE\u544A\u8BC9\u6211\u4EEC\uFF0C\u6211\u4EEC\u975E\u5E38\u91CD\u89C6\u60A8\u7684\u5B9D\u8D35\u610F\u89C1!"
  120. }),
  121. b: common_vendor.t(_ctx.dortor != null ? $data.doctor.doctorName : ""),
  122. c: $data.follow != null
  123. }, $data.follow != null ? {
  124. d: common_vendor.t($data.follow.num),
  125. e: common_vendor.t($data.follow.totalNum)
  126. } : {}, {
  127. f: common_vendor.t($data.follow.planTime),
  128. g: common_vendor.f($data.form, (item, index, i0) => {
  129. return common_vendor.e({
  130. a: common_vendor.t(item.question),
  131. b: item.type == 1
  132. }, item.type == 1 ? {
  133. c: common_vendor.f(item.options, (option, subIndex, i1) => {
  134. return {
  135. a: subIndex,
  136. b: "703ddbf6-2-" + i0 + "-" + i1 + "," + ("703ddbf6-1-" + i0),
  137. c: common_vendor.p({
  138. customStyle: {
  139. marginBottom: "8px"
  140. },
  141. label: option,
  142. name: option
  143. })
  144. };
  145. }),
  146. d: "703ddbf6-1-" + i0,
  147. e: common_vendor.o(($event) => item.answers = $event),
  148. f: common_vendor.p({
  149. disabled: true,
  150. placement: "column",
  151. modelValue: item.answers
  152. })
  153. } : {}, {
  154. g: item.type == 2
  155. }, item.type == 2 ? {
  156. h: common_vendor.f(item.options, (option, subIndex, i1) => {
  157. return {
  158. a: subIndex,
  159. b: "703ddbf6-4-" + i0 + "-" + i1 + "," + ("703ddbf6-3-" + i0),
  160. c: common_vendor.p({
  161. customStyle: {
  162. marginBottom: "8px"
  163. },
  164. label: option,
  165. name: option
  166. })
  167. };
  168. }),
  169. i: "703ddbf6-3-" + i0,
  170. j: common_vendor.o(($event) => item.answers = $event),
  171. k: common_vendor.p({
  172. disabled: true,
  173. placement: "column",
  174. modelValue: item.answers
  175. })
  176. } : {}, {
  177. l: item.type == 3
  178. }, item.type == 3 ? {
  179. m: "703ddbf6-5-" + i0,
  180. n: common_vendor.o(($event) => item.answers = $event),
  181. o: common_vendor.p({
  182. disabled: true,
  183. count: true,
  184. maxlength: "200",
  185. placeholder: "\u8BF7\u8F93\u5165\u5185\u5BB9",
  186. modelValue: item.answers
  187. })
  188. } : {});
  189. }),
  190. h: common_vendor.o(($event) => $options.toIM())
  191. });
  192. }
  193. var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-703ddbf6"], ["__file", "E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_user/followDetails.vue"]]);
  194. wx.createPage(MiniProgramPage);