[breaking change] Coupon: use camelcase data (#1643)

This commit is contained in:
neverland 2018-08-17 15:20:08 +08:00 committed by GitHub
parent bf7b84fee6
commit abd4819ca1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 25 additions and 21 deletions

View File

@ -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>

View File

@ -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);
}
},

View File

@ -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
};
},

View File

@ -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` |

View File

@ -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` |