...
|
...
|
@@ -5,9 +5,12 @@ |
|
|
*/
|
|
|
'use strict';
|
|
|
|
|
|
const api = global.yoho.API;
|
|
|
module.exports = class extends global.yoho.BaseModel {
|
|
|
constructor(ctx) {
|
|
|
super(ctx);
|
|
|
}
|
|
|
|
|
|
const getEasyPaymentAsync = (uid, goods, activity) => {
|
|
|
getEasyPaymentAsync(uid, goods, activity) {
|
|
|
let param = {
|
|
|
method: 'app.Shopping.easyPayment',
|
|
|
uid: uid,
|
...
|
...
|
@@ -21,11 +24,10 @@ const getEasyPaymentAsync = (uid, goods, activity) => { |
|
|
param.activity_id = activity;
|
|
|
}
|
|
|
|
|
|
return api.get('', param, {code: 200});
|
|
|
};
|
|
|
|
|
|
return this.get({data: param});
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* 订单计算API
|
|
|
* @param uid [number] uid
|
|
|
* @param cartType [string] 购物车类型,ordinary表示普通, advance表示预售
|
...
|
...
|
@@ -36,9 +38,8 @@ const getEasyPaymentAsync = (uid, goods, activity) => { |
|
|
* @param couponCode [string] 优惠券码
|
|
|
* @param promotionCode [string] 优惠码
|
|
|
* @param productSkuList [string] 限购商品
|
|
|
|
|
|
*/
|
|
|
const getEasypayComputeAsync = (uid, cartType, paymentType, deliveryWay, other) => {
|
|
|
getEasypayComputeAsync(uid, cartType, paymentType, deliveryWay, other) {
|
|
|
let param = {
|
|
|
method: 'app.Shopping.easyCompute',
|
|
|
uid: uid,
|
...
|
...
|
@@ -84,13 +85,12 @@ const getEasypayComputeAsync = (uid, cartType, paymentType, deliveryWay, other) |
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return api.get('', param);
|
|
|
};
|
|
|
return this.get({data: param});
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* 订单提交API
|
|
|
* @param uid [number] uid
|
|
|
* @param cartType [String] 购物车类型,ordinary表示普通, advance表示预售
|
...
|
...
|
@@ -109,7 +109,7 @@ const getEasypayComputeAsync = (uid, cartType, paymentType, deliveryWay, other) |
|
|
* @param couponCode [string] 优惠券码
|
|
|
* @param printPrice [string] 是否打印价格
|
|
|
*/
|
|
|
const easypayOrderSubmitAsync = (uid, cartType, addressId, deliveryTime, deliveryWay, paymentType, paymentId, printPrice, other, remoteIp) => { // eslint-disable-line
|
|
|
easypayOrderSubmitAsync(uid, cartType, addressId, deliveryTime, deliveryWay, paymentType, paymentId, printPrice, other, remoteIp) { // eslint-disable-line
|
|
|
let param = {
|
|
|
method: 'app.Shopping.easySubmit',
|
|
|
uid: uid,
|
...
|
...
|
@@ -178,13 +178,10 @@ const easypayOrderSubmitAsync = (uid, cartType, addressId, deliveryTime, deliver |
|
|
});
|
|
|
}
|
|
|
|
|
|
return api.get('', param, {
|
|
|
headers: {'X-Forwarded-For': remoteIp || ''}
|
|
|
});
|
|
|
};
|
|
|
|
|
|
module.exports = {
|
|
|
getEasyPaymentAsync,
|
|
|
getEasypayComputeAsync,
|
|
|
easypayOrderSubmitAsync
|
|
|
return this.get({data: param, param: {
|
|
|
headers: {
|
|
|
'X-Forwarded-For': remoteIp || ''
|
|
|
}
|
|
|
}});
|
|
|
}
|
|
|
}; |
...
|
...
|
|