jsapi支付

msb_prod
ch 3 years ago
parent 661aaa874a
commit c872c15ef3

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-07-08 11:46:30 * @Date: 2022-07-08 11:46:30
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-07-12 11:37:13 * @LastEditTime: 2022-07-12 14:29:22
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -80,7 +80,7 @@ const ENV = process.env;
* 微信APP内部点击支付 * 微信APP内部点击支付
*/ */
async wxJsapiPay(){ async wxJsapiPay(){
const {result} = await this.getOrderInfo('WX_JSAPI'); const {result} = await this.getPayData('WX_JSAPI');
if(result){ if(result){
const par = result.payDataInfo; const par = result.payDataInfo;
WeixinJSBridge.invoke('getBrandWCPayRequest', { WeixinJSBridge.invoke('getBrandWCPayRequest', {
@ -107,14 +107,14 @@ const ENV = process.env;
* h5唤起微信支付 * h5唤起微信支付
*/ */
async wxH5Pay(){ async wxH5Pay(){
const {error, result} = await this.getOrderInfo('WX_H5'); const {error, result} = await this.getPayData('WX_H5');
if(result){ if(result){
// h5windowAPI // h5windowAPI
window.location.replace(data.payDataInfo.h5Url); window.location.replace(data.payDataInfo.h5Url);
} }
}, },
async aliPay(){ async aliPay(){
const {error, result} = await this.getOrderInfo('ALI_WAP'); const {error, result} = await this.getPayData('ALI_WAP');
if(result){ if(result){
// h5windowAPI // h5windowAPI
window.location.replace(data.payDataInfo.payUrl); window.location.replace(data.payDataInfo.payUrl);
@ -129,6 +129,7 @@ const ENV = process.env;
if(error){ if(error){
uni._$toast(error.message); uni._$toast(error.message);
} }
return {error, result}; return {error, result};
} }
} }

Loading…
Cancel
Save