Authored by 梁志锋

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

... ... @@ -633,11 +633,13 @@ class Helpers
$gift = array();
$oneGoods = array();
$number = 0;
foreach ($advanceGoods as $value) {
$gift = array();
$gift['promotionId'] = $value['promotion_id'];
$gift['promotionTitle'] = $value['promotion_title'];
$number = 0;
foreach ($value['goods_list'] as $single) {
$oneGoods = array();
$oneGoods['id'] = $single['product_skn'];
... ... @@ -648,12 +650,14 @@ class Helpers
$oneGoods['count'] = $single['storage_number'];
$gift['goods'][] = $oneGoods;
$number ++;
}
$arr[] = $gift;
// 计算加价购商品数目
$count += count($value['goods_list']);
//$count += count($value['goods_list']);
$count += $number;
}
return $arr;
... ...
... ... @@ -10,11 +10,13 @@ var $ = require('jquery'),
var chosePanel = require('./chose-panel'),
dialog = require('../me/dialog'),
loading = require('../plugin/loading'),
tip = require('../plugin/tip');
var $cartContent = $('.cart-content'),
cartType = $('#cartType').val(),
$cartNav = $('.cart-nav'),
$cartPage = $('.shopping-cart-page'),
hasShowCartPresellTip = false;
var navHammer,
... ... @@ -22,19 +24,30 @@ var navHammer,
freebieHammer,
switchChose = false;
var isRefreshByDelete = window.cookie('_yoho-cart-refreshByDelete') === 'true' ? true : false;
loading.showLoadingMask();
function needLoadRecommandForYou() {
return window.isCookiesEnabled() ?
$('.cart-goods').length <= 0 && window.cookie('_yoho-cart-refreshByDelete') !== 'true' :
$('.cart-goods').length <= 0 && !isRefreshByDelete :
$('.cart-goods').length <= 0;
}
if (needLoadRecommandForYou()) {
require('../product/recommend-for-you');
} else {
if (isRefreshByDelete) {
$('body').css('background-color', '#f0f0f0');
}
require('./good');
}
$cartPage.css('display', 'block');
loading.hideLoadingMask();
window.setCookie('_yoho-cart-refreshByDelete', false);
ellipsis.init();
... ...
... ... @@ -19,7 +19,8 @@ $('.address-item').on('touchend', function() {
address_id: $this.data('address-id'),
consignee: $this.find('.name').text(),
mobile: $this.find('.tel').text(),
address_info: $this.find('.address-info').text()
address_info: $this.find('.address-info').text(),
is_support: $this.data('is-support')
};
orderInfo('addressId', addressId);
... ...
... ... @@ -16,6 +16,8 @@ var $action = $('.action'),
$addressItem = $('.address-item'),
deleteId;
require('../common');
$pageWrap.first().css('min-height', function() {
return $(window).height() - $('#yoho-header').height() - $footer.height();
});
... ...
... ... @@ -154,7 +154,7 @@
.vip {
display: inline-block;
color: #fff;
background: #d1021c;
background: #e01;
@include border-radius(16rem / $pxConvertRem);
padding: 0rem / $pxConvertRem 12rem / $pxConvertRem;
margin-left: 8rem / $pxConvertRem;
... ...
... ... @@ -8,6 +8,7 @@
margin-bottom: 120rem / $pxConvertRem;
overflow-x: hidden;
background: #f0f0f0;
display: none;
.yoho-tip {
z-index: 4;
... ...
... ... @@ -15,7 +15,7 @@
.swiper-container {
padding: pxToRem(30px) 0 pxToRem(20px);
width: 100%;
height: pxToRem(252px);
// height: pxToRem(252px);
// overflow: hidden;
.swiper-slide {
... ...
... ... @@ -2,7 +2,7 @@
<div class="my-address-page select-address-page yoho-page">
<div class="page-wrap">
{{# address}}
<a class="address-item" data-address-id="{{address_id}}" href="/cart/index/orderEnsure">
<a class="address-item" data-address-id="{{address_id}}" data-is-support="{{is_support}}" href="/cart/index/orderEnsure">
<span class="name">{{consignee}}</span>
<span class="tel">{{mobile}}</span>
<p class="address-info">{{area}} {{address}}</p>
... ...
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-W958MG" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>
var _hmt = _hmt || [];
(function() {
... ... @@ -10,7 +9,6 @@ var _hmt = _hmt || [];
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-W958MG');
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?c6ee7218b8321cb65fb2e98f284d8311";
... ... @@ -18,7 +16,6 @@ var _hmt = _hmt || [];
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?65dd99e0435a55177ffda862198ce841";
... ... @@ -26,7 +23,6 @@ var _hmt = _hmt || [];
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
(function() {
var hm = document.createElement("script");
hm.src = "http://static.yohobuy.com/js/analytics/analysis.js";
... ... @@ -38,40 +34,18 @@ var _hmt = _hmt || [];
window.addEventListener('load', async_load, false);
})();
</script>
<<<<<<< HEAD
<!-- End Google Tag Manager -->
<script type="text/javascript">
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?c6ee7218b8321cb65fb2e98f284d8311";
hm.async = 1;
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?65dd99e0435a55177ffda862198ce841";
hm.async = 1;
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<script>
window._py = window._py||[];
window._py.push(['a', 'MC..o8vMMWxEXDCiqYckD81lUX']);
window._py.push(['domain','stats.ipinyou.com']);
if(typeof _goodsData!='undefined')
window._py.push(['pi',_goodsData]);
window._py.push(['e','']);
if(typeof _goodsData!='undefined'){
window._py.push(['pi',_goodsData]);
}
-function(d){
var f = 'https:' == d.location.protocol;var c = d.createElement('script');c.type='text/javascript';c.async=1;
c.src=(f ? 'https' : 'http') + '://'+(f?'fm.ipinyou.com':'fm.p0y.cn')+'/j/t/adv.js';
var h = d.getElementsByTagName("script")[0];h.parentNode.insertBefore(c, h);
}(document);
</script>
<script src="http://static.yohobuy.com/js/analytics/analysis.js" async="async"></script>
<script src="http://static.yohobuy.com/m/v1/js/om_code.js" async="async"></script>
\ No newline at end of file
... ...
... ... @@ -325,7 +325,7 @@ class CartModel
$pay = CartData::cartPay($uid, $cartType);
// 商品为空返回
if (!$pay || (isset($pay['data']['goods_list']) && empty($pay['data']['goods_list']))) {
if (!$pay || empty($pay['data']['goods_list'])) {
$result['cartUrl'] = Helpers::url('/cart/index/index');
return $result;
}
... ...
... ... @@ -17,6 +17,9 @@ class LoginController extends AbstractAction
*/
public function indexAction()
{
// 设置登录有效时间30分钟, 防机器刷
$this->setSession('_LOGIN_EXPIRE', time() + 1800);
// 清除客户端
$this->setCookie('_UID', '');
$this->setCookie('_TOKEN', '');
... ... @@ -44,9 +47,6 @@ class LoginController extends AbstractAction
// 渲染模板
$this->_view->display('index', $data);
// 设置登录有效时间30分钟, 防机器刷
$this->setSession('_LOGIN_EXPIRE', time() + 1800);
}
/**
... ... @@ -54,6 +54,9 @@ class LoginController extends AbstractAction
*/
public function internationalAction()
{
// 设置登录有效时间30分钟, 防机器刷
$this->setSession('_LOGIN_EXPIRE', time() + 1800);
$refer = $this->get('refer');
if (!empty($refer)) {
$this->setCookie('refer', $refer);
... ... @@ -70,9 +73,6 @@ class LoginController extends AbstractAction
$data['countrys'] = RegData::getAreasData(); // 地区信息列表
// 渲染模板
$this->_view->display('international', $data);
// 设置登录有效时间30分钟, 防机器刷
$this->setSession('_LOGIN_EXPIRE', time() + 1800);
}
/**
... ... @@ -129,13 +129,13 @@ class LoginController extends AbstractAction
if (!$verifyEmail && !$verifyMobile) {
break;
}
/* 设置登录有效时间30分钟, 防机器刷 */
$expire = $this->getSession('_LOGIN_EXPIRE');
if (empty($expire) || $expire < time()) {
break;
}
/* 调用登录接口进行登录 */
// 获取未登录时的唯一识别码
$shoppingKey = Helpers::getShoppingKeyByCookie();
... ... @@ -157,7 +157,6 @@ class LoginController extends AbstractAction
$this->setCookie('_TOKEN', $token);
$this->setSession('_TOKEN', $token);
$this->setSession('_LOGIN_UID', $data['data']['uid']);
} while (false);
$this->echoJson($data);
... ... @@ -226,9 +225,9 @@ class LoginController extends AbstractAction
if (isset($result['code']) && $result['code'] == 200 && !empty($result['data']['uid'])) {
$token = Helpers::makeToken($result['data']['uid']);
$this->setCookie('_TOKEN', $token);
$this->setSession('_TOKEN', $token);
$this->setSession('_LOGIN_UID', $result['data']['uid']);
$this->setCookie('_TOKEN', $token);
$this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
} else {
$this->go($refer);
... ... @@ -264,9 +263,9 @@ class LoginController extends AbstractAction
if (isset($result['code']) && $result['code'] == 200 && !empty($result['data']['uid'])) {
$token = Helpers::makeToken($result['data']['uid']);
$this->setCookie('_TOKEN', $token);
$this->setSession('_TOKEN', $token);
$this->setSession('_LOGIN_UID', $result['data']['uid']);
$this->setCookie('_TOKEN', $token);
$this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
} else {
$this->go($refer);
... ... @@ -302,9 +301,9 @@ class LoginController extends AbstractAction
if (isset($result['code']) && $result['code'] == 200 && !empty($result['data']['uid'])) {
$token = Helpers::makeToken($result['data']['uid']);
$this->setCookie('_TOKEN', $token);
$this->setSession('_TOKEN', $token);
$this->setSession('_LOGIN_UID', $result['data']['uid']);
$this->setCookie('_TOKEN', $token);
$this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
} else {
$this->go($refer);
... ...