Showing
8 changed files
with
136 additions
and
26 deletions
@@ -93,7 +93,7 @@ router.get('/me/preferlist', require(cRoot + '/prefer').list); | @@ -93,7 +93,7 @@ router.get('/me/preferlist', require(cRoot + '/prefer').list); | ||
93 | 93 | ||
94 | // 会员等级 | 94 | // 会员等级 |
95 | router.get('/me/grade', auth, home.grade); | 95 | router.get('/me/grade', auth, home.grade); |
96 | -router.get('/me/gradeData', auth, home.gradeData); | 96 | +router.get('/me/gradeData', home.gradeData); |
97 | router.get('/me/privilege', auth, home.preferential); | 97 | router.get('/me/privilege', auth, home.preferential); |
98 | 98 | ||
99 | module.exports = router; | 99 | module.exports = router; |
@@ -31,6 +31,14 @@ const saveRecentGoodInCookies = (oldSkns, res, addSkns) => { | @@ -31,6 +31,14 @@ const saveRecentGoodInCookies = (oldSkns, res, addSkns) => { | ||
31 | }); | 31 | }); |
32 | }; | 32 | }; |
33 | 33 | ||
34 | +const vipLe = (key) => { | ||
35 | + return { | ||
36 | + 银卡: 1, | ||
37 | + 金卡: 2, | ||
38 | + 白金: 3, | ||
39 | + }[key]; | ||
40 | +}; | ||
41 | + | ||
34 | /** | 42 | /** |
35 | * 商品详情 | 43 | * 商品详情 |
36 | */ | 44 | */ |
@@ -51,8 +59,7 @@ const component = { | @@ -51,8 +59,7 @@ const component = { | ||
51 | product.formatPrice = product.formatSalesPrice !== '0' ? product.formatSalesPrice : product.formatMarketPrice; | 59 | product.formatPrice = product.formatSalesPrice !== '0' ? product.formatSalesPrice : product.formatMarketPrice; |
52 | product.isDiscount = product.marketPrice > product.salesPrice; | 60 | product.isDiscount = product.marketPrice > product.salesPrice; |
53 | 61 | ||
54 | - console.log(product); | ||
55 | - res.render('detail', { | 62 | + res.render('pdetail', { |
56 | module: 'product', | 63 | module: 'product', |
57 | page: 'detail', | 64 | page: 'detail', |
58 | pid: pid, | 65 | pid: pid, |
@@ -71,11 +78,24 @@ const component = { | @@ -71,11 +78,24 @@ const component = { | ||
71 | }; | 78 | }; |
72 | 79 | ||
73 | model.product(params).then(result => { | 80 | model.product(params).then(result => { |
81 | + let vipPrice = []; | ||
82 | + | ||
74 | // 最近浏览存储cookies | 83 | // 最近浏览存储cookies |
75 | if (_.has(result.data, 'product_skn') && !req.user.uid) { | 84 | if (_.has(result.data, 'product_skn') && !req.user.uid) { |
76 | saveRecentGoodInCookies(req.cookies._browseskn_h5, res, result.data.product_skn); | 85 | saveRecentGoodInCookies(req.cookies._browseskn_h5, res, result.data.product_skn); |
77 | } | 86 | } |
78 | 87 | ||
88 | + if (result.data.vip) { | ||
89 | + for (let val of result.data.vip) { | ||
90 | + vipPrice.push({ | ||
91 | + level: vipLe(val.caption), | ||
92 | + price: val.price | ||
93 | + }); | ||
94 | + } | ||
95 | + | ||
96 | + result.data.vipPrice = vipPrice; | ||
97 | + } | ||
98 | + | ||
79 | res.json(result); | 99 | res.json(result); |
80 | }).catch(next); | 100 | }).catch(next); |
81 | }, | 101 | }, |
@@ -63,6 +63,7 @@ const model = { | @@ -63,6 +63,7 @@ const model = { | ||
63 | }, params), { | 63 | }, params), { |
64 | code: 200 | 64 | code: 200 |
65 | }).then(result => { | 65 | }).then(result => { |
66 | + | ||
66 | if (result.data) { | 67 | if (result.data) { |
67 | let storage = 0; // result.storage 的 数值 不可靠,循环累加 库存 | 68 | let storage = 0; // result.storage 的 数值 不可靠,循环累加 库存 |
68 | const goodsList = result.data.goods_list; | 69 | const goodsList = result.data.goods_list; |
@@ -30,37 +30,63 @@ | @@ -30,37 +30,63 @@ | ||
30 | max-width: 240px; | 30 | max-width: 240px; |
31 | text-overflow: ellipsis; | 31 | text-overflow: ellipsis; |
32 | white-space: nowrap; | 32 | white-space: nowrap; |
33 | - font-size: 25px; | 33 | + font-size: 40px; |
34 | margin-right: 0.5rem; | 34 | margin-right: 0.5rem; |
35 | } | 35 | } |
36 | 36 | ||
37 | .vip-icon { | 37 | .vip-icon { |
38 | + margin-top: 6px; | ||
38 | float: left; | 39 | float: left; |
39 | - width: 72px; | ||
40 | - height: 32px; | ||
41 | - line-height: 36px; | 40 | + width: 110px; |
41 | + height: 40px; | ||
42 | + line-height: 40px; | ||
43 | + } | ||
44 | + | ||
45 | + .vip-3 { | ||
46 | + background: resolve("me/vip-3.png"); | ||
47 | + } | ||
48 | + | ||
49 | + .vip-2 { | ||
50 | + background: resolve("me/vip-2.png"); | ||
51 | + } | ||
52 | + | ||
53 | + .vip-1 { | ||
54 | + background: resolve("me/vip-1.png"); | ||
55 | + } | ||
56 | + | ||
57 | + .vip-3, | ||
58 | + .vip-2, | ||
59 | + .vip-1 { | ||
60 | + background-size: 100%; | ||
42 | } | 61 | } |
43 | 62 | ||
44 | .grade-desc { | 63 | .grade-desc { |
45 | margin-top: 20px; | 64 | margin-top: 20px; |
46 | - font-size: 22px; | 65 | + font-size: 26px; |
47 | color: #b0b0b0; | 66 | color: #b0b0b0; |
67 | + | ||
68 | + .sub-desc { | ||
69 | + margin-top: 10px; | ||
70 | + } | ||
48 | } | 71 | } |
49 | 72 | ||
50 | .sum-cost { | 73 | .sum-cost { |
51 | - font-size: 22px; | 74 | + margin-top: 10px; |
75 | + font-size: 26px; | ||
52 | 76 | ||
53 | > span { | 77 | > span { |
54 | font-style: italic; | 78 | font-style: italic; |
55 | - font-size: 28px; | ||
56 | - color: #d1021c; | 79 | + font-size: 34px; |
80 | + color: #000; | ||
81 | + font-weight: bold; | ||
57 | } | 82 | } |
58 | } | 83 | } |
59 | 84 | ||
60 | .progresser { | 85 | .progresser { |
61 | position: relative; | 86 | position: relative; |
62 | width: 100%; | 87 | width: 100%; |
63 | - padding: 20px 0; | 88 | + padding: 15px 0; |
89 | + margin-bottom: 30px; | ||
64 | } | 90 | } |
65 | 91 | ||
66 | .outer { | 92 | .outer { |
@@ -71,16 +97,17 @@ | @@ -71,16 +97,17 @@ | ||
71 | 97 | ||
72 | .inner { | 98 | .inner { |
73 | position: absolute; | 99 | position: absolute; |
74 | - top: 20px; | 100 | + top: 15px; |
75 | height: 20px; | 101 | height: 20px; |
76 | - background: #d1021c; | 102 | + background: #000; |
77 | border-radius: 10px; | 103 | border-radius: 10px; |
78 | } | 104 | } |
79 | 105 | ||
80 | .beacon { | 106 | .beacon { |
81 | position: absolute; | 107 | position: absolute; |
82 | - margin-top: 5px; | 108 | + margin-top: 15px; |
83 | font-style: italic; | 109 | font-style: italic; |
110 | + margin-bottom: 30px; | ||
84 | } | 111 | } |
85 | 112 | ||
86 | .beacon-max { | 113 | .beacon-max { |
@@ -89,7 +116,7 @@ | @@ -89,7 +116,7 @@ | ||
89 | 116 | ||
90 | .cost-limit { | 117 | .cost-limit { |
91 | position: absolute; | 118 | position: absolute; |
92 | - top: -5px; | 119 | + top: -30px; |
93 | right: 0; | 120 | right: 0; |
94 | color: #b0b0b0; | 121 | color: #b0b0b0; |
95 | } | 122 | } |
@@ -111,7 +138,7 @@ | @@ -111,7 +138,7 @@ | ||
111 | .cost li { | 138 | .cost li { |
112 | height: 90px; | 139 | height: 90px; |
113 | line-height: 90px; | 140 | line-height: 90px; |
114 | - font-size: 30px; | 141 | + font-size: 34px; |
115 | padding-right: 0; | 142 | padding-right: 0; |
116 | 143 | ||
117 | &:first-child { | 144 | &:first-child { |
@@ -121,6 +148,7 @@ | @@ -121,6 +148,7 @@ | ||
121 | > span { | 148 | > span { |
122 | float: right; | 149 | float: right; |
123 | padding: 0 30px 0 0; | 150 | padding: 0 30px 0 0; |
151 | + font-size: 28px; | ||
124 | } | 152 | } |
125 | } | 153 | } |
126 | 154 | ||
@@ -169,12 +197,20 @@ | @@ -169,12 +197,20 @@ | ||
169 | } | 197 | } |
170 | 198 | ||
171 | li { | 199 | li { |
172 | - padding: 25px 0; | 200 | + padding-top: 25px; |
173 | } | 201 | } |
174 | 202 | ||
175 | p { | 203 | p { |
176 | font-size: 28px; | 204 | font-size: 28px; |
177 | margin-left: 100px; | 205 | margin-left: 100px; |
206 | + padding-bottom: 25px; | ||
207 | + border-bottom: 1px solid #e0e0e0; | ||
208 | + } | ||
209 | + | ||
210 | + li:last-child { | ||
211 | + p { | ||
212 | + border-bottom: none; | ||
213 | + } | ||
178 | } | 214 | } |
179 | 215 | ||
180 | span { | 216 | span { |
@@ -6,8 +6,8 @@ | @@ -6,8 +6,8 @@ | ||
6 | <a class="user-info auth" id="user-info" href='/me/mydetails'> | 6 | <a class="user-info auth" id="user-info" href='/me/mydetails'> |
7 | <img class="user-avatar" :src="headIco" @error="setEmptyimg"> | 7 | <img class="user-avatar" :src="headIco" @error="setEmptyimg"> |
8 | </a> | 8 | </a> |
9 | - <a class="vip-level level-{{data.vipLevel}}" v-if="data.vipLevel" href='/me/grade'></a> | ||
10 | <span class="username">{{ data.nickName }}</span> | 9 | <span class="username">{{ data.nickName }}</span> |
10 | + <a class="vip-level level-{{data.vipLevel}}" v-if="data.vipLevel" href='/me/grade'></a> | ||
11 | </div> | 11 | </div> |
12 | <div class="my-order"> | 12 | <div class="my-order"> |
13 | <a class="order-title auth" href="/me/order?type=1"> | 13 | <a class="order-title auth" href="/me/order?type=1"> |
@@ -137,7 +137,6 @@ | @@ -137,7 +137,6 @@ | ||
137 | } else { | 137 | } else { |
138 | getRecordsNum(this); | 138 | getRecordsNum(this); |
139 | } | 139 | } |
140 | - | ||
141 | } else { | 140 | } else { |
142 | this.data = { | 141 | this.data = { |
143 | nickName: '登录/注册' | 142 | nickName: '登录/注册' |
@@ -281,11 +280,11 @@ | @@ -281,11 +280,11 @@ | ||
281 | 280 | ||
282 | .vip-level { | 281 | .vip-level { |
283 | display: block; | 282 | display: block; |
284 | - position: relative; | ||
285 | - top: 75px; | ||
286 | width: 100px; | 283 | width: 100px; |
287 | - height: 34px; | ||
288 | - left: 415px; | 284 | + height: 36px; |
285 | + position: relative; | ||
286 | + top: 160px; | ||
287 | + left: 325px; | ||
289 | } | 288 | } |
290 | 289 | ||
291 | .level-1, | 290 | .level-1, |
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | <div class="basic-info block" v-if="vipGrade.vip3"> | 2 | <div class="basic-info block" v-if="vipGrade.vip3"> |
3 | <p> | 3 | <p> |
4 | <span class="user-name">{{vipGrade.name}}</span> | 4 | <span class="user-name">{{vipGrade.name}}</span> |
5 | + <span class="vip-icon vip-3"></span> | ||
5 | </p> | 6 | </p> |
6 | <p class="grade-desc"> | 7 | <p class="grade-desc"> |
7 | 您已升级至最高的等级啦! | 8 | 您已升级至最高的等级啦! |
@@ -20,6 +21,7 @@ | @@ -20,6 +21,7 @@ | ||
20 | <div class="basic-info block" v-if="vipGrade.vip2"> | 21 | <div class="basic-info block" v-if="vipGrade.vip2"> |
21 | <p> | 22 | <p> |
22 | <span class="user-name">{{vipGrade.name}}</span> | 23 | <span class="user-name">{{vipGrade.name}}</span> |
24 | + <span class="vip-icon vip-2"></span> | ||
23 | </p> | 25 | </p> |
24 | <p class="grade-desc"> | 26 | <p class="grade-desc"> |
25 | 还差<span class="cost-gap">¥{{vipGrade.costGap}}</span>就可以升级为白金会员! | 27 | 还差<span class="cost-gap">¥{{vipGrade.costGap}}</span>就可以升级为白金会员! |
@@ -41,6 +43,7 @@ | @@ -41,6 +43,7 @@ | ||
41 | <div class="basic-info block" v-if="vipGrade.vip1"> | 43 | <div class="basic-info block" v-if="vipGrade.vip1"> |
42 | <p> | 44 | <p> |
43 | <span class="user-name">{{vipGrade.name}}</span> | 45 | <span class="user-name">{{vipGrade.name}}</span> |
46 | + <span class="vip-icon vip-1"></span> | ||
44 | </p> | 47 | </p> |
45 | <p class="grade-desc"> | 48 | <p class="grade-desc"> |
46 | 还差<span class="cost-gap">¥{{vipGrade.costGap}}</span>就可以升级为金卡会员! | 49 | 还差<span class="cost-gap">¥{{vipGrade.costGap}}</span>就可以升级为金卡会员! |
@@ -93,7 +96,7 @@ | @@ -93,7 +96,7 @@ | ||
93 | </ul> | 96 | </ul> |
94 | 97 | ||
95 | <div class="privilege block" v-if="!vipGrade.vip0"> | 98 | <div class="privilege block" v-if="!vipGrade.vip0"> |
96 | - <h3 class="title">当前可享受的特权</h3> | 99 | + <h3 class="title">我享受的特权</h3> |
97 | <ul class="privilege-list"> | 100 | <ul class="privilege-list"> |
98 | <li v-for="pri in vipGrade.privilege"> | 101 | <li v-for="pri in vipGrade.privilege"> |
99 | <span class="icon {{pri.pic}}"></span> | 102 | <span class="icon {{pri.pic}}"></span> |
@@ -11,6 +11,12 @@ | @@ -11,6 +11,12 @@ | ||
11 | :class="{price: true, highlight: entity.market_price > entity.sales_price}"> | 11 | :class="{price: true, highlight: entity.market_price > entity.sales_price}"> |
12 | {{entity.format_sales_price !== '0' ? entity.format_sales_price : entity.format_market_price}} | 12 | {{entity.format_sales_price !== '0' ? entity.format_sales_price : entity.format_market_price}} |
13 | </i> | 13 | </i> |
14 | + <ul class="vip-level" v-if="entity.vipPrice"> | ||
15 | + <li class="icons-item" v-for="vip in entity.vipPrice"> | ||
16 | + <span class="vip-img vip-{{vip.level}}"></span> | ||
17 | + <span class="vip-price">{{vip.price}}</span> | ||
18 | + </li> | ||
19 | + </ul> | ||
14 | </div> | 20 | </div> |
15 | </show-box> | 21 | </show-box> |
16 | 22 | ||
@@ -261,6 +267,7 @@ | @@ -261,6 +267,7 @@ | ||
261 | 267 | ||
262 | ul.service { | 268 | ul.service { |
263 | font-size: 0; | 269 | font-size: 0; |
270 | + | ||
264 | li { | 271 | li { |
265 | font-size: 24px; | 272 | font-size: 24px; |
266 | width: 195px; | 273 | width: 195px; |
@@ -350,6 +357,50 @@ | @@ -350,6 +357,50 @@ | ||
350 | color: #d0021b; | 357 | color: #d0021b; |
351 | } | 358 | } |
352 | } | 359 | } |
360 | + | ||
361 | + .vip-level { | ||
362 | + padding: 0 40px; | ||
363 | + min-height: 2.2rem; | ||
364 | + background-color: #fff; | ||
365 | + | ||
366 | + .icons-item { | ||
367 | + float: left; | ||
368 | + margin: 0; | ||
369 | + width: 33.3%; | ||
370 | + height: 90px; | ||
371 | + font-size: 22px; | ||
372 | + line-height: 90px; | ||
373 | + | ||
374 | + span { | ||
375 | + display: inline-block; | ||
376 | + padding-left: 8px; | ||
377 | + vertical-align: middle; | ||
378 | + } | ||
379 | + } | ||
380 | + | ||
381 | + .vip-img { | ||
382 | + width: 90px; | ||
383 | + height: 33px; | ||
384 | + } | ||
385 | + | ||
386 | + .vip-3 { | ||
387 | + background: resolve("me/vip-3.png"); | ||
388 | + } | ||
389 | + | ||
390 | + .vip-2 { | ||
391 | + background: resolve("me/vip-2.png"); | ||
392 | + } | ||
393 | + | ||
394 | + .vip-1 { | ||
395 | + background: resolve("me/vip-1.png"); | ||
396 | + } | ||
397 | + | ||
398 | + .vip-3, | ||
399 | + .vip-2, | ||
400 | + .vip-1 { | ||
401 | + background-size: 100%; | ||
402 | + } | ||
403 | + } | ||
353 | } | 404 | } |
354 | 405 | ||
355 | .control-box { | 406 | .control-box { |
@@ -621,6 +672,7 @@ | @@ -621,6 +672,7 @@ | ||
621 | // 是否支持7天无理由退换货 | 672 | // 是否支持7天无理由退换货 |
622 | $.get(`/product/refundExchange/${data.product_skn}`).then(sd => { | 673 | $.get(`/product/refundExchange/${data.product_skn}`).then(sd => { |
623 | let support = sd.data[data.product_skn] === "N" ? "Y" : "N"; | 674 | let support = sd.data[data.product_skn] === "N" ? "Y" : "N"; |
675 | + | ||
624 | this.$set('intro.supportRefundExchange', support); | 676 | this.$set('intro.supportRefundExchange', support); |
625 | }); | 677 | }); |
626 | 678 |
-
Please register or login to post a comment