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-BYcXwl4U.js";import{i as k,c as C}from"./app-a6cKceqE.js";import{N as x}from"./app-DCd54JMo.js";import{N as _}from"./app-CabATHnR.js";import{_ as g}from"./app-uhTxLRnQ.js";import{C as N}from"./app-Biqm6MNM.js";import{C as b}from"./app-C14NbwKQ.js";import"./app-MrAtUXr3.js";import"./app-BWSI2Z1R.js";import"./app-DPDEogA0.js";import"./app-DxjODhok.js";import"./app-BhzV4gWo.js";import"./app-CO4sV-Ic.js";import"./app-yt37eDzA.js";import"./app-BG60hdvp.js";import"./app-BQ5ggxk2.js";import"./app-SxAW7vhf.js";import"./app-D3zbrzdO.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};
