"use strict";var e=require("../common/vendor.js"),t=require("../api/package.js");require("../common/request.js");const i={data:()=>({displayText:"查看更多",displayMore:0,imgs:[],activeImg:1,doctorShow:!1,doctors:[],products:[],packageId:null,item:{},describe:null,doctorId:null,doctorPageNum:1,doctorLastPage:!1,doctorTotal:0}),onLoad(t){this.packageId=t.packageId,this.companyId=e.index.getStorageSync("companyId"),this.companyUserId=e.index.getStorageSync("companyUserId")},onShow(){this.getPackageById(),this.getPackageDoctorList()},onShareAppMessage(e){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=1==this.displayMore?0:1,this.displayText=1==this.displayMore?"收起":"查看更多",console.log(this.displayText)},swiperChange(e){this.activeImg=e.detail.current+1},handleDoctorClick(t){this.doctorShow=!1,this.doctorId=t.doctorId,e.index.navigateTo({url:"/pages_index/packageForm?packageId="+this.packageId+"&doctorId="+this.doctorId})},lower(e){this.doctorTotal>this.doctors.length&&(this.doctorPageNum++,this.getPackageDoctorList())},doctorOpen(){this.doctorShow=!0},doctorClose(){this.doctorShow=!1},showImg(){e.index.previewImage({urls:this.imgs,current:this.imgs[0]})},getPackageDoctorList(){if(!this.doctorLastPage){var i={packageId:this.packageId,pageNum:this.doctorPageNum,pageSize:10},o=this;t.getPackageDoctorList(i).then((t=>{200==t.code?(0==this.doctorPageNum?o.doctors=t.data.list:o.doctors=o.doctors.concat(t.data.list),this.doctorLastPage=t.data.isLastPage,this.doctorTotal=t.data.total,console.log(o.doctors)):e.index.showToast({icon:"none",title:"请求失败"})}),(e=>{}))}},getPackageById(){let i={packageId:this.packageId};t.getPackageById(i).then((t=>{200==t.code?(this.item=t.data,null!=t.data.images?this.imgs=t.data.images.split(","):this.activeImg=0,this.describe=JSON.parse(this.item.describeJson),null!=this.item.productJson&&(this.products=JSON.parse(this.item.productJson)),console.log(this.imgs)):e.index.showToast({icon:"none",title:"请求失败"})}),(e=>{}))}}};var o=e._export_sfc(i,[["render",function(t,i,o,a,s,c){return e.e({a:e.f(s.imgs,((e,t,i)=>({a:e,b:t}))),b:e.o(((...e)=>c.swiperChange&&c.swiperChange(...e))),c:e.t(s.activeImg),d:e.t(s.imgs.length),e:e.o((e=>c.showImg())),f:e.t(s.item.packageName),g:s.item.cycle>0},s.item.cycle>0?{h:e.t(s.item.cycle)}:{},{i:s.item.duration>0},s.item.duration>0?{j:e.t(s.item.duration)}:{},{k:null!=s.item},null!=s.item?{l:e.t(s.item.price.toFixed(2))}:{},{m:null!=s.item&&1==s.item.packageSubType},(null!=s.item&&s.item.packageSubType,{}),{n:null!=s.item&&2==s.item.packageSubType},(null!=s.item&&s.item.packageSubType,{}),{o:null!=s.item&&3==s.item.packageSubType},(null!=s.item&&s.item.packageSubType,{}),{p:e.t(s.item.sales),q:s.products.length>0},s.products.length>0?e.e({r:e.f(s.products,((t,i,o)=>e.e({a:0!=s.displayMore||i<2},0!=s.displayMore||i<2?{b:t.image,c:e.t(t.productName),d:e.t(t.sku),e:e.t(t.usageMethod)}:{}))),s:s.products.length>2},s.products.length>2?{t:e.t(s.displayText),v:e.o((e=>c.showMore()))}:{}):{},{w:null!=s.describe.use},null!=s.describe.use?e.e({x:null!=s.describe},null!=s.describe?{y:s.describe.use}:{}):{},{z:null!=s.item.indication},null!=s.item.indication?e.e({A:null!=s.item},null!=s.item?{B:s.item.indication}:{}):{},{C:null!=s.describe.usageMethod},null!=s.describe.usageMethod?{D:s.describe.usageMethod}:{},{E:null!=s.describe.forPeople},null!=s.describe.forPeople?{F:s.describe.forPeople}:{},{G:null!=s.describe.tabooPeople},null!=s.describe.tabooPeople?{H:s.describe.tabooPeople}:{},{I:null!=s.item.explain},null!=s.item.explain?{J:s.item.explain}:{},{K:s.item.desc,L:null!=s.item},null!=s.item?{M:e.t(s.item.totalPrice.toFixed(2))}:{})}]]);i.__runtimeHooks=2,wx.createPage(o);
