diseaseDetails.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. "use strict";
  2. var common_vendor = require("../common/vendor.js");
  3. var api_disease = require("../api/disease.js");
  4. var api_adv = require("../api/adv.js");
  5. require("../common/request.js");
  6. const _sfc_main = {
  7. data() {
  8. return {
  9. advs: [],
  10. advImgs: [],
  11. diseaseId: null,
  12. item: {}
  13. };
  14. },
  15. onLoad(option) {
  16. this.diseaseId = option.diseaseId;
  17. },
  18. onShow() {
  19. this.getAdvList();
  20. this.getDiseaseById();
  21. },
  22. onShareAppMessage(res) {
  23. if (this.$isLogin()) {
  24. return {
  25. title: this.item.diseaseName,
  26. path: "/pages_index/diseaseDetails?id=" + this.diseaseId,
  27. imageUrl: "https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20230106/6b459adfb1004c1a96219bcdf07e337c.png"
  28. };
  29. }
  30. },
  31. onShareTimeline(res) {
  32. if (this.utils.isLogin()) {
  33. return {
  34. title: this.item.diseaseName,
  35. imageUrl: "https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20230106/6b459adfb1004c1a96219bcdf07e337c.png"
  36. };
  37. }
  38. },
  39. methods: {
  40. handleAdvClick(index) {
  41. var ad = this.advs[index];
  42. console.log(ad.advUrl);
  43. if (ad.showType == 1) {
  44. common_vendor.index.setStorageSync("url", ad.advUrl);
  45. common_vendor.index.navigateTo({
  46. url: "h5"
  47. });
  48. } else if (ad.showType == 2) {
  49. common_vendor.index.navigateTo({
  50. url: ad.advUrl
  51. });
  52. } else if (ad.showType == 3) {
  53. common_vendor.index.setStorageSync("content", ad.content);
  54. common_vendor.index.navigateTo({
  55. url: "content"
  56. });
  57. }
  58. },
  59. getAdvList() {
  60. var that = this;
  61. var data = {
  62. advType: 7
  63. };
  64. api_adv.getAdvList(data).then((res) => {
  65. if (res.code == 200) {
  66. that.advImgs = [];
  67. that.advs = [];
  68. res.data.forEach(function(element) {
  69. if (element.imageUrl != null && element.imageUrl != "") {
  70. that.advs.push(element);
  71. that.advImgs.push(element.imageUrl);
  72. }
  73. });
  74. } else {
  75. common_vendor.index.showToast({
  76. icon: "none",
  77. title: "\u8BF7\u6C42\u5931\u8D25"
  78. });
  79. }
  80. });
  81. },
  82. getDiseaseById() {
  83. let data = { diseaseId: this.diseaseId };
  84. api_disease.getDiseaseById(data).then((res) => {
  85. if (res.code == 200) {
  86. this.item = res.data;
  87. } else {
  88. common_vendor.index.showToast({
  89. icon: "none",
  90. title: "\u8BF7\u6C42\u5931\u8D25"
  91. });
  92. }
  93. }, (rej) => {
  94. });
  95. }
  96. }
  97. };
  98. if (!Array) {
  99. const _easycom_u_swiper2 = common_vendor.resolveComponent("u-swiper");
  100. _easycom_u_swiper2();
  101. }
  102. const _easycom_u_swiper = () => "../uni_modules/uview-plus/components/u-swiper/u-swiper.js";
  103. if (!Math) {
  104. _easycom_u_swiper();
  105. }
  106. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  107. return common_vendor.e({
  108. a: $data.item != null
  109. }, $data.item != null ? {
  110. b: $data.item.diseaseName,
  111. c: $data.item.symptom,
  112. d: $data.item.diagnose,
  113. e: $data.item.inspect,
  114. f: common_vendor.o($options.handleAdvClick),
  115. g: common_vendor.p({
  116. list: $data.advImgs,
  117. indicator: true,
  118. indicatorMode: "line",
  119. circular: true
  120. })
  121. } : {});
  122. }
  123. 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/diseaseDetails.vue"]]);
  124. _sfc_main.__runtimeHooks = 6;
  125. wx.createPage(MiniProgramPage);