[new feature] Coupon: add valueDesc、unitDesc prop (#2710)

This commit is contained in:
rex
2019-02-14 13:58:59 +08:00
committed by neverland
parent 144a3fefd3
commit 7a1ed98eb7
5 changed files with 27 additions and 21 deletions
+6 -2
View File
@@ -37,9 +37,13 @@ export default sfc({
},
faceAmount() {
return this.coupon.denominations
const { coupon } = this;
if (coupon.valueDesc && coupon.unitDesc) {
return `${coupon.valueDesc}<span>${coupon.unitDesc}</span>`;
}
return coupon.denominations
? `<span>${this.currency}</span> ${formatAmount(this.coupon.denominations)}`
: this.coupon.discount
: coupon.discount
? t('discount', formatDiscount(this.coupon.discount))
: '';
},
+3 -1
View File
@@ -40,13 +40,15 @@
&__head {
position: relative;
min-width: 95px;
min-width: 85px;
padding-right: 10px;
h2 {
color: @red;
font-size: 24px;
span {
margin-left: 2px;
font-size: 50%;
}
}