Authored by Rock Zhang

Merge branch 'hotfix/yohocoinuse' into beta

Conflicts:
	static/js/cart/cart.js
	static/js/cart/order-info.js
... ... @@ -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 {
... ...
... ... @@ -88,11 +88,8 @@ $('.invoice').on('touchend', '.checkbox', function() {
}
});
function orderCompute(firstEnter) {
function orderCompute() {
var yohoCoin = orderInfo('yohoCoin');
if (firstEnter) {
yohoCoin = 0;
}
$.ajax({
method: 'POST',
url: '/cart/index/orderCompute',
... ... @@ -130,9 +127,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();
}
... ...
... ... @@ -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'];
}
... ...