shopDetaile.js 3.1 KB
"use strict";const e=require("../../common/vendor.js"),L=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"),l=e.resolveComponent("u-badge");(v+i+p+l)()}const j=()=>"../../uni_modules/uview-plus/components/u-navbar/u-navbar.js",D=()=>"../../uni_modules/uview-plus/components/u-swiper/u-swiper.js",S=()=>"../../uni_modules/uview-plus/components/u-parse/u-parse.js",T=()=>"../../uni_modules/uview-plus/components/u-badge/u-badge.js";Math||(j+D+P+I+S+T+$)();const P=()=>"../../componets/shopInfo.js",I=()=>"../../componets/comment.js",$=()=>"../../componets/popPay.js",k={__name:"shopDetaile",setup(v){e.onLoad(s=>{console.log("商品id",s.id),x(s.id)}),e.onHide(()=>{a.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"}]),l=e.ref("1"),w=()=>{e.index.navigateTo({url:`/pages/index/allComment?allCommentList=${h.value}`})};let g=e.ref(0),a=e.ref(!1);const f=s=>{g.value=s,a.value=!0},b=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 u=e.ref({}),y=e.ref({}),m=e.ref([]),r=e.ref([]);const _=e.ref(0);let d=e.ref({}),o=e.ref(1);const h=e.ref(""),x=async s=>{try{const n=await L.getShopDetaile(s);u.value=n.detail,y.value=n.detail.spec[0],m.value=n.detail.images,h.value=JSON.stringify(n.pinglun),_.value=n.pinglun.length,r.value=n.pinglun.splice(0,1),d.value=n.specData,o.value=n.detail.goodstatus,l.value=n.cartNum}catch(n){e.index.showToast({title:n,icon:"none"}),console.log("",n)}};return(s,n)=>e.e({a:e.p({bgColor:"transparent",autoBack:!0}),b:e.unref(o)!=3},e.unref(o)!=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(u)}),h:e.unref(o)==1},e.unref(o)==1?e.e({i:e.t(_.value),j:e.unref(r).length>0},e.unref(r).length>0?{k:e.o(w)}:{},{l:e.unref(r).length},e.unref(r).length?{m:e.p({commentList:e.unref(r)})}:{}):{},{n:e.unref(o)!==3},e.unref(o)!==3?{o:e.p({content:e.unref(u).content})}:{},{p:e.unref(o)==3},e.unref(o)==3?{q:e.p({content:e.unref(u).content})}:{},{r:e.f(p,(t,c,C)=>e.e({a:t.icon,b:c==2},c==2?{c:"1a35f0c9-6-"+C,d:e.p({absolute:!0,offset:[-6,-6],color:"#fff",bgColor:"#F63D3A",max:"99",value:l.value})}:{},{e:e.t(t.name),f:c===1},c===1?{}:{},{g:t.id,h:e.o(N=>b(c),t.id)})),s:e.unref(o)!=3},e.unref(o)!=3?{t:e.o(t=>f(0)),v:e.o(t=>f(1))}:{w:e.o(t=>f(3))},{x:e.o(t=>e.isRef(a)?a.value=!1:a=!1),y:e.p({moreSpec:e.unref(d),shopDetail:e.unref(u),shopType:e.unref(o),btnType:e.unref(g),payPopShow:e.unref(a)})})}},q=e._export_sfc(k,[["__file","D:/vue/大健康商城/healthMall/pages/index/shopDetaile.vue"]]);wx.createPage(q);