...
|
...
|
@@ -43,14 +43,16 @@ exports.cartPay = (uid, cartType, orderInfo, limitProductCode, sku, skn, buyNumb |
|
|
// cookie保存的数据
|
|
|
if (orderInfo && !_.isEmpty(orderInfo)) {
|
|
|
orderInfo.paymentType = orderInfo.paymentType ? orderInfo.paymentType : '';
|
|
|
orderComputeAPI = shoppingAPI.orderComputeAPI(
|
|
|
uid,
|
|
|
cartType,
|
|
|
orderInfo.deliveryId,
|
|
|
orderInfo.paymentType,
|
|
|
orderInfo.couponCode,
|
|
|
orderInfo.yohoCoin, skuList, activityInfo
|
|
|
);
|
|
|
orderComputeAPI = shoppingAPI.orderComputeAPI({
|
|
|
uid: uid,
|
|
|
cart_type: cartType,
|
|
|
delivery_way: orderInfo.deliveryId,
|
|
|
payment_type: orderInfo.paymentType,
|
|
|
coupon_code: orderInfo.couponCode,
|
|
|
use_yoho_coin: orderInfo.yohoCoin,
|
|
|
product_sku_list: skuList,
|
|
|
activityInfo: activityInfo
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 区分套餐量贩和普通商品
|
...
|
...
|
@@ -111,8 +113,16 @@ exports.cartPay = (uid, cartType, orderInfo, limitProductCode, sku, skn, buyNumb |
|
|
* @return array 接口返回的数据
|
|
|
*/
|
|
|
exports.orderCompute = (uid, cartType, deliveryWay, paymentType, couponCode, yohoCoin, skuList, activityInfo) => {
|
|
|
return shoppingAPI.orderComputeAPI(uid, cartType, deliveryWay, paymentType,
|
|
|
couponCode, yohoCoin, skuList, activityInfo).then(result => {
|
|
|
return shoppingAPI.orderComputeAPI({
|
|
|
uid: uid,
|
|
|
cart_type: cartType,
|
|
|
delivery_way: deliveryWay,
|
|
|
payment_type: paymentType,
|
|
|
coupon_code: couponCode,
|
|
|
use_yoho_coin: yohoCoin,
|
|
|
product_sku_list: skuList,
|
|
|
activityInfo: activityInfo
|
|
|
}).then(result => {
|
|
|
if (result && result.data) {
|
|
|
result.data.use_yoho_coin = paymentProcess.transPrice(result.data.use_yoho_coin);
|
|
|
result.data.yohoCoinCompute = paymentProcess.yohoCoinCompute(result.data);
|
...
|
...
|
@@ -330,15 +340,15 @@ exports.jitDetailData = (uid, cartType, skuList, orderCode, sessionKey, |
|
|
if (deliveryId) {
|
|
|
|
|
|
// 购物车选择改变字段,重新运算订单数据
|
|
|
return shoppingAPI.orderComputeAPI(
|
|
|
uid,
|
|
|
cartType,
|
|
|
deliveryId,
|
|
|
paymentType,
|
|
|
couponCode,
|
|
|
yohoCoin,
|
|
|
skuList
|
|
|
).then(result => {
|
|
|
return shoppingAPI.orderComputeAPI({
|
|
|
uid: uid,
|
|
|
cart_type: cartType,
|
|
|
delivery_way: deliveryId,
|
|
|
payment_type: paymentType,
|
|
|
coupon_code: couponCode,
|
|
|
use_yoho_coin: yohoCoin,
|
|
|
product_sku_list: skuList
|
|
|
}).then(result => {
|
|
|
return paymentProcess.transformJit(_.get(result, 'data.package_list', []));
|
|
|
});
|
|
|
} else {
|
...
|
...
|
|