...
|
...
|
@@ -14,7 +14,7 @@ const authcode = require(global.utils + '/authcode'); |
|
|
const actCkOpthn = {
|
|
|
expires: 0,
|
|
|
path: '/cart/index',
|
|
|
domain: '.m.yohobuy.com'
|
|
|
domain: 'm.yohobuy.com'
|
|
|
};
|
|
|
|
|
|
exports.orderEnsure = (req, res, next) => {
|
...
|
...
|
@@ -81,9 +81,10 @@ exports.orderEnsure = (req, res, next) => { |
|
|
let orderAddress = _.get(order, 'address', []);
|
|
|
let addressList = _.get(address, 'data', []);
|
|
|
|
|
|
orderAddress.length && addressList.forEach(address => { //eslint-disable-line
|
|
|
orderAddress.length && _.forEach(addressList, address => { //eslint-disable-line
|
|
|
if (address.address_id === orderAddress.address_id) {
|
|
|
mobile = address.mobile;
|
|
|
return false;
|
|
|
}
|
|
|
});
|
|
|
|
...
|
...
|
@@ -143,7 +144,7 @@ exports.orderCompute = (req, res, next) => { |
|
|
/**
|
|
|
* 确认结算订单
|
|
|
*/
|
|
|
exports.orderSub = (req, res) => {
|
|
|
exports.orderSub = (req, res, next) => {
|
|
|
let uid = req.user.uid;
|
|
|
let addressId = parseInt(crypto.decrypt('', req.body.addressId), 10);
|
|
|
let cartType = req.body.cartType || 'ordinary';
|
...
|
...
|
@@ -242,7 +243,7 @@ exports.orderSub = (req, res) => { |
|
|
} else {
|
|
|
return res.json(result);
|
|
|
}
|
|
|
})();
|
|
|
})().catch(next);
|
|
|
};
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -276,7 +277,7 @@ exports.couponList = (req, res, next) => { |
|
|
return cartModel.getCouponList(uid)
|
|
|
.then(data => {
|
|
|
res.json(data);
|
|
|
});
|
|
|
}).catch(next);
|
|
|
} else {
|
|
|
return next();
|
|
|
}
|
...
|
...
|
@@ -299,7 +300,7 @@ exports.couponSearch = (req, res, next) => { |
|
|
return next();
|
|
|
}
|
|
|
|
|
|
})();
|
|
|
})().catch(next);
|
|
|
};
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -346,7 +347,7 @@ exports.selectAddress = (req, res, next) => { |
|
|
/**
|
|
|
* 发票信息
|
|
|
*/
|
|
|
exports.invoiceInfo = (req, res) => {
|
|
|
exports.invoiceInfo = (req, res, next) => {
|
|
|
let uid = req.user.uid;
|
|
|
let cookieData = req.cookies['order-info'];
|
|
|
let orderInfo = JSON.parse(cookieData);
|
...
|
...
|
@@ -366,7 +367,7 @@ exports.invoiceInfo = (req, res) => { |
|
|
module: 'cart',
|
|
|
page: 'select-invoice'
|
|
|
}));
|
|
|
})();
|
|
|
})().catch(next);
|
|
|
};
|
|
|
|
|
|
/**
|
...
|
...
|
|