vip-grade.vue
5.9 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
<template>
<div>
<div class="blk-header-wrap">
<div class="blk-header">
<div class="blk-header-left">
<i class="icon icon-back go-back-btn" @click="goBack"></i>
</div>
<div class="blk-header-main">
<span class="blk-header-title">会员等级</span>
</div>
</div>
</div>
<div class="basic-info block" v-if="vipGrade.vip3">
<p>
<span class="user-name">{{vipGrade.name}}</span>
<span class="vip-icon vip-3"></span>
</p>
<p class="grade-desc">
您已升级至最高的等级啦!
</p>
<p class="sum-cost">
年度累计金额<span> ¥{{vipGrade.costOfThisYear}}</span>
</p>
<div class="progresser">
<div class="outer"></div>
<div class="inner" :style="{width: vipGrade.percent + '%'}"></div>
<span class="beacon beacon-min">
白金卡会员
</span>
</div>
</div>
<div class="basic-info block" v-if="vipGrade.vip2">
<p>
<span class="user-name">{{vipGrade.name}}</span>
<span class="vip-icon vip-2"></span>
</p>
<p class="grade-desc">
还差<span class="cost-gap">¥{{vipGrade.costGap}}</span>就可以升级为白金会员!
<span class="sub-desc">(VIP金额累计需订单成功签收满15天并无退换货)</span>
</p>
<p class="sum-cost">
年度累计金额<span> ¥{{vipGrade.costOfThisYear}}</span>
</p>
<div class="progresser">
<div class="outer"></div>
<div class="inner" :style="{width: vipGrade.percent + '%'}"></div>
<span class="beacon beacon-min">
金卡会员
</span>
<span class="beacon beacon-max">白金卡会员</span>
<span class="cost-limit">¥5000.00</span>
</div>
</div>
<div class="basic-info block" v-if="vipGrade.vip1">
<p>
<span class="user-name">{{vipGrade.name}}</span>
<span class="vip-icon vip-1"></span>
</p>
<p class="grade-desc">
还差<span class="cost-gap">¥{{vipGrade.costGap}}</span>就可以升级为金卡会员!
<span class="sub-desc">(VIP金额累计需订单成功签收满15天并无退换货)</span>
</p>
<p class="sum-cost">
年度累计金额<span> ¥{{vipGrade.costOfThisYear}}</span>
</p>
<div class="progresser">
<div class="outer"></div>
<div class="inner" :style="{width: vipGrade.percent + '%'}"></div>
<span class="beacon beacon-min">
银卡会员
</span>
<span class="beacon beacon-max">金卡会员</span>
<span class="cost-limit">¥2000.00</span>
</div>
</div>
<div class="basic-info block" v-if="vipGrade.vip0">
<p>
<span class="user-name">{{vipGrade.name}}</span>
</p>
<p class="grade-desc">
还差<span class="cost-gap">¥{{vipGrade.costGap}}</span>就可以升级为银卡会员!
<span class="sub-desc">(VIP金额累计需订单成功签收满15天并无退换货)</span>
</p>
<p class="sum-cost">
年度累计金额<span> ¥{{vipGrade.costOfThisYear}}</span>
</p>
<div class="progresser">
<div class="outer"></div>
<div class="inner" :style="{width: vipGrade.percent + '%'}"></div>
<span class="beacon beacon-min">
普通
</span>
<span class="beacon beacon-max">银卡会员</span>
<span class="cost-limit">¥600.00</span>
</div>
</div>
<ul class="cost block">
<li>
年度累计金额:
<span>¥{{vipGrade.costOfThisYear}}</span>
</li>
<li>
历史消费总金额
<span>¥{{vipGrade.sumCost}}</span>
</li>
</ul>
<div class="privilege block" v-if="!vipGrade.vip0">
<h3 class="title">我享受的特权</h3>
<ul class="privilege-list">
<li v-for="pri in vipGrade.privilege" :key="pri.title">
<span :class="'icon ' + pri.pic"></span>
<p>
{{pri.title}}
<span>{{pri.description}}</span>
</p>
</li>
</ul>
</div>
<a class="all-privilege block tap-hightlight" href="/me/privilege">
查看全部VIP特权
<span class="icon icon-right"></span>
</a>
</div>
</template>
<script>
import $ from 'jquery';
import yoho from 'yoho';
export default {
data() {
return {
vipGrade: {}
};
},
methods: {
reload() {
$.ajax({
url: '/me/gradeData'
}).then(result => {
this.vipGrade = result || {};
});
setTimeout(function() {
if ($('.vip-grade-page').height() < $(window).height()) {
$('.vip-grade-page').height($(window).height());
}
}, 500);
},
goBack() {
yoho.goBack({}, function() {}, function() {});
}
},
ready() {
this.reload();
}
};
</script>