Authored by 梁志锋

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

... ... @@ -139,7 +139,7 @@ class Yohobuy
if (!empty($data)) {
$url = self::httpBuildQuery($url, $data);
}
var_dump($url);
/* 开启缓存的情况 */
if ($cache && USE_CACHE) {
// 先尝试获取一级缓存(master), 有数据则直接返回.
... ...
... ... @@ -555,7 +555,8 @@ class Helpers
*/
public static function syncUserSession($uid, $refer = '', $callback='call')
{
return 'http://m1.yohobuy.com/Passport/session/index?callback=' . $callback . '&uid=' . $uid . '&go=' . $refer;
return 'http://m1.yohobuy.com/Passport/session/index?callback=' . $callback
. '&sign=' . md5($uid . 'Js8Yn0!EwPM45-ws') . '&uid=' . $uid . '&go=' . $refer;
}
}
... ...
... ... @@ -17,3 +17,4 @@ require('./browse-record');
require('./address-act');
require('./logistic');
require('./pay');
require('./personal-details');
... ...
... ... @@ -20,9 +20,12 @@ var sizeSwiper,
//判断是否要显示向左滑动提示
function hiddenTips($ele) {
var offsetContainer,
offsetLastColumn;
if ($ele.length > 0) {
var offsetContainer = $ele[0].getBoundingClientRect().right;
var offsetLastColumn = $ele.find('.swiper-slide:last-child')[0].getBoundingClientRect().right;
offsetContainer = $ele[0].getBoundingClientRect().right;
offsetLastColumn = $ele.find('.swiper-slide:last-child')[0].getBoundingClientRect().right;
if (offsetLastColumn - offsetContainer < 0) {
... ...
... ... @@ -44,7 +44,8 @@ goodsSwiper = new Swiper('.banner-swiper', {
paginationClickable: true,
pagination: '.banner-top .pagination-inner',
nextButton: '.my-swiper-button-next',
prevButton: '.my-swiper-button-prev'
prevButton: '.my-swiper-button-prev',
spaceBetween: 3
});
... ... @@ -70,4 +71,3 @@ if (goodsDiscountHammer) {
require('./like');
... ...
... ... @@ -8,4 +8,6 @@ require('./newsale/newarrival');
require('./newsale/discount');
require('./list');
require('./detail/detail');
require('./detail/consultform');
\ No newline at end of file
require('./detail/consultform');
require('./newsale/hot-rank');
... ...
... ... @@ -10,19 +10,21 @@ var Swiper = require('yoho.iswiper'),
var recommendSwiper,
$recommendForYou = $('.recommend-for-you'),
productSkn = $('#productSkn').val();
preferenceUrl = $('#preferenceUrl').val();
$.get('/product/detail/preference', {productSkn: productSkn}).then(function(html) {
$recommendForYou.html(html).show();
if ($('#swiper-recommend').length) {
recommendSwiper = new Swiper('#swiper-recommend', {
slidesPerView: 'auto',
grabCursor: true,
slideElement: 'a',
lazyLoading: true,
watchSlidesVisibility: true
});
}
}).fail(function() {
$recommendForYou.hide();
});
\ No newline at end of file
if (preferenceUrl) {
$.get(preferenceUrl).then(function(html) {
$recommendForYou.html(html).show();
if ($('#swiper-recommend').length) {
recommendSwiper = new Swiper('#swiper-recommend', {
slidesPerView: 'auto',
grabCursor: true,
slideElement: 'a',
lazyLoading: true,
watchSlidesVisibility: true
});
}
}).fail(function() {
$recommendForYou.hide();
});
}
... ...
... ... @@ -13,10 +13,14 @@
.basic-info {
padding-top: 30rem / $pxConvertRem;
padding-bottom: 25rem / $pxConvertRem;
.user-name {
max-width: 240rem / $pxConvertRem;
text-overflow:ellipsis;
white-space:nowrap;
font-size: 25rem / $pxConvertRem;
margin-right: 0.5rem;
display: inline-block;
overflow: hidden;
}
.vip-icon {
... ...
... ... @@ -44,22 +44,22 @@
<a class="type-item" href="/home/order?type=2">
<span class="iconfont">&#xe634;</span>
<br>待付款
{{#if pendingPaymentCount}}
<span class="num">{{pendingPaymentCount}}</span>
{{#if wait_pay_num}}
<span class="num">{{wait_pay_num}}</span>
{{/if}}
</a>
<a class="type-item" href="/home/order?type=3">
<span class="iconfont">&#xe63b;</span>
<br>待发货
{{#if dueOutGoodsCount}}
<span class="num">{{dueOutGoodsCount}}</span>
{{#if wait_cargo_num}}
<span class="num">{{wait_cargo_num}}</span>
{{/if}}
</a>
<a class="type-item" href="/home/order?type=4">
<span class="iconfont">&#xe633;</span>
<br>待收货
{{#if dueInGoodsCount}}
<span class="num">{{dueInGoodsCount}}</span>
{{#if send_cargo_num}}
<span class="num">{{send_cargo_num}}</span>
{{/if}}
</a>
</div>
... ...
... ... @@ -136,8 +136,8 @@
{{#if id}}
<input id="productId" type="hidden" value="{{id}}">
{{/if}}
{{#if productSkn}}
<input id="productSkn" type="hidden" value="{{productSkn}}">
{{#if preferenceUrl}}
<input id="preferenceUrl" type="hidden" value="{{preferenceUrl}}">
{{/if}}
</div>
... ...
... ... @@ -62,10 +62,9 @@ class UserModel
'brand_favorite_total',
'product_favorite_total',
'product_browse',
'dueInGoodsCount',
'dueOutGoodsCount',
'pendingPaymentCount',
'refundGoodsCount'
'send_cargo_num',
'wait_cargo_num',
'wait_pay_num',
);
foreach ($infoNumData['data'] as $key => &$val) {
... ...
... ... @@ -221,7 +221,7 @@ class LoginController extends AbstractAction
*/
public function sinacallbackAction()
{
$sina = Factory::create('sina');
$sina = Factory::create('sinaweibo');
$access = $sina->getAccessToken();
/* 获取QQ腾讯用户的详细信息 */
$partnerInfo = $sina->getUserInfo($access);
... ...