diff --git a/packages/coupon-cell/index.vue b/packages/coupon-cell/index.vue index 50d49a441..3009fafa5 100644 --- a/packages/coupon-cell/index.vue +++ b/packages/coupon-cell/index.vue @@ -22,6 +22,10 @@ export default create({ props: { title: String, coupons: Array, + currency: { + type: String, + default: '¥' + }, border: { type: Boolean, default: true @@ -42,7 +46,7 @@ export default create({ const coupon = coupons[this.chosenCoupon]; if (coupon) { const value = coupon.denominations || coupon.value; - return `-¥${(value / 100).toFixed(2)}`; + return `-${this.currency}${(value / 100).toFixed(2)}`; } return coupons.length === 0 ? this.$t('tips') : this.$t('count', coupons.length); } diff --git a/packages/coupon-list/Item.vue b/packages/coupon-list/Item.vue index 4f38880b6..5af1e0859 100644 --- a/packages/coupon-list/Item.vue +++ b/packages/coupon-list/Item.vue @@ -34,7 +34,8 @@ export default create({ props: { data: Object, chosen: Boolean, - disabled: Boolean + disabled: Boolean, + currency: String }, components: { @@ -48,7 +49,7 @@ export default create({ faceAmount() { return this.data.denominations !== 0 - ? `¥ ${this.formatAmount(this.data.denominations)}` + ? `${this.currency} ${this.formatAmount(this.data.denominations)}` : this.data.discount !== 0 ? this.formatDiscount(this.data.discount) : ''; diff --git a/packages/coupon-list/en-US.md b/packages/coupon-list/en-US.md index 812a5a28f..89e3daaf2 100644 --- a/packages/coupon-list/en-US.md +++ b/packages/coupon-list/en-US.md @@ -74,6 +74,7 @@ export default { | coupons | Coupon list | `Array` | `[]` | | editable | Cell editable | `Boolean` | `true` | | border | Whether to show innner border | `Boolean` | `true` | +| currency | Currency symbol | `String` | `¥` | ### CouponList API @@ -90,6 +91,7 @@ export default { | displayed-coupon-index | Index of displayed coupon | `Number` | - | | close-button-text | Close button text | `String` | `Close` | | input-placeholder | Input placeholder | `String` | `Coupon code` | +| currency | Currency symbol | `String` | `¥` | ### CouponList Event diff --git a/packages/coupon-list/index.vue b/packages/coupon-list/index.vue index cf053898b..75af38f6f 100644 --- a/packages/coupon-list/index.vue +++ b/packages/coupon-list/index.vue @@ -35,6 +35,7 @@ v-for="(item, index) in coupons" :key="item.id || item.name" :data="item" + :currency="currency" :chosen="index === chosenCoupon" @click.native="$emit('change', index)" /> @@ -57,6 +58,7 @@ v-for="item in disabledCoupons" :key="item.id || item.name" :data="item" + :currency="currency" />
优惠券
-
-¥1.00
+
-¥1.00
diff --git a/packages/coupon-list/zh-CN.md b/packages/coupon-list/zh-CN.md index e5d2a93f1..e3140bfa3 100644 --- a/packages/coupon-list/zh-CN.md +++ b/packages/coupon-list/zh-CN.md @@ -75,6 +75,7 @@ export default { | coupons | 可用优惠券列表 | `Array` | `[]` | - | | editable | 能否切换优惠券 | `Boolean` | `true` | - | | border | 是否显示内边框 | `Boolean` | `true` | 1.3.10 | +| currency | 货币符号 | `String` | `¥` | - | 1.4.10 | ### CouponList API @@ -93,6 +94,7 @@ export default { | close-button-text | 列表底部按钮文字 | `String` | `不使用优惠` | - | | input-placeholder | 输入框文字提示 | `String` | `请输入优惠码` | - | | show-exchange-bar | 是否展示兑换栏 | `Boolean` | `true` | - | +| currency | 货币符号 | `String` | `¥` | - | 1.4.10 | ### CouponList Event @@ -102,6 +104,7 @@ export default { | exchange | 兑换优惠券回调 | code, 兑换码 | ### 数据格式 + #### 优惠券字段说明 | key | 说明 | 类型 |