doFollow.js 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. "use strict";
  2. var common_vendor = require("../common/vendor.js");
  3. var api_follow = require("../api/follow.js");
  4. require("../common/request.js");
  5. const _sfc_main = {
  6. data() {
  7. return {
  8. followId: null,
  9. follow: null,
  10. doctor: null,
  11. form: null
  12. };
  13. },
  14. onLoad(options) {
  15. this.followId = options.followId;
  16. },
  17. onShow() {
  18. this.getFollowById();
  19. },
  20. methods: {
  21. doFollow() {
  22. common_vendor.index.showModal({
  23. title: "\u63D0\u793A",
  24. content: "\u786E\u8BA4\u63D0\u4EA4\u5417\u5417?",
  25. showCancel: true,
  26. cancelText: "\u53D6\u6D88",
  27. confirmText: "\u786E\u5B9A",
  28. success: (res) => {
  29. if (res.confirm) {
  30. var data = {
  31. followId: this.followId,
  32. formJson: JSON.stringify(this.form)
  33. };
  34. api_follow.doFollow(data).then((res2) => {
  35. if (res2.code == 200) {
  36. common_vendor.index.showToast({
  37. icon: "success",
  38. title: "\u64CD\u4F5C\u6210\u529F"
  39. });
  40. setTimeout(function() {
  41. common_vendor.index.$emit("refreshFollowList");
  42. common_vendor.index.navigateBack({
  43. delta: 1
  44. });
  45. }, 500);
  46. } else {
  47. common_vendor.index.showToast({
  48. icon: "none",
  49. title: res2.msg
  50. });
  51. }
  52. }, (rej) => {
  53. });
  54. }
  55. }
  56. });
  57. },
  58. getFollowById() {
  59. var data = { followId: this.followId };
  60. api_follow.getFollowById(data).then((res) => {
  61. if (res.code == 200) {
  62. this.follow = res.follow;
  63. this.doctor = res.doctor;
  64. this.form = JSON.parse(this.follow.formJson);
  65. this.form.forEach(function(element) {
  66. if (element.type == 3) {
  67. element.answers = "";
  68. }
  69. });
  70. }
  71. }, (err) => {
  72. });
  73. }
  74. }
  75. };
  76. if (!Array) {
  77. const _easycom_u_alert2 = common_vendor.resolveComponent("u-alert");
  78. const _easycom_u_radio2 = common_vendor.resolveComponent("u-radio");
  79. const _easycom_u_radio_group2 = common_vendor.resolveComponent("u-radio-group");
  80. const _easycom_u_checkbox2 = common_vendor.resolveComponent("u-checkbox");
  81. const _easycom_u_checkbox_group2 = common_vendor.resolveComponent("u-checkbox-group");
  82. const _easycom_u__textarea2 = common_vendor.resolveComponent("u--textarea");
  83. (_easycom_u_alert2 + _easycom_u_radio2 + _easycom_u_radio_group2 + _easycom_u_checkbox2 + _easycom_u_checkbox_group2 + _easycom_u__textarea2)();
  84. }
  85. const _easycom_u_alert = () => "../uni_modules/uview-plus/components/u-alert/u-alert.js";
  86. const _easycom_u_radio = () => "../uni_modules/uview-plus/components/u-radio/u-radio.js";
  87. const _easycom_u_radio_group = () => "../uni_modules/uview-plus/components/u-radio-group/u-radio-group.js";
  88. const _easycom_u_checkbox = () => "../uni_modules/uview-plus/components/u-checkbox/u-checkbox.js";
  89. const _easycom_u_checkbox_group = () => "../uni_modules/uview-plus/components/u-checkbox-group/u-checkbox-group.js";
  90. const _easycom_u__textarea = () => "../uni_modules/uview-plus/components/u--textarea/u--textarea.js";
  91. if (!Math) {
  92. (_easycom_u_alert + _easycom_u_radio + _easycom_u_radio_group + _easycom_u_checkbox + _easycom_u_checkbox_group + _easycom_u__textarea)();
  93. }
  94. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  95. return common_vendor.e({
  96. a: common_vendor.p({
  97. fontSize: "13",
  98. type: "info",
  99. 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!"
  100. }),
  101. b: common_vendor.t(_ctx.dortor != null ? $data.doctor.doctorName : ""),
  102. c: $data.follow != null
  103. }, $data.follow != null ? {
  104. d: common_vendor.t($data.follow.num),
  105. e: common_vendor.t($data.follow.totalNum)
  106. } : {}, {
  107. f: common_vendor.t($data.follow.planTime),
  108. g: common_vendor.f($data.form, (item, index, i0) => {
  109. return common_vendor.e({
  110. a: common_vendor.t(item.question),
  111. b: item.require
  112. }, item.require ? {} : {}, {
  113. c: item.type == 1
  114. }, item.type == 1 ? {
  115. d: common_vendor.f(item.options, (option, subIndex, i1) => {
  116. return {
  117. a: subIndex,
  118. b: "5724fc07-2-" + i0 + "-" + i1 + "," + ("5724fc07-1-" + i0),
  119. c: common_vendor.p({
  120. customStyle: {
  121. marginBottom: "8px"
  122. },
  123. label: option,
  124. name: option
  125. })
  126. };
  127. }),
  128. e: "5724fc07-1-" + i0,
  129. f: common_vendor.o(($event) => item.answers = $event),
  130. g: common_vendor.p({
  131. placement: "column",
  132. modelValue: item.answers
  133. })
  134. } : {}, {
  135. h: item.type == 2
  136. }, item.type == 2 ? {
  137. i: common_vendor.f(item.options, (option, subIndex, i1) => {
  138. return {
  139. a: subIndex,
  140. b: "5724fc07-4-" + i0 + "-" + i1 + "," + ("5724fc07-3-" + i0),
  141. c: common_vendor.p({
  142. customStyle: {
  143. marginBottom: "8px"
  144. },
  145. label: option,
  146. name: option
  147. })
  148. };
  149. }),
  150. j: "5724fc07-3-" + i0,
  151. k: common_vendor.o(($event) => item.answers = $event),
  152. l: common_vendor.p({
  153. placement: "column",
  154. modelValue: item.answers
  155. })
  156. } : {}, {
  157. m: item.type == 3
  158. }, item.type == 3 ? {
  159. n: "5724fc07-5-" + i0,
  160. o: common_vendor.o(($event) => item.answers = $event),
  161. p: common_vendor.p({
  162. count: true,
  163. maxlength: "200",
  164. placeholder: "\u8BF7\u8F93\u5165\u5185\u5BB9",
  165. modelValue: item.answers
  166. })
  167. } : {});
  168. }),
  169. h: common_vendor.o(($event) => $options.doFollow())
  170. });
  171. }
  172. var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-5724fc07"], ["__file", "E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_user/doFollow.vue"]]);
  173. wx.createPage(MiniProgramPage);