import{r as e,o as a,n as t,c as s,b as l,d as u,e as o,f as r,w as c,g as n,x as i,h as d,i as p,F as f,k as _,p as m,z as v,l as y,G as g,v as h,A as x,j as b,y as k}from"./index-DVkgSHpn.js";import{_ as j}from"./el-navbar.DVIyjZEN.js";import{_ as w}from"./el-tabs.DRFTppt3.js";import{_ as P}from"./el-refresh.CkIPFmzm.js";import{_ as H,a as S}from"./el-layout._U-vZTft.js";import"./el-empty.CMLN1lgh.js";import"./el-loading-icon.Bh3RKCou.js";const C=H({__name:"index",setup(H){const C=e(),R=e(0),z=e(0),A=e([{name:"未使用"},{name:"已使用"},{name:"已过期"}]);a((()=>{t((()=>{F()}))}));const D=e([]),F=async()=>{var e;null==(e=C.value)||e.resetPage()},G=e=>{z.value=e,F()},I=s((()=>{const{windowHeight:e}=_();return e-R.value-50})),M=()=>{F()},T=e=>{C.value.isMore()&&(C.value.loadingPage(),setTimeout((()=>{uni.$http.get("ucenter.coupon/index",{active:z.value,page:e.page}).then((a=>{1==a.code?(1==e.page&&(D.value=[]),C.value.setData(a.data.total,a.data.list.length),D.value=D.value.concat(a.data.list)):-1==a.code&&(1==e.page&&a.data.list.length<=0&&(D.value=[]),C.value.emptyPage())}))}),100))};return(e,a)=>{const t=l(u("el-navbar"),j),s=l(u("el-tabs"),w),_=m,H=k,F=l(u("el-refresh"),P),U=l(u("el-layout"),S);return o(),r(U,null,{default:c((()=>[n(t,{top:R.value,"onUpdate:top":a[0]||(a[0]=e=>R.value=e),placeholder:!0,fixed:!0,border:!1,title:"我的优惠券"},null,8,["top"]),n(_,{class:"tabs",style:i({top:R.value-1+"px"})},{default:c((()=>[n(s,{list:A.value,current:z.value,onChange:G,activeColor:"var(--ui-bg-color)",itemStyle:{width:"33.333%"}},null,8,["list","current"])])),_:1},8,["style"]),n(_,{style:{width:"100%",height:"50px"}}),n(F,{ref_key:"refreshRef",ref:C,onRefresh:M,onScrolltolower:T,scrollHeight:I.value},{default:c((()=>[n(_,{class:"wrapper"},{default:c((()=>[n(_,{class:"coupon-list"},{default:c((()=>[(o(!0),d(f,null,p(D.value,((e,a)=>(o(),r(_,{class:"coupon-item",key:a},{default:c((()=>[n(_,{class:v(["coupon-box",{grey:y(g)(e.status,[2,3])}])},{default:c((()=>[n(_,{class:v(["top-type",{grey:y(g)(e.status,[2,3])}])},{default:c((()=>[h(x(1==e.type?"满减券":"折扣券"),1)])),_:2},1032,["class"]),n(_,{class:"l"},{default:c((()=>[n(_,{class:"price"},{default:c((()=>[1==e.type?(o(),r(H,{key:0,class:"prefix"},{default:c((()=>[h("￥")])),_:1})):b("",!0),n(H,{class:"money"},{default:c((()=>[h(x(e.amount)+x(2==e.type?"折":""),1)])),_:2},1024)])),_:2},1024),n(_,{class:"discount"},{default:c((()=>[h("满"+x(e.order_amount)+"元可用",1)])),_:2},1024)])),_:2},1024),n(_,{class:"line"}),n(_,{class:"content"},{default:c((()=>[n(_,{class:"title"},{default:c((()=>[h(x(e.name),1)])),_:2},1024),n(_,{class:"bottom"},{default:c((()=>[1==e.expire_type?(o(),r(_,{key:0,class:"time"},{default:c((()=>[h("领取后"+x(e.time)+"天内有效",1)])),_:2},1024)):b("",!0),2==e.expire_type?(o(),r(_,{key:1,class:"time"},{default:c((()=>[h(x(e.time)+"当天有效",1)])),_:2},1024)):b("",!0),1==e.status?(o(),r(_,{key:2,class:"receive"},{default:c((()=>[h("未使用")])),_:1})):b("",!0),2==e.status?(o(),r(_,{key:3,class:"receive"},{default:c((()=>[h("已使用")])),_:1})):b("",!0),3==e.status?(o(),r(_,{key:4,class:"receive"},{default:c((()=>[h("已过期")])),_:1})):b("",!0)])),_:2},1024)])),_:2},1024)])),_:2},1032,["class"])])),_:2},1024)))),128))])),_:1})])),_:1})])),_:1},8,["scrollHeight"])])),_:1})}}},[["__scopeId","data-v-ca4c8358"]]);export{C as default};
//# sourceMappingURL=pages-ucenter-coupon-index.DiQ2t-IS.js.map
