Merge branch 'hotfix/apichange-bug' into develop
Showing
7 changed files
with
59 additions
and
28 deletions
@@ -21,6 +21,7 @@ class UserData | @@ -21,6 +21,7 @@ class UserData | ||
21 | * 个人详情数据 | 21 | * 个人详情数据 |
22 | * | 22 | * |
23 | * @param int $uid 用户ID | 23 | * @param int $uid 用户ID |
24 | + * @param int $udid 客户端唯一标识 | ||
24 | * @return array 个人详情接口返回的数据 | 25 | * @return array 个人详情接口返回的数据 |
25 | */ | 26 | */ |
26 | public static function userData($uid) | 27 | public static function userData($uid) |
@@ -39,11 +40,12 @@ class UserData | @@ -39,11 +40,12 @@ class UserData | ||
39 | * @param int $uid 用户ID | 40 | * @param int $uid 用户ID |
40 | * @return array 接口返回的数据 | 41 | * @return array 接口返回的数据 |
41 | */ | 42 | */ |
42 | - public static function infoNum($uid) | 43 | + public static function infoNum($uid, $udid) |
43 | { | 44 | { |
44 | $param = Yohobuy::param(); | 45 | $param = Yohobuy::param(); |
45 | $param['method'] = 'app.home.getInfoNum'; | 46 | $param['method'] = 'app.home.getInfoNum'; |
46 | $param['uid'] = $uid; | 47 | $param['uid'] = $uid; |
48 | + $param['udid'] = $udid; | ||
47 | $param['client_secret'] = Sign::getSign($param); | 49 | $param['client_secret'] = Sign::getSign($param); |
48 | 50 | ||
49 | return Yohobuy::get(Yohobuy::API_URL, $param); | 51 | return Yohobuy::get(Yohobuy::API_URL, $param); |
@@ -189,7 +191,23 @@ class UserData | @@ -189,7 +191,23 @@ class UserData | ||
189 | } | 191 | } |
190 | 192 | ||
191 | /** | 193 | /** |
192 | - * YOHO币数据 | 194 | + * YOHO币总数 |
195 | + * | ||
196 | + * @param int $uid 用户ID | ||
197 | + * @return array YOHO币接口返回的数据 | ||
198 | + */ | ||
199 | + public static function yohoCoinTotal($uid) | ||
200 | + { | ||
201 | + $param = Yohobuy::param(); | ||
202 | + $param['method'] = 'app.yohocoin.total'; | ||
203 | + $param['uid'] = $uid; | ||
204 | + $param['client_secret'] = Sign::getSign($param); | ||
205 | + | ||
206 | + return Yohobuy::get(Yohobuy::API_URL, $param); | ||
207 | + } | ||
208 | + | ||
209 | + /** | ||
210 | + * YOHO币列表数据 | ||
193 | * | 211 | * |
194 | * @param int $uid 用户ID | 212 | * @param int $uid 用户ID |
195 | * @param int $page 第几页,默认1 | 213 | * @param int $page 第几页,默认1 |
@@ -2,10 +2,9 @@ | @@ -2,10 +2,9 @@ | ||
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 new-tag">NEW</p> | ||
6 | {{# tags}} | 5 | {{# tags}} |
7 | {{# is_new}} | 6 | {{# is_new}} |
8 | - <!-- <p class="good-tag new-tag">NEW</p> --> | 7 | + <p class="good-tag new-tag">NEW</p> |
9 | {{/ is_new}} | 8 | {{/ is_new}} |
10 | {{# is_advance}} | 9 | {{# is_advance}} |
11 | <p class="good-tag renew-tag">再到着</p> | 10 | <p class="good-tag renew-tag">再到着</p> |
@@ -22,7 +22,10 @@ | @@ -22,7 +22,10 @@ | ||
22 | <ul class="swiper-wrapper swiper-wrapper-{{id}}"> | 22 | <ul class="swiper-wrapper swiper-wrapper-{{id}}"> |
23 | {{# productList}} | 23 | {{# productList}} |
24 | <li class="swiper-slide"> | 24 | <li class="swiper-slide"> |
25 | - <img class="swiper-lazy" data-src="{{imgUrl}}" alt=""/> | 25 | + <a href="{{link}}"> |
26 | + <img class="swiper-lazy" data-src="{{imgUrl}}" alt=""/> | ||
27 | + </a> | ||
28 | + | ||
26 | <div class="brand-product"> | 29 | <div class="brand-product"> |
27 | <div class="{{# discount}}price-discount{{/ discount}}"> | 30 | <div class="{{# discount}}price-discount{{/ discount}}"> |
28 | {{# discount}}<span>{{.}}<span>{{/ discount}} | 31 | {{# discount}}<span>{{.}}<span>{{/ discount}} |
@@ -277,14 +277,11 @@ | @@ -277,14 +277,11 @@ | ||
277 | </script> | 277 | </script> |
278 | {{/if}} | 278 | {{/if}} |
279 | {{#if browseRecordPage}} | 279 | {{#if browseRecordPage}} |
280 | -<<<<<<< HEAD | ||
281 | <script> | 280 | <script> |
282 | seajs.use('js/me/browse-record'); | 281 | seajs.use('js/me/browse-record'); |
283 | </script> | 282 | </script> |
284 | {{/if}} | 283 | {{/if}} |
285 | {{#if logisticInfoPage}} | 284 | {{#if logisticInfoPage}} |
286 | -======= | ||
287 | ->>>>>>> feature/hf | ||
288 | <script> | 285 | <script> |
289 | seajs.use('js/me/logistic'); | 286 | seajs.use('js/me/logistic'); |
290 | </script> | 287 | </script> |
@@ -65,8 +65,9 @@ class HomeController extends AbstractAction | @@ -65,8 +65,9 @@ class HomeController extends AbstractAction | ||
65 | ); | 65 | ); |
66 | if ($this->_uid) { | 66 | if ($this->_uid) { |
67 | $data['isLogin'] = true; | 67 | $data['isLogin'] = true; |
68 | + $udid = $this->getUdid(); | ||
68 | $data += UserModel::getUserProfileData($this->_uid); | 69 | $data += UserModel::getUserProfileData($this->_uid); |
69 | - $data += UserModel::getInfoNumData($this->_uid); | 70 | + $data += UserModel::getInfoNumData($this->_uid, $udid); |
70 | 71 | ||
71 | // 优选新品数据 | 72 | // 优选新品数据 |
72 | $channel = Helpers::getChannelByCookie(); | 73 | $channel = Helpers::getChannelByCookie(); |
@@ -46,14 +46,15 @@ class UserModel | @@ -46,14 +46,15 @@ class UserModel | ||
46 | * 处理个人中心页面优惠券,收藏的商品等的数目数据 | 46 | * 处理个人中心页面优惠券,收藏的商品等的数目数据 |
47 | * | 47 | * |
48 | * @param int $uid 用户ID | 48 | * @param int $uid 用户ID |
49 | + * @param int $udid 客户端唯一标识 | ||
49 | * @return array|mixed 处理之后的个人中心页面优惠券,收藏的商品等的数目数据 | 50 | * @return array|mixed 处理之后的个人中心页面优惠券,收藏的商品等的数目数据 |
50 | */ | 51 | */ |
51 | - public static function getInfoNumData($uid) | 52 | + public static function getInfoNumData($uid, $udid) |
52 | { | 53 | { |
53 | $result = array(); | 54 | $result = array(); |
54 | 55 | ||
55 | // 调用接口获取个人中心页面优惠券,收藏的商品等的数目数据 | 56 | // 调用接口获取个人中心页面优惠券,收藏的商品等的数目数据 |
56 | - $infoNumData = UserData::infoNum($uid); | 57 | + $infoNumData = UserData::infoNum($uid, $udid); |
57 | 58 | ||
58 | // 处理个人中心页面优惠券,收藏的商品等的数目数据 | 59 | // 处理个人中心页面优惠券,收藏的商品等的数目数据 |
59 | if (isset($infoNumData['data']) && !empty($infoNumData['data'])) { | 60 | if (isset($infoNumData['data']) && !empty($infoNumData['data'])) { |
@@ -181,9 +182,9 @@ class UserModel | @@ -181,9 +182,9 @@ class UserModel | ||
181 | $product['imgUrl'] = Helpers::getImageUrl($val['image'], 447, 596); | 182 | $product['imgUrl'] = Helpers::getImageUrl($val['image'], 447, 596); |
182 | ; | 183 | ; |
183 | $product['title'] = $val['product_name']; | 184 | $product['title'] = $val['product_name']; |
184 | - $product['price'] = !empty($val['market_price']) ? '¥' . $val['market_price'] . '.00' : 0; | ||
185 | - $product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥' . $val['sales_price'] . '.00' : false; | ||
186 | - $product['savePrice'] = ($val['price_down'] > 0) ? '¥' . $val['price_down'] . '.00' : false; | 185 | + $product['price'] = !empty($val['market_price']) ? '¥' . $val['market_price'] . '.00' : 0; |
186 | + $product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥' . $val['sales_price'] . '.00' : false; | ||
187 | + $product['savePrice'] = ($val['price_down'] > 0) ? '¥' . $val['price_down'] . '.00' : false; | ||
187 | $product['sellOut'] = ($val['storage'] <= 0); | 188 | $product['sellOut'] = ($val['storage'] <= 0); |
188 | 189 | ||
189 | $datas[] = $product; | 190 | $datas[] = $product; |
@@ -236,7 +237,8 @@ class UserModel | @@ -236,7 +237,8 @@ class UserModel | ||
236 | $product = array(); | 237 | $product = array(); |
237 | foreach ($val['new_product'] as $one) { | 238 | foreach ($val['new_product'] as $one) { |
238 | $product = array(); | 239 | $product = array(); |
239 | - $product['imgUrl'] = Images::getImageUrl($one['default_images'], 235, 314); | 240 | + $product['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : ''; |
241 | + $product['imgUrl'] = (isset($one['default_images']) && !empty($one['default_images'])) ? Images::getImageUrl($one['default_images'], 235, 314) : ''; | ||
240 | $product['price'] = !empty($one['market_price']) ? '¥' . $one['market_price'] . '.00' : 0; | 242 | $product['price'] = !empty($one['market_price']) ? '¥' . $one['market_price'] . '.00' : 0; |
241 | $product['discount'] = !empty($one['sales_price']) ? '¥' . $one['sales_price'] . '.00' : 0; | 243 | $product['discount'] = !empty($one['sales_price']) ? '¥' . $one['sales_price'] . '.00' : 0; |
242 | 244 | ||
@@ -299,9 +301,10 @@ class UserModel | @@ -299,9 +301,10 @@ class UserModel | ||
299 | } else { | 301 | } else { |
300 | $data = $records['data']['product_list']; | 302 | $data = $records['data']['product_list']; |
301 | foreach ($data as &$val) { | 303 | foreach ($data as &$val) { |
302 | - $val['image'] = Helpers::getImageUrl($val['image'], 140, 140); | 304 | + $val['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : ''; |
305 | + $val['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 140, 140) : ''; | ||
303 | $val['sales_price'] = !empty($val['sales_price']) ? $val['sales_price'] . '.00' : 0; | 306 | $val['sales_price'] = !empty($val['sales_price']) ? $val['sales_price'] . '.00' : 0; |
304 | - $val['market_price'] = !empty($val['market_price']) ? $val['market_price'] . '.00' : 0; | 307 | + $val['market_price'] = ($val['market_price'] - $val['sales_price'] > 0) ? $val['market_price'] . '.00' : false; |
305 | } | 308 | } |
306 | !empty($data) && $result['browseRecord'] = $data; | 309 | !empty($data) && $result['browseRecord'] = $data; |
307 | } | 310 | } |
@@ -333,7 +336,7 @@ class UserModel | @@ -333,7 +336,7 @@ class UserModel | ||
333 | } | 336 | } |
334 | 337 | ||
335 | /** | 338 | /** |
336 | - * 处理YOHO币数据 | 339 | + * 处理YOHO币总数数据 |
337 | * | 340 | * |
338 | * @param int $uid 用户ID | 341 | * @param int $uid 用户ID |
339 | * @return array|mixed 处理之后的YOHO币数据 | 342 | * @return array|mixed 处理之后的YOHO币数据 |
@@ -343,7 +346,7 @@ class UserModel | @@ -343,7 +346,7 @@ class UserModel | ||
343 | $result = array(); | 346 | $result = array(); |
344 | 347 | ||
345 | // 调用接口获取YOHO币 | 348 | // 调用接口获取YOHO币 |
346 | - $yohoCoin = UserData::yohoCoinData($uid); | 349 | + $yohoCoin = UserData::yohoCoinTotal($uid); |
347 | 350 | ||
348 | // 处理YOHO币数据 | 351 | // 处理YOHO币数据 |
349 | if (isset($yohoCoin['data']) && !empty($yohoCoin['data'])) { | 352 | if (isset($yohoCoin['data']) && !empty($yohoCoin['data'])) { |
@@ -50,10 +50,10 @@ class DetailModel | @@ -50,10 +50,10 @@ class DetailModel | ||
50 | case 'is_soon_sold_out': // 即将售磬 | 50 | case 'is_soon_sold_out': // 即将售磬 |
51 | $result['tags']['is_soon_sold_out'] = true; | 51 | $result['tags']['is_soon_sold_out'] = true; |
52 | break; | 52 | break; |
53 | - case 'is_new': // 新品 | 53 | + case 'is_new': // 新品NEW |
54 | $result['tags']['is_new'] = true; | 54 | $result['tags']['is_new'] = true; |
55 | break; | 55 | break; |
56 | - case 'is_discount': // 在售 | 56 | + case 'is_discount': // SALE |
57 | $result['tags']['is_discount'] = true; | 57 | $result['tags']['is_discount'] = true; |
58 | break; | 58 | break; |
59 | case 'is_limited': // 限量 | 59 | case 'is_limited': // 限量 |
@@ -68,7 +68,17 @@ class DetailModel | @@ -68,7 +68,17 @@ class DetailModel | ||
68 | } | 68 | } |
69 | } | 69 | } |
70 | } | 70 | } |
71 | - | 71 | + |
72 | + // 新品标签 | ||
73 | + if (isset($baseInfo['isNew']) && $baseInfo['isNew'] === 'Y') { | ||
74 | + $result['tags']['is_new'] = true; | ||
75 | + } | ||
76 | + | ||
77 | + // NEW和SALE只显示一个 | ||
78 | + if (isset($result['tags']['is_new']) && isset($result['tags']['is_discount'])) { | ||
79 | + unset($result['tags']['is_discount']); | ||
80 | + } | ||
81 | + | ||
72 | // 商品价格 | 82 | // 商品价格 |
73 | if (isset($baseInfo['productPriceBo'])) { | 83 | if (isset($baseInfo['productPriceBo'])) { |
74 | $result['goodsPrice'] = array(); | 84 | $result['goodsPrice'] = array(); |
@@ -87,10 +97,10 @@ class DetailModel | @@ -87,10 +97,10 @@ class DetailModel | ||
87 | } | 97 | } |
88 | } | 98 | } |
89 | 99 | ||
90 | - // 上市期 | ||
91 | - if (isset($baseInfo['expectArrivalTime'])) { | ||
92 | - $result['periodOfMarket'] = date('n', $baseInfo['firstShelveTime']) . '月'; | ||
93 | - } | 100 | + // 上市期 |
101 | + if (isset($baseInfo['expectArrivalTime']) && !empty($baseInfo['expectArrivalTime'])) { | ||
102 | + $result['periodOfMarket'] = date('n', $baseInfo['expectArrivalTime']) . '月'; | ||
103 | + } | ||
94 | 104 | ||
95 | // 促销信息 | 105 | // 促销信息 |
96 | if (isset($baseInfo['promotionBoList'])) { | 106 | if (isset($baseInfo['promotionBoList'])) { |
@@ -245,7 +255,7 @@ class DetailModel | @@ -245,7 +255,7 @@ class DetailModel | ||
245 | } | 255 | } |
246 | $result['goodsDescription'] = array( | 256 | $result['goodsDescription'] = array( |
247 | 'title' => '商品信息', | 257 | 'title' => '商品信息', |
248 | - 'enTitle' => 'PRODUCT INFO', | 258 | + 'enTitle' => 'DESCRIPTION', |
249 | 'detail' => array( | 259 | 'detail' => array( |
250 | 'list' => array( | 260 | 'list' => array( |
251 | array('param' => '编号:' . $sizeInfo['productDescBo']['erpProductId']), | 261 | array('param' => '编号:' . $sizeInfo['productDescBo']['erpProductId']), |
@@ -363,7 +373,7 @@ class DetailModel | @@ -363,7 +373,7 @@ class DetailModel | ||
363 | $result['washTips']['list'][] = $value; | 373 | $result['washTips']['list'][] = $value; |
364 | } | 374 | } |
365 | } | 375 | } |
366 | - | 376 | + |
367 | // 详情配图 | 377 | // 详情配图 |
368 | if (isset($sizeInfo['productIntroBo']['productIntro'])) { | 378 | if (isset($sizeInfo['productIntroBo']['productIntro'])) { |
369 | $productIntro = $sizeInfo['productIntroBo']['productIntro']; | 379 | $productIntro = $sizeInfo['productIntroBo']['productIntro']; |
-
Please register or login to post a comment