feat(Coupon): add new prop condition @rex-zsd (#2551)

This commit is contained in:
rex 2019-01-18 13:18:53 +08:00 committed by neverland
parent 3f60e4701b
commit 4fdf731a8e
5 changed files with 11 additions and 6 deletions

View File

@ -67,7 +67,7 @@ export default {
id: 1,
discount: 0,
denominations: 150,
originCondition: 0,
condition: '无使用门槛\n最多优惠12元',
reason: '',
value: 150,
name: this.$t('coupon.name'),

View File

@ -108,7 +108,7 @@ export default {
| name | Name | `String` |
| discount | Discount | `Number` |
| denominations | Denominations | `Number` |
| originCondition | Condition | `Number` |
| condition | Condition | `String` |
| startAt | Start time (Timestmap, unit second) | `Number` |
| endAt | End time (Timestmap, unit second) | `Number` |
| description | Description | `String` |

View File

@ -36,7 +36,7 @@ const coupon = {
available: 1,
discount: 0,
denominations: 150,
originCondition: 0,
condition: '无使用门槛\n最多优惠12元',
reason: '',
value: 150,
name: '优惠券名称',
@ -113,7 +113,7 @@ export default {
| name | 优惠券名称 | `String` |
| discount | 折扣0为满减券88=>8.8折 | `Number` |
| denominations | 面值0为折扣券单位分 | `Number` |
| originCondition | 满减条件0为无门槛满XX元可用单位分 | `Number` |
| condition | 满减条件 | `String` |
| startAt | 卡有效开始时间 (时间戳, 单位秒) | `Number` |
| endAt | 卡失效日期 (时间戳, 单位秒) | `Number` |
| description | 描述信息,优惠券可用时展示 | `String` |

View File

@ -60,7 +60,7 @@ export default sfc({
<div class={bem('content')}>
<div class={bem('head')}>
<h2 domPropsInnerHTML={this.faceAmount} />
<p>{this.conditionMessage}</p>
<p>{this.coupon.condition || this.conditionMessage}</p>
</div>
<div class={bem('body')}>
<h2>{coupon.name}</h2>

View File

@ -39,7 +39,8 @@
}
&__head {
min-width: 90px;
position: relative;
min-width: 95px;
h2 {
color: @red;
@ -49,6 +50,10 @@
font-size: 50%;
}
}
p {
white-space: pre-wrap;
}
}
&__body {