Merge branch 'develop' into test
Conflicts: library/Api/Yohobuy.php
Showing
36 changed files
with
375 additions
and
201 deletions
@@ -28,7 +28,7 @@ class Yohobuy | @@ -28,7 +28,7 @@ class Yohobuy | ||
28 | const SERVICE_URL = 'http://test.service.api.yohobuy.com/'; | 28 | const SERVICE_URL = 'http://test.service.api.yohobuy.com/'; |
29 | const YOHOBUY_URL = 'http://www.yohobuy.com/'; | 29 | const YOHOBUY_URL = 'http://www.yohobuy.com/'; |
30 | const YOHOBUY_ORDER = 'http://192.168.102.209:8080/yoho-order/'; //我的订单 | 30 | const YOHOBUY_ORDER = 'http://192.168.102.209:8080/yoho-order/'; //我的订单 |
31 | - const API_URL_MYCENTER = 'http://192.168.102.213:8081/yoho-users-web/'; // 我的个人中心接口URL | 31 | + const API_URL_MYCENTER = 'http://192.168.102.205:8081/api-gateway-web/'; // 我的个人中心接口URL |
32 | const API_URL_SHOPINGCART = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的购物车接口URL | 32 | const API_URL_SHOPINGCART = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的购物车接口URL |
33 | const API_URL_PRODUCTDETAIL = 'http://192.168.102.209:18080/yoho-product/'; // 商品详情页 | 33 | const API_URL_PRODUCTDETAIL = 'http://192.168.102.209:18080/yoho-product/'; // 商品详情页 |
34 | 34 |
@@ -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,4 +9,5 @@ require('./order-detail'); | @@ -9,4 +9,5 @@ require('./order-detail'); | ||
9 | require('./fav'); | 9 | require('./fav'); |
10 | require('./index'); | 10 | require('./index'); |
11 | require('./coupons'); | 11 | require('./coupons'); |
12 | -require('./online-service'); | ||
12 | +require('./online-service'); | ||
13 | +require('./address'); |
@@ -6,12 +6,17 @@ | @@ -6,12 +6,17 @@ | ||
6 | var $ = require('jquery'); | 6 | var $ = require('jquery'); |
7 | var $userAvatar = $('.user-avatar'), | 7 | var $userAvatar = $('.user-avatar'), |
8 | $listItem = $('.list-item'); | 8 | $listItem = $('.list-item'); |
9 | -var myImage = new Image(); | 9 | +var myImage = new Image(), |
10 | + avatar; | ||
10 | 11 | ||
11 | require('../product/recommend-for-you.js'); | 12 | require('../product/recommend-for-you.js'); |
12 | -myImage.src = $userAvatar.attr('src'); | ||
13 | -myImage.onerror = function() { | ||
14 | - $userAvatar.attr('src', 'http://static.dev.yohobuy.com/img/me/index/user-avatar.png'); | 13 | +require('../product/suspend-cart.js'); |
14 | + | ||
15 | +// 部分老用户没有头像,显示默认头像 | ||
16 | +avatar = $userAvatar.data('avatar'); | ||
17 | +myImage.src = avatar; | ||
18 | +myImage.onload = function() { | ||
19 | + $userAvatar.css('background-image', 'url(' + avatar + ')'); | ||
15 | }; | 20 | }; |
16 | 21 | ||
17 | $('.yoho-page').on('touchstart', '.list-item, .type-item', function() { | 22 | $('.yoho-page').on('touchstart', '.list-item, .type-item', function() { |
@@ -5,9 +5,12 @@ | @@ -5,9 +5,12 @@ | ||
5 | */ | 5 | */ |
6 | var $ = require('jquery'); | 6 | var $ = require('jquery'); |
7 | var $userAvatar = $('.user-avatar'); | 7 | var $userAvatar = $('.user-avatar'); |
8 | -var myImage = new Image(); | 8 | +var myImage = new Image(), |
9 | + avatar; | ||
9 | 10 | ||
10 | -myImage.src = $userAvatar.attr('src'); | ||
11 | -myImage.onerror = function() { | ||
12 | - $userAvatar.attr('src', 'http://static.dev.yohobuy.com/img/me/index/user-avatar.png'); | 11 | +// 部分老用户没有头像,显示默认头像 |
12 | +avatar = $userAvatar.data('avatar'); | ||
13 | +myImage.src = avatar; | ||
14 | +myImage.onload = function() { | ||
15 | + $userAvatar.css('background-image', 'url(' + avatar + ')'); | ||
13 | }; | 16 | }; |
@@ -47,15 +47,6 @@ function search() { | @@ -47,15 +47,6 @@ function search() { | ||
47 | slidesPerView: 'auto' | 47 | slidesPerView: 'auto' |
48 | }); | 48 | }); |
49 | 49 | ||
50 | - //优选 | ||
51 | - // recommendSwiper = new Swiper('#swiper-recommend', { | ||
52 | - // slidesPerView: 'auto', | ||
53 | - // grabCursor: true, | ||
54 | - // slideElement: 'li', | ||
55 | - // lazyLoading: true, | ||
56 | - // watchSlidesVisibility: true | ||
57 | - // }); | ||
58 | - | ||
59 | searching = false; | 50 | searching = false; |
60 | end = true; | 51 | end = true; |
61 | loading.hideLoadingMask(); | 52 | loading.hideLoadingMask(); |
@@ -11,8 +11,7 @@ var goodsSwiper; | @@ -11,8 +11,7 @@ var goodsSwiper; | ||
11 | 11 | ||
12 | require('./desc'); | 12 | require('./desc'); |
13 | require('./comments-consults'); | 13 | require('./comments-consults'); |
14 | -require('./like.js'); | ||
15 | -require('../recommend-for-you.js'); | 14 | +require('./like'); |
16 | 15 | ||
17 | lazyLoad($('img.lazy')); | 16 | lazyLoad($('img.lazy')); |
18 | 17 | ||
@@ -50,6 +49,4 @@ $('.goodsDiscount .dropdown').on('click', function() { | @@ -50,6 +49,4 @@ $('.goodsDiscount .dropdown').on('click', function() { | ||
50 | $('.goodsDiscount .first-item span').html(''); | 49 | $('.goodsDiscount .first-item span').html(''); |
51 | $('.goodsDiscount .discount-folder').slideUp(); | 50 | $('.goodsDiscount .discount-folder').slideUp(); |
52 | } | 51 | } |
53 | -}); | ||
54 | - | ||
55 | - | 52 | +}); |
@@ -7,11 +7,12 @@ var $ = require('jquery'), | @@ -7,11 +7,12 @@ var $ = require('jquery'), | ||
7 | Hammer = require('yoho.hammer'), | 7 | Hammer = require('yoho.hammer'), |
8 | tip = require('../../plugin/tip'); | 8 | tip = require('../../plugin/tip'); |
9 | 9 | ||
10 | -var likeHammer = new Hammer('#likeBtn'); | 10 | +var likeHammer = new Hammer(document.getElementById('likeBtn')); |
11 | 11 | ||
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')) { |
@@ -40,4 +41,9 @@ likeHammer.on('tap', function(e) { | @@ -40,4 +41,9 @@ likeHammer.on('tap', function(e) { | ||
40 | tip.show('网络断开连接了~'); | 41 | tip.show('网络断开连接了~'); |
41 | } | 42 | } |
42 | }); | 43 | }); |
43 | -}); | ||
44 | + | ||
45 | +}); | ||
46 | + | ||
47 | +// $('#likeBtn').on('click', function(e) { | ||
48 | +// return false; | ||
49 | +// }); |
@@ -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 | }); |
@@ -105,4 +105,22 @@ | @@ -105,4 +105,22 @@ | ||
105 | font-weight: bold; | 105 | font-weight: bold; |
106 | color: #fff; | 106 | color: #fff; |
107 | } | 107 | } |
108 | +} | ||
109 | +.systemMain{ | ||
110 | + width: 92%; | ||
111 | + height: 100%; | ||
112 | + overflow: hidden; | ||
113 | + background-color:#444; | ||
114 | + color: #fff; | ||
115 | + padding:0 4%; | ||
116 | + position: absolute; | ||
117 | + top: 0; | ||
118 | + left: 0; | ||
119 | + p{ | ||
120 | + font-size: 52em / $pxConvertRem; | ||
121 | + line-height: 60rem / $pxConvertRem; | ||
122 | + &:first-of-type{ | ||
123 | + padding-top: 90rem / $pxConvertRem; | ||
124 | + } | ||
125 | + } | ||
108 | } | 126 | } |
@@ -25,10 +25,17 @@ | @@ -25,10 +25,17 @@ | ||
25 | height: pxToRem(126px); | 25 | height: pxToRem(126px); |
26 | border-radius: 50%; | 26 | border-radius: 50%; |
27 | border: pxToRem(6px) solid #a7a8a9; | 27 | border: pxToRem(6px) solid #a7a8a9; |
28 | + background-image: image-url("me/index/user-avatar.png"); | ||
29 | + background-size: 100%; | ||
28 | } | 30 | } |
29 | 31 | ||
30 | .username { | 32 | .username { |
33 | + float: left; | ||
31 | padding: 0 pxToRem(16px); | 34 | padding: 0 pxToRem(16px); |
35 | + text-overflow: ellipsis; | ||
36 | + overflow: hidden; | ||
37 | + white-space: nowrap; | ||
38 | + max-width: pxToRem(290px); | ||
32 | } | 39 | } |
33 | 40 | ||
34 | .vip-icon { | 41 | .vip-icon { |
@@ -17,6 +17,14 @@ | @@ -17,6 +17,14 @@ | ||
17 | } | 17 | } |
18 | height: 80rem / $pxConvertRem; | 18 | height: 80rem / $pxConvertRem; |
19 | border-bottom: 1px solid #e0e0e0; | 19 | border-bottom: 1px solid #e0e0e0; |
20 | + | ||
21 | + .user-avatar { | ||
22 | + width: 100%; | ||
23 | + height: 100%; | ||
24 | + background-image: image-url("me/index/user-avatar.png"); | ||
25 | + background-size: 100%; | ||
26 | + } | ||
27 | + | ||
20 | span{ | 28 | span{ |
21 | &:first-of-type{ | 29 | &:first-of-type{ |
22 | color: #444; | 30 | color: #444; |
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); |
@@ -39,12 +39,14 @@ | @@ -39,12 +39,14 @@ | ||
39 | } | 39 | } |
40 | 40 | ||
41 | .goods-consults-page { | 41 | .goods-consults-page { |
42 | + background-color: #f0f0f0; | ||
42 | .goto-consult { | 43 | .goto-consult { |
43 | padding: 0 pxToRem(28px); | 44 | padding: 0 pxToRem(28px); |
44 | height: pxToRem(120px); | 45 | height: pxToRem(120px); |
45 | background-color: #ffffff; | 46 | background-color: #ffffff; |
46 | i, | 47 | i, |
47 | - span { | 48 | + span, |
49 | + a { | ||
48 | line-height: pxToRem(120px); | 50 | line-height: pxToRem(120px); |
49 | font-size: pxToRem(28px); | 51 | font-size: pxToRem(28px); |
50 | color: $mainFontC; | 52 | color: $mainFontC; |
@@ -59,6 +61,7 @@ | @@ -59,6 +61,7 @@ | ||
59 | } | 61 | } |
60 | .goods-consults { | 62 | .goods-consults { |
61 | .consult-item { | 63 | .consult-item { |
64 | + margin-top: pxToRem(30px); | ||
62 | padding: pxToRem(20px) pxToRem(28px); | 65 | padding: pxToRem(20px) pxToRem(28px); |
63 | background-color: #fff; | 66 | background-color: #fff; |
64 | .question { | 67 | .question { |
@@ -98,10 +101,10 @@ | @@ -98,10 +101,10 @@ | ||
98 | } | 101 | } |
99 | } | 102 | } |
100 | } | 103 | } |
101 | - .gap-block { | ||
102 | - min-height: 30rem/$pxConvertRem; | ||
103 | - background-color: #f0f0f0; | ||
104 | - } | 104 | + // .gap-block { |
105 | + // min-height: 30rem/$pxConvertRem; | ||
106 | + // background-color: #f0f0f0; | ||
107 | + // } | ||
105 | } | 108 | } |
106 | 109 | ||
107 | .consult-form-page { | 110 | .consult-form-page { |
@@ -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,49 @@ $basicBtnC:#eb0313; | @@ -227,8 +229,49 @@ $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 | + font-size: pxToRem(22px); | ||
239 | + color: #999999; | ||
240 | + border-bottom: 1px solid $borderC; | ||
241 | + .icons-item { | ||
242 | + float: left; | ||
243 | + width: 33.3%; | ||
244 | + height: pxToRem(88px); | ||
245 | + margin: 0; | ||
246 | + span { | ||
247 | + vertical-align: middle; | ||
248 | + display: inline-block; | ||
249 | + line-height: pxToRem(88px); | ||
250 | + } | ||
251 | + .vip-img { | ||
252 | + width: pxToRem(53px); | ||
253 | + height: pxToRem(32px); | ||
254 | + } | ||
255 | + &:nth-child(3) { | ||
256 | + text-align: right; | ||
257 | + .vip-img{ | ||
258 | + background: image-url('product/silver.png') no-repeat; | ||
259 | + } | ||
260 | + } | ||
261 | + &:nth-child(2) { | ||
262 | + .vip-img{ | ||
263 | + background: image-url('product/golden.png') no-repeat; | ||
264 | + } | ||
265 | + } | ||
266 | + &:nth-child(1) { | ||
267 | + text-align: left; | ||
268 | + .vip-img{ | ||
269 | + background: image-url('product/platinum.png') no-repeat; | ||
270 | + } | ||
271 | + } | ||
272 | + } | ||
273 | + } | ||
230 | .vipLevel { | 274 | .vipLevel { |
231 | - width: 100%; | ||
232 | box-sizing: border-box; | 275 | box-sizing: border-box; |
233 | background-color: #fff; | 276 | background-color: #fff; |
234 | display: table; | 277 | display: table; |
@@ -242,25 +285,24 @@ $basicBtnC:#eb0313; | @@ -242,25 +285,24 @@ $basicBtnC:#eb0313; | ||
242 | display: table-cell; | 285 | display: table-cell; |
243 | vertical-align: middle; | 286 | vertical-align: middle; |
244 | } | 287 | } |
245 | - .vip-img{ | 288 | + .vip-img { |
246 | padding-right: pxToRem(22px); | 289 | padding-right: pxToRem(22px); |
247 | - .img{ | ||
248 | - width: pxToRem(52px); | ||
249 | - height: pxToRem(32px); | 290 | + .img { |
291 | + width: pxToRem(53px); | ||
292 | + height: pxToRem(33px); | ||
250 | } | 293 | } |
251 | - &:nth-child(3n-3) .img{ | 294 | + &:nth-child(3n-3) .img { |
252 | background: image-url('product/silver.png') no-repeat; | 295 | background: image-url('product/silver.png') no-repeat; |
253 | } | 296 | } |
254 | - &:nth-child(3n-2) .img{ | 297 | + &:nth-child(3n-2) .img { |
255 | background: image-url('product/golden.png') no-repeat; | 298 | background: image-url('product/golden.png') no-repeat; |
256 | } | 299 | } |
257 | - &:nth-child(3n-1) .img{ | 300 | + &:nth-child(3n-1) .img { |
258 | background: image-url('product/platinum.png') no-repeat; | 301 | background: image-url('product/platinum.png') no-repeat; |
259 | } | 302 | } |
260 | - | ||
261 | } | 303 | } |
262 | .vip-price { | 304 | .vip-price { |
263 | - padding-right: pxToRem(55px); | 305 | + padding-right: pxToRem(52px); |
264 | } | 306 | } |
265 | .vip-price:last-child { | 307 | .vip-price:last-child { |
266 | padding-right: 0; | 308 | padding-right: 0; |
@@ -295,7 +337,6 @@ $basicBtnC:#eb0313; | @@ -295,7 +337,6 @@ $basicBtnC:#eb0313; | ||
295 | .goodsDiscount { | 337 | .goodsDiscount { |
296 | text-indent: pxToRem(-14px); | 338 | text-indent: pxToRem(-14px); |
297 | } | 339 | } |
298 | - | ||
299 | .enter-store { | 340 | .enter-store { |
300 | min-height: pxToRem(100px); | 341 | min-height: pxToRem(100px); |
301 | display: table; | 342 | display: table; |
@@ -327,7 +368,6 @@ $basicBtnC:#eb0313; | @@ -327,7 +368,6 @@ $basicBtnC:#eb0313; | ||
327 | } | 368 | } |
328 | } | 369 | } |
329 | } | 370 | } |
330 | - | ||
331 | //底部固定栏 | 371 | //底部固定栏 |
332 | .cart-bar { | 372 | .cart-bar { |
333 | position: relative; | 373 | position: relative; |
@@ -350,10 +390,10 @@ $basicBtnC:#eb0313; | @@ -350,10 +390,10 @@ $basicBtnC:#eb0313; | ||
350 | font-size: pxToRem(34px); | 390 | font-size: pxToRem(34px); |
351 | color: #ccc | 391 | color: #ccc |
352 | } | 392 | } |
353 | - &.favorite.liked{ | ||
354 | - color:$basicBtnC;; | 393 | + &.favorite.liked { |
394 | + color: $basicBtnC; | ||
395 | + ; | ||
355 | } | 396 | } |
356 | - | ||
357 | &.addto-cart, | 397 | &.addto-cart, |
358 | &.sold-out { | 398 | &.sold-out { |
359 | height: pxToRem(80px); | 399 | height: pxToRem(80px); |
@@ -382,10 +422,10 @@ $basicBtnC:#eb0313; | @@ -382,10 +422,10 @@ $basicBtnC:#eb0313; | ||
382 | font-size: pxToRem(24px); | 422 | font-size: pxToRem(24px); |
383 | } | 423 | } |
384 | } | 424 | } |
385 | - | ||
386 | - .recommend-for-you{ | 425 | + .recommend-for-you { |
387 | margin-bottom: pxToRem(120px); | 426 | margin-bottom: pxToRem(120px); |
388 | } | 427 | } |
389 | } | 428 | } |
429 | + | ||
390 | @import "comments-consults"; | 430 | @import "comments-consults"; |
391 | -@import "product-description"; | ||
431 | +@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; |
@@ -45,20 +45,17 @@ | @@ -45,20 +45,17 @@ | ||
45 | line-height: 1; | 45 | line-height: 1; |
46 | 46 | ||
47 | span { | 47 | span { |
48 | - display: block; | 48 | + display: inline-block; |
49 | // chrome 最小支持12px, 设计图是 10px ,用CSS3变换 | 49 | // chrome 最小支持12px, 设计图是 10px ,用CSS3变换 |
50 | @include transform(scale(0.875)); | 50 | @include transform(scale(0.875)); |
51 | } | 51 | } |
52 | 52 | ||
53 | .sale-price { | 53 | .sale-price { |
54 | color: #d9134f; | 54 | color: #d9134f; |
55 | - margin-left: pxToRem(-10px); | 55 | + margin-right: pxToRem(8px); |
56 | } | 56 | } |
57 | 57 | ||
58 | .old-price { | 58 | .old-price { |
59 | - position: absolute; | ||
60 | - top: 0; | ||
61 | - right: pxToRem(-6px); | ||
62 | color: #b0b0b0; | 59 | color: #b0b0b0; |
63 | text-decoration: line-through; | 60 | text-decoration: line-through; |
64 | } | 61 | } |
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | <div class="my-header"> | 3 | <div class="my-header"> |
4 | {{#isLogin}} | 4 | {{#isLogin}} |
5 | <a class="user-info" href="/home/mydetails"> | 5 | <a class="user-info" href="/home/mydetails"> |
6 | - <img class="user-avatar" src="{{head_ico}}"> | 6 | + <span class="user-avatar" data-avatar="{{head_ico}}"></span> |
7 | <span class="username">{{profile_name}}</span> | 7 | <span class="username">{{profile_name}}</span> |
8 | {{#vip_info}} | 8 | {{#vip_info}} |
9 | <span class="vip-icon vip-{{next_level}}"></span> | 9 | <span class="vip-icon vip-{{next_level}}"></span> |
@@ -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}} |
1 | {{> layout/header}} | 1 | {{> layout/header}} |
2 | <div class="personal-details"> | 2 | <div class="personal-details"> |
3 | <ul> | 3 | <ul> |
4 | - <li><span>头像</span><span><i class="head-portrait"><img class="user-avatar" src="{{ head_ico }}"></i></span></li> | 4 | + <li><span>头像</span><span><i class="head-portrait"><span class="user-avatar" data-avatar="{{ head_ico }}"></span></i></span></li> |
5 | <li><span>昵称</span><span>{{ username }}</span></li> | 5 | <li><span>昵称</span><span>{{ username }}</span></li> |
6 | <li><span>性别</span><span>{{ gender }}</span></li> | 6 | <li><span>性别</span><span>{{ gender }}</span></li> |
7 | <li><span>生日</span><span>{{ birthday }}</span></li> | 7 | <li><span>生日</span><span>{{ birthday }}</span></li> |
1 | +{{> layout/header}} | ||
2 | +<div class="systemMain"> | ||
3 | + <P>尊敬的顾客:</P> | ||
4 | + <P>您好!</P> | ||
5 | + <P>为了向您提供更优质的服务,目前系统正在升级,请您耐心等待。</P> | ||
6 | + <P>系统升级期间,部分地区用户体验会有暂 时中断,如遇紧急事宜,欢迎垂询客服热线:400-889-9646 09:00-22:30(周一至周日)。</P> | ||
7 | + <P>稍后系统将恢复正常使用,欢迎您继续光顾 YOHO!BUY 有货!</P> | ||
8 | + <P>带来不便之处深表 歉意,请您谅解!</P> | ||
9 | + <P>特此公告</P> | ||
10 | + <P>YOHO!BUY 有货 客户服务中心。</P> | ||
11 | +</div> | ||
12 | +{{> layout/footer}} |
1 | {{> layout/header}} | 1 | {{> layout/header}} |
2 | <div class="goods-comments-page yoho-page"> | 2 | <div class="goods-comments-page yoho-page"> |
3 | {{#comments}} | 3 | {{#comments}} |
4 | - <div class="goods-comments"> | 4 | + <div class="goods-comments" id="goods-comments"> |
5 | {{#list}} | 5 | {{#list}} |
6 | <div class="comment-item"> | 6 | <div class="comment-item"> |
7 | <span class="user-name"> | 7 | <span class="user-name"> |
@@ -20,7 +20,10 @@ | @@ -20,7 +20,10 @@ | ||
20 | {{/list}} | 20 | {{/list}} |
21 | </div> | 21 | </div> |
22 | {{/comments}} | 22 | {{/comments}} |
23 | - | 23 | + |
24 | + {{#if loadmore}} | ||
25 | + <input id="loadMoreUrl" type="hidden" value={{loadMoreUrl}}> | ||
26 | + {{/if}} | ||
24 | </div> | 27 | </div> |
25 | 28 | ||
26 | {{> layout/footer}} | 29 | {{> layout/footer}} |
@@ -3,12 +3,11 @@ | @@ -3,12 +3,11 @@ | ||
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="/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" id="goods-consults"> |
10 | {{#list}} | 10 | {{#list}} |
11 | - <div class="gap-block"></div> | ||
12 | <div class="consult-item"> | 11 | <div class="consult-item"> |
13 | <div class="question"> | 12 | <div class="question"> |
14 | <span class="iconfont"></span> | 13 | <span class="iconfont"></span> |
@@ -27,5 +26,9 @@ | @@ -27,5 +26,9 @@ | ||
27 | {{/list}} | 26 | {{/list}} |
28 | </div> | 27 | </div> |
29 | {{/ consults}} | 28 | {{/ consults}} |
29 | + | ||
30 | + {{#if loadmore}} | ||
31 | + <input id="loadMoreUrl" type="hidden" value={{loadMoreUrl}}> | ||
32 | + {{/if}} | ||
30 | </div> | 33 | </div> |
31 | {{> layout/footer}} | 34 | {{> layout/footer}} |
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | <div class="good-detail-page yoho-page"> | 2 | <div class="good-detail-page yoho-page"> |
3 | <div class="banner-container"> | 3 | <div class="banner-container"> |
4 | <div class="tag-container"> | 4 | <div class="tag-container"> |
5 | - <p class="good-tag soonSoldOut-tag">即将售罄</p> | 5 | + <!-- <p class="good-tag soonSoldOut-tag">即将售罄</p> --> |
6 | {{# tags}} | 6 | {{# tags}} |
7 | {{# is_new}} | 7 | {{# is_new}} |
8 | <p class="good-tag new-tag">NEW</p> | 8 | <p class="good-tag new-tag">NEW</p> |
@@ -53,6 +53,19 @@ | @@ -53,6 +53,19 @@ | ||
53 | </div> | 53 | </div> |
54 | 54 | ||
55 | {{# vipLevel}} | 55 | {{# vipLevel}} |
56 | + <ul class="vip-level clearfix"> | ||
57 | + {{# list}} | ||
58 | + <li class="icons-item"> | ||
59 | + <span class="vip-img" style="background-size:cover;"> | ||
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 | + | ||
68 | + <!-- {{# vipLevel}} | ||
56 | <div class="vipLevel"> | 69 | <div class="vipLevel"> |
57 | {{# list}} | 70 | {{# list}} |
58 | <span class="vip-img"> | 71 | <span class="vip-img"> |
@@ -61,7 +74,7 @@ | @@ -61,7 +74,7 @@ | ||
61 | <span class="vip-price">{{text}}</span> | 74 | <span class="vip-price">{{text}}</span> |
62 | {{/ list}} | 75 | {{/ list}} |
63 | </div> | 76 | </div> |
64 | - {{/ vipLevel}} | 77 | + {{/ vipLevel}} --> |
65 | 78 | ||
66 | {{# goodsDiscount}} | 79 | {{# goodsDiscount}} |
67 | <div class="goodsDiscount"> | 80 | <div class="goodsDiscount"> |
@@ -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 favorite}} | ||
122 | - <a href="" id="likeBtn" class="favorite iconfont liked"></a> | ||
123 | - {{else}} | ||
124 | - <a href="" class="favorite iconfont"></a> | 132 | + <a href="javascript:;" class="sold-out">已售罄</a> |
125 | {{/if}} | 133 | {{/if}} |
134 | + | ||
135 | + <a href="javascript:;" id="likeBtn" class="favorite iconfont {{#isCollect}}liked{{/isCollect}}"></a> | ||
126 | </div> | 136 | </div> |
127 | {{/cartInfo}} | 137 | {{/cartInfo}} |
128 | 138 |
@@ -45,7 +45,7 @@ | @@ -45,7 +45,7 @@ | ||
45 | <body {{#if isPassportPage}}class=passport-body{{/if}}> | 45 | <body {{#if isPassportPage}}class=passport-body{{/if}}> |
46 | {{#if systemUpdate}} | 46 | {{#if systemUpdate}} |
47 | <div class="systemUpdate"> | 47 | <div class="systemUpdate"> |
48 | - <a href="systemUpdate" class="systemHeader">YOHO!BUY关于系统升级的公告</a> | 48 | + <a href="index/systemUpdate" class="systemHeader">YOHO!BUY关于系统升级的公告</a> |
49 | <span>X</span> | 49 | <span>X</span> |
50 | </div> | 50 | </div> |
51 | {{/if}} | 51 | {{/if}} |
@@ -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}} |
@@ -38,7 +38,7 @@ | @@ -38,7 +38,7 @@ | ||
38 | <div class="question"> | 38 | <div class="question"> |
39 | <span class="iconfont"></span> | 39 | <span class="iconfont"></span> |
40 | <p> | 40 | <p> |
41 | - {{question}} | 41 | + {{question}}<br> |
42 | <span class="time">{{time}}</span> | 42 | <span class="time">{{time}}</span> |
43 | </p> | 43 | </p> |
44 | </div> | 44 | </div> |
@@ -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> |
@@ -49,6 +49,7 @@ class HomeController extends AbstractAction | @@ -49,6 +49,7 @@ class HomeController extends AbstractAction | ||
49 | 49 | ||
50 | $data = array( | 50 | $data = array( |
51 | 'myIndexPage' => true, | 51 | 'myIndexPage' => true, |
52 | + 'showDownloadApp' => true, | ||
52 | 'pageFooter' => true | 53 | 'pageFooter' => true |
53 | ); | 54 | ); |
54 | if ($this->_uid) { | 55 | if ($this->_uid) { |
@@ -122,7 +123,7 @@ class HomeController extends AbstractAction | @@ -122,7 +123,7 @@ class HomeController extends AbstractAction | ||
122 | 123 | ||
123 | if ($this->isAjax()) { | 124 | if ($this->isAjax()) { |
124 | $uid = $this->getUid(); | 125 | $uid = $this->getUid(); |
125 | - $fav_id = $this->post('fav_id', 0); | 126 | + $fav_id = $this->post('id', 0); |
126 | 127 | ||
127 | $result = UserModel::favoriteDelete($this->_uid, $fav_id); | 128 | $result = UserModel::favoriteDelete($this->_uid, $fav_id); |
128 | } | 129 | } |
@@ -38,9 +38,11 @@ class IndexController extends AbstractAction | @@ -38,9 +38,11 @@ class IndexController extends AbstractAction | ||
38 | * | 38 | * |
39 | */ | 39 | */ |
40 | 40 | ||
41 | - public function systemUpdate() | 41 | + public function systemUpdateAction() |
42 | { | 42 | { |
43 | - $this->_view->display('systemUpdate',''); | 43 | + $this->setTitle('关于系统升级的公告'); |
44 | + | ||
45 | + $this->_view->display('systemUpdate'); | ||
44 | } | 46 | } |
45 | 47 | ||
46 | } | 48 | } |
@@ -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 | } |
@@ -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']; |
@@ -201,9 +201,9 @@ class UserModel | @@ -201,9 +201,9 @@ class UserModel | ||
201 | $product['fav_id'] = $val['product_id']; | 201 | $product['fav_id'] = $val['product_id']; |
202 | $product['imgUrl'] = Helpers::getImageUrl($val['image'], 140, 140); | 202 | $product['imgUrl'] = Helpers::getImageUrl($val['image'], 140, 140); |
203 | $product['title'] = $val['product_name']; | 203 | $product['title'] = $val['product_name']; |
204 | - $product['price'] = '¥'.$val['market_price']; | ||
205 | - $product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥'.$val['sales_price'] : false; | ||
206 | - $product['savePrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥'.($val['market_price'] - $val['sales_price']) : false; | 204 | + $product['price'] = !empty($val['market_price']) ? '¥'.$val['market_price'] . '.00' : 0; |
205 | + $product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥' . $val['sales_price'] . '.00' : false; | ||
206 | + $product['savePrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥'.($val['market_price'] - $val['sales_price']) . '.00' : false; | ||
207 | $product['sellOut'] = (bool)($val['price_down']); | 207 | $product['sellOut'] = (bool)($val['price_down']); |
208 | 208 | ||
209 | $result[] = $product; | 209 | $result[] = $product; |
@@ -203,6 +203,12 @@ class DetailModel | @@ -203,6 +203,12 @@ class DetailModel | ||
203 | 'goodsInstore' => $baseInfo['storage'], | 203 | 'goodsInstore' => $baseInfo['storage'], |
204 | ); | 204 | ); |
205 | 205 | ||
206 | + // 是否收藏 | ||
207 | + $result['isCollect'] = false; | ||
208 | + if (isset($baseInfo['isCollect']) && $baseInfo['isCollect'] === 'Y') { | ||
209 | + $result['isCollect'] = true; | ||
210 | + } | ||
211 | + | ||
206 | // 底部简介的URL链接 | 212 | // 底部简介的URL链接 |
207 | $result['introUrl'] = Helpers::url('/product/intro_' . $baseInfo['erpProductId'] . '/' . $baseInfo['cnAlphabet'] . '.html'); | 213 | $result['introUrl'] = Helpers::url('/product/intro_' . $baseInfo['erpProductId'] . '/' . $baseInfo['cnAlphabet'] . '.html'); |
208 | $result['id'] = $productId; | 214 | $result['id'] = $productId; |
-
Please register or login to post a comment