mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[breaking change] Coupon: use camelcase data (#1643)
This commit is contained in:
parent
bf7b84fee6
commit
abd4819ca1
@ -1,6 +1,11 @@
|
||||
<template>
|
||||
<cell-group :class="b()">
|
||||
<cell :title="title || $t('title')" :value="value" :is-link="editable" @click="$emit('click')" />
|
||||
<cell
|
||||
:title="title || $t('title')"
|
||||
:value="value"
|
||||
:is-link="editable"
|
||||
@click="$emit('click')"
|
||||
/>
|
||||
</cell-group>
|
||||
</template>
|
||||
|
||||
|
@ -34,7 +34,7 @@ export default create({
|
||||
|
||||
computed: {
|
||||
validPeriod() {
|
||||
return `${this.$t('valid')}:${this.getDate(this.data.start_at)} - ${this.getDate(this.data.end_at)}`;
|
||||
return `${this.$t('valid')}:${this.getDate(this.data.startAt)} - ${this.getDate(this.data.endAt)}`;
|
||||
},
|
||||
|
||||
faceAmount() {
|
||||
@ -46,9 +46,9 @@ export default create({
|
||||
},
|
||||
|
||||
conditionMessage() {
|
||||
let condition = this.data.origin_condition;
|
||||
let condition = this.data.originCondition;
|
||||
condition = condition % 100 === 0 ? Math.round(condition / 100) : (condition / 100).toFixed(2);
|
||||
return this.data.origin_condition === 0 ? this.$t('unlimited') : this.$t('condition', condition);
|
||||
return this.data.originCondition === 0 ? this.$t('unlimited') : this.$t('condition', condition);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -63,12 +63,12 @@ export default {
|
||||
available: 1,
|
||||
discount: 0,
|
||||
denominations: 150,
|
||||
origin_condition: 0,
|
||||
originCondition: 0,
|
||||
reason: '',
|
||||
value: 150,
|
||||
name: this.$t('coupon.name'),
|
||||
start_at: 1489104000,
|
||||
end_at: 1514592000
|
||||
startAt: 1489104000,
|
||||
endAt: 1514592000
|
||||
};
|
||||
},
|
||||
|
||||
@ -78,7 +78,7 @@ export default {
|
||||
id: 2,
|
||||
discount: 88,
|
||||
denominations: 0,
|
||||
origin_condition: 50,
|
||||
originCondition: 50,
|
||||
value: 12
|
||||
};
|
||||
},
|
||||
|
@ -36,12 +36,12 @@ const coupon = {
|
||||
available: 1,
|
||||
discount: 0,
|
||||
denominations: 150,
|
||||
origin_condition: 0,
|
||||
originCondition: 0,
|
||||
reason: '',
|
||||
value: 150,
|
||||
name: 'Coupon name',
|
||||
start_at: 1489104000,
|
||||
end_at: 1514592000
|
||||
startAt: 1489104000,
|
||||
endAt: 1514592000
|
||||
};
|
||||
|
||||
export default {
|
||||
@ -106,9 +106,8 @@ export default {
|
||||
| name | Name | `String` |
|
||||
| discount | Discount | `Number` |
|
||||
| denominations | Denominations | `Number` |
|
||||
| origin_condition | Condition | `Number` |
|
||||
| start_at | Start time (Timestmap, unit second) | `Number` |
|
||||
| end_at | End time (Timestmap, unit second) | `Number` |
|
||||
| originCondition | Condition | `Number` |
|
||||
| startAt | Start time (Timestmap, unit second) | `Number` |
|
||||
| endAt | End time (Timestmap, unit second) | `Number` |
|
||||
| reason | Unavailable reason | `String` |
|
||||
| value | Value | `Number` |
|
||||
|
||||
|
@ -36,12 +36,12 @@ const coupon = {
|
||||
available: 1,
|
||||
discount: 0,
|
||||
denominations: 150,
|
||||
origin_condition: 0,
|
||||
originCondition: 0,
|
||||
reason: '',
|
||||
value: 150,
|
||||
name: '优惠券名称',
|
||||
start_at: 1489104000,
|
||||
end_at: 1514592000
|
||||
startAt: 1489104000,
|
||||
endAt: 1514592000
|
||||
};
|
||||
|
||||
export default {
|
||||
@ -109,8 +109,8 @@ export default {
|
||||
| name | 优惠券名称 | `String` |
|
||||
| discount | 折扣(0为满减券)88=>8.8折 | `Number` |
|
||||
| denominations | 面值(0为折扣券)单位分 | `Number` |
|
||||
| origin_condition | 满减条件(0为无门槛,满XX元可用)单位分 | `Number` |
|
||||
| start_at | 卡有效开始时间 (时间戳, 单位秒) | `Number` |
|
||||
| end_at | 卡失效日期 (时间戳, 单位秒) | `Number` |
|
||||
| originCondition | 满减条件(0为无门槛,满XX元可用)单位分 | `Number` |
|
||||
| startAt | 卡有效开始时间 (时间戳, 单位秒) | `Number` |
|
||||
| endAt | 卡失效日期 (时间戳, 单位秒) | `Number` |
|
||||
| reason | 不可用原因 | `String` |
|
||||
| value | 订单优惠金额,单位分 | `Number` |
|
||||
|
Loading…
x
Reference in New Issue
Block a user