"use strict"; var common_vendor = require("../common/vendor.js"); var api_package = require("../api/package.js"); require("../common/request.js"); const _sfc_main = { data() { return { displayText: "\u67E5\u770B\u66F4\u591A", displayMore: 0, imgs: [], activeImg: 1, doctorShow: false, doctors: [], products: [], packageId: null, item: {}, describe: null, doctorId: null, doctorPageNum: 1, doctorLastPage: false, doctorTotal: 0 }; }, onLoad(option) { this.packageId = option.packageId; this.companyId = common_vendor.index.getStorageSync("companyId"); this.companyUserId = common_vendor.index.getStorageSync("companyUserId"); }, onShow() { this.getPackageById(); this.getPackageDoctorList(); }, onShareAppMessage(res) { return { title: this.item.packageName, path: "/pages_index/packageDetails?packageId=" + this.packageId + "&companyId=" + this.companyId + "&companyUserId=" + this.companyUserId, imageUrl: this.item.imgUrl }; }, methods: { showMore() { this.displayMore = this.displayMore == 1 ? 0 : 1; this.displayText = this.displayMore == 1 ? "\u6536\u8D77" : "\u67E5\u770B\u66F4\u591A"; console.log(this.displayText); }, swiperChange(event) { this.activeImg = event.detail.current + 1; }, handleDoctorClick(item) { this.doctorShow = false; this.doctorId = item.doctorId; common_vendor.index.navigateTo({ url: "/pages_index/packageForm?packageId=" + this.packageId + "&doctorId=" + this.doctorId }); }, lower(event) { if (this.doctorTotal > this.doctors.length) { this.doctorPageNum++; this.getPackageDoctorList(); } }, doctorOpen() { this.doctorShow = true; }, doctorClose() { this.doctorShow = false; }, showImg() { common_vendor.index.previewImage({ urls: this.imgs, current: this.imgs[0] }); }, getPackageDoctorList() { if (this.doctorLastPage) { return; } var data = { packageId: this.packageId, pageNum: this.doctorPageNum, pageSize: 10 }; var that = this; api_package.getPackageDoctorList(data).then((res) => { if (res.code == 200) { if (this.doctorPageNum == 0) { that.doctors = res.data.list; } else { that.doctors = that.doctors.concat(res.data.list); } this.doctorLastPage = res.data.isLastPage; this.doctorTotal = res.data.total; console.log(that.doctors); } else { common_vendor.index.showToast({ icon: "none", title: "\u8BF7\u6C42\u5931\u8D25" }); } }, (rej) => { }); }, getPackageById() { let data = { packageId: this.packageId }; api_package.getPackageById(data).then((res) => { if (res.code == 200) { this.item = res.data; if (res.data.images != null) { this.imgs = res.data.images.split(","); } else { this.activeImg = 0; } this.describe = JSON.parse(this.item.describeJson); if (this.item.productJson != null) { this.products = JSON.parse(this.item.productJson); } console.log(this.imgs); } else { common_vendor.index.showToast({ icon: "none", title: "\u8BF7\u6C42\u5931\u8D25" }); } }, (rej) => { }); } } }; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { return common_vendor.e({ a: common_vendor.f($data.imgs, (item, index, i0) => { return { a: item, b: index }; }), b: common_vendor.o((...args) => $options.swiperChange && $options.swiperChange(...args)), c: common_vendor.t($data.activeImg), d: common_vendor.t($data.imgs.length), e: common_vendor.o(($event) => $options.showImg()), f: common_vendor.t($data.item.packageName), g: $data.item.cycle > 0 }, $data.item.cycle > 0 ? { h: common_vendor.t($data.item.cycle) } : {}, { i: $data.item.duration > 0 }, $data.item.duration > 0 ? { j: common_vendor.t($data.item.duration) } : {}, { k: $data.item != null }, $data.item != null ? { l: common_vendor.t($data.item.price.toFixed(2)) } : {}, { m: $data.item != null && $data.item.packageSubType == 1 }, $data.item != null && $data.item.packageSubType == 1 ? {} : {}, { n: $data.item != null && $data.item.packageSubType == 2 }, $data.item != null && $data.item.packageSubType == 2 ? {} : {}, { o: $data.item != null && $data.item.packageSubType == 3 }, $data.item != null && $data.item.packageSubType == 3 ? {} : {}, { p: common_vendor.t($data.item.sales), q: $data.products.length > 0 }, $data.products.length > 0 ? common_vendor.e({ r: common_vendor.f($data.products, (product, index, i0) => { return common_vendor.e({ a: $data.displayMore == 0 ? index < 2 : true }, ($data.displayMore == 0 ? index < 2 : true) ? { b: product.image, c: common_vendor.t(product.productName), d: common_vendor.t(product.sku), e: common_vendor.t(product.usageMethod) } : {}); }), s: $data.products.length > 2 }, $data.products.length > 2 ? { t: common_vendor.t($data.displayText), v: common_vendor.o(($event) => $options.showMore()) } : {}) : {}, { w: $data.describe.use != null }, $data.describe.use != null ? common_vendor.e({ x: $data.describe != null }, $data.describe != null ? { y: $data.describe.use } : {}) : {}, { z: $data.item.indication != null }, $data.item.indication != null ? common_vendor.e({ A: $data.item != null }, $data.item != null ? { B: $data.item.indication } : {}) : {}, { C: $data.describe.usageMethod != null }, $data.describe.usageMethod != null ? { D: $data.describe.usageMethod } : {}, { E: $data.describe.forPeople != null }, $data.describe.forPeople != null ? { F: $data.describe.forPeople } : {}, { G: $data.describe.tabooPeople != null }, $data.describe.tabooPeople != null ? { H: $data.describe.tabooPeople } : {}, { I: $data.item.explain != null }, $data.item.explain != null ? { J: $data.item.explain } : {}, { K: $data.item.desc, L: $data.item != null }, $data.item != null ? { M: common_vendor.t($data.item.totalPrice.toFixed(2)) } : {}); } var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_company/packageDetails.vue"]]); _sfc_main.__runtimeHooks = 2; wx.createPage(MiniProgramPage);