coupon-list.vue
3.79 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<template>
<YohoActionSheet ref="actionSheet" @cancel="close">
<div class="pay-type-wrapper">
<div class="header">
<div class="title">选择优惠券</div>
<span><i class="iconfont iconweibiao45133 close" @click="close"></i></span>
</div>
<slot name="content">
<div class="pay-list-wrapper">
<div class="pay-list-item" v-for="item in data" :key="item.coupon_code" @click="onItemClick(item)">
<div class="pay-info">
<div class="price">{{item.coupon_value_str}}</div>
<div class="price-desc">{{item.use_rule_str}}</div>
</div>
<div class="coupon-info">
<div class="coupon-name">[{{ isSeller ? '卖家券': item.coupon_type_name }}]{{item.coupon_name}}</div>
<div class="coupon-time">{{item.coupon_validity}}</div>
</div>
<Check class="check" :value="item.selected === 'Y'"></Check>
<div class="time-up" v-if="item.is_expired_soon === 'Y'"></div>
</div>
</div>
</slot>
<div class="footer">
<YohoButton txt="确定" class="btn-wrapper" @click="pay"></YohoButton>
</div>
</div>
</YohoActionSheet>
</template>
<script>
import YohoActionSheet from '../action-sheet';
import Check from '../order-pay-type/check2';
import YohoButton from '../button';
export default {
name: 'OrderCouponList',
props: {
data: {
type: Array,
default() {
return [];
}
},
isSeller: {
type: Boolean,
default() {
return false;
}
}
},
components: {
YohoButton,
YohoActionSheet,
Check
},
data() {
return {};
},
methods: {
show() {
this.$refs.actionSheet.show();
},
hide() {
this.$refs.actionSheet.hide();
},
close() {
this.hide();
this.$emit('closeAction');
},
pay() {
this.$emit('confirmAction');
},
onItemClick(item) {
this.$emit('itemClickAction', { couponCode: item.coupon_code, couponType: item.coupon_type });
}
}
};
</script>
<style lang="scss" scoped>
.pay-type-wrapper {
height: 960px;
background: white;
position: relative;
display: flex;
flex-direction: column;
border-top-left-radius: 32px 32px;
border-top-right-radius: 32px 32px;
}
.header {
display: flex;
justify-content: space-between;
padding: 40px;
}
.title {
font-weight: bold;
font-size: 32px;
color: #222;
}
.close {
font-size: 32px;
}
.pay-list-wrapper {
flex: 1;
overflow-y: auto;
background-color: #f5f5f5;
}
.pay-list-item {
height: 200px;
font-size: 28px;
margin: 20px 20px;
display: flex;
justify-content: space-between;
align-items: center;
background: url(~statics/image/order/bg@3x.png) no-repeat;
background-size: cover;
position: relative;
}
.check {
font-size: 48px;
margin-left: 40px;
margin-right: 40px;
}
.pay-info {
width: 210px;
}
.footer {
font-size: 32px;
height: 112px;
background-color: white;
border-top: 1px solid #eee;
display: flex;
align-items: center;
justify-content: center;
}
.btn-wrapper {
width: 640px;
height: 80px;
line-height: 80px;
font-size: 32px;
font-weight: bold;
}
.price-info {
margin-top: 40px;
margin-bottom: 60px;
}
.price {
font-size: 72px;
color: #002b47;
text-align: center;
font-weight: bolder;
}
.price-desc {
font-size: 24px;
color: #002b47;
text-align: center;
}
.coupon-info {
flex: 1;
height: 160px;
padding-left: 20px;
}
.coupon-name {
font-size: 24px;
color: #002b47;
margin-bottom: 40px;
}
.coupon-time {
font-size: 22px;
color: #999;
}
.time-up {
background: url(~statics/image/coupon/time-up@3x.png) no-repeat;
background-size: cover;
position: absolute;
top: 0;
right: 0;
width: 80px;
height: 80px;
}
</style>