Authored by whb

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

This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
... ... @@ -113,6 +113,10 @@ function showChooseGifDialog() {
}, function() {
window.location.href = cartContentShow().find('.freebie > a').attr('href');
}, function() {
var info = window.cookie('order-info');
if (info) {
window.setCookie('order-info', '');
}
window.location.href = '/cart/index/orderEnsure?cartType=' + cartType;
});
}
... ... @@ -188,6 +192,7 @@ if ($('.freebie').length > 0) {
$('.btn-balance').on('touchend', function() {
lowStockCount = 0;
var info = window.cookie('order-info');
if (shouldLowStocks()) {
tip.show('所选商品中有' + lowStockCount + '种库存不足的商品');
return false;
... ... @@ -199,6 +204,9 @@ $('.btn-balance').on('touchend', function() {
}
if (hasChecked()) {
if (info) {
window.setCookie('order-info', '');
}
window.location.href = '/cart/index/orderEnsure?cartType=' + cartType;
} else {
tip.show('请先勾选商品');
... ...
... ... @@ -105,7 +105,7 @@ $('.icon-del').on('touchstart', function(e) {
autoHide: true,
fast: true
});
window.setCookie('order-info', '');
//window.setCookie('order-info', '');
window.setCookie('_yoho-cart-refreshByDelete', true);
window.location.href = '/cart/index/index?cartType=' + $('#cartType').val();
} else {
... ...
... ... @@ -89,13 +89,8 @@ $('.invoice').on('touchend', '.checkbox', function() {
return false;
});
function orderCompute(firstEnter) {
function orderCompute() {
var yohoCoin = orderInfo('yohoCoin');
if (firstEnter) {
yohoCoin = 0;
}
$.ajax({
method: 'POST',
url: '/cart/index/orderCompute',
... ... @@ -133,9 +128,6 @@ function orderCompute(firstEnter) {
});
}
// 进入页面计算一次价格
//orderCompute(1);
function submitOrder() {
var invoiceText = $invoice.find('[name="invoice-title"]').val() || orderInfo('invoiceText'),
msg = $('#msg').find('input').val() || orderInfo('msg');
... ...
... ... @@ -11,7 +11,7 @@ require('../common');
function init() {
info = {
uid: window.getUid(),
deliveryId: 1,
deliveryId: $('.dispatch-mode .chosed').data('id') || 1,
deliveryTimeId: 1,
paymentTypeId: 1,
yohoCoin: 0,
... ... @@ -32,7 +32,7 @@ try {
info = JSON.parse(info);
// 2015/12/31 hf: fixes bug to 购物车页面调用该JS, 会导致有YOHO币,值却没有传给服务端. 因此需要再设置一下
// info.yohoCoin = $('.coin').data('yoho-coin') || 0;
//info['yohoCoin'] = $('.coin').data('yoho-coin') || 0;
} catch (e) {
init();
}
... ...
.yoho-coin-new-page {
padding-top: pxToRem(30px);
background-color: #f0f0f0;
margin-top: pxToRem(30px);
.coin{
text-align: center;
background-color: #fff;
}
.coin-num {
color: #d0021b;
... ... @@ -58,6 +60,7 @@
}
.banner {
margin-bottom: pxToRem(30px);
padding-top: pxToRem(30px);
border-top: 1px solid #e0e0e0;
}
}
... ...
... ... @@ -7,7 +7,7 @@
<a href="{{.}}" class="iconfont nav-home">&#xe611;</a>
{{/navHome}}
{{#currencyPage}}
<a href="/home/help" class="iconfont nav-home">&#xe639;</a>
<a href="/home/helpDetail?code=20111130-152530&caption=如何使用YOHO币支付" class="iconfont nav-home">&#xe639;</a>
{{/currencyPage}}
{{#navPhone}}
<a href="{{.}}" class="iconfont nav-home">&#xe641;</a>
... ...
... ... @@ -264,7 +264,7 @@ class DetailModel
'numInCart' => 0,
'goodsInstore' => $baseInfo['storage'], // 库存量
);
$soldOut = ($baseInfo['storage'] == 0) || ($baseInfo['status'] == 0);
$soldOut = ($baseInfo['storage'] == 0) || ($baseInfo['status'] == 0 || $totalStorageNum === 0);
$notForSale = $baseInfo['attribute'] == 2;
// 显示加入购物车链接
if (!$soldOut && !$notForSale) {
... ...
... ... @@ -283,7 +283,7 @@ class IndexController extends AbstractAction
$cartType = $this->get('cartType', '');
$cookieData = $this->getCookie('order-info', null);
$orderInfo = array();
if (empty($cartType) && !empty($cookieData)) {
if (!empty($cookieData)) {
$orderInfo = json_decode($cookieData, true);
$cartType = $orderInfo['cartType'];
}
... ...