...
|
...
|
@@ -7,6 +7,7 @@ const headerModel = require('../../../doraemon/models/header'); |
|
|
const userModel = require('../models/user');
|
|
|
const addressModel = require('../models/address');
|
|
|
const orderModel = require('../models/order');
|
|
|
const buyNowModel = require('../models/buy-now-model');
|
|
|
const crypto = global.yoho.crypto;
|
|
|
const paymentProcess = require(global.utils + '/payment-process');
|
|
|
const logger = global.yoho.logger;
|
...
|
...
|
@@ -399,23 +400,40 @@ exports.invoiceInfo = (req, res, next) => { |
|
|
* JIT 拆单配送信息页面
|
|
|
*/
|
|
|
exports.jitDetail = (req, res, next) => {
|
|
|
let uid = req.user.uid;
|
|
|
let cartType = req.query.cartType;
|
|
|
let deliveryId = req.query.deliveryId;
|
|
|
let headerData = headerModel.setNav({
|
|
|
navTitle: '配送信息',
|
|
|
navBtn: false
|
|
|
});
|
|
|
|
|
|
cartModel.jitDetailData(
|
|
|
req.user.uid,
|
|
|
cartType,
|
|
|
req.query.skuList,
|
|
|
req.query.orderCode,
|
|
|
req.session.TOKEN,
|
|
|
req.query.deliveryId,
|
|
|
req.query.paymentType,
|
|
|
req.query.couponCode,
|
|
|
req.query.yohoCoin
|
|
|
).then(result => {
|
|
|
co(function* () {
|
|
|
let result = {};
|
|
|
|
|
|
if (req.query.buynow === 'Y') {
|
|
|
let resultFromApi = yield req.ctx(buyNowModel).compute({
|
|
|
delivery_way: deliveryId,
|
|
|
uid: uid,
|
|
|
product_sku: req.query.product_sku,
|
|
|
buy_number: 1
|
|
|
});
|
|
|
|
|
|
result = paymentProcess.transformJit(_.get(resultFromApi, 'data.package_list', []));
|
|
|
} else {
|
|
|
result = yield cartModel.jitDetailData(
|
|
|
uid,
|
|
|
cartType,
|
|
|
req.query.skuList,
|
|
|
req.query.orderCode,
|
|
|
req.session.TOKEN,
|
|
|
deliveryId,
|
|
|
req.query.paymentType,
|
|
|
req.query.couponCode,
|
|
|
req.query.yohoCoin
|
|
|
);
|
|
|
}
|
|
|
|
|
|
if (cartType) {
|
|
|
_.assign(headerData, {
|
|
|
backUrl: result.returnUrl
|
...
|
...
|
@@ -427,6 +445,7 @@ exports.jitDetail = (req, res, next) => { |
|
|
jitDetailPage: true,
|
|
|
module: 'cart',
|
|
|
page: 'jit-detail',
|
|
|
localCss: true
|
|
|
}));
|
|
|
}).catch(next);
|
|
|
})().catch(next);
|
|
|
}; |
...
|
...
|
|