You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong/public/assets/pages-coupon-index.2c9e6dd7.js

1 lines
3.0 KiB

import{$ as e,o as t,c as s,w as l,i as a,b as o,d as n,F as i,e as u,r as c,a as d,k as p,f as r,t as _,l as f}from"./index-4ddb689d.js";import{r as m}from"./myCoupon.49a23600.js";import{C as y}from"./CouponType.eb6d2fde.js";import{E as x}from"./index.25c5a396.js";import{_ as g}from"./_plugin-vue_export-helper.1b428a4d.js";const k="coupon/list",C=["red","blue","violet","yellow"];const h=g({components:{Empty:x},data:()=>({CouponTypeEnum:y,color:C,list:[],isLoading:!0}),onLoad(e){this.getCouponList()},methods:{getCouponList(t=!0){const s=this;s.isLoading=!0,((t,s)=>{const l={isPrompt:!0,load:!0,...s};return e.get(k,t,l)})({},{load:t}).then((e=>{s.list=e.data.list})).finally((()=>s.isLoading=!1))},receive(e){const t=this;m(e).then((e=>{t.$success(e.message),t.getCouponList(!1)}))}}},[["render",function(e,m,y,x,g,k){const C=a,h=f,L=c("empty");return t(),s(C,{class:"container"},{default:l((()=>[g.list.length?(t(),s(C,{key:0,class:"coupon-list"},{default:l((()=>[(t(!0),o(i,null,n(g.list,((a,n)=>(t(),s(C,{class:"coupon-item",key:n},{default:l((()=>[d(C,{class:p(["item-wrapper",[a.state.value?"color-"+g.color[n%g.color.length]:"color-gray"]])},{default:l((()=>[d(C,{class:"coupon-type"},{default:l((()=>[r(_(g.CouponTypeEnum[a.coupon_type].name),1)])),_:2},1024),d(C,{class:"tip dis-flex flex-dir-column flex-x-center"},{default:l((()=>[a.coupon_type==g.CouponTypeEnum.FULL_DISCOUNT.value?(t(),s(C,{key:0},{default:l((()=>[d(h,{class:"f-30"},{default:l((()=>[r("¥")])),_:1}),d(h,{class:"money"},{default:l((()=>[r(_(a.reduce_price),1)])),_:2},1024)])),_:2},1024)):u("",!0),a.coupon_type==g.CouponTypeEnum.DISCOUNT.value?(t(),s(h,{key:1,class:"money"},{default:l((()=>[r(_(a.discount)+"折",1)])),_:2},1024)):u("",!0),d(h,{class:"pay-line"},{default:l((()=>[r("满"+_(a.min_price)+"元可用",1)])),_:2},1024)])),_:2},1024),d(C,{class:"split-line"}),d(C,{class:"content dis-flex flex-dir-column flex-x-between"},{default:l((()=>[d(C,{class:"title oneline-hide"},{default:l((()=>[r(_(a.name),1)])),_:2},1024),d(C,{class:"bottom dis-flex flex-y-center"},{default:l((()=>[d(C,{class:"time flex-box"},{default:l((()=>[10==a.expire_type?(t(),s(h,{key:0},{default:l((()=>[r("领取"+_(a.expire_day)+"天内有效",1)])),_:2},1024)):u("",!0),20==a.expire_type?(t(),s(h,{key:1},{default:l((()=>[a.start_time===a.end_time?(t(),o(i,{key:0},[r(_(a.start_time)+" 当天有效",1)],64)):(t(),o(i,{key:1},[r(_(a.start_time)+"~"+_(a.end_time),1)],64))])),_:2},1024)):u("",!0)])),_:2},1024),e.$checkModule("market-coupon")&&a.state.value?(t(),s(C,{key:0,class:"receive",onClick:e=>k.receive(a.coupon_id)},{default:l((()=>[d(h,null,{default:l((()=>[r("立即领取")])),_:1})])),_:2},1032,["onClick"])):(t(),s(C,{key:1,class:"receive state"},{default:l((()=>[d(h,null,{default:l((()=>[r(_(a.state.text),1)])),_:2},1024)])),_:2},1024))])),_:2},1024)])),_:2},1024)])),_:2},1032,["class"])])),_:2},1024)))),128))])),_:1})):u("",!0),g.list.length?u("",!0):(t(),s(L,{key:1,isLoading:g.isLoading},null,8,["isLoading"]))])),_:1})}],["__scopeId","data-v-8f6470d3"]]);export{h as default};