Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
12 changed files
with
158 additions
and
48 deletions
framework @ 75bbc3b0
@@ -22,7 +22,7 @@ class HelpData | @@ -22,7 +22,7 @@ class HelpData | ||
22 | $param['method'] = 'app.help.li'; | 22 | $param['method'] = 'app.help.li'; |
23 | $param['client_secret'] = Sign::getSign($param); | 23 | $param['client_secret'] = Sign::getSign($param); |
24 | 24 | ||
25 | - return Yohobuy::post(Yohobuy::API_URL, $param, $param); | 25 | + return Yohobuy::post(Yohobuy::API_URL, $param); |
26 | } | 26 | } |
27 | 27 | ||
28 | 28 |
@@ -6,7 +6,9 @@ | @@ -6,7 +6,9 @@ | ||
6 | 6 | ||
7 | var $ = require('jquery'), | 7 | var $ = require('jquery'), |
8 | lazyLoad = require('yoho.lazyload'), | 8 | lazyLoad = require('yoho.lazyload'), |
9 | - Hammer = require('yoho.hammer'); | 9 | + Hammer = require('yoho.hammer'), |
10 | + dialog = require('./dialog'), | ||
11 | + tip = require('../plugin/tip'); | ||
10 | 12 | ||
11 | var orderId = $('#order-detail').data('id'); | 13 | var orderId = $('#order-detail').data('id'); |
12 | 14 | ||
@@ -24,26 +26,64 @@ optHammer.on('tap', function(e) { | @@ -24,26 +26,64 @@ optHammer.on('tap', function(e) { | ||
24 | if ($cur.hasClass('btn-del')) { | 26 | if ($cur.hasClass('btn-del')) { |
25 | 27 | ||
26 | //删除订单 | 28 | //删除订单 |
27 | - if (confirm('确定删除订单吗?')) { | 29 | + dialog.showDialog({ |
30 | + dialogText: '确定删除订单吗?', | ||
31 | + hasFooter: { | ||
32 | + leftBtnText: '取消', | ||
33 | + rightBtnText: '确定' | ||
34 | + } | ||
35 | + }, function() { | ||
28 | $.ajax({ | 36 | $.ajax({ |
29 | type: 'GET', | 37 | type: 'GET', |
30 | url: '/home/delOrder', | 38 | url: '/home/delOrder', |
31 | data: { | 39 | data: { |
32 | id: orderId | 40 | id: orderId |
33 | } | 41 | } |
34 | - }); | 42 | + }).then(function(res) { |
43 | + $('#dialog-wrapper').hide(); | ||
44 | + if (!res) { | ||
45 | + tip.show('网络错误'); | ||
46 | + } | ||
47 | + if (res.code === 200) { | ||
48 | + tip.show('删除成功'); | ||
49 | + } else { | ||
50 | + tip.show(res.message || '网络错误'); | ||
35 | } | 51 | } |
52 | + window.location.href = '/home/orders'; | ||
53 | + }).fail(function() { | ||
54 | + tip.show('网络错误'); | ||
55 | + }); | ||
56 | + }); | ||
36 | } else if ($cur.hasClass('btn-cancel')) { | 57 | } else if ($cur.hasClass('btn-cancel')) { |
37 | 58 | ||
38 | //取消订单 | 59 | //取消订单 |
39 | - if (confirm('确定取消订单吗?')) { | 60 | + dialog.showDialog({ |
61 | + dialogText: '确定取消订单吗?', | ||
62 | + hasFooter: { | ||
63 | + leftBtnText: '取消', | ||
64 | + rightBtnText: '确定' | ||
65 | + } | ||
66 | + }, function() { | ||
40 | $.ajax({ | 67 | $.ajax({ |
41 | type: 'GET', | 68 | type: 'GET', |
42 | url: '/home/cancelOrder', | 69 | url: '/home/cancelOrder', |
43 | data: { | 70 | data: { |
44 | id: orderId | 71 | id: orderId |
45 | } | 72 | } |
46 | - }); | 73 | + }).then(function(res) { |
74 | + $('#dialog-wrapper').hide(); | ||
75 | + if (!res) { | ||
76 | + tip.show('网络错误'); | ||
77 | + } | ||
78 | + if (res.code === 200) { | ||
79 | + tip.show('取消成功'); | ||
80 | + } else { | ||
81 | + tip.show(res.message || '网络错误'); | ||
47 | } | 82 | } |
83 | + window.location.reload(); | ||
84 | + }).fail(function() { | ||
85 | + tip.show('网络错误'); | ||
86 | + }); | ||
87 | + }); | ||
48 | } | 88 | } |
49 | }); | 89 | }); |
@@ -100,8 +100,8 @@ function submitOrder() { | @@ -100,8 +100,8 @@ function submitOrder() { | ||
100 | data: { | 100 | data: { |
101 | addressId: orderInfo('addressId'), | 101 | addressId: orderInfo('addressId'), |
102 | cartType: orderInfo('cartType'), | 102 | cartType: orderInfo('cartType'), |
103 | - deliveryId: orderInfo('deliveryId') || 1, | ||
104 | - deliveryTimeId: orderInfo('deliveryTimeId') || 2, | 103 | + deliveryId: orderInfo('deliveryId'), |
104 | + deliveryTimeId: orderInfo('deliveryTimeId'), | ||
105 | invoiceText: $invoice.find('[name="invoice-title"]').val() || orderInfo('invoiceText'), | 105 | invoiceText: $invoice.find('[name="invoice-title"]').val() || orderInfo('invoiceText'), |
106 | invoiceType: $invoice.find('.invoice-type').val() || orderInfo('invoiceType'), | 106 | invoiceType: $invoice.find('.invoice-type').val() || orderInfo('invoiceType'), |
107 | msg: $('#msg').find('input').val() || orderInfo('msg'), | 107 | msg: $('#msg').find('input').val() || orderInfo('msg'), |
@@ -30,6 +30,7 @@ $newCoupon.on('submit', function() { | @@ -30,6 +30,7 @@ $newCoupon.on('submit', function() { | ||
30 | if (res.code === 200) { | 30 | if (res.code === 200) { |
31 | tip.show('优惠券可用'); | 31 | tip.show('优惠券可用'); |
32 | orderInfo('couponCode', res.data.coupon_code); | 32 | orderInfo('couponCode', res.data.coupon_code); |
33 | + orderInfo('couponValue', res.data.coupon_value); | ||
33 | window.location.href = '/shoppingCart/orderEnsure?coupon_code=' + res.data.coupon_code; | 34 | window.location.href = '/shoppingCart/orderEnsure?coupon_code=' + res.data.coupon_code; |
34 | } else { | 35 | } else { |
35 | tip.show(res.message); | 36 | tip.show(res.message); |
@@ -93,7 +93,7 @@ | @@ -93,7 +93,7 @@ | ||
93 | } | 93 | } |
94 | 94 | ||
95 | .coupon-count { | 95 | .coupon-count { |
96 | - padding: 5rem / $pxConvertRem; | 96 | + padding: 5rem / $pxConvertRem 15rem / $pxConvertRem; |
97 | background: #f00; | 97 | background: #f00; |
98 | color: #fff; | 98 | color: #fff; |
99 | @include border-radius(10px); | 99 | @include border-radius(10px); |
@@ -104,6 +104,14 @@ | @@ -104,6 +104,14 @@ | ||
104 | .coin-check { | 104 | .coin-check { |
105 | float: right; | 105 | float: right; |
106 | color: #999; | 106 | color: #999; |
107 | + | ||
108 | + &.used { | ||
109 | + color: #f00; | ||
110 | + } | ||
111 | + | ||
112 | + .iconfont { | ||
113 | + color: #999; | ||
114 | + } | ||
107 | } | 115 | } |
108 | 116 | ||
109 | .coin-check { | 117 | .coin-check { |
@@ -115,6 +123,10 @@ | @@ -115,6 +123,10 @@ | ||
115 | color: #000; | 123 | color: #000; |
116 | } | 124 | } |
117 | 125 | ||
126 | + em { | ||
127 | + color: #f00; | ||
128 | + } | ||
129 | + | ||
118 | } | 130 | } |
119 | 131 | ||
120 | .checkbox.icon-checkbox { | 132 | .checkbox.icon-checkbox { |
@@ -187,6 +199,10 @@ | @@ -187,6 +199,10 @@ | ||
187 | } | 199 | } |
188 | } | 200 | } |
189 | 201 | ||
202 | + .price-cal { | ||
203 | + font-family: monospace; | ||
204 | + } | ||
205 | + | ||
190 | .cost { | 206 | .cost { |
191 | border-top: 1px solid #f7f7f7; | 207 | border-top: 1px solid #f7f7f7; |
192 | line-height: 100rem / $pxConvertRem; | 208 | line-height: 100rem / $pxConvertRem; |
@@ -44,7 +44,6 @@ | @@ -44,7 +44,6 @@ | ||
44 | {{# coupon}} | 44 | {{# coupon}} |
45 | <li class="coupon"> | 45 | <li class="coupon"> |
46 | <a href="/shoppingCart/selectCoupon"> | 46 | <a href="/shoppingCart/selectCoupon"> |
47 | - <!-- <a href="{{url}}"> --> | ||
48 | <span class="title">优惠券</span> | 47 | <span class="title">优惠券</span> |
49 | {{#if count}} | 48 | {{#if count}} |
50 | <span class="coupon-count"> | 49 | <span class="coupon-count"> |
@@ -122,7 +121,7 @@ | @@ -122,7 +121,7 @@ | ||
122 | {{/couponPrice}} | 121 | {{/couponPrice}} |
123 | <li> | 122 | <li> |
124 | <span>YOHO币</span> | 123 | <span>YOHO币</span> |
125 | - - {{yohoCoin}} | 124 | + - ¥{{yohoCoin}} |
126 | </li> | 125 | </li> |
127 | <li class="cost"> | 126 | <li class="cost"> |
128 | 应付金额: <em>¥{{price}}</em> | 127 | 应付金额: <em>¥{{price}}</em> |
@@ -845,7 +845,7 @@ class HomeController extends AbstractAction | @@ -845,7 +845,7 @@ class HomeController extends AbstractAction | ||
845 | 845 | ||
846 | $this->_view->display('order-detail', array( | 846 | $this->_view->display('order-detail', array( |
847 | 'orderDetailPage' => true, | 847 | 'orderDetailPage' => true, |
848 | - 'orderDetail' => OrderModel::orderDetail($orderCode, $this->_uid, $this->_session), | 848 | + 'orderDetail' => OrderModel::orderDetail($orderCode, $this->_uid, $this->_usession), |
849 | )); | 849 | )); |
850 | } | 850 | } |
851 | 851 | ||
@@ -867,7 +867,8 @@ class HomeController extends AbstractAction | @@ -867,7 +867,8 @@ class HomeController extends AbstractAction | ||
867 | /** | 867 | /** |
868 | * 帮助中心列表详细信息 | 868 | * 帮助中心列表详细信息 |
869 | */ | 869 | */ |
870 | - public function helpDetailAction() { | 870 | + public function helpDetailAction() |
871 | + { | ||
871 | $caption = $this->get('caption', '帮助中心'); | 872 | $caption = $this->get('caption', '帮助中心'); |
872 | $code = $this->get('code', 0); | 873 | $code = $this->get('code', 0); |
873 | if (empty($code)) { | 874 | if (empty($code)) { |
@@ -877,9 +878,8 @@ class HomeController extends AbstractAction | @@ -877,9 +878,8 @@ class HomeController extends AbstractAction | ||
877 | $this->setTitle($caption); | 878 | $this->setTitle($caption); |
878 | $this->setNavHeader($caption); | 879 | $this->setNavHeader($caption); |
879 | 880 | ||
880 | - $service = Home\HelpModel::serviceDetail($code); | ||
881 | $this->_view->display('helpDetail', array( | 881 | $this->_view->display('helpDetail', array( |
882 | - 'iHelp' => $service, | 882 | + 'iHelp' => Home\HelpModel::serviceDetail($code), |
883 | )); | 883 | )); |
884 | } | 884 | } |
885 | 885 |
@@ -13,6 +13,7 @@ class ShoppingCartController extends AbstractAction | @@ -13,6 +13,7 @@ class ShoppingCartController extends AbstractAction | ||
13 | /* | 13 | /* |
14 | * 购物车首页 | 14 | * 购物车首页 |
15 | */ | 15 | */ |
16 | + | ||
16 | public function indexAction() | 17 | public function indexAction() |
17 | { | 18 | { |
18 | $this->setTitle('购物车'); | 19 | $this->setTitle('购物车'); |
@@ -29,9 +30,11 @@ class ShoppingCartController extends AbstractAction | @@ -29,9 +30,11 @@ class ShoppingCartController extends AbstractAction | ||
29 | // 渲染模板 | 30 | // 渲染模板 |
30 | $this->_view->display('index', $data); | 31 | $this->_view->display('index', $data); |
31 | } | 32 | } |
33 | + | ||
32 | /* | 34 | /* |
33 | * 异步获取购物车数据 | 35 | * 异步获取购物车数据 |
34 | */ | 36 | */ |
37 | + | ||
35 | public function getCartDataAction() | 38 | public function getCartDataAction() |
36 | { | 39 | { |
37 | $result = array(); | 40 | $result = array(); |
@@ -115,6 +118,7 @@ class ShoppingCartController extends AbstractAction | @@ -115,6 +118,7 @@ class ShoppingCartController extends AbstractAction | ||
115 | /* | 118 | /* |
116 | * 获取购物车商品数据 | 119 | * 获取购物车商品数据 |
117 | */ | 120 | */ |
121 | + | ||
118 | public function goodinfoAction() | 122 | public function goodinfoAction() |
119 | { | 123 | { |
120 | $result = array(); | 124 | $result = array(); |
@@ -137,6 +141,7 @@ class ShoppingCartController extends AbstractAction | @@ -137,6 +141,7 @@ class ShoppingCartController extends AbstractAction | ||
137 | /* | 141 | /* |
138 | * 获取购物车加价购商品数据 | 142 | * 获取购物车加价购商品数据 |
139 | */ | 143 | */ |
144 | + | ||
140 | public function giftinfoAction() | 145 | public function giftinfoAction() |
141 | { | 146 | { |
142 | $result = array(); | 147 | $result = array(); |
@@ -166,10 +171,10 @@ class ShoppingCartController extends AbstractAction | @@ -166,10 +171,10 @@ class ShoppingCartController extends AbstractAction | ||
166 | $uid = $this->getUid(true); | 171 | $uid = $this->getUid(true); |
167 | 172 | ||
168 | $params = array(); | 173 | $params = array(); |
169 | - $params['old_product_sku']= $this->post('old_product_sku', 0); | ||
170 | - $params['new_product_sku']= $this->post('new_product_sku', 0); | ||
171 | - $params['buy_number']= $this->post('buy_number', 0); | ||
172 | - $params['selected']= $this->post('selected', null); | 174 | + $params['old_product_sku'] = $this->post('old_product_sku', 0); |
175 | + $params['new_product_sku'] = $this->post('new_product_sku', 0); | ||
176 | + $params['buy_number'] = $this->post('buy_number', 0); | ||
177 | + $params['selected'] = $this->post('selected', null); | ||
173 | $result = CartModel::modifyCartProduct($uid, $params, $shoppingKey); | 178 | $result = CartModel::modifyCartProduct($uid, $params, $shoppingKey); |
174 | } | 179 | } |
175 | 180 | ||
@@ -328,4 +333,40 @@ class ShoppingCartController extends AbstractAction | @@ -328,4 +333,40 @@ class ShoppingCartController extends AbstractAction | ||
328 | $this->echoJson($result); | 333 | $this->echoJson($result); |
329 | } | 334 | } |
330 | } | 335 | } |
336 | + | ||
337 | + /** | ||
338 | + * 加入购物车 | ||
339 | + * | ||
340 | + * @param string productSku 商品的SKU | ||
341 | + * @param int buyNumber 购买数量 | ||
342 | + * @param int promotionId 促销ID, 加价购有关 | ||
343 | + * @param int goodsType 商品类型,0表示普通商品,1表示加价购商品 | ||
344 | + * @param int isEdit 是否是编辑商品SKU,0表示不是编辑 | ||
345 | + * @return json | ||
346 | + */ | ||
347 | + public function addAction() | ||
348 | + { | ||
349 | + $result = array(); | ||
350 | + | ||
351 | + if ($this->isAjax()) { | ||
352 | + $shoppingKey = Helpers::getShoppingKeyByCookie(); | ||
353 | + $productSku = $this->post('productSku'); | ||
354 | + $buyNumber = $this->post('buyNumber', 1); | ||
355 | + $goodsType = $this->post('goodsType', 0); | ||
356 | + $promotionId = $this->post('promotionId', 0); | ||
357 | + $isEdit = $this->post('isEdit', 0); | ||
358 | + $uid = $this->getUid(true); | ||
359 | + | ||
360 | + // 执行加入购物车操作 | ||
361 | + $result = CartModel::addToCart($productSku, $buyNumber, $goodsType, $isEdit, $promotionId, $uid, $shoppingKey); | ||
362 | + | ||
363 | + // 设置加入购物车凭证到客户端浏览器 | ||
364 | + if (isset($result['data']['shopping_key'])) { | ||
365 | + $this->setCookie('_spk', $shoppingKey); | ||
366 | + } | ||
367 | + } | ||
368 | + | ||
369 | + $this->echoJson($result); | ||
370 | + } | ||
371 | + | ||
331 | } | 372 | } |
@@ -8,36 +8,37 @@ use Plugin\Helpers; | @@ -8,36 +8,37 @@ use Plugin\Helpers; | ||
8 | /** | 8 | /** |
9 | * 帮助中心相关数据处理 | 9 | * 帮助中心相关数据处理 |
10 | */ | 10 | */ |
11 | - | ||
12 | -class HelpModel { | 11 | +class HelpModel |
12 | +{ | ||
13 | /* | 13 | /* |
14 | * 获取帮助中心列表 | 14 | * 获取帮助中心列表 |
15 | */ | 15 | */ |
16 | - | ||
17 | - public static function serviceInfo() { | ||
18 | - //调用接口获取数据 | ||
19 | - $res = json_decode(HelpData::serviceInfo(), TRUE); | ||
20 | - $cateInfo = $res['data']; | 16 | + public static function serviceInfo() |
17 | + { | ||
21 | $iHelp = array(); | 18 | $iHelp = array(); |
22 | - $list = array(); | ||
23 | - if ($cateInfo) { | ||
24 | - foreach ($cateInfo as $key => $value) { | 19 | + |
20 | + $cateInfo = HelpData::serviceInfo(); | ||
21 | + if (!empty($cateInfo['data'])) { | ||
22 | + foreach ($cateInfo['data'] as $key => $value) { | ||
25 | $iHelp[$key]['name'] = $value['caption']; | 23 | $iHelp[$key]['name'] = $value['caption']; |
26 | $iHelp[$key]['code'] = $value['code']; | 24 | $iHelp[$key]['code'] = $value['code']; |
27 | - $iHelp[$key]['url'] = Helpers::url('/home/helpDetail', array('code' => $value['code'], 'caption' => $value['caption']) ); | 25 | + $iHelp[$key]['url'] = Helpers::url('/home/helpDetail', array('code' => $value['code'], 'caption' => $value['caption'])); |
28 | } | 26 | } |
29 | } | 27 | } |
28 | + | ||
30 | return $iHelp; | 29 | return $iHelp; |
31 | } | 30 | } |
32 | 31 | ||
33 | /* | 32 | /* |
34 | * 获取帮助中心详细内容 | 33 | * 获取帮助中心详细内容 |
35 | */ | 34 | */ |
36 | - public static function serviceDetail($code) { | 35 | + |
36 | + public static function serviceDetail($code) | ||
37 | + { | ||
37 | $res = HelpData::serviceDetail($code); | 38 | $res = HelpData::serviceDetail($code); |
38 | if (!empty($res)) { | 39 | if (!empty($res)) { |
39 | - if (false !== ($part = strstr($res,'<div class="deal_main">'))) { | ||
40 | - $res = strstr($part,'</body>',TRUE); | 40 | + if (false !== ($part = strstr($res, '<body>'))) { |
41 | + $res = strstr($part, '</body>', true); | ||
41 | } | 42 | } |
42 | } | 43 | } |
43 | return $res; | 44 | return $res; |
@@ -160,17 +160,15 @@ class DetailModel | @@ -160,17 +160,15 @@ class DetailModel | ||
160 | $colorGroup = array(); | 160 | $colorGroup = array(); |
161 | $sizeList = array(); | 161 | $sizeList = array(); |
162 | $goodsGroup = array(); | 162 | $goodsGroup = array(); |
163 | - $coverImage = ''; | ||
164 | - $colorStorageNum = 0; // 颜色的库存总数 | 163 | + $thumbImageList = array(); |
164 | + $colorStorageGroup = array(); // 颜色分组的库存总数集合, 多个之间用/分隔 | ||
165 | + $sizeStorageStr = ''; // 尺码库存总数集合, 多个之间用/分隔 | ||
166 | + $colorStorageNum = 0; | ||
165 | $totalStorageNum = 0; // 总库存数 | 167 | $totalStorageNum = 0; // 总库存数 |
166 | - foreach ($baseInfo['goodsList'] as $i => $value) { | 168 | + foreach ($baseInfo['goodsList'] as $value) { |
167 | $sizeList = array(); | 169 | $sizeList = array(); |
168 | $colorStorageNum = 0; | 170 | $colorStorageNum = 0; |
169 | - | ||
170 | - // 获取默认的封面图 | ||
171 | - if ($i === 0) { | ||
172 | - $coverImage = Helpers::getImageUrl($value['colorImage'], 60, 60); | ||
173 | - } | 171 | + $sizeStorageStr = ''; // clear to empty |
174 | 172 | ||
175 | // 商品分组 | 173 | // 商品分组 |
176 | if (isset($value['goodsImagesList'])) { | 174 | if (isset($value['goodsImagesList'])) { |
@@ -189,10 +187,13 @@ class DetailModel | @@ -189,10 +187,13 @@ class DetailModel | ||
189 | 'id' => $size['id'], | 187 | 'id' => $size['id'], |
190 | 'skuId' => $size['goodsSizeSkuId'], | 188 | 'skuId' => $size['goodsSizeSkuId'], |
191 | 'goodsId' => $size['goodsId'], | 189 | 'goodsId' => $size['goodsId'], |
190 | + 'colorId' => $value['colorId'], | ||
192 | 'name' => $size['sizeName'], | 191 | 'name' => $size['sizeName'], |
193 | 'sizeNum' => $size['goodsSizeStorageNum'], | 192 | 'sizeNum' => $size['goodsSizeStorageNum'], |
194 | ); | 193 | ); |
195 | $colorStorageNum += intval($size['goodsSizeStorageNum']); | 194 | $colorStorageNum += intval($size['goodsSizeStorageNum']); |
195 | + $sizeStorageStr .= $size['goodsSizeStorageNum'] . '/'; | ||
196 | + $colorStorageGroup[ $size['sizeName'] ][ $value['colorName'] ] = $size['goodsSizeStorageNum']; | ||
196 | } | 197 | } |
197 | } | 198 | } |
198 | 199 | ||
@@ -202,11 +203,19 @@ class DetailModel | @@ -202,11 +203,19 @@ class DetailModel | ||
202 | 'skcId' => $value['productSkc'], | 203 | 'skcId' => $value['productSkc'], |
203 | 'name' => $value['colorName'], | 204 | 'name' => $value['colorName'], |
204 | 'goodsName' => $value['goodsName'], | 205 | 'goodsName' => $value['goodsName'], |
205 | - 'shortUrl' => Helpers::getImageUrl($value['colorImage'], 60, 60), | ||
206 | 'colorNum' => $colorStorageNum, | 206 | 'colorNum' => $colorStorageNum, |
207 | - 'sizes' => $sizeList, | 207 | + 'sizeNumStr' => rtrim($sizeStorageStr, '/'), |
208 | ); | 208 | ); |
209 | 209 | ||
210 | + // 缩略图 | ||
211 | + $thumbImageList[] = array('img' => Helpers::getImageUrl($value['colorImage'], 60, 60) ); | ||
212 | + | ||
213 | + // 统计每个尺码对应的各个颜色的库存量 | ||
214 | + foreach ($sizeList as &$sizeArr) { | ||
215 | + $sizeArr['colorNumStr'] = implode('/', array_values($colorStorageGroup[ $sizeArr['name'] ]) ); | ||
216 | + } | ||
217 | + | ||
218 | + // 商品库存总数 | ||
210 | $totalStorageNum += $colorStorageNum; | 219 | $totalStorageNum += $colorStorageNum; |
211 | } | 220 | } |
212 | 221 | ||
@@ -238,12 +247,13 @@ class DetailModel | @@ -238,12 +247,13 @@ class DetailModel | ||
238 | if (!$soldOut && !$notForSale) { | 247 | if (!$soldOut && !$notForSale) { |
239 | $result['cartInfo']['addToCartUrl'] = Helpers::url('/product/buy_' . $productId . '_' . $goodsId . '.html'); | 248 | $result['cartInfo']['addToCartUrl'] = Helpers::url('/product/buy_' . $productId . '_' . $goodsId . '.html'); |
240 | $result['cartInfo']['productId'] = $productId; | 249 | $result['cartInfo']['productId'] = $productId; |
241 | - $result['cartInfo']['thumb'] = $coverImage; | 250 | + $result['cartInfo']['thumbs'] = $thumbImageList; |
242 | $result['cartInfo']['name'] = isset($result['goodsName']) ? $result['goodsName'] : ''; | 251 | $result['cartInfo']['name'] = isset($result['goodsName']) ? $result['goodsName'] : ''; |
243 | $result['cartInfo']['price'] = isset($result['goodsPrice']['currentPrice']) ? $result['goodsPrice']['currentPrice'] : ''; | 252 | $result['cartInfo']['price'] = isset($result['goodsPrice']['currentPrice']) ? $result['goodsPrice']['currentPrice'] : ''; |
244 | $result['cartInfo']['salePrice'] = isset($result['goodsPrice']['previousPrice']) ? $result['goodsPrice']['previousPrice'] : ''; | 253 | $result['cartInfo']['salePrice'] = isset($result['goodsPrice']['previousPrice']) ? $result['goodsPrice']['previousPrice'] : ''; |
245 | $result['cartInfo']['totalNum'] = $totalStorageNum; | 254 | $result['cartInfo']['totalNum'] = $totalStorageNum; |
246 | $result['cartInfo']['colors'] = $colorGroup; | 255 | $result['cartInfo']['colors'] = $colorGroup; |
256 | + $result['cartInfo']['sizes'] = $sizeList; | ||
247 | } | 257 | } |
248 | // 非卖品 | 258 | // 非卖品 |
249 | elseif ($notForSale) { | 259 | elseif ($notForSale) { |
@@ -336,7 +346,7 @@ class DetailModel | @@ -336,7 +346,7 @@ class DetailModel | ||
336 | 346 | ||
337 | $referenceList = array(); | 347 | $referenceList = array(); |
338 | // 判断是否显示参考尺码 | 348 | // 判断是否显示参考尺码 |
339 | - $showReference = !empty($sizeInfo['sizeInfoBo']['sizeBoList'][0]['referenceSize']) && ($sizeInfo['sizeInfoBo']['sizeBoList'][0]['referenceSize']['gender'] == $gender || $sizeInfo['sizeInfoBo']['sizeBoList'][0]['referenceSize']['gender'] == 3); | 349 | + $showReference = !empty($sizeInfo['sizeInfoBo']['sizeBoList'][0]['referenceSize']); |
340 | if ($showReference) { | 350 | if ($showReference) { |
341 | $referenceList[0] = array('param' => $referenceName); | 351 | $referenceList[0] = array('param' => $referenceName); |
342 | } | 352 | } |
@@ -351,7 +361,10 @@ class DetailModel | @@ -351,7 +361,10 @@ class DetailModel | ||
351 | foreach ($sizeInfo['sizeInfoBo']['sizeBoList'] as $value) { | 361 | foreach ($sizeInfo['sizeInfoBo']['sizeBoList'] as $value) { |
352 | $item = array(); | 362 | $item = array(); |
353 | $sizeNameList[] = array('param' => $value['sizeName']); | 363 | $sizeNameList[] = array('param' => $value['sizeName']); |
354 | - if (!empty($value['referenceSize']['gender']) && ($value['referenceSize']['gender'] == $gender || $value['referenceSize']['gender'] == 3)) { | 364 | + if (!empty($value['referenceSize']['gender']) && $boyReference && ($value['referenceSize']['gender'] == 1 || $value['referenceSize']['gender'] == 3)) { |
365 | + $referenceList[] = array('param' => empty($value['referenceSize']['referenceName']) ? ' ' : $value['referenceSize']['referenceName']); | ||
366 | + } | ||
367 | + elseif (!empty($value['referenceSize']['gender']) && $girlReference && ($value['referenceSize']['gender'] == 2 || $value['referenceSize']['gender'] == 3)) { | ||
355 | $referenceList[] = array('param' => empty($value['referenceSize']['referenceName']) ? ' ' : $value['referenceSize']['referenceName']); | 368 | $referenceList[] = array('param' => empty($value['referenceSize']['referenceName']) ? ' ' : $value['referenceSize']['referenceName']); |
356 | } | 369 | } |
357 | foreach ($value['sortAttributes'] as $attr) { | 370 | foreach ($value['sortAttributes'] as $attr) { |
-
Please register or login to post a comment