import{_ as e}from"./u-tabs.f280784d.js";import{p as t,q as s,o as a,c as l,w as o,n,i,a as u,b as r,d as c,F as p,x as m,j as d,f,t as _,e as y,k as b}from"./index-ae8bbb19.js";import{r as h}from"./uni-app.es.ee1d5b08.js";import{M as x,_ as T}from"./mescroll-mixins.7cda1bf3.js";import{l as C}from"./myCoupon.f3c77da5.js";import{C as g}from"./CouponType.a4f88c42.js";import{_ as v}from"./_plugin-vue_export-helper.1b428a4d.js";const k=["red","blue","violet","yellow"],j=[{name:"未使用",value:"isUnused"},{name:"已使用",value:"isUse"},{name:"已过期",value:"isExpire"}];const U=v({mixins:[x],data:()=>({CouponTypeEnum:g,color:k,tabs:j,curTab:0,list:t(),upOption:{auto:!0,page:{size:15},noMoreSize:4,empty:{tip:"亲,暂无相关优惠券"}}}),onLoad(e){},methods:{upCallback(e){const t=this;t.getCouponList(e.num).then((e=>{const s=e.data.length,a=e.data.total;t.mescroll.endBySize(s,a)})).catch((()=>t.mescroll.endErr()))},getCouponList(e=1){const t=this;return new Promise(((a,l)=>{C({dataType:t.getTabValue(),page:e},{load:!1}).then((l=>{const o=l.data.list;t.list.data=s(o,t.list,e),a(o)}))}))},getTabValue(){return this.tabs[this.curTab].value},onChangeTab(e){this.curTab=e,this.onRefreshList()},onRefreshList(){this.list=t(),setTimeout((()=>{this.mescroll.resetUpScroll()}),120)}}},[["render",function(t,s,x,C,g,v){const k=h(m("u-tabs"),e),j=i,U=b,L=h(m("mescroll-body"),T);return a(),l(j,{class:"container",style:n(t.appThemeStyle)},{default:o((()=>[u(L,{ref:"mescrollRef",sticky:!0,onInit:t.mescrollInit,down:{use:!1},up:g.upOption,onUp:v.upCallback},{default:o((()=>[u(k,{list:g.tabs,"is-scroll":!1,current:g.curTab,"active-color":t.appTheme.mainBg,duration:.2,onChange:v.onChangeTab},null,8,["list","current","active-color","duration","onChange"]),u(j,{class:"coupon-list"},{default:o((()=>[(a(!0),r(p,null,c(g.list.data,((e,t)=>(a(),l(j,{class:"coupon-item",key:t},{default:o((()=>[u(j,{class:d(["item-wrapper",["color-"+(e.state.value?g.color[t%g.color.length]:"gray")]])},{default:o((()=>[u(j,{class:"coupon-type"},{default:o((()=>[f(_(g.CouponTypeEnum[e.coupon_type].name),1)])),_:2},1024),u(j,{class:"tip dis-flex flex-dir-column flex-x-center"},{default:o((()=>[e.coupon_type==g.CouponTypeEnum.FULL_DISCOUNT.value?(a(),l(j,{key:0},{default:o((()=>[u(U,{class:"f-30"},{default:o((()=>[f("¥")])),_:1}),u(U,{class:"money"},{default:o((()=>[f(_(e.reduce_price),1)])),_:2},1024)])),_:2},1024)):y("",!0),e.coupon_type==g.CouponTypeEnum.DISCOUNT.value?(a(),l(U,{key:1,class:"money"},{default:o((()=>[f(_(e.discount)+"折",1)])),_:2},1024)):y("",!0),u(U,{class:"pay-line"},{default:o((()=>[f("满"+_(e.min_price)+"元可用",1)])),_:2},1024)])),_:2},1024),u(j,{class:"split-line"}),u(j,{class:"content dis-flex flex-dir-column flex-x-between"},{default:o((()=>[u(j,{class:"title"},{default:o((()=>[f(_(e.name),1)])),_:2},1024),u(j,{class:"bottom dis-flex flex-y-center"},{default:o((()=>[u(j,{class:"time flex-box"},{default:o((()=>[e.start_time===e.end_time?(a(),r(p,{key:0},[f(_(e.start_time)+" 当天有效",1)],64)):(a(),r(p,{key:1},[f(_(e.start_time)+"~"+_(e.end_time),1)],64))])),_:2},1024),u(j,{class:"receive state"},{default:o((()=>[u(U,null,{default:o((()=>[f(_(e.state.text),1)])),_:2},1024)])),_:2},1024)])),_:2},1024)])),_:2},1024)])),_:2},1032,["class"])])),_:2},1024)))),128))])),_:1})])),_:1},8,["onInit","up","onUp"])])),_:1},8,["style"])}],["__scopeId","data-v-90b4b808"]]);export{U as default};