var fe=Object.defineProperty,xe=Object.defineProperties;var _e=Object.getOwnPropertyDescriptors;var ee=Object.getOwnPropertySymbols;var we=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable;var te=(d,l,i)=>l in d?fe(d,l,{enumerable:!0,configurable:!0,writable:!0,value:i}):d[l]=i,H=(d,l)=>{for(var i in l||(l={}))we.call(l,i)&&te(d,i,l[i]);if(ee)for(var i of ee(l))ye.call(l,i)&&te(d,i,l[i]);return d},W=(d,l)=>xe(d,_e(l));var w=(d,l,i)=>new Promise((r,g)=>{var k=f=>{try{b(i.next(f))}catch(C){g(C)}},$=f=>{try{b(i.throw(f))}catch(C){g(C)}},b=f=>f.done?r(f.value):Promise.resolve(f.value).then(k,$);b((i=i.apply(d,l)).next())});import{b as ve,m as J,a as ke,c as j,d as oe,r as h,w as K,e as be,f as _,o as u,g as s,h as e,i as Ce,j as ne,k as Le,l as re,n as X,_ as Pe,p as Ie,q as le,s as Se,t as $e,u as Ve,v as ze,x as Te,y as Ee,z as De,A as Be,B as I,C as Ae,D as S,E as Q,F as n,G as y,H as v,I as D,J as Me,K as x,L as ae,M as ie,S as Ne}from"./index-gpqDTsa8.js";import{_ as Ue}from"./product.CXb3e2t6.js";import{_ as Re}from"./wd-skeleton.CQoi-soQ.js";import{_ as je}from"./wd-swiper.BETPAMCS.js";import{_ as qe,a as Fe}from"./wd-tabs.Cq2dOxaT.js";import{_ as Oe}from"./z-paging.DNpMakhR.js";import{u as Ge}from"./useZPaging.Phynb18d.js";import{g as se}from"./product.DW_uWSJB.js";import"./useTouch.CeLxyvbc.js";const He=W(H({},ve),{value:j(!1),modelValue:j(!1),closePosition:J("inset"),src:String,to:String,width:Number,closeOnClickModal:j(!1),hideWhenClose:j(!0),zIndex:ke(10),customCloseClass:J(""),customCloseStyle:J("")}),We={name:"wd-curtain",options:{virtualHost:!0,addGlobalClass:!0,styleIsolation:"shared"}},Je=oe(W(H({},We),{props:He,emits:["beforeenter","enter","afterenter","beforeleave","leave","afterleave","close","closed","click-modal","load","error","click","update:modelValue"],setup(d,{emit:l}){const i=d,r=l,g=h(i.modelValue||i.value);K(()=>i.modelValue,o=>{g.value=o}),K(()=>i.value,o=>{g.value=o}),K(g,o=>{r("update:modelValue",o),o||r("close")});const k=h(!0),$=h(1),b=be(()=>{let o="";return i.width&&(o+=`width: ${i.width}px ;`,o+=`height: ${i.width/$.value}px`),o});function f(){r("beforeenter")}function C(){r("enter")}function V(){r("afterenter")}function q(){r("beforeleave")}function z(){r("leave")}function B(){r("afterleave"),r("closed")}function A(){g.value=!1}function F(){r("click-modal")}function O(o){const{height:L,width:c}=o.detail;$.value=c/L,k.value=!0,r("load")}function N(){k.value=!1,r("error")}function M(){i.to&&Ie({url:i.to}),r("click"),A()}return(o,L)=>{const c=re,U=ne;return u(),_(U,{class:"wd-curtain-wrapper"},{default:s(()=>[e(Ce,{modelValue:g.value,"onUpdate:modelValue":L[0]||(L[0]=G=>g.value=G),transition:"zoom-in",position:"center","close-on-click-modal":o.closeOnClickModal,"hide-when-close":o.hideWhenClose,"z-index":o.zIndex,onBeforeEnter:f,onEnter:C,onAfterEnter:V,onBeforeLeave:q,onLeave:z,onAfterLeave:B,onClose:A,onClickModal:F,"custom-class":`wd-curtain ${o.customClass}`,"custom-style":o.customStyle},{default:s(()=>[e(U,{class:"wd-curtain__content"},{default:s(()=>[e(c,{src:o.src,class:"wd-curtain__content-img",style:X(b.value),onClick:M,onError:N,onLoad:O},null,8,["src","style"]),Le(o.$slots,"close",{},()=>[e(Pe,{name:"close-outline","custom-class":`wd-curtain__content-close ${o.closePosition} ${o.customCloseClass}`,"custom-style":o.customCloseStyle,onClick:A},null,8,["custom-class","custom-style"])],!0)]),_:3})]),_:3},8,["modelValue","close-on-click-modal","hide-when-close","z-index","custom-class","custom-style"])]),_:3})}}})),Ke=le(Je,[["__scopeId","data-v-63645f63"]]),Qe="/static/header-logo.png",Xe="/static/icons/search.png",Ze="/static/icons/notifications.png",Ye=oe({name:"Index",__name:"index",setup(d){const i=Se().safeAreaInsets,r=h(null);Ge(r);const g=h(0),k=h([]);function $(t){t.item.linkType===0?x({url:t.item.link}):x({url:"/pages/webLink/webLink",params:{title:t.item.title,link:t.item.link}})}const b=h([{image:"/static/icons/mission-center.png",title:"home.missionCenter",size:"100rpx",url:"/pages/missionCenter/missionCenter"},{image:"/static/icons/refer-earn.png",title:"home.refer&earn",size:"100rpx",url:"/pages/referEarn/referEarn"},{image:"/static/icons/vip-membership.png",title:"home.vip",size:"112rpx",url:"/pages/vipMembership/vipMembership"},{image:"/static/icons/best-sellers.png",title:"home.bestSellers",size:"100rpx",url:"/pages/bestSellers/bestSellers"},{image:"/static/icons/top-champions.png",title:"home.topChampions",size:"100rpx",url:"/pages/topChampions/topChampions"}]),f=h([]);function C(){return w(this,null,function*(){const t=yield se({page:1,size:20,sort:"CREATE_DESC"});f.value=t.data.list})}const V=h("300"),q=h([{title:"home.priceTab.300spot",value:"300",minPrice:0,maxPrice:300},{title:"home.priceTab.500spot",value:"500",minPrice:300,maxPrice:500},{title:"home.priceTab.1000spot",value:"1000",minPrice:500,maxPrice:1e3},{title:"home.priceTab.2000spot",value:"2000",minPrice:1e3,maxPrice:2e3},{title:"home.priceTab.3000spot",value:"3000",minPrice:2e3,maxPrice:3e3}]),z=h([]),B=h(!1);function A(){var t;(t=r.value)==null||t.reload()}function F(t,m){return w(this,null,function*(){t===1&&(B.value=!0);try{const T={page:t,size:m,sort:"SALES_DESC",price:V.value},R=yield se(T);r.value.complete(R.data.list)}finally{t===1&&(B.value=!1)}})}function O(){return w(this,null,function*(){const t=yield Be({page:1,size:20});k.value=t.data.list})}const N=h(0),M=h(!0);function o(){return w(this,null,function*(){try{M.value=!0,yield Promise.all([L(),C(),O()])}finally{M.value=!1}})}function L(){return w(this,null,function*(){try{const t=yield Te();t.code==="200"&&(N.value=Number(t.data)||0)}catch(t){}})}const c=$e({show:!1,img:"",link:"",linkType:"",title:""});function U(){return w(this,null,function*(){try{const t=yield Ee({advType:"INDEX"});t.code==="200"&&t.data.length&&(c.show=!0,c.img=t.data[0].advImage,c.link=t.data[0].link,c.linkType=t.data[0].linkType,c.title=t.data[0].title)}catch(t){}})}function G(){c.linkType==="IN"?x({url:c.link}):x({url:"/pages/webLink/webLink",params:{title:c.title,link:c.link}})}return Ve(()=>w(this,null,function*(){U(),yield o()})),ze(()=>{L()}),(t,m)=>{const T=re,R=I(S("wd-badge"),Ae),p=ne,E=I(S("wd-skeleton"),Re),ce=I(S("wd-swiper"),je),Z=Ue,pe=Ne,ue=I(S("wd-tab"),qe),de=I(S("wd-tabs"),Fe),me=I(S("wd-curtain"),Ke),he=I(S("z-paging"),Oe),ge=De("layout-tabbar-uni");return u(),_(ge,null,{default:s(()=>[e(he,{ref_key:"paging",ref:r,modelValue:n(z),"onUpdate:modelValue":m[5]||(m[5]=a=>Q(z)?z.value=a:null),"auto-scroll-to-top-when-reload":!1,"auto-clean-list-when-reload":!1,"use-page-scroll":"",onQuery:F,onOnRefresh:o},{top:s(()=>{var a;return[e(p,{class:"flex items-center justify-between bg-white pb-40rpx pl-42rpx pr-34rpx pt-26rpx",style:X({paddingTop:`${((a=n(i))==null?void 0:a.top)+13}px`})},{default:s(()=>[e(T,{src:Qe,class:"h-44rpx w-275rpx"}),e(p,{class:"flex items-center"},{default:s(()=>[e(R,{"model-value":0},{default:s(()=>[e(T,{src:Xe,class:"mr-20rpx h-40rpx w-40rpx",onClick:m[0]||(m[0]=P=>n(x)({url:"/pages/search/search"}))})]),_:1}),e(R,{"model-value":n(N),max:99},{default:s(()=>[e(T,{src:Ze,class:"h-40rpx w-40rpx",onClick:m[1]||(m[1]=P=>n(x)({url:"/pages/notifications/notifications"}))})]),_:1},8,["model-value"])]),_:1})]),_:1},8,["style"])]}),default:s(()=>[n(M)?(u(),y(v,{key:0},[e(E,{"row-col":[{height:"400rpx"}],animation:"gradient"}),e(p,{class:"px-24rpx pb-24rpx"},{default:s(()=>[e(p,{class:"pb-22rpx pt-24rpx"},{default:s(()=>[e(E,{"row-col":[[{width:"100rpx",height:"100rpx",type:"circle"},{width:"100rpx",height:"100rpx",type:"circle"},{width:"100rpx",height:"100rpx",type:"circle"},{width:"100rpx",height:"100rpx",type:"circle"},{width:"100rpx",height:"100rpx",type:"circle"}],[{width:"60rpx",height:"24rpx"},{width:"60rpx",height:"24rpx"},{width:"60rpx",height:"24rpx"},{width:"60rpx",height:"24rpx"},{width:"60rpx",height:"24rpx"}]],animation:"gradient"})]),_:1}),e(p,{class:"mb-32rpx"},{default:s(()=>[e(E,{"row-col":[{width:"120rpx",height:"32rpx",marginBottom:"16rpx"},[{width:"260rpx",height:"260rpx"},{width:"260rpx",height:"260rpx",marginLeft:"16rpx"},{width:"260rpx",height:"260rpx",marginLeft:"16rpx"}]],animation:"gradient"})]),_:1}),e(p,{class:"mb-20rpx"},{default:s(()=>[e(E,{"row-col":[[{width:"80rpx",height:"36rpx"},{width:"80rpx",height:"36rpx",marginLeft:"20rpx"},{width:"80rpx",height:"36rpx",marginLeft:"20rpx"},{width:"80rpx",height:"36rpx",marginLeft:"20rpx"},{width:"80rpx",height:"36rpx",marginLeft:"20rpx"}]],animation:"gradient"})]),_:1}),e(p,{class:"grid grid-cols-2 gap-20rpx"},{default:s(()=>[(u(),y(v,null,D(6,a=>e(E,{key:a,"row-col":[{height:"340rpx"},{width:"180rpx",height:"40rpx",marginTop:"10rpx"},[{width:"80rpx",height:"24rpx"},{width:"60rpx",height:"20rpx"}]],animation:"gradient"})),64))]),_:1})]),_:1})],64)):(u(),y(v,{key:1},[e(ce,{current:n(g),"onUpdate:current":m[2]||(m[2]=a=>Q(g)?g.value=a:null),list:n(k),"value-key":"image",autoplay:"",indicator:"","indicator-position":"bottom-right","image-mode":"aspectFill",height:"388rpx",onClick:$},null,8,["current","list"]),e(p,{class:"px-24rpx pb-24rpx"},{default:s(()=>[e(p,{class:"flex items-end justify-between pb-22rpx pt-24rpx"},{default:s(()=>[(u(!0),y(v,null,D(n(b),(a,P)=>(u(),_(p,{key:P,class:"flex flex-col items-center",onClick:Y=>n(x)({url:a.url})},{default:s(()=>[e(T,{src:a.image,style:X(`width: ${a.size}; height: ${a.size};`)},null,8,["src","style"]),e(p,{class:"mt-14rpx whitespace-pre-line text-center text-22rpx text-#898989 font-bold"},{default:s(()=>[ae(ie(t.$t(a.title)),1)]),_:2},1024)]),_:2},1032,["onClick"]))),128))]),_:1}),n(f).length?(u(),_(p,{key:0},{default:s(()=>[e(p,{class:"mb-16rpx text-32rpx"},{default:s(()=>[ae(ie(t.$t("home.news")),1)]),_:1}),e(pe,{"scroll-x":"",class:"whitespace-nowrap"},{default:s(()=>[e(p,{class:"flex items-center gap-16rpx",style:{"min-width":"max-content"}},{default:s(()=>[(u(!0),y(v,null,D(n(f),(a,P)=>(u(),_(Z,{key:P,"title-font-size":18,item:a,class:"shrink-0",onItemClick:Y=>n(x)({url:"/pages/productDetail/productDetail",params:{productId:a.productId}})},null,8,["item","onItemClick"]))),128))]),_:1})]),_:1})]),_:1})):Me("",!0),e(p,{class:"productList"},{default:s(()=>[e(de,{modelValue:n(V),"onUpdate:modelValue":m[3]||(m[3]=a=>Q(V)?V.value=a:null),slidable:"always","line-width":0,"line-height":0,onClick:A},{default:s(()=>[(u(!0),y(v,null,D(n(q),a=>(u(),_(ue,{key:a,title:t.$t(a.title),name:a.value},null,8,["title","name"]))),128))]),_:1},8,["modelValue"]),n(B)?(u(),_(p,{key:0,class:"grid grid-cols-2 gap-20rpx"},{default:s(()=>[(u(),y(v,null,D(6,a=>e(E,{key:a,"row-col":[{height:"340rpx",borderRadius:"12rpx"},{width:"180rpx",height:"40rpx",marginTop:"10rpx"},[{width:"80rpx",height:"24rpx"},{width:"60rpx",height:"20rpx"}]],animation:"gradient"})),64))]),_:1})):(u(),_(p,{key:1,class:"grid grid-cols-2 gap-20rpx"},{default:s(()=>[(u(!0),y(v,null,D(n(z),(a,P)=>(u(),_(Z,{key:P,width:"100%",height:340,item:a,onItemClick:Y=>n(x)({url:"/pages/productDetail/productDetail",params:{productId:a.productId}})},null,8,["item","onItemClick"]))),128))]),_:1}))]),_:1})]),_:1})],64)),e(me,{modelValue:n(c).show,"onUpdate:modelValue":m[4]||(m[4]=a=>n(c).show=a),src:n(c).img,to:n(c).link,"close-position":"bottom",width:280,onClick:G},null,8,["modelValue","src","to"])]),_:1},8,["modelValue"])]),_:1})}}}),pt=le(Ye,[["__scopeId","data-v-b3f71588"]]);export{pt as default};