2 lines
1.8 KiB
JavaScript
2 lines
1.8 KiB
JavaScript
"use strict";const e=require("../../../common/vendor.js"),t=require("../../index.js"),u={__name:"su-coupon",props:{size:{type:String,default:"lg"},textColor:{type:String,default:"#FF6000"},background:{type:String,default:"#FFC19C"},btnBg:{type:String,default:"#fff"},btnTextColor:{type:String,default:"#FF6000"},state:{type:Number,default:0},couponId:{type:Number,default:0},title:{type:String,default:"这是优惠券"},value:{type:[Number,String],default:50},sellBy:{type:String,default:"2019.11.25至2019.12.25"},surplus:{type:[Number,String],default:0},type:{type:String,default:""}},setup(u){e.useCssVars((e=>({a62a1874:u.textColor,"705dc7aa":u.btnTextColor,"734c6d51":u.btnBg})));const s=e.reactive({stateMap:{0:"立即领取",1:"去使用"}}),r=u,l=e.computed((()=>({background:r.background})));return(a,o)=>e.e({a:"xs"===r.size},"xs"===r.size?{b:e.t("reduce"===u.type?u.value:Number(u.value)),c:e.t("reduce"===u.type?"元":"折"),d:e.t(r.title),e:e.t(s.stateMap[r.state]),f:e.s(l.value),g:e.o((s=>e.unref(t.sheep).$router.go("/modules/mall/coupon/detail",{id:u.couponId})))}:{},{h:"md"===r.size},"md"===r.size?e.e({i:e.t("reduce"===u.type?u.value:Number(u.value)),j:e.t("reduce"===u.type?"元":"折"),k:e.t(r.title),l:r.surplus},r.surplus?{m:e.t(r.surplus)}:{},{n:e.t(s.stateMap[r.state]),o:e.s(l.value),p:e.o((s=>e.unref(t.sheep).$router.go("/modules/mall/coupon/detail",{id:u.couponId})))}):{},{q:"lg"===r.size},"lg"===r.size?e.e({r:e.t("reduce"===u.type?u.value:Number(u.value)),s:e.t("reduce"===u.type?"元":"折"),t:e.t(r.title),v:e.t(r.sellBy),w:e.t(s.stateMap[r.state]),x:r.surplus},r.surplus?{y:e.t(r.surplus)}:{},{z:e.s(l.value),A:e.o((s=>e.unref(t.sheep).$router.go("/modules/mall/coupon/detail",{id:u.couponId})))}):{},{B:e.s(a.__cssVars())})}},s=e._export_sfc(u,[["__scopeId","data-v-388e8d84"]]);wx.createComponent(s);
|