Authored by 梁志锋

商品详情页 为你优先 code review by bikai

@@ -139,7 +139,7 @@ class Yohobuy @@ -139,7 +139,7 @@ class Yohobuy
139 if (!empty($data)) { 139 if (!empty($data)) {
140 $url = self::httpBuildQuery($url, $data); 140 $url = self::httpBuildQuery($url, $data);
141 } 141 }
142 - var_dump($url); 142 +
143 /* 开启缓存的情况 */ 143 /* 开启缓存的情况 */
144 if ($cache && USE_CACHE) { 144 if ($cache && USE_CACHE) {
145 // 先尝试获取一级缓存(master), 有数据则直接返回. 145 // 先尝试获取一级缓存(master), 有数据则直接返回.
@@ -555,7 +555,8 @@ class Helpers @@ -555,7 +555,8 @@ class Helpers
555 */ 555 */
556 public static function syncUserSession($uid, $refer = '', $callback='call') 556 public static function syncUserSession($uid, $refer = '', $callback='call')
557 { 557 {
558 - return 'http://m1.yohobuy.com/Passport/session/index?callback=' . $callback . '&uid=' . $uid . '&go=' . $refer; 558 + return 'http://m1.yohobuy.com/Passport/session/index?callback=' . $callback
  559 + . '&sign=' . md5($uid . 'Js8Yn0!EwPM45-ws') . '&uid=' . $uid . '&go=' . $refer;
559 } 560 }
560 561
561 } 562 }
@@ -17,3 +17,4 @@ require('./browse-record'); @@ -17,3 +17,4 @@ require('./browse-record');
17 require('./address-act'); 17 require('./address-act');
18 require('./logistic'); 18 require('./logistic');
19 require('./pay'); 19 require('./pay');
  20 +require('./personal-details');
