|
@@ -1,6 +1,7 @@
|
|
|
|
|
|
import wxpay from '@service.wxpay';
|
|
import wxpay from '@service.wxpay';
|
|
-import { getPayQuery } from "../api";
|
|
|
|
|
|
+import alipay from '@service.alipay';
|
|
|
|
+import { getConfigOfWxPay, getConfigOfAliPay } from "../api";
|
|
|
|
|
|
export const pageLoad = (meta, fn, params) => {
|
|
export const pageLoad = (meta, fn, params) => {
|
|
return new Promise(async (resolve, reject) => {
|
|
return new Promise(async (resolve, reject) => {
|
|
@@ -19,7 +20,7 @@ export const pageLoad = (meta, fn, params) => {
|
|
|
|
|
|
// 支付配置
|
|
// 支付配置
|
|
export const configWxPay = async (params) => {
|
|
export const configWxPay = async (params) => {
|
|
- let config = await getPayQuery(params);
|
|
|
|
|
|
+ let config = await getConfigOfWxPay(params);
|
|
console.log("pay config", config);
|
|
console.log("pay config", config);
|
|
let prepayid = config.prepay_id;
|
|
let prepayid = config.prepay_id;
|
|
// app中的配置信息
|
|
// app中的配置信息
|
|
@@ -72,3 +73,17 @@ let useWxPay = (prepayid, extra) => {
|
|
})
|
|
})
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+// 配置支付宝支付
|
|
|
|
+export const configAliPay = (params) => {
|
|
|
|
+ return new Promise(async (resolve) => {
|
|
|
|
+ let orderInfo = await getConfigOfAliPay(params);
|
|
|
|
+ alipay.pay({
|
|
|
|
+ orderInfo: orderInfo,
|
|
|
|
+ callback: (ret) => {
|
|
|
|
+ console.log("alipay cb", ret);
|
|
|
|
+ resolve({ code: ret.resultStatus, result: ret.result ? JSON.parse(ret.result) : "" })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+}
|