Authored by 郭成尧

detail-jit

@@ -5,6 +5,7 @@ const helpers = global.yoho.helpers; @@ -5,6 +5,7 @@ const helpers = global.yoho.helpers;
5 const paymentProcess = require(global.utils + '/payment-process'); 5 const paymentProcess = require(global.utils + '/payment-process');
6 const shoppingAPI = require('./shopping'); 6 const shoppingAPI = require('./shopping');
7 const logger = global.yoho.logger; 7 const logger = global.yoho.logger;
  8 +const payModel = require('../models/pay');
8 9
9 /** 10 /**
10 * 转换价格 11 * 转换价格
@@ -326,6 +327,19 @@ exports.searchCoupon = (uid, couponCode) => { @@ -326,6 +327,19 @@ exports.searchCoupon = (uid, couponCode) => {
326 */ 327 */
327 exports.jitDetailData = (uid, cartType, skuList, orderCode, sessionKey, 328 exports.jitDetailData = (uid, cartType, skuList, orderCode, sessionKey,
328 deliveryId, paymentType, couponCode, yohoCoin) => { 329 deliveryId, paymentType, couponCode, yohoCoin) => {
  330 +
  331 + // 订单详情页拆单
  332 + if (orderCode) {
  333 + return payModel.getOtherDetail({
  334 + uid: uid,
  335 + orderCode: orderCode,
  336 + sessionKey: sessionKey
  337 + }).then(result => {
  338 + return paymentProcess.transformJit(_.get(result, 'data.package_list', []));
  339 + });
  340 + }
  341 +
  342 + // 购物车拆单
329 if (deliveryId) { 343 if (deliveryId) {
330 344
331 // 购物车选择改变字段,重新运算订单数据 345 // 购物车选择改变字段,重新运算订单数据
@@ -312,17 +312,9 @@ const orderDetailData = (uid, orderCode) => { @@ -312,17 +312,9 @@ const orderDetailData = (uid, orderCode) => {
312 312
313 // 为支付的拆单配送信息 313 // 为支付的拆单配送信息
314 if (orderDetail.isMultiPackage && orderDetail.isMultiPackage === 'Y') { 314 if (orderDetail.isMultiPackage && orderDetail.isMultiPackage === 'Y') {
315 - let jitInfo = {  
316 - deliveryId: orderDetail.deliveryId,  
317 - paymentType: orderDetail.paymentType,  
318 - couponCode: orderDetail.couponCode,  
319 - yohoCoin: orderDetail.yohoCoin,  
320 - cartType: 'ordinary'  
321 - };  
322 -  
323 orderDetail = _.assign(orderDetail, { 315 orderDetail = _.assign(orderDetail, {
324 isJit: true, 316 isJit: true,
325 - jitDetailUrl: helpers.urlFormat('/cart/index/new/jitDetail', jitInfo) 317 + jitDetailUrl: helpers.urlFormat('/cart/index/new/jitDetail', {orderCode: orderCode})
326 }); 318 });
327 } 319 }
328 320