Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
22 changed files
with
368 additions
and
251 deletions
@@ -51,17 +51,17 @@ class CartData | @@ -51,17 +51,17 @@ class CartData | ||
51 | } | 51 | } |
52 | 52 | ||
53 | /** | 53 | /** |
54 | - * 修改购物车商品数据 | 54 | + * 移入收藏夹 |
55 | * | 55 | * |
56 | * @param int $uid 用户ID | 56 | * @param int $uid 用户ID |
57 | - * @param string $swapData 商品数据 | 57 | + * @param string $sku 商品sku列表 |
58 | * @return array 接口返回的数据 | 58 | * @return array 接口返回的数据 |
59 | */ | 59 | */ |
60 | - public static function modifyCartProduct($uid, $swapData) | 60 | + public static function addToFav($uid, $sku) |
61 | { | 61 | { |
62 | $param = Yohobuy::param(); | 62 | $param = Yohobuy::param(); |
63 | - $param['method'] = 'app.Shopping.swap'; | ||
64 | - $param['swap_data'] = $swapData; | 63 | + $param['method'] = 'app.Shopping.addfavorite'; |
64 | + $param['product_sku_list'] = $sku; | ||
65 | $param['uid'] = $uid; | 65 | $param['uid'] = $uid; |
66 | $param['client_secret'] = Sign::getSign($param); | 66 | $param['client_secret'] = Sign::getSign($param); |
67 | 67 | ||
@@ -69,17 +69,35 @@ class CartData | @@ -69,17 +69,35 @@ class CartData | ||
69 | } | 69 | } |
70 | 70 | ||
71 | /** | 71 | /** |
72 | - * 移入收藏夹 | 72 | + * 获取购物车商品数据 |
73 | * | 73 | * |
74 | * @param int $uid 用户ID | 74 | * @param int $uid 用户ID |
75 | - * @param string $sku 商品sku列表 | 75 | + * @param int $skn 商品skn |
76 | * @return array 接口返回的数据 | 76 | * @return array 接口返回的数据 |
77 | */ | 77 | */ |
78 | - public static function addToFav($uid, $sku) | 78 | + public static function cartProductData($uid, $skn) |
79 | { | 79 | { |
80 | $param = Yohobuy::param(); | 80 | $param = Yohobuy::param(); |
81 | - $param['method'] = 'app.Shopping.addfavorite'; | ||
82 | - $param['product_sku_list'] = $sku; | 81 | + $param['method'] = 'app.product.data'; |
82 | + $param['product_skn'] = $skn; | ||
83 | + $param['uid'] = $uid; | ||
84 | + $param['client_secret'] = Sign::getSign($param); | ||
85 | + | ||
86 | + return Yohobuy::get(Yohobuy::API_URL, $param); | ||
87 | + } | ||
88 | + | ||
89 | + /** | ||
90 | + * 修改购物车商品数据 | ||
91 | + * | ||
92 | + * @param int $uid 用户ID | ||
93 | + * @param string $swapData 商品数据 | ||
94 | + * @return array 接口返回的数据 | ||
95 | + */ | ||
96 | + public static function modifyCartProduct($uid, $swapData) | ||
97 | + { | ||
98 | + $param = Yohobuy::param(); | ||
99 | + $param['method'] = 'app.Shopping.swap'; | ||
100 | + $param['swap_data'] = $swapData; | ||
83 | $param['uid'] = $uid; | 101 | $param['uid'] = $uid; |
84 | $param['client_secret'] = Sign::getSign($param); | 102 | $param['client_secret'] = Sign::getSign($param); |
85 | 103 |
@@ -9,6 +9,8 @@ var $userAvatar = $('.user-avatar'), | @@ -9,6 +9,8 @@ var $userAvatar = $('.user-avatar'), | ||
9 | var myImage = new Image(); | 9 | var myImage = new Image(); |
10 | 10 | ||
11 | require('../product/recommend-for-you.js'); | 11 | require('../product/recommend-for-you.js'); |
12 | +require('../product/suspend-cart.js'); | ||
13 | + | ||
12 | myImage.src = $userAvatar.attr('src'); | 14 | myImage.src = $userAvatar.attr('src'); |
13 | myImage.onerror = function() { | 15 | myImage.onerror = function() { |
14 | $userAvatar.attr('src', 'http://static.dev.yohobuy.com/img/me/index/user-avatar.png'); | 16 | $userAvatar.attr('src', 'http://static.dev.yohobuy.com/img/me/index/user-avatar.png'); |
@@ -12,6 +12,7 @@ var likeHammer = new Hammer(document.getElementById('likeBtn')); | @@ -12,6 +12,7 @@ var likeHammer = new Hammer(document.getElementById('likeBtn')); | ||
12 | likeHammer.on('tap', function(e) { | 12 | likeHammer.on('tap', function(e) { |
13 | var productId = $('#productId').val(), | 13 | var productId = $('#productId').val(), |
14 | opt; | 14 | opt; |
15 | + | ||
15 | var $this = $(this); | 16 | var $this = $(this); |
16 | 17 | ||
17 | if ($this.hasClass('liked')) { | 18 | if ($this.hasClass('liked')) { |
@@ -17,7 +17,7 @@ $.get('/home/preference').then(function(html) { | @@ -17,7 +17,7 @@ $.get('/home/preference').then(function(html) { | ||
17 | recommendSwiper = new Swiper('#swiper-recommend', { | 17 | recommendSwiper = new Swiper('#swiper-recommend', { |
18 | slidesPerView: 'auto', | 18 | slidesPerView: 'auto', |
19 | grabCursor: true, | 19 | grabCursor: true, |
20 | - slideElement: 'li', | 20 | + slideElement: 'a', |
21 | lazyLoading: true, | 21 | lazyLoading: true, |
22 | watchSlidesVisibility: true | 22 | watchSlidesVisibility: true |
23 | }); | 23 | }); |
@@ -28,7 +28,12 @@ | @@ -28,7 +28,12 @@ | ||
28 | } | 28 | } |
29 | 29 | ||
30 | .username { | 30 | .username { |
31 | + float: left; | ||
31 | padding: 0 pxToRem(16px); | 32 | padding: 0 pxToRem(16px); |
33 | + text-overflow: ellipsis; | ||
34 | + overflow: hidden; | ||
35 | + white-space: nowrap; | ||
36 | + max-width: pxToRem(290px); | ||
32 | } | 37 | } |
33 | 38 | ||
34 | .vip-icon { | 39 | .vip-icon { |
1 | .goods-comments-page { | 1 | .goods-comments-page { |
2 | .goods-comments { | 2 | .goods-comments { |
3 | .comment-item { | 3 | .comment-item { |
4 | - border: 1px solid $borderC; | 4 | + border-bottom: 1px solid $borderC; |
5 | padding: 0 pxToRem(28px); | 5 | padding: 0 pxToRem(28px); |
6 | .user-name { | 6 | .user-name { |
7 | font-size: pxToRem(24px); | 7 | font-size: pxToRem(24px); |
@@ -44,7 +44,8 @@ | @@ -44,7 +44,8 @@ | ||
44 | height: pxToRem(120px); | 44 | height: pxToRem(120px); |
45 | background-color: #ffffff; | 45 | background-color: #ffffff; |
46 | i, | 46 | i, |
47 | - span { | 47 | + span, |
48 | + a { | ||
48 | line-height: pxToRem(120px); | 49 | line-height: pxToRem(120px); |
49 | font-size: pxToRem(28px); | 50 | font-size: pxToRem(28px); |
50 | color: $mainFontC; | 51 | color: $mainFontC; |
@@ -30,50 +30,52 @@ $basicBtnC:#eb0313; | @@ -30,50 +30,52 @@ $basicBtnC:#eb0313; | ||
30 | left: pxToRem(30px); | 30 | left: pxToRem(30px); |
31 | right: auto; | 31 | right: auto; |
32 | } | 32 | } |
33 | -.tag-container{ | 33 | + |
34 | +.tag-container { | ||
34 | position: absolute; | 35 | position: absolute; |
35 | left: pxToRem(108px); | 36 | left: pxToRem(108px); |
36 | top: pxToRem(40px); | 37 | top: pxToRem(40px); |
37 | height: pxToRem(35px); | 38 | height: pxToRem(35px); |
38 | - // width: pxToRem(70px); | ||
39 | - color: #fff; | ||
40 | - font-size: pxToRem(20px); | ||
41 | - line-height: pxToRem(35px); | ||
42 | - z-index: 2; | ||
43 | - .good-tag{ | ||
44 | - display: inline-block; | ||
45 | - box-sizing: border-box; | ||
46 | - margin-left: .5px; | ||
47 | - font-size: pxToRem(23px); | ||
48 | - text-align: center; | ||
49 | - line-height: pxToRem(35px); | ||
50 | - padding:0 8px; | ||
51 | - } | ||
52 | - .new-tag { | ||
53 | - background-color: #78dc7e; | ||
54 | - color: #fff; | ||
55 | - } | ||
56 | - .renew-tag { | ||
57 | - background-color: #78dc7e; | ||
58 | - color: #fff; | ||
59 | - } | ||
60 | - .sale-tag { | ||
61 | - background-color: #ff575c; | ||
62 | - color: #fff; | ||
63 | - } | ||
64 | - .new-festival-tag { | ||
65 | - background-color: #000; | ||
66 | - color: #fff; | ||
67 | - } | ||
68 | - .limit-tag { | ||
69 | - border: 1px solid #000; | ||
70 | - color: #000; | ||
71 | - } | ||
72 | - .soonSoldOut-tag{ | ||
73 | - background-color:#ffac5b; | ||
74 | - color:#fff; | ||
75 | - } | 39 | + // width: pxToRem(70px); |
40 | + color: #fff; | ||
41 | + font-size: pxToRem(20px); | ||
42 | + line-height: pxToRem(35px); | ||
43 | + z-index: 2; | ||
44 | + .good-tag { | ||
45 | + display: inline-block; | ||
46 | + box-sizing: border-box; | ||
47 | + margin-left: .5px; | ||
48 | + font-size: pxToRem(23px); | ||
49 | + text-align: center; | ||
50 | + line-height: pxToRem(35px); | ||
51 | + padding: 0 8px; | ||
52 | + } | ||
53 | + .new-tag { | ||
54 | + background-color: #78dc7e; | ||
55 | + color: #fff; | ||
56 | + } | ||
57 | + .renew-tag { | ||
58 | + background-color: #78dc7e; | ||
59 | + color: #fff; | ||
60 | + } | ||
61 | + .sale-tag { | ||
62 | + background-color: #ff575c; | ||
63 | + color: #fff; | ||
64 | + } | ||
65 | + .new-festival-tag { | ||
66 | + background-color: #000; | ||
67 | + color: #fff; | ||
68 | + } | ||
69 | + .limit-tag { | ||
70 | + border: 1px solid #000; | ||
71 | + color: #000; | ||
72 | + } | ||
73 | + .soonSoldOut-tag { | ||
74 | + background-color: #ffac5b; | ||
75 | + color: #fff; | ||
76 | + } | ||
76 | } | 77 | } |
78 | + | ||
77 | .good-detail-page { | 79 | .good-detail-page { |
78 | overflow: hidden; | 80 | overflow: hidden; |
79 | background-color: #f0f0f0; | 81 | background-color: #f0f0f0; |
@@ -104,16 +106,16 @@ $basicBtnC:#eb0313; | @@ -104,16 +106,16 @@ $basicBtnC:#eb0313; | ||
104 | width: 100%; | 106 | width: 100%; |
105 | // .row { | 107 | // .row { |
106 | // display: table-row; | 108 | // display: table-row; |
107 | - .column { | ||
108 | - box-sizing:border-box; | ||
109 | - display: table-cell; | ||
110 | - padding: pxToRem(16px) pxToRem(12px); | ||
111 | - width: 50%; | ||
112 | - border: 1px solid #fff; | ||
113 | - font-size: pxToRem(24px); | ||
114 | - background-color: $tableCellC; | ||
115 | - float:left; | ||
116 | - } | 109 | + .column { |
110 | + box-sizing: border-box; | ||
111 | + display: table-cell; | ||
112 | + padding: pxToRem(16px) pxToRem(12px); | ||
113 | + width: 50%; | ||
114 | + border: 1px solid #fff; | ||
115 | + font-size: pxToRem(24px); | ||
116 | + background-color: $tableCellC; | ||
117 | + float: left; | ||
118 | + } | ||
117 | // } | 119 | // } |
118 | } | 120 | } |
119 | } | 121 | } |
@@ -136,15 +138,15 @@ $basicBtnC:#eb0313; | @@ -136,15 +138,15 @@ $basicBtnC:#eb0313; | ||
136 | position: absolute; | 138 | position: absolute; |
137 | z-index: 2; | 139 | z-index: 2; |
138 | bottom: pxToRem(40px); | 140 | bottom: pxToRem(40px); |
139 | - .pagination-inner{ | ||
140 | - span{ | 141 | + .pagination-inner { |
142 | + span { | ||
141 | background-color: #b0b0b0; | 143 | background-color: #b0b0b0; |
142 | } | 144 | } |
143 | .swiper-pagination-bullet { | 145 | .swiper-pagination-bullet { |
144 | margin-right: 2px; | 146 | margin-right: 2px; |
145 | } | 147 | } |
146 | .swiper-pagination-bullet-active { | 148 | .swiper-pagination-bullet-active { |
147 | - background-color: #000 ; | 149 | + background-color: #000; |
148 | } | 150 | } |
149 | } | 151 | } |
150 | } | 152 | } |
@@ -227,8 +229,45 @@ $basicBtnC:#eb0313; | @@ -227,8 +229,45 @@ $basicBtnC:#eb0313; | ||
227 | vertical-align: middle; | 229 | vertical-align: middle; |
228 | } | 230 | } |
229 | } | 231 | } |
232 | + .vip-level { | ||
233 | + box-sizing: box-border; | ||
234 | + padding-left: pxToRem(28px); | ||
235 | + padding-right: pxToRem(28px); | ||
236 | + min-height: pxToRem(88px); | ||
237 | + background-color: #fff; | ||
238 | + .icons-item { | ||
239 | + float: left; | ||
240 | + width: 33.3%; | ||
241 | + height: pxToRem(88px); | ||
242 | + span { | ||
243 | + display: inline-block; | ||
244 | + line-height: pxToRem(88px); | ||
245 | + } | ||
246 | + .vip-img { | ||
247 | + padding-right: pxToRem(22px); | ||
248 | + .img { | ||
249 | + width: pxToRem(53px); | ||
250 | + height: pxToRem(32px); | ||
251 | + } | ||
252 | + &:nth-child(3n-3) .img { | ||
253 | + background: image-url('product/silver.png') no-repeat; | ||
254 | + } | ||
255 | + &:nth-child(3n-2) .img { | ||
256 | + background: image-url('product/golden.png') no-repeat; | ||
257 | + } | ||
258 | + &:nth-child(3n-1) .img { | ||
259 | + background: image-url('product/platinum.png') no-repeat; | ||
260 | + } | ||
261 | + } | ||
262 | + &:first-child { | ||
263 | + float: left; | ||
264 | + } | ||
265 | + &:last-child { | ||
266 | + float: right; | ||
267 | + } | ||
268 | + } | ||
269 | + } | ||
230 | .vipLevel { | 270 | .vipLevel { |
231 | - width: 100%; | ||
232 | box-sizing: border-box; | 271 | box-sizing: border-box; |
233 | background-color: #fff; | 272 | background-color: #fff; |
234 | display: table; | 273 | display: table; |
@@ -242,25 +281,24 @@ $basicBtnC:#eb0313; | @@ -242,25 +281,24 @@ $basicBtnC:#eb0313; | ||
242 | display: table-cell; | 281 | display: table-cell; |
243 | vertical-align: middle; | 282 | vertical-align: middle; |
244 | } | 283 | } |
245 | - .vip-img{ | 284 | + .vip-img { |
246 | padding-right: pxToRem(22px); | 285 | padding-right: pxToRem(22px); |
247 | - .img{ | ||
248 | - width: pxToRem(52px); | ||
249 | - height: pxToRem(32px); | 286 | + .img { |
287 | + width: pxToRem(53px); | ||
288 | + height: pxToRem(33px); | ||
250 | } | 289 | } |
251 | - &:nth-child(3n-3) .img{ | 290 | + &:nth-child(3n-3) .img { |
252 | background: image-url('product/silver.png') no-repeat; | 291 | background: image-url('product/silver.png') no-repeat; |
253 | } | 292 | } |
254 | - &:nth-child(3n-2) .img{ | 293 | + &:nth-child(3n-2) .img { |
255 | background: image-url('product/golden.png') no-repeat; | 294 | background: image-url('product/golden.png') no-repeat; |
256 | } | 295 | } |
257 | - &:nth-child(3n-1) .img{ | 296 | + &:nth-child(3n-1) .img { |
258 | background: image-url('product/platinum.png') no-repeat; | 297 | background: image-url('product/platinum.png') no-repeat; |
259 | } | 298 | } |
260 | - | ||
261 | } | 299 | } |
262 | .vip-price { | 300 | .vip-price { |
263 | - padding-right: pxToRem(55px); | 301 | + padding-right: pxToRem(52px); |
264 | } | 302 | } |
265 | .vip-price:last-child { | 303 | .vip-price:last-child { |
266 | padding-right: 0; | 304 | padding-right: 0; |
@@ -295,7 +333,6 @@ $basicBtnC:#eb0313; | @@ -295,7 +333,6 @@ $basicBtnC:#eb0313; | ||
295 | .goodsDiscount { | 333 | .goodsDiscount { |
296 | text-indent: pxToRem(-14px); | 334 | text-indent: pxToRem(-14px); |
297 | } | 335 | } |
298 | - | ||
299 | .enter-store { | 336 | .enter-store { |
300 | min-height: pxToRem(100px); | 337 | min-height: pxToRem(100px); |
301 | display: table; | 338 | display: table; |
@@ -327,7 +364,6 @@ $basicBtnC:#eb0313; | @@ -327,7 +364,6 @@ $basicBtnC:#eb0313; | ||
327 | } | 364 | } |
328 | } | 365 | } |
329 | } | 366 | } |
330 | - | ||
331 | //底部固定栏 | 367 | //底部固定栏 |
332 | .cart-bar { | 368 | .cart-bar { |
333 | position: relative; | 369 | position: relative; |
@@ -350,10 +386,10 @@ $basicBtnC:#eb0313; | @@ -350,10 +386,10 @@ $basicBtnC:#eb0313; | ||
350 | font-size: pxToRem(34px); | 386 | font-size: pxToRem(34px); |
351 | color: #ccc | 387 | color: #ccc |
352 | } | 388 | } |
353 | - &.favorite.liked{ | ||
354 | - color:$basicBtnC;; | 389 | + &.favorite.liked { |
390 | + color: $basicBtnC; | ||
391 | + ; | ||
355 | } | 392 | } |
356 | - | ||
357 | &.addto-cart, | 393 | &.addto-cart, |
358 | &.sold-out { | 394 | &.sold-out { |
359 | height: pxToRem(80px); | 395 | height: pxToRem(80px); |
@@ -382,10 +418,10 @@ $basicBtnC:#eb0313; | @@ -382,10 +418,10 @@ $basicBtnC:#eb0313; | ||
382 | font-size: pxToRem(24px); | 418 | font-size: pxToRem(24px); |
383 | } | 419 | } |
384 | } | 420 | } |
385 | - | ||
386 | - .recommend-for-you{ | 421 | + .recommend-for-you { |
387 | margin-bottom: pxToRem(120px); | 422 | margin-bottom: pxToRem(120px); |
388 | } | 423 | } |
389 | } | 424 | } |
425 | + | ||
390 | @import "comments-consults"; | 426 | @import "comments-consults"; |
391 | -@import "product-description"; | ||
427 | +@import "product-description"; |
1 | .good-detail-page{ | 1 | .good-detail-page{ |
2 | .goods-desc { | 2 | .goods-desc { |
3 | .service { | 3 | .service { |
4 | - width: pxToRem(489px); | 4 | + width: pxToRem(494px); |
5 | height: pxToRem(28px); | 5 | height: pxToRem(28px); |
6 | margin-top: pxToRem(22px); | 6 | margin-top: pxToRem(22px); |
7 | + margin-left: pxToRem(40px); | ||
8 | + background: image-url('product/service.png') no-repeat; | ||
9 | + background-size: cover; | ||
7 | } | 10 | } |
8 | .detail{ | 11 | .detail{ |
9 | background-color: $tableCellC; | 12 | background-color: $tableCellC; |
@@ -58,7 +58,7 @@ | @@ -58,7 +58,7 @@ | ||
58 | .old-price { | 58 | .old-price { |
59 | position: absolute; | 59 | position: absolute; |
60 | top: 0; | 60 | top: 0; |
61 | - right: pxToRem(-6px); | 61 | + right: pxToRem(-4px); |
62 | color: #b0b0b0; | 62 | color: #b0b0b0; |
63 | text-decoration: line-through; | 63 | text-decoration: line-through; |
64 | } | 64 | } |
@@ -101,8 +101,9 @@ | @@ -101,8 +101,9 @@ | ||
101 | </a> | 101 | </a> |
102 | </div> | 102 | </div> |
103 | 103 | ||
104 | - {{#isLogin}} | ||
105 | {{> product/recommend-for-you}} | 104 | {{> product/recommend-for-you}} |
106 | - {{/isLogin}} | 105 | + {{> product/suspend-cart}} |
107 | </div> | 106 | </div> |
107 | + | ||
108 | +{{> layout/download_app}} | ||
108 | {{> layout/footer}} | 109 | {{> layout/footer}} |
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | <div class="goto-consult"> | 3 | <div class="goto-consult"> |
4 | <i class="iconfont consult-logo"></i> | 4 | <i class="iconfont consult-logo"></i> |
5 | <span>我要咨询</span> | 5 | <span>我要咨询</span> |
6 | - <i class="iconfont enter-consult-page"></i> | 6 | + <a href="/product/detail/consultform" class="iconfont enter-consult-page"></a> |
7 | </div> | 7 | </div> |
8 | {{# consults}} | 8 | {{# consults}} |
9 | <div class="goods-consults"> | 9 | <div class="goods-consults"> |
@@ -52,6 +52,19 @@ | @@ -52,6 +52,19 @@ | ||
52 | {{/ periodOfMarket}} | 52 | {{/ periodOfMarket}} |
53 | </div> | 53 | </div> |
54 | 54 | ||
55 | + <!-- {{# vipLevel}} | ||
56 | + <ul class="vip-level clearfix"> | ||
57 | + {{# list}} | ||
58 | + <li class="icons-item"> | ||
59 | + <span class="vip-img"> | ||
60 | + <div class="img" alt="" style="background-size:cover;"></div> | ||
61 | + </span> | ||
62 | + <span class="vip-price">{{text}}</span> | ||
63 | + </li> | ||
64 | + {{/ list}} | ||
65 | + </ul> | ||
66 | + {{/vipLevel}} --> | ||
67 | + | ||
55 | {{# vipLevel}} | 68 | {{# vipLevel}} |
56 | <div class="vipLevel"> | 69 | <div class="vipLevel"> |
57 | {{# list}} | 70 | {{# list}} |
@@ -112,17 +125,14 @@ | @@ -112,17 +125,14 @@ | ||
112 | {{#if numInCart}} | 125 | {{#if numInCart}} |
113 | <span class="num-tag">{{numInCart}}</span> | 126 | <span class="num-tag">{{numInCart}}</span> |
114 | {{/if}} | 127 | {{/if}} |
115 | - <a href="" class="num-incart iconfont"></a> | 128 | + <a href="/shoppingCart" class="num-incart iconfont"></a> |
116 | {{#if goodsInstore}} | 129 | {{#if goodsInstore}} |
117 | - <a href="" class="addto-cart ">加入购物车</a> | 130 | + <a href="/shoppingCart" class="addto-cart ">加入购物车</a> |
118 | {{else}} | 131 | {{else}} |
119 | - <a href="" class="sold-out">已售罄</a> | ||
120 | - {{/if}} | ||
121 | - {{#if isCollect}} | ||
122 | - <a href="#" id="likeBtn" class="favorite iconfont liked"></a> | ||
123 | - {{else}} | ||
124 | - <a href="" id="likeBtn" class="favorite iconfont"></a> | 132 | + <a href="javascript:;" class="sold-out">已售罄</a> |
125 | {{/if}} | 133 | {{/if}} |
134 | + | ||
135 | + <a href="#" id="likeBtn" class="favorite iconfont {{#isCollect}}liked{{/isCollect}}"></a> | ||
126 | </div> | 136 | </div> |
127 | {{/cartInfo}} | 137 | {{/cartInfo}} |
128 | 138 |
@@ -166,7 +166,13 @@ | @@ -166,7 +166,13 @@ | ||
166 | {{!-- 商品详情评论 --}} | 166 | {{!-- 商品详情评论 --}} |
167 | {{#if goodsCommentsPage}} | 167 | {{#if goodsCommentsPage}} |
168 | <script> | 168 | <script> |
169 | - seajs.use('js/product/detail/comments-consults'); | 169 | + seajs.use('js/product/detail/loadmore'); |
170 | +</script> | ||
171 | +{{/if}} | ||
172 | +{{!-- 商品详情咨询 --}} | ||
173 | +{{#if goodsConsultsPage}} | ||
174 | +<script> | ||
175 | + seajs.use('js/product/detail/loadmore'); | ||
170 | </script> | 176 | </script> |
171 | {{/if}} | 177 | {{/if}} |
172 | {{!-- 品类 --}} | 178 | {{!-- 品类 --}} |
@@ -210,6 +216,7 @@ | @@ -210,6 +216,7 @@ | ||
210 | {{#if myIndexPage}} | 216 | {{#if myIndexPage}} |
211 | <script> | 217 | <script> |
212 | seajs.use('js/me/index'); | 218 | seajs.use('js/me/index'); |
219 | + seajs.use('js/index/footer'); | ||
213 | </script> | 220 | </script> |
214 | {{/if}} | 221 | {{/if}} |
215 | {{#if orderPage}} | 222 | {{#if orderPage}} |
@@ -59,7 +59,7 @@ | @@ -59,7 +59,7 @@ | ||
59 | <span class="iconfont"></span>暂无咨询 | 59 | <span class="iconfont"></span>暂无咨询 |
60 | </div> | 60 | </div> |
61 | <div class="consult-content-footer"> | 61 | <div class="consult-content-footer"> |
62 | - <a href="{{link}}"> | 62 | + <a href="/consultform"> |
63 | 我要咨询 | 63 | 我要咨询 |
64 | <span class="iconfont"></span></a> | 64 | <span class="iconfont"></span></a> |
65 | </div> | 65 | </div> |
1 | {{#goodsDescription}} | 1 | {{#goodsDescription}} |
2 | <div class="goods-desc page-block"> | 2 | <div class="goods-desc page-block"> |
3 | - <img class="service lazy" data-original="http://static.dev.yohobuy.com/img/product/service.png" alt=""> | 3 | + <div class="service"></div> |
4 | <h1 class="title"> | 4 | <h1 class="title"> |
5 | {{title}} | 5 | {{title}} |
6 | <span class="en-title">{{enTitle}}</span> | 6 | <span class="en-title">{{enTitle}}</span> |
1 | <div class="title">为您优选新品</div> | 1 | <div class="title">为您优选新品</div> |
2 | <div id="swiper-recommend" class="swiper-container"> | 2 | <div id="swiper-recommend" class="swiper-container"> |
3 | - <ul class="swiper-wrapper swiper-wrapper-recommend"> | 3 | + <div class="swiper-wrapper swiper-wrapper-recommend"> |
4 | {{#recommendList}} | 4 | {{#recommendList}} |
5 | - <li class="swiper-slide"> | 5 | + <a class="swiper-slide" href="{{url}}"> |
6 | <img class="swiper-lazy img-box" data-src="{{thumb}}"> | 6 | <img class="swiper-lazy img-box" data-src="{{thumb}}"> |
7 | <div class="price"> | 7 | <div class="price"> |
8 | <span class="sale-price {{^price}}no-price{{/price}}">¥{{salePrice}}</span> | 8 | <span class="sale-price {{^price}}no-price{{/price}}">¥{{salePrice}}</span> |
9 | {{#price}}<span class="old-price">¥{{.}}</span>{{/price}} | 9 | {{#price}}<span class="old-price">¥{{.}}</span>{{/price}} |
10 | </div> | 10 | </div> |
11 | <div class="swiper-lazy-preloader"></div> | 11 | <div class="swiper-lazy-preloader"></div> |
12 | - </li> | 12 | + </a> |
13 | {{/recommendList}} | 13 | {{/recommendList}} |
14 | - </ul> | 14 | + </div> |
15 | </div> | 15 | </div> |
@@ -51,6 +51,7 @@ class HomeController extends AbstractAction | @@ -51,6 +51,7 @@ class HomeController extends AbstractAction | ||
51 | 51 | ||
52 | $data = array( | 52 | $data = array( |
53 | 'myIndexPage' => true, | 53 | 'myIndexPage' => true, |
54 | + 'showDownloadApp' => true, | ||
54 | 'pageFooter' => true | 55 | 'pageFooter' => true |
55 | ); | 56 | ); |
56 | $uid = $this->getUid(); | 57 | $uid = $this->getUid(); |
@@ -323,7 +324,7 @@ class HomeController extends AbstractAction | @@ -323,7 +324,7 @@ class HomeController extends AbstractAction | ||
323 | 324 | ||
324 | $this->_view->display('online-service', array( | 325 | $this->_view->display('online-service', array( |
325 | 'onlineServicePage' => true, | 326 | 'onlineServicePage' => true, |
326 | - // 'pageFooter' => true, | 327 | + 'pageFooter' => true, |
327 | 'service' => $service | 328 | 'service' => $service |
328 | )); | 329 | )); |
329 | } | 330 | } |
@@ -231,54 +231,19 @@ class ShoppingCartController extends AbstractAction | @@ -231,54 +231,19 @@ class ShoppingCartController extends AbstractAction | ||
231 | 231 | ||
232 | public function goodinfoAction() | 232 | public function goodinfoAction() |
233 | { | 233 | { |
234 | + $result = array(); | ||
235 | + | ||
234 | if ($this->isAjax()) { | 236 | if ($this->isAjax()) { |
235 | - $data = array( | ||
236 | - 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/09/17/03/014cacfa5c458b9732c68adf1af15d7a45.jpg?imageMogr2/thumbnail/120x120/extent/120x120/background/d2hpdGU=/position/center/quality/90', | ||
237 | - 'name' => '黄伟文Wyman X y yohood 联名商品YYYOHOOD圆领卫衣', | ||
238 | - 'price' => 289, | ||
239 | - 'salePrice' => 241, | ||
240 | - 'colors' => array( | ||
241 | - array( | ||
242 | - 'id' => 1, | ||
243 | - 'name' => '黄色' | ||
244 | - ), | ||
245 | - array( | ||
246 | - 'id' => 2, | ||
247 | - 'chosed' => true, | ||
248 | - 'name' => '白色' | ||
249 | - ) | ||
250 | - ), | ||
251 | - 'sizes' => array( | ||
252 | - array( | ||
253 | - 'id' => 1, | ||
254 | - 'name' => 'XS' | ||
255 | - ), | ||
256 | - array( | ||
257 | - 'id' => 2, | ||
258 | - 'name' => 'S' | ||
259 | - ), | ||
260 | - array( | ||
261 | - 'id' => 3, | ||
262 | - 'chosed' => true, | ||
263 | - 'name' => 'M' | ||
264 | - ), | ||
265 | - array( | ||
266 | - 'id' => 4, | ||
267 | - 'name' => 'L' | ||
268 | - ), | ||
269 | - array( | ||
270 | - 'id' => 5, | ||
271 | - 'name' => 'XL' | ||
272 | - ), | ||
273 | - array( | ||
274 | - 'id' => 6, | ||
275 | - 'name' => 'XXL' | ||
276 | - ) | ||
277 | - ), | ||
278 | - 'num' => 1 | ||
279 | - ); | ||
280 | - | ||
281 | - $this->echoJson(array('code' => 200, 'data' => $data)); | 237 | + $num = $this->get('buy_num', 1); |
238 | + $skn = $this->get('id', 1); | ||
239 | + $result = CartModel::cartProductData($this->_uid, $skn, $num); // 测试skn的ID为51172055 | ||
240 | + $result['num'] = $num; | ||
282 | } | 241 | } |
242 | + | ||
243 | + if (empty($result)) { | ||
244 | + echo ' '; | ||
245 | + } else { | ||
246 | + $this->echoJson($result); | ||
247 | + } | ||
283 | } | 248 | } |
284 | } | 249 | } |
1 | -<?php | ||
2 | - | ||
3 | -namespace Home; | ||
4 | - | ||
5 | -use LibModels\Wap\Home\OnlineData; | ||
6 | -use Plugin\Helpers; | ||
7 | - | ||
8 | -/** | ||
9 | - * 在线客服相关数据处理 | ||
10 | - */ | ||
11 | -class OnlineModel | ||
12 | -{ | ||
13 | - | ||
14 | - /* | ||
15 | - * 获取在线帮助分类 | ||
16 | - * $clientType客户端类型 | ||
17 | - */ | ||
18 | - public static function getOnlineServiceInfo($clientType = 'iphone') | ||
19 | - { | ||
20 | - //调用接口获取数据 | ||
21 | - $res = OnlineData::getOnlineServiceInfo($clientType); | ||
22 | - $cateInfo = $res['data']; | ||
23 | - $question = array(); | ||
24 | - $tab = array(); | ||
25 | - if ($cateInfo) | ||
26 | - { | ||
27 | - foreach ($cateInfo as $key => $value) | ||
28 | - { | ||
29 | - //强制截成3个tab | ||
30 | - if ($key > 2) | ||
31 | - { | ||
32 | - break; | ||
33 | - } | ||
34 | - $tab[$key]['tabid'] = 'tab' . $value['id']; | ||
35 | - $tab[$key]['tabname'] = $value['category_name']; | ||
36 | - $tab[$key]['iscut'] = true; | ||
37 | - $tab[$key]['current'] = (!$key) ? TRUE : FALSE; | ||
38 | - $question[$key]['name'] = 'tab' . $value['id']; | ||
39 | - $question[$key]['current'] = (!$key) ? TRUE : FALSE; | ||
40 | - $sub = $value['sub']; | ||
41 | - $qTmp = array(); | ||
42 | - if ($sub) | ||
43 | - { | ||
44 | - foreach ($sub as $sk => $sv) | ||
45 | - { | ||
46 | - $qTmp[$sk]['title'] = $sv['category_name']; | ||
47 | - $qTmp[$sk]['link'] = Helpers::url('/home/onlineservicedetail',array('cateId'=>$sv['id'],'cateName'=>$sv['category_name'])); | ||
48 | - } | ||
49 | - } | ||
50 | - $question[$key]['list'] = $qTmp; | ||
51 | - } | ||
52 | - $question[0]['current'] = true; | ||
53 | - $tab[count($tab) - 1]['iscut'] = false; | ||
54 | - } | ||
55 | - //处理返回信息 | ||
56 | - $result = array( | ||
57 | - 'header' => array('title' => '在线客服'), | ||
58 | - 'tab' => $tab, | ||
59 | - 'question' => $question | ||
60 | - ); | ||
61 | - | ||
62 | - return $result; | ||
63 | - } | ||
64 | - | ||
65 | - /* | ||
66 | - * 加载分类下的问题和解决方法 | ||
67 | - * cateId问题分类ID | ||
68 | - * clientType客户端 | ||
69 | - */ | ||
70 | - public static function getOnlineServiceDetail($cateId, $clinetType = 'iphone') | ||
71 | - { | ||
72 | - $result = array(); | ||
73 | - if (!$cateId) | ||
74 | - { | ||
75 | - return $result; | ||
76 | - } | ||
77 | - $res = OnlineData::getOnlineServiceDetail($cateId, $clinetType); | ||
78 | - $questionInfo = $res['data']; | ||
79 | - if ($questionInfo) | ||
80 | - { | ||
81 | - $list = array(); | ||
82 | - if ($questionInfo) | ||
83 | - { | ||
84 | - foreach ($questionInfo as $qk => $qv) | ||
85 | - { | ||
86 | - $list[$qk]['q'] = $qv['title']; | ||
87 | - $list[$qk]['a'] = $qv['content']; | ||
88 | - } | ||
89 | - } | ||
90 | - //处理返回信息 | ||
91 | - $result = array( | ||
92 | - 'header' => array('title' => '在线客服'), | ||
93 | - 'list' => $list | ||
94 | - ); | ||
95 | - } | ||
96 | - return $result; | ||
97 | - } | ||
98 | - | ||
99 | -} | 1 | +<?php |
2 | + | ||
3 | +namespace Home; | ||
4 | + | ||
5 | +use LibModels\Wap\Home\OnlineData; | ||
6 | +use Plugin\Helpers; | ||
7 | + | ||
8 | +/** | ||
9 | + * 在线客服相关数据处理 | ||
10 | + */ | ||
11 | +class OnlineModel | ||
12 | +{ | ||
13 | + | ||
14 | + /* | ||
15 | + * 获取在线帮助分类 | ||
16 | + * $clientType客户端类型 | ||
17 | + */ | ||
18 | + public static function getOnlineServiceInfo($clientType = 'iphone') | ||
19 | + { | ||
20 | + //调用接口获取数据 | ||
21 | + $res = OnlineData::getOnlineServiceInfo($clientType); | ||
22 | + $cateInfo = $res['data']; | ||
23 | + $question = array(); | ||
24 | + $tab = array(); | ||
25 | + if ($cateInfo) | ||
26 | + { | ||
27 | + foreach ($cateInfo as $key => $value) | ||
28 | + { | ||
29 | + //强制截成3个tab | ||
30 | + if ($key > 2) | ||
31 | + { | ||
32 | + break; | ||
33 | + } | ||
34 | + $tab[$key]['tabid'] = 'tab' . $value['id']; | ||
35 | + $tab[$key]['tabname'] = $value['category_name']; | ||
36 | + $tab[$key]['iscut'] = true; | ||
37 | + $tab[$key]['current'] = (!$key) ? TRUE : FALSE; | ||
38 | + $question[$key]['name'] = 'tab' . $value['id']; | ||
39 | + $question[$key]['current'] = (!$key) ? TRUE : FALSE; | ||
40 | + $sub = $value['sub']; | ||
41 | + $qTmp = array(); | ||
42 | + if ($sub) | ||
43 | + { | ||
44 | + foreach ($sub as $sk => $sv) | ||
45 | + { | ||
46 | + $qTmp[$sk]['title'] = $sv['category_name']; | ||
47 | + $qTmp[$sk]['link'] = Helpers::url('/home/onlineservicedetail',array('cateId'=>$sv['id'],'cateName'=>$sv['category_name'])); | ||
48 | + } | ||
49 | + } | ||
50 | + $question[$key]['list'] = $qTmp; | ||
51 | + } | ||
52 | + $question[0]['current'] = true; | ||
53 | + $tab[count($tab) - 1]['iscut'] = false; | ||
54 | + } | ||
55 | + //处理返回信息 | ||
56 | + $result = array( | ||
57 | + 'header' => array('title' => '在线客服'), | ||
58 | + 'tab' => $tab, | ||
59 | + 'question' => $question | ||
60 | + ); | ||
61 | + | ||
62 | + return $result; | ||
63 | + } | ||
64 | + | ||
65 | + /* | ||
66 | + * 加载分类下的问题和解决方法 | ||
67 | + * cateId问题分类ID | ||
68 | + * clientType客户端 | ||
69 | + */ | ||
70 | + public static function getOnlineServiceDetail($cateId, $clinetType = 'iphone') | ||
71 | + { | ||
72 | + $result = array(); | ||
73 | + if (!$cateId) | ||
74 | + { | ||
75 | + return $result; | ||
76 | + } | ||
77 | + $res = OnlineData::getOnlineServiceDetail($cateId, $clinetType); | ||
78 | + $questionInfo = $res['data']; | ||
79 | + if ($questionInfo) | ||
80 | + { | ||
81 | + $list = array(); | ||
82 | + if ($questionInfo) | ||
83 | + { | ||
84 | + foreach ($questionInfo as $qk => $qv) | ||
85 | + { | ||
86 | + $list[$qk]['q'] = $qv['title']; | ||
87 | + $list[$qk]['a'] = $qv['content']; | ||
88 | + } | ||
89 | + } | ||
90 | + //处理返回信息 | ||
91 | + $result = array( | ||
92 | + 'header' => array('title' => '在线客服'), | ||
93 | + 'list' => $list | ||
94 | + ); | ||
95 | + } | ||
96 | + return $result; | ||
97 | + } | ||
98 | + | ||
99 | +} |
@@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
3 | namespace Index; | 3 | namespace Index; |
4 | 4 | ||
5 | use LibModels\Wap\Home\CartData; | 5 | use LibModels\Wap\Home\CartData; |
6 | +use Plugin\Helpers; | ||
6 | use Plugin\Images; | 7 | use Plugin\Images; |
7 | 8 | ||
8 | /** | 9 | /** |
@@ -98,6 +99,70 @@ class CartModel | @@ -98,6 +99,70 @@ class CartModel | ||
98 | } | 99 | } |
99 | 100 | ||
100 | /** | 101 | /** |
102 | + * 处理购物车商品数据 | ||
103 | + * | ||
104 | + * @param int $uid 用户ID | ||
105 | + * @param int $skn 商品skn | ||
106 | + * @param int $num 购买数目 | ||
107 | + * @return array 接口返回的数据 | ||
108 | + */ | ||
109 | + public static function cartProductData($uid, $skn, $num) | ||
110 | + { | ||
111 | + $result = array('code' => 400, 'message' => '出错啦~'); | ||
112 | + | ||
113 | + $product = CartData::cartProductData($uid, $skn); | ||
114 | + if (isset($product['code']) && $product['code'] === 200) { | ||
115 | + $result['code'] = 200; | ||
116 | + $data = array(); | ||
117 | + $productData = $product['data']; | ||
118 | + | ||
119 | + // 品牌信息 | ||
120 | + if (isset($productData['brand_info']) && !empty($productData['brand_info'])) { | ||
121 | + $data['thumb'] = Helpers::getImageUrl($productData['brand_info']['brand_ico'], 120, 120); | ||
122 | + } | ||
123 | + | ||
124 | + $data['name'] = $productData['product_name']; | ||
125 | + $data['price'] = $productData['market_price']; | ||
126 | + $data['salePrice'] = $productData['sales_price']; | ||
127 | + $data['storage'] = $productData['storage_sum']; | ||
128 | + $data['num'] = $num; | ||
129 | + | ||
130 | + // 商品选择 | ||
131 | + if (isset($productData['goods_list'])) { | ||
132 | + $goodsList = $productData['goods_list']; | ||
133 | + | ||
134 | + $colors = array(); | ||
135 | + $oneColor = array(); | ||
136 | + $sizes = array(); | ||
137 | + $oneSize = array(); | ||
138 | + foreach ($goodsList as $val) { | ||
139 | + // 颜色 | ||
140 | + $oneColor = array(); | ||
141 | + $oneColor['id'] = $val['color_id']; | ||
142 | + $oneColor['name'] = $val['color_name']; | ||
143 | + | ||
144 | + // 尺码 | ||
145 | + foreach ($val['size_list'] as $one) { | ||
146 | + $oneSize = array(); | ||
147 | + $oneSize['id'] = $one['size_id']; | ||
148 | + $oneSize['name'] = $one['size_name']; | ||
149 | + } | ||
150 | + $sizes[] = $oneSize; | ||
151 | + | ||
152 | + $oneColor['sizes'] = $sizes; | ||
153 | + $colors[] = $oneColor; | ||
154 | + } | ||
155 | + | ||
156 | + $data['colors'] = $colors; | ||
157 | + } | ||
158 | + | ||
159 | + $result['data'] = $data; | ||
160 | + } | ||
161 | + | ||
162 | + return $result; | ||
163 | + } | ||
164 | + | ||
165 | + /** | ||
101 | * 修改购物车商品数据 | 166 | * 修改购物车商品数据 |
102 | * | 167 | * |
103 | * @param int $uid 用户ID | 168 | * @param int $uid 用户ID |
@@ -135,6 +200,7 @@ class CartModel | @@ -135,6 +200,7 @@ class CartModel | ||
135 | // 购买的商品列表 | 200 | // 购买的商品列表 |
136 | foreach ($data['goods_list'] as $value) { | 201 | foreach ($data['goods_list'] as $value) { |
137 | $oneGoods['id'] = $value['product_sku']; | 202 | $oneGoods['id'] = $value['product_sku']; |
203 | + $oneGoods['skn'] = $value['product_skn']; | ||
138 | $oneGoods['name'] = $value['product_name']; | 204 | $oneGoods['name'] = $value['product_name']; |
139 | $oneGoods['thumb'] = Images::getImageUrl($value['goods_images'], 120, 120); | 205 | $oneGoods['thumb'] = Images::getImageUrl($value['goods_images'], 120, 120); |
140 | $oneGoods['color'] = $value['color_name']; | 206 | $oneGoods['color'] = $value['color_name']; |
-
Please register or login to post a comment