Authored by 郭成尧

order-computer-modified

... ... @@ -162,30 +162,27 @@ exports.orderCompute = (req, res, next) => {
let type = req.body.type;
if (type !== 'tickets') {
let params = {
uid: uid,
cart_type: cartType,
delivery_way: deliveryId,
payment_type: paymentType,
coupon_code: couponCode,
use_yoho_coin: yohoCoin,
};
if (req.body.cartType === 'bundle') {
let activityInfo = JSON.parse(req.cookies['activity-info']);
cartModel.orderCompute({
uid: uid,
cartType: cartType,
deliveryWay: deliveryId,
paymentType: paymentType,
couponCode: couponCode,
yohoCoin: yohoCoin,
cartModel.orderCompute(_.assign(params, {
activityInfo: activityInfo
}).then(result => {
})).then(result => {
res.json(result);
}).catch(next);
} else {
cartModel.orderCompute({
uid: uid,
cartType: cartType,
deliveryWay: deliveryId,
paymentType: paymentType,
couponCode: couponCode,
yohoCoin: yohoCoin,
skuList: skuList
}).then(result => {
cartModel.orderCompute(_.assign(params, {
product_sku_list: skuList
})).then(result => {
res.json(result);
}).catch(next);
}
... ...
... ... @@ -120,16 +120,7 @@ exports.cartPay = (params) => {
* @return array 接口返回的数据
*/
exports.orderCompute = (params) => {
return shoppingAPI.orderComputeAPI({
uid: params.uid,
cart_type: params.cartType,
delivery_way: params.deliveryWay,
payment_type: params.paymentType,
coupon_code: params.couponCode,
use_yoho_coin: params.yohoCoin,
product_sku_list: params.skuList,
activityInfo: params.activityInfo
}).then(result => {
return shoppingAPI.orderComputeAPI(params).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);
... ...