goods.js 5.1 KB

12
  1. "use strict";const e=require("../common/vendor.js"),a=require("../api/live.js"),g=require("../api/order.js"),n=require("../common/assets.js"),_=()=>"../components/px-popup-bottom/px-popup-bottom.js",h={components:{popupBottom:_},data(){return{storeInfo:{},goodsId:null,totalNum:1,orderKey:null,type:null,liveOrderList:[],liveId:null,storeId:null,serviceList:["免邮发货","药师服务","隐私保护"],editShow:!1,productId:null,goosDetail:{},loadding:!0,buyText:"立即购买",showStorePicker:!1,goodsNum:0,attrs:[],values:[],stores:[],storeNames:[],storeIdx:0,storeName:"",product:{price:0,otPrice:0},showModal:!1,activeBanner:1,cartCount:0,specVisible:!1,config:null,showServiceFee:!1,selectVal:"",urlStoreId:void 0,storePriceList:[],storeSelectInfo:{},choseSpecSubIndex:0,choseSpecIndex:0}},onLoad(o){e.index.__f__("log","at pages_shop/goods.vue:351","商品详情options",o),o.productId&&(this.productId=o.productId),this.liveId=o.liveId,this.goodsId=o.goodsId,o.storeId?this.storeId=o.storeId||"":e.index.showToast({title:"storeId不存在~",icon:"none"})},mounted(){this.getliveGoods(),e.index.getStorageSync("userInfo"),this.getSearchStore()},onShow(){},methods:{getSearchStore(){if(!this.storeId)return;a.store(this.storeId,"",this.liveId).then(t=>{t.code==200?(e.index.__f__("log","at pages_shop/goods.vue:395","查询店铺>>>>",t),this.storeInfo=t.data):e.index.showToast({title:t.msg,icon:"none"})},t=>{})},getliveStore(){let o={pageSize:10,page:1};liveStore(this.liveId,o).then(t=>{t.code==200?(e.index.__f__("log","at pages_shop/goods.vue:416","小黄车 店铺展示>>>>",t),this.products=t.data):e.index.showToast({title:t.msg,icon:"none"})},t=>{})},doAddCart(o){if(this.totalNum==0){e.index.showToast({icon:"none",title:"库存不足"});return}o=="buy"?this.getKey():(this.getCartCount(),e.index.showToast({icon:"success",title:"添加成功"}))},getCartCount(){let o={productId:this.productId,liveId:this.liveId,goodsId:this.goodsId||"",cartNum:this.totalNum};g.addLiveCart(o).then(t=>{t.code==200&&(e.index.__f__("log","at pages_shop/goods.vue:483","加购物车啦",t),this.cartCount=t.data)},t=>{})},getKey(){g.liveOrderKey().then(o=>{o.code==200?(e.index.__f__("log","at pages_shop/goods.vue:495","下订单的key>>>>",o),this.orderKey=o.orderKey,e.index.__f__("log","at pages_shop/goods.vue:497","key>>>>",this.orderKey),e.index.navigateTo({url:"/pages_shop/confirmCreateOrder?type=goods&orderKey="+this.orderKey+"&liveId="+this.liveId+"&productId="+this.productId+"&totalNum="+this.totalNum+"&price="+this.goosDetail.price})):e.index.showToast({title:o.msg,icon:"none"})},o=>{})},operateOrder(o){let t=this.liveOrderList;e.index.__f__("log","at pages_shop/goods.vue:521","orderId>>",t)},goodsNumChange(o){e.index.__f__("log","at pages_shop/goods.vue:538","当前选择商品数量为: "+o.value),this.totalNum=o.value},submit(){this.specVisible=!1,this.doAddCart(this.type)},addCart(o){this.type=o,this.specVisible=!0},navgetTo(o){e.index.__f__("log","at pages_shop/goods.vue:555","跳转"),e.index.navigateTo({url:o})},openEditMoney(){this.editShow=!0},cancelEditMoney(){this.editShow=!1},getliveGoods(){this.productId&&a.liveGoodsDetail(this.productId).then(o=>{o.code==200?(e.index.__f__("log","at pages_shop/goods.vue:571","小黄车 商品详情>>>>",o),this.goosDetail=o.data):e.index.showToast({title:o.msg,icon:"none"})},o=>{})}}};if(!Array){const o=e.resolveComponent("u-icon"),t=e.resolveComponent("u-popup"),u=e.resolveComponent("u-number-box"),l=e.resolveComponent("popupBottom");(o+t+u+l)()}const m=()=>"../uni_modules/uview-plus/components/u-icon/u-icon.js",v=()=>"../uni_modules/uview-plus/components/u-popup/u-popup.js",f=()=>"../uni_modules/uview-plus/components/u-number-box/u-number-box.js";Math||(m+v+f)();function I(o,t,u,l,s,r){var c;return e.e({a:s.goosDetail.imgUrl,b:s.product.productType==2},s.product.productType==2?{}:{},{c:e.t(s.goosDetail.price),d:e.t(s.goosDetail.otPrice),e:e.t(s.goosDetail.sales),f:e.f(s.serviceList,(i,d,p)=>({a:e.t(i),b:d})),g:n._imports_0$4,h:n._imports_1$5,i:e.o(i=>r.openEditMoney()),j:s.editShow},s.editShow?{k:e.o(i=>r.cancelEditMoney()),l:e.o(i=>r.cancelEditMoney()),m:e.o(i=>r.cancelEditMoney())}:{},{n:n._imports_2$3,o:e.o(i=>r.navgetTo("./storeOrderRefundList")),p:e.t(s.buyText),q:e.o(i=>r.addCart("buy")),r:((c=s.goosDetail)==null?void 0:c.imgUrl)||o.$img.img,s:e.t(s.goosDetail.productName),t:e.t(s.goosDetail.price?s.goosDetail.price.toFixed(2):"0.00"),v:e.t(s.goosDetail.sales),w:e.f(s.storePriceList,(i,d,p)=>({a:e.t(i.price.toFixed(2)),b:e.t(o.utils.formatSalesNum(i.sales)),c:e.t(i.storeName),d:"14e5f6c8-2-"+p+",14e5f6c8-1",e:d,f:e.n(o.productValueSelect.storeId==i.storeId?"item hover":"item"),g:e.o(x=>o.pickerStore(i,d),d)})),x:e.p({name:"arrow-right",color:"#000",size:"14"}),y:e.p({show:s.showStorePicker,round:16,mode:"bottom"}),z:e.o(r.goodsNumChange),A:e.o(i=>s.goodsNum=i),B:e.p({bgColor:"#ececec",modelValue:s.goodsNum}),C:e.o((...i)=>r.submit&&r.submit(...i)),D:e.sr("popup","14e5f6c8-0"),E:e.p({visible:s.specVisible,title:" ",radius:"32",maxHeight:"800"})})}const y=e._export_sfc(h,[["render",I]]);wx.createPage(y);
  2. //# sourceMappingURL=../../.sourcemap/mp-weixin/pages_shop/goods.js.map