import{_ as a}from"./uv-tabs.5d8e6539.js";import{a as o,x as s,a1 as e,o as t,j as l,w as n,B as u,h as r,i,e as c,k as p,F as m,I as d,G as b,H as f}from"./index-9bec188e.js";import{c as v}from"./coupon.e8046488.js";import{C as h}from"./CouponItem.b2bb8e74.js";import{E as y}from"./index.036a38bb.js";import{J as g}from"./images.52fc6216.js";import{R as j}from"./index.f3f840d0.js";import{u as _}from"./useScroll.c0a86152.js";import{_ as x}from"./_plugin-vue_export-helper.1b428a4d.js";import"./uv-badge.07f8d0fa.js";import"./config.6730da78.js";const C=[{label:"可使用",value:1},{label:"已使用",value:2},{label:"已失效",value:3}];const w=x({__name:"index",setup(x){const{scrollTop:w}=_(),{tabList:L,tabCurrent:S,handleTabsChange:T,couponList:k,showEmpty:E}=function(){const a=o(0),t=o(1),l=o(!1),n=o([]),u=s((()=>n.value.length<=0));async function r(){try{l.value=!0;const a=await v(t.value);n.value=a}finally{l.value=!1}}return e((async()=>{await r()})),{tabList:C,tabCurrent:a,handleTabsChange:async function(o){console.log(o),n.value=[],a.value=o.index,t.value=o.value,await r()},showEmpty:u,couponListLoading:l,couponList:n,doGetCouponList:r}}();return(o,s)=>{const e=b(f("uv-tabs"),a),v=u;return t(),l(v,{class:"discount-coupon"},{default:n((()=>[r(v,{class:"tabs-row"},{default:n((()=>[r(e,{current:i(S),list:i(L),lineColor:"#ee6d46",activeStyle:{color:"#ee6d46"},itemStyle:{width:`calc( 100% / ${i(L).length} )`,"box-sizing":"border-box",height:"80rpx"},keyName:"label",onChange:i(T)},null,8,["current","list","itemStyle","onChange"])])),_:1}),r(v,{class:"coupon-box"},{default:n((()=>[i(E)?(t(),l(y,{key:1,iconSrc:i(g)},{default:n((()=>[d(" 您暂时没有可使用的优惠券~ ")])),_:1},8,["iconSrc"])):(t(!0),c(m,{key:0},p(i(k),(a=>(t(),l(v,{class:"coupon-list"},{default:n((()=>[r(h,{coupons:a,tabType:i(S)},null,8,["coupons","tabType"])])),_:2},1024)))),256))])),_:1}),r(j,{"scroll-top":i(w)},null,8,["scroll-top"])])),_:1})}}},[["__scopeId","data-v-12a0279b"]]);export{w as default};
