cartCoupon.vue
1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<template>
<ul class="cartCouponBox">
<p class='title'>{{ title }}:</p>
<li
v-for='(item, index) in couponList'
:key='index'
>
<!-- 满减券 -->
<p class="coupon"
v-if="item.couponType === 1 && item.state === 3"
>
满<span>{{ item.fullMoney }}</span>减<span>{{ item.reduceMoney }}</span>元
</p>
<!-- 折扣券 -->
<p class="coupon"
v-if="item.couponType === 2 && item.state === 3"
>
满<span>{{ item.fullMoney }}</span>打<span>{{ item.reduceMoney }}</span>折
</p>
<p class="btn"
v-if="item.state === 3"
v-throttle
@click="chooseCoupon(item)"
>立即领取></p>
</li>
</ul>
</template>
<script>
export default {
props: {
title: {
type: String,
default: '优惠券'
},
couponList: {
type: Array,
default: () => []
}
},
methods: {
chooseCoupon (item) {
this.$emit('chooseCoupon', item)
}
}
}
</script>
<style lang="scss" scoped>
.cartCouponBox{
margin-top: 12px;
.title {
font-size: 14px;
color: #333;
}
// flex: 1;
li {
height: 40px;
line-height: 40px;
margin-top: 20px;
display: flex;
// overflow: hidden;
.coupon{
color: #333;
}
.btn{
margin-left: 8px;
color: #C83732;
}
}
}
</style>