[improvement] Coupon: update value display rule (#1976)

This commit is contained in:
neverland 2018-10-25 10:49:37 +08:00 committed by GitHub
parent 16973a4e0b
commit a4b71aa402
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -40,7 +40,8 @@ export default create({
const { coupons } = this;
const coupon = coupons[this.chosenCoupon];
if (coupon) {
return `-¥${(coupon.value / 100).toFixed(2)}`;
const value = coupon.denominations || coupon.value;
return `-¥${(value / 100).toFixed(2)}`;
}
return coupons.length === 0 ? this.$t('tips') : this.$t('count', coupons.length);
}

View File

@ -113,4 +113,4 @@ export default {
| startAt | 卡有效开始时间 (时间戳, 单位秒) | `Number` |
| endAt | 卡失效日期 (时间戳, 单位秒) | `Number` |
| reason | 不可用原因 | `String` |
| value | 订单优惠金额,单位分 | `Number` |
| value | 折扣券优惠金额,单位分 | `Number` |