Authored by 郭成尧

detail-jit

... ... @@ -5,6 +5,7 @@ const helpers = global.yoho.helpers;
const paymentProcess = require(global.utils + '/payment-process');
const shoppingAPI = require('./shopping');
const logger = global.yoho.logger;
const payModel = require('../models/pay');
/**
* 转换价格
... ... @@ -326,6 +327,19 @@ exports.searchCoupon = (uid, couponCode) => {
*/
exports.jitDetailData = (uid, cartType, skuList, orderCode, sessionKey,
deliveryId, paymentType, couponCode, yohoCoin) => {
// 订单详情页拆单
if (orderCode) {
return payModel.getOtherDetail({
uid: uid,
orderCode: orderCode,
sessionKey: sessionKey
}).then(result => {
return paymentProcess.transformJit(_.get(result, 'data.package_list', []));
});
}
// 购物车拆单
if (deliveryId) {
// 购物车选择改变字段,重新运算订单数据
... ...
... ... @@ -312,17 +312,9 @@ const orderDetailData = (uid, orderCode) => {
// 为支付的拆单配送信息
if (orderDetail.isMultiPackage && orderDetail.isMultiPackage === 'Y') {
let jitInfo = {
deliveryId: orderDetail.deliveryId,
paymentType: orderDetail.paymentType,
couponCode: orderDetail.couponCode,
yohoCoin: orderDetail.yohoCoin,
cartType: 'ordinary'
};
orderDetail = _.assign(orderDetail, {
isJit: true,
jitDetailUrl: helpers.urlFormat('/cart/index/new/jitDetail', jitInfo)
jitDetailUrl: helpers.urlFormat('/cart/index/new/jitDetail', {orderCode: orderCode})
});
}
... ...