import{_ as a}from"./uv-tabs.1dd9974c.js";import{f as e,M as t,o,c as s,w as n,d as l,a as u,u as r,b as i,r as c,F as p,h as b,g as d}from"./index-3714412c.js";import{b as m,r as f}from"./useRouter.f44141c1.js";import{b as v,C as h}from"./CouponItem.61273561.js";import{E as y}from"./index.573aa2d3.js";import{e as g}from"./优惠券.a7c7f2a4.js";import{_}from"./_plugin-vue_export-helper.1b428a4d.js";import"./uv-badge.e9560e1c.js";import"./api.966d6934.js";const x=[{label:"可使用",value:1},{label:"已使用",value:2},{label:"已失效",value:3}];const C=_({__name:"index",setup(_){const{tabList:C,tabCurrent:j,handleTabsChange:w,couponList:L,showEmpty:S}=function(){const a=e(0),o=e(1),s=e(!1),n=e([]),l=t((()=>n.value.length<=0));async function u(){try{s.value=!0;const a=await v(o.value);n.value=a}finally{s.value=!1}}return m((async()=>{await u()})),{tabList:x,tabCurrent:a,handleTabsChange:async function(e){console.log(e),n.value=[],a.value=e.index,o.value=e.value,await u()},showEmpty:l,couponListLoading:s,couponList:n,doGetCouponList:u}}();return(e,t)=>{const m=f(d("uv-tabs"),a),v=l;return o(),s(v,{class:"discount-coupon"},{default:n((()=>[u(v,{class:"tabs-row"},{default:n((()=>[u(m,{current:r(j),list:r(C),lineColor:"#ee6d46",activeStyle:{color:"#ee6d46"},itemStyle:{width:`calc( 100% / ${r(C).length} )`,"box-sizing":"border-box",height:"80rpx"},keyName:"label",onChange:r(w)},null,8,["current","list","itemStyle","onChange"])])),_:1}),u(v,{class:"coupon-box"},{default:n((()=>[r(S)?(o(),s(y,{key:1,iconSrc:r(g)},{default:n((()=>[b(" 您暂时没有可使用的优惠券~ ")])),_:1},8,["iconSrc"])):(o(!0),i(p,{key:0},c(r(L),(a=>(o(),s(h,{coupons:a,tabType:r(j)},null,8,["coupons","tabType"])))),256))])),_:1})])),_:1})}}},[["__scopeId","data-v-bdf6b8f7"]]);export{C as default};
