Authored by 郭成尧

cookie-product-sku

... ... @@ -2,7 +2,6 @@
* @Author: Targaryen
* @Date: 2017-06-21 10:15:38
* @Last Modified by: Targaryen
* @Last Modified time: 2017-06-28 15:04:29
*/
const _ = require('lodash');
const co = require('bluebird').coroutine;
... ... @@ -48,6 +47,10 @@ class BuyNowController {
return next();
}
if (product_sku !== orderInfo.product_sku) {
orderInfo = {};
}
co(function * () {
let result = yield req.ctx(BuyNowModel).payment({
uid: req.user.uid,
... ...
... ... @@ -2,7 +2,6 @@
* @Author: Targaryen
* @Date: 2017-06-21 10:30:21
* @Last Modified by: Targaryen
* @Last Modified time: 2017-06-27 15:04:06
*/
require('buynow/order-ensure.page.css');
const $ = require('yoho-jquery');
... ... @@ -41,17 +40,8 @@ require('common');
lazyLoad();
/**
* Cookie Init
*/
function orderInfoInit() {
let product_sku = qs.product_sku;
if (orderInfo('product_sku') !== product_sku) {
cookie.remove(['buynow_info']);
orderInfo('product_sku', product_sku);
}
}
// 存 COOKIE
orderInfo('product_sku', qs.product_sku);
function getQueryParam() {
let queryArray = location.search.substr(1).split('&'),
... ... @@ -526,4 +516,3 @@ $(window).scroll(function() {
$('.address-bottom').hide();
}
});
orderInfoInit();
... ...