Authored by 郭成尧

order-computer-params-modified

... ... @@ -165,13 +165,27 @@ exports.orderCompute = (req, res, next) => {
if (req.body.cartType === 'bundle') {
let activityInfo = JSON.parse(req.cookies['activity-info']);
cartModel.orderCompute(uid, cartType, deliveryId, paymentType,
couponCode, yohoCoin, null, activityInfo).then(result => {
cartModel.orderCompute({
uid: uid,
cartType: cartType,
deliveryWay: deliveryId,
paymentType: paymentType,
couponCode: couponCode,
yohoCoin: yohoCoin,
activityInfo: activityInfo
}).then(result => {
res.json(result);
}).catch(next);
} else {
cartModel.orderCompute(uid, cartType, deliveryId, paymentType,
couponCode, yohoCoin, skuList).then(result => {
cartModel.orderCompute({
uid: uid,
cartType: cartType,
deliveryWay: deliveryId,
paymentType: paymentType,
couponCode: couponCode,
yohoCoin: yohoCoin,
skuList: skuList
}).then(result => {
res.json(result);
}).catch(next);
}
... ...
... ... @@ -119,16 +119,16 @@ exports.cartPay = (params) => {
* @param string $skuList 购买限购商品时需要传递的参数
* @return array 接口返回的数据
*/
exports.orderCompute = (uid, cartType, deliveryWay, paymentType, couponCode, yohoCoin, skuList, activityInfo) => {
exports.orderCompute = (params) => {
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
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 => {
if (result && result.data) {
result.data.use_yoho_coin = paymentProcess.transPrice(result.data.use_yoho_coin);
... ...