import{_ as a}from"./uv-tabs.8890707f.js";import{f as e,y as t,o as s,c as o,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-d76b1e7a.js";import{c as m,r as v}from"./useRouter.2bdb47a0.js";import{b as f,e as y,C as h}from"./CouponItem.110644df.js";import{E as g}from"./index.81294ba6.js";import{_}from"./_plugin-vue_export-helper.1b428a4d.js";import"./uv-badge.8f9f267e.js";import"./api.9246a192.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),s=e(1),o=e(!1),n=e([]),l=t((()=>n.value.length<=0));async function u(){try{o.value=!0;const a=await f(s.value);n.value=a}finally{o.value=!1}}return m((async()=>{await u()})),{tabList:x,tabCurrent:a,handleTabsChange:async function(e){console.log(e),n.value=[],a.value=e.index,s.value=e.value,await u()},showEmpty:l,couponListLoading:o,couponList:n,doGetCouponList:u}}();return(e,t)=>{const m=v(d("uv-tabs"),a),f=l;return s(),o(f,{class:"discount-coupon"},{default:n((()=>[u(f,{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(f,{class:"coupon-box"},{default:n((()=>[r(S)?(s(),o(g,{key:1,iconSrc:r(y)},{default:n((()=>[b(" 您暂时没有可使用的优惠券~ ")])),_:1},8,["iconSrc"])):(s(!0),i(p,{key:0},c(r(L),(a=>(s(),o(h,{coupons:a,tabType:r(j)},null,8,["coupons","tabType"])))),256))])),_:1})])),_:1})}}},[["__scopeId","data-v-fa250860"]]);export{C as default};
