[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))
: '';
},