famousPrescribeDetails.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. "use strict";
  2. var common_vendor = require("../common/vendor.js");
  3. var api_adv = require("../api/adv.js");
  4. var api_index = require("../api/index.js");
  5. require("../common/request.js");
  6. const _sfc_main = {
  7. data() {
  8. return {
  9. advs: [],
  10. advImgs: [],
  11. tabIndex: 1,
  12. id: null,
  13. item: {}
  14. };
  15. },
  16. onLoad(option) {
  17. this.id = option.id;
  18. },
  19. onShow() {
  20. this.getAdvList();
  21. this.getFamousPrescribeById();
  22. },
  23. onShareAppMessage(res) {
  24. if (this.$isLogin()) {
  25. return {
  26. title: this.item.prescribeName,
  27. path: "/pages_index/famousPrescribeDetails?id=" + this.id,
  28. imageUrl: "https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20230106/6b459adfb1004c1a96219bcdf07e337c.png"
  29. };
  30. }
  31. },
  32. onShareTimeline(res) {
  33. if (this.utils.isLogin()) {
  34. return {
  35. title: this.item.title,
  36. imageUrl: "https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20230106/6b459adfb1004c1a96219bcdf07e337c.png"
  37. };
  38. }
  39. },
  40. methods: {
  41. handleAdvClick(index) {
  42. var ad = this.advs[index];
  43. console.log(ad.advUrl);
  44. if (ad.showType == 1) {
  45. common_vendor.index.setStorageSync("url", ad.advUrl);
  46. common_vendor.index.navigateTo({
  47. url: "h5"
  48. });
  49. } else if (ad.showType == 2) {
  50. common_vendor.index.navigateTo({
  51. url: ad.advUrl
  52. });
  53. } else if (ad.showType == 3) {
  54. common_vendor.index.setStorageSync("content", ad.content);
  55. common_vendor.index.navigateTo({
  56. url: "content"
  57. });
  58. }
  59. },
  60. getAdvList() {
  61. var that = this;
  62. var data = {
  63. advType: 9
  64. };
  65. api_adv.getAdvList(data).then((res) => {
  66. if (res.code == 200) {
  67. that.advImgs = [];
  68. that.advs = [];
  69. res.data.forEach(function(element) {
  70. if (element.imageUrl != null && element.imageUrl != "") {
  71. that.advs.push(element);
  72. that.advImgs.push(element.imageUrl);
  73. }
  74. });
  75. } else {
  76. common_vendor.index.showToast({
  77. icon: "none",
  78. title: "\u8BF7\u6C42\u5931\u8D25"
  79. });
  80. }
  81. });
  82. },
  83. tabClick(index) {
  84. this.tabIndex = index;
  85. },
  86. getFamousPrescribeById() {
  87. let data = { id: this.id };
  88. api_index.getFamousPrescribeById(data).then((res) => {
  89. if (res.code == 200) {
  90. this.item = res.data;
  91. } else {
  92. common_vendor.index.showToast({
  93. icon: "none",
  94. title: "\u8BF7\u6C42\u5931\u8D25"
  95. });
  96. }
  97. }, (rej) => {
  98. });
  99. }
  100. }
  101. };
  102. if (!Array) {
  103. const _easycom_u_swiper2 = common_vendor.resolveComponent("u-swiper");
  104. _easycom_u_swiper2();
  105. }
  106. const _easycom_u_swiper = () => "../uni_modules/uview-plus/components/u-swiper/u-swiper.js";
  107. if (!Math) {
  108. _easycom_u_swiper();
  109. }
  110. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  111. return common_vendor.e({
  112. a: $data.item != null
  113. }, $data.item != null ? common_vendor.e({
  114. b: $data.item.imgUrl,
  115. c: common_vendor.t($data.item.prescribeName),
  116. d: common_vendor.t($data.item.pinyin),
  117. e: common_vendor.t($data.item.actionTitle),
  118. f: common_vendor.o(($event) => $options.tabClick(1)),
  119. g: common_vendor.n($data.tabIndex == 1 ? "tab1 active" : "tab1"),
  120. h: common_vendor.o(($event) => $options.tabClick(2)),
  121. i: common_vendor.n($data.tabIndex == 2 ? "tab2 active" : "tab2"),
  122. j: common_vendor.o(($event) => $options.tabClick(3)),
  123. k: common_vendor.n($data.tabIndex == 3 ? "tab3 active" : "tab3"),
  124. l: common_vendor.o(($event) => $options.tabClick(4)),
  125. m: common_vendor.n($data.tabIndex == 4 ? "tab4 active" : "tab4"),
  126. n: $data.tabIndex == 1
  127. }, $data.tabIndex == 1 ? {
  128. o: $data.item.descs
  129. } : {}, {
  130. p: $data.tabIndex == 2
  131. }, $data.tabIndex == 2 ? {
  132. q: $data.item.action
  133. } : {}, {
  134. r: $data.tabIndex == 3
  135. }, $data.tabIndex == 3 ? {
  136. s: $data.item.usageMethod
  137. } : {}, {
  138. t: $data.tabIndex == 4
  139. }, $data.tabIndex == 4 ? {
  140. v: $data.item.msg
  141. } : {}, {
  142. w: common_vendor.o($options.handleAdvClick),
  143. x: common_vendor.p({
  144. list: $data.advImgs,
  145. indicator: true,
  146. indicatorMode: "line",
  147. circular: true
  148. })
  149. }) : {});
  150. }
  151. var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_index/famousPrescribeDetails.vue"]]);
  152. _sfc_main.__runtimeHooks = 6;
  153. wx.createPage(MiniProgramPage);