Authored by 郭成尧

invoice-bug-fixed-cookie-handle-cart-type-bug-fixed

... ... @@ -25,7 +25,7 @@ exports.orderEnsure = (req, res, next) => {
let uid = req.user.uid;
let returnUrl = helpers.urlFormat('/cart/index/new');
let cartType = req.query.cartType || 'ordinary';
let cartType = req.query.cartType;
let orderInfo;
try {
... ... @@ -35,10 +35,8 @@ exports.orderEnsure = (req, res, next) => {
res.cookie('order-info', null, actCkOpthn);
}
let cookieCartType = _.get(orderInfo, 'cartType');
if (cookieCartType) {
cartType = cookieCartType;
if (!cartType) {
cartType = _.get(orderInfo, 'cartType', 'ordinary');
}
// 如果传递了code, skn, sku, buy_number 就代表限购商品
... ...
... ... @@ -23,7 +23,7 @@ const processInvoiceData = (orderInfo, mobile, addresslist) => {
// 发票信息处理
if (orderInfo.invoiceType && orderInfo.invoiceTitle) {
invoices_title = orderInfo.invoiceText;
invoiceType = orderInfo.invoiceType;
invoiceType = orderInfo.invoiceType * 1;
invoices_type = orderInfo.invoicesType * 1;
invoice_Top = orderInfo.invoiceTitle;
}
... ...
... ... @@ -43,7 +43,7 @@ exports.cartPayAPI = (uid, cartType, isUseYohoCoin, skuList, activityInfo) => {
param.product_sku_list = activityInfo.product_sku_list;
}
return api.get('', param);
return api.get('', param, {cache: false});
};
/**
... ...
... ... @@ -31,7 +31,7 @@ var lowStockCount = 0;
var actCkOpthn = {
expires: 'Session',
path: '/cart/index',
domain: '.m.yohobuy.com'
domain: 'm.yohobuy.com'
};
... ...
... ... @@ -6,7 +6,9 @@
var $ = require('yoho-jquery'),
lazyLoad = require('yoho-jquery-lazyload'),
tip = require('../plugin/tip'),
cookie = require('yoho-cookie');
var tip = require('../plugin/tip'),
loading = require('../plugin/loading'),
order = require('./order-info'),
richTip = require('../plugin/rich-tip');
... ... @@ -31,7 +33,7 @@ var $invoice = $('.invoice'),
isYohoCoinClick = $coinLi.data('yoho-coin-click') * 1, // 判断有货币是否可以单击
addressTop = $('.address-wrap').outerHeight();
var orderCont = window.cookie('order-info') && JSON.parse(window.cookie('order-info'));
var orderCont = cookie.get('order-info') && JSON.parse(cookie.get('order-info'));
var invoiceCont = {
7: '服装',
1: '图书',
... ... @@ -50,7 +52,7 @@ var invoiceCont = {
var actCkOpthn = {
expires: 'Session',
path: '/cart/index',
domain: '.m.yohobuy.com'
domain: 'm.yohobuy.com'
};
require('../common');
... ... @@ -168,7 +170,7 @@ $invoice.on('touchend', '.checkbox', function() {
orderInfo('invoiceTitle', null);
}
orderCont = window.cookie('order-info') && JSON.parse(window.cookie('order-info'));
orderCont = cookie.get('order-info') && JSON.parse(cookie.get('order-info'));
invoiceInit();
});
... ... @@ -323,7 +325,7 @@ function submitOrder() {
window._yas.sendCustomInfo({
op: 'YB_SC_TOPAY_CLICK',
param: JSON.stringify({
C_ID: window._ChannelVary[window.cookie('_Channel')],
C_ID: window._ChannelVary[cookie.get('_Channel')],
ORDER_CODE: res.data.order_code,
PRD_NUM: $('#goods-num').val(),
ORDER_AMOUNT: res.data.order_amount,
... ... @@ -332,8 +334,8 @@ function submitOrder() {
}, true);
}
window.setCookie('order-info', '', actCkOpthn);
window.setCookie('activity-info', '', {
cookie.set('order-info', '', actCkOpthn);
cookie.set('activity-info', '', {
expires: 'Session',
path: '/',
domain: '.m.yohobuy.com'
... ...
... ... @@ -10,7 +10,7 @@ var info = window.cookie('order-info');
var actCkOpthn = {
expires: 'Session',
path: '/cart/index',
domain: '.m.yohobuy.com'
domain: 'm.yohobuy.com'
};
function init() {
... ...
... ... @@ -9,7 +9,9 @@ require('common.js');
var lazyLoad = require('yoho-jquery-lazyload'),
tip = require('plugin/tip'),
loading = require('plugin/loading'),
cookie = require('yoho-cookie');
var loading = require('plugin/loading'),
order = require('../order-info');
var $invoice = $('.invoice'),
... ... @@ -29,7 +31,7 @@ var $invoice = $('.invoice'),
isYohoCoinClick = $coinLi.data('yoho-coin-click') * 1, // 判断有货币是否可以单击
productSku = $('#product-sku').val();
var orderCont = window.cookie('order-info') && JSON.parse(window.cookie('order-info'));
var orderCont = cookie.get('order-info') && JSON.parse(cookie.get('order-info'));
var invoiceCont = {
7: '服装',
1: '图书',
... ... @@ -48,7 +50,7 @@ var invoiceCont = {
var actCkOpthn = {
expires: 'Session',
path: '/cart/index',
domain: '.m.yohobuy.com'
domain: 'm.yohobuy.com'
};
lazyLoad();
... ... @@ -163,7 +165,7 @@ $invoice.on('touchend', '.checkbox', function() {
orderInfo('invoiceTitle', null);
}
orderCont = window.cookie('order-info') && JSON.parse(window.cookie('order-info'));
orderCont = cookie.get('order-info') && JSON.parse(cookie.get('order-info'));
invoiceInit();
});
... ... @@ -299,7 +301,7 @@ function submitOrder() {
} else {
url = '/home/orders/pay?order_code=' + res.data.order_code;
}
window.setCookie('order-info', '', actCkOpthn);
cookie.set('order-info', '', actCkOpthn);
window.location.href = url;
} else if (res.message) {
tip.show(res.message);
... ...
... ... @@ -14,7 +14,7 @@ var $selectBtn = $('.select-btn'),
actCkOpthn = {
expires: 'Session',
path: '/',
domain: '.m.yohobuy.com'
domain: 'm.yohobuy.com'
};
$(function() {
... ...