import{o as s,g as e,b as n,w as r,u as m,c as p,h as c,F as h,D as v,f as u,a as o,t as a,i as y}from"./app-DnroACXc.js";import{i as k,c as C}from"./app-DckefXYL.js";import{N as x}from"./app-C9iVkiu5.js";import{N as _}from"./app-CUPmXIij.js";import{_ as g}from"./app-DezwSKU9.js";import{C as N}from"./app-DR6MAZZy.js";import{C as b}from"./app-BQ_EeKjW.js";import"./app-DrIi-dNq.js";import"./app-zueB50zj.js";import"./app-B0NrURRk.js";import"./app-Co2SIBzr.js";import"./app-Cu6FD8m8.js";import"./app-R-vSvFIF.js";import"./app-HaDoyrq5.js";import"./app-CYYQ_Zep.js";import"./app-Cmxxk_WX.js";import"./app-CF8nmC-F.js";import"./app-B09rlSqG.js";function w(){const{utils:d}=k(this);this.claimCoupon=function(i){d.confirm("确定要领取当前优惠券吗？",function(){this.$post(".claim").params({couponId:i}).success(function(f){d.successRefresh("已领取")})})}}const V={key:1},B={class:"text-xl"},F={class:"mt-2"},R={key:0},T={key:1},$={class:"mt-2"},D={key:0,class:"mt-2"},j={key:1,class:"mt-2"},A={key:2,class:"mt-2"},E={key:0},I={key:1},L={class:"mt-2"},M={class:"mt-2"},S=["onClick"],ot={__name:"coupons",setup(d){const i=C(new w);return(f,q)=>(s(),e(h,null,[n(x,null,{tabs:r(()=>[n(_,{href:"/finance/coupons",name:"已领取优惠券"}),n(_,{separator:""}),n(_,{href:"/finance/coupons/coupons",active:"",name:"待领取优惠券"})]),_:1}),m(i).coupons.length==0?(s(),p(g,{key:0,"disable-spacing":""},{default:r(()=>[u("暂时还没有可以领取的优惠券。")]),_:1})):c("",!0),m(i).coupons.length>0?(s(),e("div",V,[(s(!0),e(h,null,v(m(i).coupons,t=>(s(),p(N,{class:"mb-4"},{default:r(()=>[n(b,{full:""},{value:r(()=>[o("div",B,a(t.name),1),o("div",F,[t.description.length>0?(s(),e("span",R,"使用说明："+a(t.description),1)):(s(),e("span",T,"使用说明："+a(t.name),1))]),o("div",$," 适用最低原价：满¥"+a(t.minAmount)+"元 ",1),t.type=="discount"?(s(),e("div",D," 优惠："+a(t.discount)+"折 ",1)):c("",!0),t.type=="reduce"?(s(),e("div",j," 优惠：立减¥-"+a(t.reduce)+"元 ",1)):c("",!0),t.category=="plan"?(s(),e("div",A,[u(" 适用套餐： "),t.plans.length>0?(s(),e("span",E,a(t.plans.map(l=>l.name).join("、")),1)):(s(),e("span",I,"所有套餐"))])):c("",!0),o("div",L," 有效期："+a(t.dayFrom)+" - "+a(t.dayTo),1)]),end:r(()=>[o("div",M,[o("a",{href:"",onClick:y(l=>m(i).claimCoupon(t.id),["prevent"])},"领取优惠券",8,S)])]),_:2},1024)]),_:2},1024))),256))])):c("",!0)],64))}};export{ot as default};