@@ -20,9 +20,12 @@ var sizeSwiper, @@ -20,9 +20,12 @@ var sizeSwiper,
20 20
21 //判断是否要显示向左滑动提示 21 //判断是否要显示向左滑动提示
22 function hiddenTips($ele) { 22 function hiddenTips($ele) {
  23 + var offsetContainer,
  24 + offsetLastColumn;
  25 +
23 if ($ele.length > 0) { 26 if ($ele.length > 0) {
24 - var offsetContainer = $ele[0].getBoundingClientRect().right;  
25 - var offsetLastColumn = $ele.find('.swiper-slide:last-child')[0].getBoundingClientRect().right; 27 + offsetContainer = $ele[0].getBoundingClientRect().right;
  28 + offsetLastColumn = $ele.find('.swiper-slide:last-child')[0].getBoundingClientRect().right;
26 29
27 30
28 if (offsetLastColumn - offsetContainer < 0) { 31 if (offsetLastColumn - offsetContainer < 0) {
@@ -44,7 +44,8 @@ goodsSwiper = new Swiper('.banner-swiper', { @@ -44,7 +44,8 @@ goodsSwiper = new Swiper('.banner-swiper', {
44 paginationClickable: true, 44 paginationClickable: true,
45 pagination: '.banner-top .pagination-inner', 45 pagination: '.banner-top .pagination-inner',
46 nextButton: '.my-swiper-button-next', 46 nextButton: '.my-swiper-button-next',
47 - prevButton: '.my-swiper-button-prev' 47 + prevButton: '.my-swiper-button-prev',
  48 + spaceBetween: 3
48 }); 49 });
49 50
50 51
@@ -70,4 +71,3 @@ if (goodsDiscountHammer) { @@ -70,4 +71,3 @@ if (goodsDiscountHammer) {
70 71
71 72
72 require('./like'); 73 require('./like');
73 -  
@@ -9,3 +9,5 @@ require('./newsale/discount'); @@ -9,3 +9,5 @@ require('./newsale/discount');
9 require('./list'); 9 require('./list');
10 require('./detail/detail'); 10 require('./detail/detail');
11 require('./detail/consultform'); 11 require('./detail/consultform');
  12 +require('./newsale/hot-rank');
  13 +
@@ -10,9 +10,10 @@ var Swiper = require('yoho.iswiper'), @@ -10,9 +10,10 @@ var Swiper = require('yoho.iswiper'),
10 10
11 var recommendSwiper, 11 var recommendSwiper,
12 $recommendForYou = $('.recommend-for-you'), 12 $recommendForYou = $('.recommend-for-you'),
13 - productSkn = $('#productSkn').val(); 13 + preferenceUrl = $('#preferenceUrl').val();
14 14
15 -$.get('/product/detail/preference', {productSkn: productSkn}).then(function(html) { 15 +if (preferenceUrl) {
  16 + $.get(preferenceUrl).then(function(html) {
16 $recommendForYou.html(html).show(); 17 $recommendForYou.html(html).show();
17 if ($('#swiper-recommend').length) { 18 if ($('#swiper-recommend').length) {
18 recommendSwiper = new Swiper('#swiper-recommend', { 19 recommendSwiper = new Swiper('#swiper-recommend', {
@@ -23,6 +24,7 @@ $.get('/product/detail/preference', {productSkn: productSkn}).then(function(html @@ -23,6 +24,7 @@ $.get('/product/detail/preference', {productSkn: productSkn}).then(function(html
23 watchSlidesVisibility: true 24 watchSlidesVisibility: true
24 }); 25 });
25 } 26 }
26 -}).fail(function() { 27 + }).fail(function() {
27 $recommendForYou.hide(); 28 $recommendForYou.hide();
28 -});  
  29 + });
  30 +}
@@ -13,10 +13,14 @@ @@ -13,10 +13,14 @@
13 .basic-info { 13 .basic-info {
14 padding-top: 30rem / $pxConvertRem; 14 padding-top: 30rem / $pxConvertRem;
15 padding-bottom: 25rem / $pxConvertRem; 15 padding-bottom: 25rem / $pxConvertRem;
16 -  
17 .user-name { 16 .user-name {
  17 + max-width: 240rem / $pxConvertRem;
  18 + text-overflow:ellipsis;
  19 + white-space:nowrap;
18 font-size: 25rem / $pxConvertRem; 20 font-size: 25rem / $pxConvertRem;
19 margin-right: 0.5rem; 21 margin-right: 0.5rem;
  22 + display: inline-block;
  23 + overflow: hidden;
20 } 24 }
21 25
22 .vip-icon { 26 .vip-icon {
@@ -44,22 +44,22 @@ @@ -44,22 +44,22 @@
44 <a class="type-item" href="/home/order?type=2"> 44 <a class="type-item" href="/home/order?type=2">
45 <span class="iconfont">&#xe634;</span> 45 <span class="iconfont">&#xe634;</span>
46 <br>待付款 46 <br>待付款
47 - {{#if pendingPaymentCount}}  
48 - <span class="num">{{pendingPaymentCount}}</span> 47 + {{#if wait_pay_num}}
  48 + <span class="num">{{wait_pay_num}}</span>
49 {{/if}} 49 {{/if}}
50 </a> 50 </a>
51 <a class="type-item" href="/home/order?type=3"> 51 <a class="type-item" href="/home/order?type=3">
52 <span class="iconfont">&#xe63b;</span> 52 <span class="iconfont">&#xe63b;</span>
53 <br>待发货 53 <br>待发货
54 - {{#if dueOutGoodsCount}}  
55 - <span class="num">{{dueOutGoodsCount}}</span> 54 + {{#if wait_cargo_num}}
  55 + <span class="num">{{wait_cargo_num}}</span>
56 {{/if}} 56 {{/if}}
57 </a> 57 </a>
58 <a class="type-item" href="/home/order?type=4"> 58 <a class="type-item" href="/home/order?type=4">
59 <span class="iconfont">&#xe633;</span> 59 <span class="iconfont">&#xe633;</span>
60 <br>待收货 60 <br>待收货
61 - {{#if dueInGoodsCount}}  
62 - <span class="num">{{dueInGoodsCount}}</span> 61 + {{#if send_cargo_num}}
  62 + <span class="num">{{send_cargo_num}}</span>
63 {{/if}} 63 {{/if}}
64 </a> 64 </a>
65 </div> 65 </div>
@@ -136,8 +136,8 @@ @@ -136,8 +136,8 @@
136 {{#if id}} 136 {{#if id}}
137 <input id="productId" type="hidden" value="{{id}}"> 137 <input id="productId" type="hidden" value="{{id}}">
138 {{/if}} 138 {{/if}}
139 - {{#if productSkn}}  
140 - <input id="productSkn" type="hidden" value="{{productSkn}}"> 139 + {{#if preferenceUrl}}
  140 + <input id="preferenceUrl" type="hidden" value="{{preferenceUrl}}">
141 {{/if}} 141 {{/if}}
142 142
143 </div> 143 </div>
@@ -62,10 +62,9 @@ class UserModel @@ -62,10 +62,9 @@ class UserModel
62 'brand_favorite_total', 62 'brand_favorite_total',
63 'product_favorite_total', 63 'product_favorite_total',
64 'product_browse', 64 'product_browse',
65 - 'dueInGoodsCount',  
66 - 'dueOutGoodsCount',  
67 - 'pendingPaymentCount',  
68 - 'refundGoodsCount' 65 + 'send_cargo_num',
  66 + 'wait_cargo_num',
  67 + 'wait_pay_num',
69 ); 68 );
70 foreach ($infoNumData['data'] as $key => &$val) { 69 foreach ($infoNumData['data'] as $key => &$val) {
71 70
@@ -221,7 +221,7 @@ class LoginController extends AbstractAction @@ -221,7 +221,7 @@ class LoginController extends AbstractAction
221 */ 221 */
222 public function sinacallbackAction() 222 public function sinacallbackAction()
223 { 223 {
224 - $sina = Factory::create('sina'); 224 + $sina = Factory::create('sinaweibo');
225 $access = $sina->getAccessToken(); 225 $access = $sina->getAccessToken();
226 /* 获取QQ腾讯用户的详细信息 */ 226 /* 获取QQ腾讯用户的详细信息 */
227 $partnerInfo = $sina->getUserInfo($access); 227 $partnerInfo = $sina->getUserInfo($access);