123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- "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);
|