"use strict"; var common_vendor = require("../common/vendor.js"); var api_adv = require("../api/adv.js"); var api_index = require("../api/index.js"); require("../common/request.js"); const _sfc_main = { data() { return { advs: [], advImgs: [], tabIndex: 1, articleId: null, item: {} }; }, onLoad(option) { this.id = option.id; }, onShow() { this.getChineseMedicineById(); this.getAdvList(); }, onShareAppMessage(res) { if (this.$isLogin()) { return { title: this.item.medicineName, path: "/pages_index/chineseMedicineDetails?id=" + this.id, imageUrl: "https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20230106/6b459adfb1004c1a96219bcdf07e337c.png" }; } }, onShareTimeline(res) { if (this.utils.isLogin()) { return { title: this.item.title, 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: 8 }; 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" }); } }); }, tabClick(index) { this.tabIndex = index; }, getChineseMedicineById() { let data = { id: this.id }; api_index.getChineseMedicineById(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 ? common_vendor.e({ b: $data.item.imgUrl, c: common_vendor.t($data.item.medicineName), d: common_vendor.t($data.item.pinyin), e: common_vendor.t($data.item.actionTitle), f: common_vendor.o(($event) => $options.tabClick(1)), g: common_vendor.n($data.tabIndex == 1 ? "tab1 active" : "tab1"), h: common_vendor.o(($event) => $options.tabClick(2)), i: common_vendor.n($data.tabIndex == 2 ? "tab2 active" : "tab2"), j: common_vendor.o(($event) => $options.tabClick(3)), k: common_vendor.n($data.tabIndex == 3 ? "tab3 active" : "tab3"), l: common_vendor.o(($event) => $options.tabClick(4)), m: common_vendor.n($data.tabIndex == 4 ? "tab4 active" : "tab4"), n: $data.tabIndex == 1 }, $data.tabIndex == 1 ? { o: $data.item.descs } : {}, { p: $data.tabIndex == 2 }, $data.tabIndex == 2 ? { q: $data.item.action } : {}, { r: $data.tabIndex == 3 }, $data.tabIndex == 3 ? { s: $data.item.usageMethod } : {}, { t: $data.tabIndex == 4 }, $data.tabIndex == 4 ? { v: $data.item.msg } : {}, { w: common_vendor.o($options.handleAdvClick), x: 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/chineseMedicineDetails.vue"]]); _sfc_main.__runtimeHooks = 6; wx.createPage(MiniProgramPage);