8b40a4fc
刘淇
会员卡
|
1
2
3
|
<template>
<div style="height: 100%;display: flex;flex-direction: column;">
<div style="flex: 1;overflow-y: auto;padding: 15px">
|
555e2a0e
刘淇
续费会员卡
|
4
|
<div class="noCardData" v-if="cardList.length == 0">
|
8b40a4fc
刘淇
会员卡
|
5
6
7
|
<p>您目前没有任何会员卡,</p>
<p>请绑定车牌通过认证后再购买会员卡!</p>
</div>
|
aabd3df4
刘淇
购买会员卡
|
8
9
|
<div v-else>
|
555e2a0e
刘淇
续费会员卡
|
10
11
12
|
<div v-for="(i ,index) in cardList" class="cardBg"
:class="{'nianka':i.cardType==1,'bannianka':i.cardType==2,'jika':i.cardType==3,'yueka':i.cardType==4,'rika':i.cardType==5,shixiao:i.cardStatus==0}"
>
|
aabd3df4
刘淇
购买会员卡
|
13
|
<ul class="cardList">
|
555e2a0e
刘淇
续费会员卡
|
14
15
16
|
<li style="padding-left: 25px;">
会员卡-
{{i.cardType=="1"?"年卡":(i.cardType=="2"?"半年卡":(i.cardType=="3"?"季卡":(i.cardType=="4"?"月卡":(i.cardType=="5"?"日卡":""))))}}
|
aabd3df4
刘淇
购买会员卡
|
17
18
19
20
21
22
23
24
25
26
27
|
</li>
<li>
绑定车牌号: {{ i.carNumber }}
</li>
<li>
有效时间段: {{i.effDate}} 至 {{i.expDate}}
</li>
<li>
卡名称: {{ i.cardName }}
</li>
</ul>
|
555e2a0e
刘淇
续费会员卡
|
28
29
30
31
32
33
34
35
36
37
38
|
<div class="cardStatus"
v-if="i.cardStatus==1"
:class="{'niankaStatus':i.cardType==1,'banniankaStatus':i.cardType==2,'jikaStatus':i.cardType==3,'yuekaStatus':i.cardType==4,'rikaStatus':i.cardType==5}"
>
月卡生效中
</div>
<div class="cardStatus shixiaocardStatus" v-else>月卡已失效</div>
<div class="renewBtn" @click="toReNew(i)"
v-if="i.cardStatus==1"
:class="{'niankaStatus':i.cardType==1,'banniankaStatus':i.cardType==2,'jikaStatus':i.cardType==3,'yuekaStatus':i.cardType==4,'rikaStatus':i.cardType==5}"
>续费</div>
|
aabd3df4
刘淇
购买会员卡
|
39
40
41
42
|
</div>
<!--cardType=='1'?'年卡':(cardType=='2'?'半年卡':(cardType=='3'?'季卡':(cardType=='4'?'月卡':(cardType=='5'?'日卡':''))))-->
|
8b40a4fc
刘淇
会员卡
|
43
|
</div>
|
aabd3df4
刘淇
购买会员卡
|
44
45
|
|
8b40a4fc
刘淇
会员卡
|
46
|
</div>
|
6e6de4e6
刘淇
修改整体颜色
|
47
48
|
<!--<x-button type="primary" ></x-button>-->
<mt-button type="primary" size="large" @click.native="$router.push({path:'buyCard'})">购买会员卡</mt-button>
|
8b40a4fc
刘淇
会员卡
|
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
</div>
</template>
<script>
import { queryVipCardsByCustId } from "@/api/cards/cards";
export default {
name: "Cards",
data() {
return {
cardList: []
};
},
mounted() {
this.queryVipCardsByCustId();
},
methods: {
|
555e2a0e
刘淇
续费会员卡
|
65
|
// 获取会员卡列表
|
8b40a4fc
刘淇
会员卡
|
66
67
68
69
70
71
72
|
queryVipCardsByCustId: function() {
let jsondata = this.$utils.commonParams();
jsondata.sign = this.$utils.signObject(jsondata);
queryVipCardsByCustId(jsondata).then(data => {
console.log(data);
if (data.code == 0) {
let res = data.data;
|
555e2a0e
刘淇
续费会员卡
|
73
|
this.cardList = res;
|
8b40a4fc
刘淇
会员卡
|
74
75
76
77
|
} else {
this.$vux.toast.text(data.message, "top");
}
});
|
555e2a0e
刘淇
续费会员卡
|
78
79
80
81
82
83
|
},
// 续费
toReNew: function(i) {
console.log(i);
sessionStorage.setItem("renewData", JSON.stringify(i));
this.$router.push("renew");
|
8b40a4fc
刘淇
会员卡
|
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
}
}
};
</script>
<style scoped lang="scss">
.noCardData {
padding-top: 130px;
background: url("../../assets/images/cards/nodata.png") no-repeat center 0;
background-size: 121px 100px;
text-align: center;
}
.cardBg {
width: 100%;
height: 150px;
|
555e2a0e
刘淇
续费会员卡
|
100
101
102
103
|
position: relative;
background-image: url("../../assets/images/cards/cards.png");
background-repeat: no-repeat;
background-position: 20px 20px;
|
8b40a4fc
刘淇
会员卡
|
104
105
106
|
background-size: 90% 90%;
border-radius: 8px;
margin-bottom: 15px;
|
555e2a0e
刘淇
续费会员卡
|
107
108
109
110
|
overflow: hidden;
}
.nianka{
background-color: #dd6c1e;
|
8b40a4fc
刘淇
会员卡
|
111
|
}
|
555e2a0e
刘淇
续费会员卡
|
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
.bannianka{
background-color: #2A1DD2;
}
.jika{
background-color: #DF6B1B;
}
.yueka{
background-color: #33CCFF;
}
.rika{
background-color: #498816;
}
.shixiao{
background-color: #ccc;
}
.cardList {
|
8b40a4fc
刘淇
会员卡
|
130
131
|
padding: 20px 0 0 20px;
color: #fff;
|
555e2a0e
刘淇
续费会员卡
|
132
|
li {
|
8b40a4fc
刘淇
会员卡
|
133
134
135
|
line-height: 30px;
}
}
|
555e2a0e
刘淇
续费会员卡
|
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
|
.cardStatus{
position: absolute;
left: -22px;
top: 21px;
font-size: 12px;
-webkit-transform: rotate(30deg);
transform: rotate(-43deg);
width: 100px;
text-align: center;
color: #fff;
}
.niankaStatus{
background-color: #c17b12;
}
.yuekaStatus{
background-color: #3989a3;
}
.banniankaStatus{
background-color: #7972cb;
}
.jikaStatus{
background-color: #f19f67;
}
.rikaStatus{
background-color: #7edb33;
}
.shixiaocardStatus{
background-color: #a59d9d;
}
.renewBtn {
position: absolute;
top: 20px;
right: 20px;
/*border: 1px solid #ffbe00;*/
/*background: #ffbe00;*/
color: #fff;
padding: 2px 10px;
border-radius: 4px;
cursor: pointer;
}
|
8b40a4fc
刘淇
会员卡
|
177
178
|
</style>
|