shopDetaile.js
3.0 KB
"use strict";const e=require("../../common/vendor.js"),C=require("../../api/index.js");require("../../utils/request.js");if(!Array){const v=e.resolveComponent("u-navbar"),i=e.resolveComponent("u-swiper"),p=e.resolveComponent("u-parse"),c=e.resolveComponent("u-badge");(v+i+p+c)()}const L=()=>"../../uni_modules/uview-plus/components/u-navbar/u-navbar.js",j=()=>"../../uni_modules/uview-plus/components/u-swiper/u-swiper.js",D=()=>"../../uni_modules/uview-plus/components/u-parse/u-parse.js",S=()=>"../../uni_modules/uview-plus/components/u-badge/u-badge.js";Math||(L+j+T+P+D+S+I)();const T=()=>"../../componets/shopInfo.js",P=()=>"../../componets/comment.js",I=()=>"../../componets/popPay.js",$={__name:"shopDetaile",setup(v){e.onLoad(s=>{console.log("商品id",s.id),y(s.id)}),e.onHide(()=>{r.value=!1});const i=e.ref(0);e.reactive(["https://cdn.uviewui.com/uview/swiper/swiper2.png","https://cdn.uviewui.com/uview/swiper/swiper3.png","https://cdn.uviewui.com/uview/swiper/swiper1.png"]);const p=e.reactive([{id:1,name:"店铺",icon:"/static/indexIc/shopIc.png"},{id:2,name:"客服",icon:"/static/indexIc/service.png"},{id:3,name:"购物车",icon:"/static/tabbarsIc/shopCar.png"}]),c=e.ref("1"),h=()=>{e.index.navigateTo({url:`/pages/index/allComment?allCommentList=${d.value}`})};let g=e.ref(0),r=e.ref(!1);const f=s=>{g.value=s,r.value=!0},w=s=>{switch(s){case 0:console.log("店铺"),e.index.switchTab({url:"/pages/index/index"});break;case 2:console.log("购物车"),e.index.switchTab({url:"/pages/shopCar/shopCar"});break}};let l=e.ref({}),b=e.ref({}),m=e.ref([]),a=e.ref([]),_=e.ref({}),n=e.ref(1);const d=e.ref(""),y=async s=>{try{const o=await C.getShopDetaile(s);l.value=o.detail,b.value=o.detail.spec[0],m.value=o.detail.images,d.value=JSON.stringify(o.pinglun),a.value=o.pinglun.splice(0,1),_.value=o.specData,n.value=o.detail.goodstatus,c.value=o.cartNum}catch(o){e.index.showToast({title:o,icon:"none"}),console.log("",o)}};return(s,o)=>e.e({a:e.p({bgColor:"transparent",autoBack:!0}),b:e.unref(n)!=3},e.unref(n)!=3?{c:e.t(i.value+1),d:e.t(e.unref(m).length)}:{},{e:e.o(t=>i.value=t.current),f:e.p({height:"375",list:e.unref(m),autoplay:!1,indicatorStyle:"right: 20px"}),g:e.p({info:e.unref(l)}),h:e.unref(n)==1},e.unref(n)==1?e.e({i:e.t(e.unref(a).length),j:e.unref(a).length>0},e.unref(a).length>0?{k:e.o(h)}:{},{l:e.unref(a).length},e.unref(a).length?{m:e.p({commentList:e.unref(a)})}:{}):{},{n:e.unref(n)!==3},e.unref(n)!==3?{o:e.p({content:e.unref(l).content})}:{},{p:e.unref(n)==3},e.unref(n)==3?{}:{},{q:e.f(p,(t,u,x)=>e.e({a:t.icon,b:u==2},u==2?{c:"1a35f0c9-5-"+x,d:e.p({absolute:!0,offset:[-6,-6],color:"#fff",bgColor:"#F63D3A",max:"99",value:c.value})}:{},{e:e.t(t.name),f:u===1},u===1?{}:{},{g:t.id,h:e.o(q=>w(u),t.id)})),r:e.unref(n)!=3},e.unref(n)!=3?{s:e.o(t=>f(0)),t:e.o(t=>f(1))}:{v:e.o(t=>f(3))},{w:e.o(t=>e.isRef(r)?r.value=!1:r=!1),x:e.p({moreSpec:e.unref(_),shopDetail:e.unref(l),shopType:e.unref(n),btnType:e.unref(g),payPopShow:e.unref(r)})})}},k=e._export_sfc($,[["__file","D:/vue/大健康商城/healthMall/pages/index/shopDetaile.vue"]]);wx.createPage(k);