1 |
- import{ah as e,e as t,d as s,w as a,f as l,aj as n,z as o,n as i,g as r,j as c,i as u,K as d,s as p,r as f,c as _,v as g,m,o as v,a as y,b as h,u as x,ab as k,bk as b,a3 as w,x as j,y as T,F as $,k as A,av as C,I as S,J as I,aw as D,l as N,M as B}from"./index-DUAp9XEj.js";import{_ as W}from"./_plugin-vue_export-helper.BCo6x5W8.js";import{_ as M}from"./s-goods-column.DpgNPXWU.js";import{_ as R}from"./uni-load-more.7LU3tP0I.js";import{_ as Y}from"./s-layout.a1_kfpIW.js";import{u as E}from"./useGoods.Cwnq-veC.js";import{T as P}from"./const.BFOqGxSC.js";import"./points.DDTOnulC.js";/* empty css */import"./s-layout.vue_vue_type_style_index_0_scoped_d5f7c468_lang.CKkHKX6k.js";import"./phone-international-input.vue_vue_type_style_index_0_scoped_a793e264_lang.Bv2EixP5.js";/* empty css */import"./s-tabbar.fodLOlFD.js";/* empty css */import"./s-menu-tools.Bn3wdRty.js";import"./phone-international-input.D4fi9eUK.js";const z=W({name:"AiProgress",components:{},props:{percentage:{type:[Number,String],required:!0},textInside:{type:Boolean,default:!1},strokeWidth:{type:[Number,String],default:6},duration:{type:[Number,String],default:2e3},isAnimate:{type:Boolean,default:!1},bgColor:{type:String,default:"linear-gradient(90deg, var(--ui-BG-Main) 0%, var(--ui-BG-Main-gradient) 100%)"},noData:{type:Boolean,default:!1},lineData:{type:Boolean,default:!1},inBgColor:{type:String,default:"#ebeef5"}},data:()=>({width:0,timer:null,containerWidth:0,contentWidth:0}),methods:{start(){if(this.isAnimate){this.$nextTick((()=>{let e=this.$refs.progressContainer.$el,t=this.$refs.progressContent.$el,s=window.getComputedStyle(e,null).width.replace("px","")*(1*this.percentage/100);t.style.width=s.toFixed(2)+"px",t.style.transition=`width ${this.duration/1e3}s ease`}));const t=e().in(this).selectAll("#container");e().in(this).selectAll("#content"),t.boundingClientRect().exec((e=>{this.contentWidth=1*e[0][0].width*(1*this.percentage/100).toFixed(2)+"px"}))}}},mounted(){this.$nextTick((()=>{this.start()}))},created(){},filters:{},computed:{},watch:{},directives:{}},[["render",function(e,d,p,f,_,g){const m=u;return t(),s(m,null,{default:a((()=>[p.lineData?(t(),s(m,{key:0,class:"flex a-center content"},{default:a((()=>[l(m,null,{default:a((()=>[n(e.$slots,"content",{},void 0,!0)])),_:3})])),_:3})):o("",!0),l(m,{class:"flex a-center",style:{"padding-right":"10rpx"}},{default:a((()=>[l(m,{class:"progress-container",id:"container",ref:"progressContainer",style:i({background:p.inBgColor})},{default:a((()=>[p.isAnimate?(t(),s(m,{key:0,class:"progress-content flex j-end",id:"content",ref:"progressContent",style:i({height:p.strokeWidth+"px",background:p.bgColor,width:_.contentWidth,transition:`width ${p.duration/1e3}s ease`})},{default:a((()=>[p.textInside&&!p.noData?(t(),s(m,{key:0,class:"textInside flex a-center j-center"},{default:a((()=>[l(m,{class:"text"},{default:a((()=>[r(c(p.percentage)+"%",1)])),_:1})])),_:1})):o("",!0)])),_:1},8,["style"])):o("",!0),p.isAnimate?o("",!0):(t(),s(m,{key:1,class:"progress-content flex j-end",style:i({width:p.percentage+"%",height:p.strokeWidth+"px",background:p.bgColor})},{default:a((()=>[p.textInside&&!p.noData?(t(),s(m,{key:0,class:"textInside flex a-center j-center"},{default:a((()=>[l(m,{class:"text"},{default:a((()=>[r(c(p.percentage)+"%",1)])),_:1})])),_:1})):o("",!0)])),_:1},8,["style"]))])),_:1},8,["style"]),l(m,null,{default:a((()=>[p.textInside||p.lineData||p.noData||p.isAnimate?o("",!0):(t(),s(m,{key:0,class:"percentage"},{default:a((()=>[r(c(p.percentage)+"% ",1)])),_:1}))])),_:1})])),_:1})])),_:3})}],["__scopeId","data-v-b4fecc65"]]),F=W({__name:"list",setup(e){d((e=>({"0aefb020":x(q)})));const{safeAreaInsets:n,safeArea:W}=p.$platform.device,F=2*p.$platform.device.statusBarHeight,G=2*(W.height+n.bottom)+F-p.$platform.navbar-350,q=p.$url.css("/static/img/shop/goods/seckill-header.png"),H={name:{show:!0},introduction:{show:!0},price:{show:!0},marketPrice:{show:!0}},J=f([]),K=f(""),L=e=>{w((()=>K.value=`timeItem${e}`))},U=f(0),O=_((()=>J.value[U.value])),Q=e=>{U.value=e,X.pageNo=1,ee.value=[],se()},V=_((()=>{var e;const t=null==(e=O.value)?void 0:e.endTime;if(t)return E(`${b().format("YYYY-MM-DD")} ${t}`)})),X=g({id:0,pageNo:1,pageSize:5}),Z=f(0),ee=f([]),te=f("");async function se(){te.value="loading";const{data:e}=await k.getSeckillActivityPage(X);e.list.forEach((e=>{e.percent=parseInt(100*(e.totalStock-e.stock)/e.totalStock)})),ee.value=ee.value.concat(...e.list),Z.value=e.total,te.value=ee.value.length<Z.value?"more":"noMore"}function ae(){"noMore"!==te.value&&(X.pageNo+=1,se())}return m((()=>ae())),v((async()=>{await(async()=>{const{data:e}=await k.getSeckillConfigList(),t=b(),s=t.format("YYYY-MM-DD");e.forEach(((e,a)=>{const l=b(`${s} ${e.startTime}`),n=b(`${s} ${e.endTime}`);t.isBefore(l)?e.status=P.WAIT_START:t.isAfter(n)?e.status=P.END:(e.status=P.STARTED,U.value=a)})),J.value=e,Q(U.value),L(U.value)})()})),(e,n)=>{const d=u,f=A,_=D,g=C,m=S,v=N,k=y(h("su-progress"),z),b=B,w=y(h("s-goods-column"),M),W=y(h("uni-load-more"),R),E=y(h("s-layout"),Y);return t(),s(E,{navbar:"inner",bgStyle:{color:"rgb(245,28,19)"}},{default:a((()=>{var e,n;return[l(d,{class:"page-bg",style:i([{marginTop:"-"+Number(F+88)+"rpx"}])},null,8,["style"]),(null==(n=null==(e=O.value)?void 0:e.sliderPicUrls)?void 0:n.length)>0?(t(),s(d,{key:0,class:"header"},{default:a((()=>[l(g,{"indicator-dots":"true",autoplay:"true",circular:!0,interval:"3000",duration:"1500","indicator-color":"rgba(255,255,255,0.6)","indicator-active-color":"#fff"},{default:a((()=>[(t(!0),j($,null,T(O.value.sliderPicUrls,((e,n)=>(t(),s(_,{key:n,class:"borRadius14"},{default:a((()=>[l(f,{src:e,class:"slide-image borRadius14","lazy-load":""},null,8,["src"])])),_:2},1024)))),128))])),_:1})])),_:1})):o("",!0),l(d,{class:"flex align-center justify-between ss-p-25"},{default:a((()=>[l(d,{class:"time-icon"},{default:a((()=>[l(f,{class:"ss-w-100 ss-h-100",src:"http://mall.yudao.iocoder.cn/static/images/priceTag.png"})])),_:1}),l(m,{class:"time-list","scroll-into-view":K.value,"scroll-x":"","scroll-with-animation":""},{default:a((()=>[(t(!0),j($,null,T(J.value,((e,n)=>(t(),s(d,{key:n,class:I(["item",{active:U.value===n}]),id:`timeItem${n}`,onClick:e=>Q(n)},{default:a((()=>[l(d,{class:"time"},{default:a((()=>[r(c(e.startTime),1)])),_:2},1024),l(d,{class:"status"},{default:a((()=>[r(c(e.status),1)])),_:2},1024)])),_:2},1032,["class","id","onClick"])))),128))])),_:1},8,["scroll-into-view"])])),_:1}),l(d,{class:"list-content"},{default:a((()=>[l(d,{class:"content-header ss-flex-col ss-col-center ss-row-center"},{default:a((()=>[l(d,{class:"content-header-box ss-flex ss-row-center"},{default:a((()=>{var e;return[(null==(e=O.value)?void 0:e.status)===x(P).STARTED?(t(),s(d,{key:0,class:"countdown-box ss-flex"},{default:a((()=>[l(d,{class:"countdown-title ss-m-r-12"},{default:a((()=>[r("距结束")])),_:1}),l(d,{class:"ss-flex countdown-time"},{default:a((()=>[l(d,{class:"ss-flex countdown-h"},{default:a((()=>[r(c(V.value.h),1)])),_:1}),l(d,{class:"ss-m-x-4"},{default:a((()=>[r(":")])),_:1}),l(d,{class:"countdown-num ss-flex ss-row-center"},{default:a((()=>[r(c(V.value.m),1)])),_:1}),l(d,{class:"ss-m-x-4"},{default:a((()=>[r(":")])),_:1}),l(d,{class:"countdown-num ss-flex ss-row-center"},{default:a((()=>[r(c(V.value.s),1)])),_:1})])),_:1})])),_:1})):(t(),s(d,{key:1},{default:a((()=>{var e;return[r(c(null==(e=O.value)?void 0:e.status),1)]})),_:1}))]})),_:1})])),_:1}),l(m,{class:"scroll-box",style:i({height:G+"rpx"}),"scroll-y":"true","scroll-with-animation":!1,"enable-back-to-top":!0},{default:a((()=>[(t(!0),j($,null,T(ee.value,(e=>(t(),s(d,{class:"goods-box ss-m-b-20",key:e.id},{default:a((()=>[l(w,{size:"lg",data:{...e,price:e.seckillPrice},goodsFields:H,seckillTag:!0,onClick:t=>x(p).$router.go("/pages/goods/seckill",{id:e.id})},{activity:a((()=>[l(d,{class:"limit"},{default:a((()=>[r("限量 "),l(v,{class:"ss-m-l-5"},{default:a((()=>[r(c(e.stock)+" "+c(e.unitName),1)])),_:2},1024)])),_:2},1024),l(k,{percentage:e.percent,strokeWidth:"10",textInside:"",isAnimate:""},null,8,["percentage"])])),cart:a((()=>[l(b,{class:I(["ss-reset-button cart-btn",{disabled:O.value.status===x(P).END}])},{default:a((()=>{var e,s;return[(null==(e=O.value)?void 0:e.status)===x(P).WAIT_START?(t(),j("span",{key:0},"未开始")):(null==(s=O.value)?void 0:s.status)===x(P).STARTED?(t(),j("span",{key:1},"马上抢")):(t(),j("span",{key:2},"已结束"))]})),_:1},8,["class"])])),_:2},1032,["data","onClick"])])),_:2},1024)))),128)),Z.value>0?(t(),s(W,{key:0,status:te.value,"content-text":{contentdown:"上拉加载更多"},onClick:ae},null,8,["status"])):o("",!0)])),_:1},8,["style"])])),_:1})]})),_:1},8,["bgStyle"])}}},[["__scopeId","data-v-55593c59"]]);export{F as default};
|