123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- "use strict";
- var common_vendor = require("../common/vendor.js");
- var api_disease = require("../api/disease.js");
- var api_adv = require("../api/adv.js");
- require("../common/request.js");
- const _sfc_main = {
- data() {
- return {
- advs: [],
- advImgs: [],
- diseaseId: null,
- item: {}
- };
- },
- onLoad(option) {
- this.diseaseId = option.diseaseId;
- },
- onShow() {
- this.getAdvList();
- this.getDiseaseById();
- },
- onShareAppMessage(res) {
- if (this.$isLogin()) {
- return {
- title: this.item.diseaseName,
- path: "/pages_index/diseaseDetails?id=" + this.diseaseId,
- imageUrl: "https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20230106/6b459adfb1004c1a96219bcdf07e337c.png"
- };
- }
- },
- onShareTimeline(res) {
- if (this.utils.isLogin()) {
- return {
- title: this.item.diseaseName,
- imageUrl: "https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20230106/6b459adfb1004c1a96219bcdf07e337c.png"
- };
- }
- },
- methods: {
- handleAdvClick(index) {
- var ad = this.advs[index];
- console.log(ad.advUrl);
- if (ad.showType == 1) {
- common_vendor.index.setStorageSync("url", ad.advUrl);
- common_vendor.index.navigateTo({
- url: "h5"
- });
- } else if (ad.showType == 2) {
- common_vendor.index.navigateTo({
- url: ad.advUrl
- });
- } else if (ad.showType == 3) {
- common_vendor.index.setStorageSync("content", ad.content);
- common_vendor.index.navigateTo({
- url: "content"
- });
- }
- },
- getAdvList() {
- var that = this;
- var data = {
- advType: 7
- };
- api_adv.getAdvList(data).then((res) => {
- if (res.code == 200) {
- that.advImgs = [];
- that.advs = [];
- res.data.forEach(function(element) {
- if (element.imageUrl != null && element.imageUrl != "") {
- that.advs.push(element);
- that.advImgs.push(element.imageUrl);
- }
- });
- } else {
- common_vendor.index.showToast({
- icon: "none",
- title: "\u8BF7\u6C42\u5931\u8D25"
- });
- }
- });
- },
- getDiseaseById() {
- let data = { diseaseId: this.diseaseId };
- api_disease.getDiseaseById(data).then((res) => {
- if (res.code == 200) {
- this.item = res.data;
- } else {
- common_vendor.index.showToast({
- icon: "none",
- title: "\u8BF7\u6C42\u5931\u8D25"
- });
- }
- }, (rej) => {
- });
- }
- }
- };
- if (!Array) {
- const _easycom_u_swiper2 = common_vendor.resolveComponent("u-swiper");
- _easycom_u_swiper2();
- }
- const _easycom_u_swiper = () => "../uni_modules/uview-plus/components/u-swiper/u-swiper.js";
- if (!Math) {
- _easycom_u_swiper();
- }
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
- return common_vendor.e({
- a: $data.item != null
- }, $data.item != null ? {
- b: $data.item.diseaseName,
- c: $data.item.symptom,
- d: $data.item.diagnose,
- e: $data.item.inspect,
- f: common_vendor.o($options.handleAdvClick),
- g: common_vendor.p({
- list: $data.advImgs,
- indicator: true,
- indicatorMode: "line",
- circular: true
- })
- } : {});
- }
- 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"]]);
- _sfc_main.__runtimeHooks = 6;
- wx.createPage(MiniProgramPage);
|