var _e=Object.defineProperty,we=Object.defineProperties;var ye=Object.getOwnPropertyDescriptors;var ee=Object.getOwnPropertySymbols;var ve=Object.prototype.hasOwnProperty,ke=Object.prototype.propertyIsEnumerable;var te=(m,p,i)=>p in m?_e(m,p,{enumerable:!0,configurable:!0,writable:!0,value:i}):m[p]=i,Q=(m,p)=>{for(var i in p||(p={}))ve.call(p,i)&&te(m,i,p[i]);if(ee)for(var i of ee(p))ke.call(p,i)&&te(m,i,p[i]);return m},W=(m,p)=>we(m,ye(p));var w=(m,p,i)=>new Promise((l,f)=>{var C=g=>{try{L(i.next(g))}catch(S){f(S)}},V=g=>{try{L(i.throw(g))}catch(S){f(S)}},L=g=>g.done?l(g.value):Promise.resolve(g.value).then(C,V);L((i=i.apply(m,p)).next())});import{b as be,m as J,a as Ce,c as j,d as ne,r as h,w as K,e as Le,f as _,o as d,g as o,h as e,i as Se,j as re,k as Te,l as le,n as X,_ as Pe,p as Ie,q as ce,s as Ve,t as $e,u as ze,v as Ee,x as De,y as Be,z as Ne,A as Ae,B as y,C as Me,D as v,E as R,F as n,G as k,H as b,I as B,J as Ue,K as x,L as ae,M as oe,S as Oe,N as ie,O as je}from"./index-q8TQmcfk.js";import{_ as qe}from"./product.DVc8JZGG.js";import{_ as Fe}from"./wd-skeleton.OzAB2NcJ.js";import{_ as Ge}from"./wd-swiper.CQvK3XpI.js";import{_ as He,a as Qe,b as We}from"./wd-tabs.h-1Wlxi-.js";import{_ as Je}from"./z-paging.qf1jZGzy.js";import{u as Ke}from"./useZPaging.CofbECAl.js";import{g as se}from"./product.D9tPlHVu.js";import"./useTouch.BnlusLLU.js";const Re=W(Q({},be),{value:j(!1),modelValue:j(!1),closePosition:J("inset"),src:String,to:String,width:Number,closeOnClickModal:j(!1),hideWhenClose:j(!0),zIndex:Ce(10),customCloseClass:J(""),customCloseStyle:J("")}),Xe={name:"wd-curtain",options:{virtualHost:!0,addGlobalClass:!0,styleIsolation:"shared"}},Ze=ne(W(Q({},Xe),{props:Re,emits:["beforeenter","enter","afterenter","beforeleave","leave","afterleave","close","closed","click-modal","load","error","click","update:modelValue"],setup(m,{emit:p}){const i=m,l=p,f=h(i.modelValue||i.value);K(()=>i.modelValue,s=>{f.value=s}),K(()=>i.value,s=>{f.value=s}),K(f,s=>{l("update:modelValue",s),s||l("close")});const C=h(!0),V=h(1),L=Le(()=>{let s="";return i.width&&(s+=`width: ${i.width}px ;`,s+=`height: ${i.width/V.value}px`),s});function g(){l("beforeenter")}function S(){l("enter")}function $(){l("afterenter")}function q(){l("beforeleave")}function z(){l("leave")}function N(){l("afterleave"),l("closed")}function A(){f.value=!1}function F(){l("click-modal")}function G(s){const{height:T,width:u}=s.detail;V.value=u/T,C.value=!0,l("load")}function U(){C.value=!1,l("error")}function M(){i.to&&Ie({url:i.to}),l("click"),A()}return(s,T)=>{const u=le,O=re;return d(),_(O,{class:"wd-curtain-wrapper"},{default:o(()=>[e(Se,{modelValue:f.value,"onUpdate:modelValue":T[0]||(T[0]=H=>f.value=H),transition:"zoom-in",position:"center","close-on-click-modal":s.closeOnClickModal,"hide-when-close":s.hideWhenClose,"z-index":s.zIndex,onBeforeEnter:g,onEnter:S,onAfterEnter:$,onBeforeLeave:q,onLeave:z,onAfterLeave:N,onClose:A,onClickModal:F,"custom-class":`wd-curtain ${s.customClass}`,"custom-style":s.customStyle},{default:o(()=>[e(O,{class:"wd-curtain__content"},{default:o(()=>[e(u,{src:s.src,class:"wd-curtain__content-img",style:X(L.value),onClick:M,onError:U,onLoad:G},null,8,["src","style"]),Te(s.$slots,"close",{},()=>[e(Pe,{name:"close-outline","custom-class":`wd-curtain__content-close ${s.closePosition} ${s.customCloseClass}`,"custom-style":s.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})}}})),Ye=ce(Ze,[["__scopeId","data-v-63645f63"]]),et="/static/header-logo.png",tt="/static/icons/search.png",at="/static/icons/notifications.png",ot=ne({name:"Index",__name:"index",setup(m){const i=Ve().safeAreaInsets,l=h(null);Ke(l);const f=h(0),C=h([]);function V(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 L=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"}]),g=h([]);function S(){return w(this,null,function*(){const t=yield se({page:1,size:20,sort:"CREATE_DESC"});g.value=t.data.list})}const $=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([]),N=h(!1);function A(){ie().select(".productList").boundingClientRect(t=>{t&&ie().selectViewport().scrollOffset(c=>{var r;const E=((c==null?void 0:c.scrollTop)||0)+t.top;(r=l.value)==null||r.reload(),setTimeout(()=>{je({scrollTop:E-40,duration:0})},100)}).exec()}).exec()}function F(t,c){return w(this,null,function*(){t===1&&(N.value=!0);try{const P={page:t,size:c,sort:"SALES_DESC",price:$.value},E=yield se(P);l.value.complete(E.data.list)}finally{t===1&&(N.value=!1)}})}function G(){return w(this,null,function*(){const t=yield Ae({page:1,size:20});C.value=t.data.list})}const U=h(0),M=h(!0);function s(){return w(this,null,function*(){try{M.value=!0,yield Promise.all([T(),S(),G()])}finally{M.value=!1}})}function T(){return w(this,null,function*(){try{const t=yield De();t.code==="200"&&(U.value=Number(t.data)||0)}catch(t){}})}const u=$e({show:!1,img:"",link:"",linkType:"",title:""});function O(){return w(this,null,function*(){try{const t=yield Be({advType:"INDEX"});t.code==="200"&&t.data.length&&(u.show=!0,u.img=t.data[0].advImage,u.link=t.data[0].link,u.linkType=t.data[0].linkType,u.title=t.data[0].title)}catch(t){}})}function H(){u.linkType==="IN"?x({url:u.link}):x({url:"/pages/webLink/webLink",params:{title:u.title,link:u.link}})}return ze(()=>w(this,null,function*(){O(),yield s()})),Ee(()=>{T()}),(t,c)=>{const P=le,E=y(v("wd-badge"),Me),r=re,D=y(v("wd-skeleton"),Fe),pe=y(v("wd-swiper"),Ge),Z=qe,ue=Oe,de=y(v("wd-tab"),He),me=y(v("wd-tabs"),Qe),he=y(v("wd-sticky"),We),fe=y(v("wd-curtain"),Ye),ge=y(v("z-paging"),Je),xe=Ne("layout-tabbar-uni");return d(),_(xe,null,{default:o(()=>[e(ge,{ref_key:"paging",ref:l,modelValue:n(z),"onUpdate:modelValue":c[5]||(c[5]=a=>R(z)?z.value=a:null),"auto-scroll-to-top-when-reload":!1,"auto-clean-list-when-reload":!1,"use-page-scroll":"",onQuery:F,onOnRefresh:s},{top:o(()=>{var a;return[e(r,{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:o(()=>[e(P,{src:et,class:"h-44rpx w-275rpx"}),e(r,{class:"flex items-center"},{default:o(()=>[e(E,{"model-value":0},{default:o(()=>[e(P,{src:tt,class:"mr-20rpx h-40rpx w-40rpx",onClick:c[0]||(c[0]=I=>n(x)({url:"/pages/search/search"}))})]),_:1}),e(E,{"model-value":n(U),max:99},{default:o(()=>[e(P,{src:at,class:"h-40rpx w-40rpx",onClick:c[1]||(c[1]=I=>n(x)({url:"/pages/notifications/notifications"}))})]),_:1},8,["model-value"])]),_:1})]),_:1},8,["style"])]}),default:o(()=>[n(M)?(d(),k(b,{key:0},[e(D,{"row-col":[{height:"422rpx"}],animation:"gradient"}),e(r,{class:"px-24rpx pb-24rpx"},{default:o(()=>[e(r,{class:"pb-22rpx pt-24rpx"},{default:o(()=>[e(D,{"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(r,{class:"mb-32rpx"},{default:o(()=>[e(D,{"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(r,{class:"mb-20rpx"},{default:o(()=>[e(D,{"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(r,{class:"grid grid-cols-2 gap-20rpx"},{default:o(()=>[(d(),k(b,null,B(6,a=>e(D,{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)):(d(),k(b,{key:1},[e(pe,{current:n(f),"onUpdate:current":c[2]||(c[2]=a=>R(f)?f.value=a:null),list:n(C),"value-key":"image",autoplay:"",indicator:"","indicator-position":"bottom-right","image-mode":"aspectFill",height:"422rpx",onClick:V},null,8,["current","list"]),e(r,{class:"px-24rpx pb-24rpx"},{default:o(()=>[e(r,{class:"flex items-end justify-between pb-22rpx pt-24rpx"},{default:o(()=>[(d(!0),k(b,null,B(n(L),(a,I)=>(d(),_(r,{key:I,class:"flex flex-col items-center",onClick:Y=>n(x)({url:a.url})},{default:o(()=>[e(P,{src:a.image,style:X(`width: ${a.size}; height: ${a.size};`)},null,8,["src","style"]),e(r,{class:"mt-14rpx whitespace-pre-line text-center text-22rpx text-#898989 font-bold"},{default:o(()=>[ae(oe(t.$t(a.title)),1)]),_:2},1024)]),_:2},1032,["onClick"]))),128))]),_:1}),n(g).length?(d(),_(r,{key:0},{default:o(()=>[e(r,{class:"mb-16rpx text-32rpx"},{default:o(()=>[ae(oe(t.$t("home.news")),1)]),_:1}),e(ue,{"scroll-x":"",class:"whitespace-nowrap"},{default:o(()=>[e(r,{class:"flex items-center gap-16rpx",style:{"min-width":"max-content"}},{default:o(()=>[(d(!0),k(b,null,B(n(g),(a,I)=>(d(),_(Z,{key:I,"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})):Ue("",!0),e(r,{class:"productList"},{default:o(()=>[e(he,{"offset-top":0},{default:o(()=>[e(r,{class:"tabs-container"},{default:o(()=>[e(me,{modelValue:n($),"onUpdate:modelValue":c[3]||(c[3]=a=>R($)?$.value=a:null),slidable:"always","line-width":0,"line-height":0,onClick:A},{default:o(()=>[(d(!0),k(b,null,B(n(q),a=>(d(),_(de,{key:a,title:t.$t(a.title),name:a.value},null,8,["title","name"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),n(N)?(d(),_(r,{key:0,class:"grid grid-cols-2 gap-20rpx"},{default:o(()=>[(d(),k(b,null,B(6,a=>e(D,{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})):(d(),_(r,{key:1,class:"grid grid-cols-2 gap-20rpx"},{default:o(()=>[(d(!0),k(b,null,B(n(z),(a,I)=>(d(),_(Z,{key:I,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(fe,{modelValue:n(u).show,"onUpdate:modelValue":c[4]||(c[4]=a=>n(u).show=a),src:n(u).img,to:n(u).link,"close-position":"bottom",width:280,onClick:H},null,8,["modelValue","src","to"])]),_:1},8,["modelValue"])]),_:1})}}}),ht=ce(ot,[["__scopeId","data-v-f15d6fcd"]]);export{ht as default};