2 lines
5.4 KiB
JavaScript
2 lines
5.4 KiB
JavaScript
|
"use strict";var e=(e,o,s)=>new Promise(((t,n)=>{var i=e=>{try{u(s.next(e))}catch(o){n(o)}},l=e=>{try{u(s.throw(e))}catch(o){n(o)}},u=e=>e.done?t(e.value):Promise.resolve(e.value).then(i,l);u((s=s.apply(e,o)).next())}));const o=require("../../../common/vendor.js"),s=require("../../../sheep/index.js"),t=require("../../../sheep/hooks/useGoods.js"),n=require("../../../sheep/api/promotion/seckill.js"),i=require("../../../sheep/api/product/spu.js"),l=require("../../../sheep/util/const.js");if(!Array){(o.resolveComponent("s-empty")+o.resolveComponent("su-swiper")+o.resolveComponent("s-select-seckill-sku")+o.resolveComponent("s-layout")+o.resolveComponent("layout-default-uni"))()}Math||(u+r+(()=>"../../../sheep/components/s-empty/s-empty.js")+(()=>"../../../sheep/ui/su-swiper/su-swiper.js")+m+a+(()=>"../../../sheep/components/s-select-seckill-sku/s-select-seckill-sku.js")+d+p+c+(()=>"../../../sheep/components/s-layout/s-layout.js"))();const u=()=>"./components/detail/detail-navbar.js",a=()=>"./components/detail/detail-cell-sku.js",c=()=>"./components/detail/detail-tabbar.js",r=()=>"./components/detail/detail-skeleton.js",d=()=>"./components/detail/detail-comment-card.js",p=()=>"./components/detail/detail-content-card.js",m=()=>"./components/detail/detail-progress.js",g={__name:"seckill",setup(u){o.useCssVars((e=>({"784bc7ac":o.unref(a),f3ef5b6e:o.unref(c),"9c5565a6":o.unref(r),e7626348:o.unref(d),"6bc8280b":o.unref(p)})));const a=s.sheep.$url.css("/static/img/shop/goods/seckill-bg.png"),c=s.sheep.$url.css("/static/img/shop/goods/seckill-btn.png"),r=s.sheep.$url.css("/static/img/shop/goods/activity-btn-disabled.png"),d=s.sheep.$url.css("/static/img/shop/goods/seckill-tip-bg.png"),p=s.sheep.$url.css("/static/img/shop/goods/groupon-tip-bg.png");o.onPageScroll((()=>{}));const m=o.reactive({skeletonLoading:!0,goodsInfo:{},showSelectSku:!1,goodsSwiper:[],selectedSku:{},showModel:!1,total:0,percent:0,price:""}),g=o.computed((()=>t.useDurationTime(h.value.endTime)));function f(e){m.selectedSku=e}function k(e){s.sheep.$router.go("/modules/mall/order/confirm",{data:JSON.stringify({order_type:"goods",buy_type:"seckill",seckillActivityId:h.value.id,items:[{skuId:e.id,count:e.count}]})})}const v=o.computed((()=>o.isEmpty(o.unref(h))?{}:s.sheep.$platform.share.getShareInfo({title:h.value.name,image:s.sheep.$url.cdn(m.goodsInfo.picUrl),params:{page:"4",query:h.value.id}},{type:"goods",title:h.value.name,image:s.sheep.$url.cdn(m.goodsInfo.picUrl),price:m.goodsInfo.price,marketPrice:m.goodsInfo.marketPrice}))),h=o.ref(),I=o.ref(""),S=o=>e(this,null,(function*(){const{data:e}=yield n.SeckillApi.getSeckillActivity(o);h.value=e,I.value=l.getTimeStatusEnum(h.value.startTime,h.value.endTime),yield y(e.spuId)})),y=s=>e(this,null,(function*(){const{data:e}=yield i.SpuApi.getSpuDetail(s);e.activity_type="seckill",m.goodsInfo=e,m.goodsSwiper=t.formatGoodsSwiper(m.goodsInfo.sliderPicUrls),m.goodsInfo.price=o.min([m.goodsInfo.price,...h.value.products.map((e=>e.seckillPrice))]),e.skus.forEach((e=>{const o=h.value.products.find((o=>o.skuId===e.id));o?(e.price=o.seckillPrice,e.stock=Math.min(e.stock,o.stock)):e.stock=0,h.value.totalLimitCount>0&&h.value.singleLimitCount>0?e.limitCount=Math.min(h.value.totalLimitCount,h.value.singleLimitCount):h.value.totalLimitCount>0?e.limitCount=h.value.totalLimitCount:h.value.singleLimitCount>0&&(e.limitCount=h.value.singleLimitCount)})),m.skeletonLoading=!1}));return o.onLoad((e=>{e.id?S(e.id):m.goodsInfo=null})),(e,n)=>o.e({a:m.skeletonLoading},m.skeletonLoading?{}:null===m.goodsInfo||"seckill"!==m.goodsInfo.activity_type?{c:o.p({text:"活动不存在或已结束",icon:"/static/soldout-empty.png",showAction:!0,actionText:"再逛逛",actionUrl:"/modules/mall/goods/list"})}:o.e({d:o.p({isPreview:!0,list:m.goodsSwiper,dotStyle:"tag",imageMode:"widthFix",dotCur:"bg-mask-40",seizeHeight:750}),e:o.t(o.unref(t.fen2yuan)(m.selectedSku.price||m.goodsInfo.price)),f:g.value.ms>0},g.value.ms>0?{g:o.t(g.value.h),h:o.t(g.value.m),i:o.t(g.value.s)}:{},{j:m.goodsInfo.marketPrice},m.goodsInfo.marketPrice?{k:o.t(o.unref(t.fen2yuan)(m.s
|