支付回调页面

feature/payCenter-0709-ch
ch 2 years ago
parent 874340f948
commit d1f0e5fbd4

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-04-15 17:46:10
* @LastEditors: ch
* @LastEditTime: 2022-07-13 17:18:01
* @LastEditTime: 2022-07-13 18:20:38
* @Description: file content
-->
<template>
@ -59,6 +59,7 @@ import {ApiPutCancelOrder,ApiPutOrderReceive} from '@/common/api/order';
import {ApiPostCashierPrepay} from '@/common/api/pay';
import BsPay from '../../../../components/BsPay.vue';
import ORDER from '@/common/dicts/order';
const ENV = process.env;
export default {
components: { UiButton, UiCell, BsPay },
props : {
@ -130,7 +131,14 @@ export default {
},
async handlePay(){
const {error, result} = await ApiPostCashierPrepay({orderId:this.orderInfo.orderId});
let payType = 'wxjsapi'
if(!this.$store.state.openId){
payType = 'h5'
}
const {error, result} = await ApiPostCashierPrepay({
orderId:this.orderInfo.orderId,
returnUrl : `${ENV.VUE_APP_STATIC_URL}/payResult?orderId=${this.orderInfo.orderId}&payType=${payType}`
});
if(error){
uni.$u.toast(error.message);
return false;

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-22 10:58:24
* @LastEditors: ch
* @LastEditTime: 2022-07-13 17:17:38
* @LastEditTime: 2022-07-13 18:21:13
* @Description: file content
-->
<template>
@ -62,6 +62,7 @@ import UiGoodsInfo from '../../components/UiGoodsInfo.vue';
import UiGoodsInfoMax from '../../components/UiGoodsInfoMax.vue';
import UiMoney from '../../components/UiMoney.vue';
import ORDER from '@/common/dicts/order';
const ENV = process.env;
export default {
components: { BsEmpty, UiButton, BsPay, UiGoodsInfo, UiGoodsInfoMax, UiMoney },
@ -135,11 +136,15 @@ export default {
* 立即支付
*/
async handlePay(item){
const {error, result} = await ApiPostCashierPrepay({orderId:item.orderId});
if(error){
uni.$u.toast(error.message);
return false;
let payType = 'wxjsapi'
if(!this.$store.state.openId){
payType = 'h5'
}
const {error, result} = await ApiPostCashierPrepay({
orderId:item.orderId,
returnUrl : `${ENV.VUE_APP_STATIC_URL}/payResult?orderId=${item.orderId}&payType=${payType}`
});
// #ifdef H5

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-20 14:14:53
* @LastEditors: ch
* @LastEditTime: 2022-07-13 14:08:54
* @LastEditTime: 2022-07-13 18:18:18
* @Description: file content
-->
<template>
@ -62,6 +62,7 @@ import {Wxpay, Alipay} from '@/common/utils';
import UiButton from '@/components/UiButton.vue';
import UiWhiteBox from '../../components/UiWhiteBox.vue';
import UiGoodsInfo from '../../components/UiGoodsInfo.vue';
const ENV = process.env;
export default {
components : {UiCell, UiButton, UiWhiteBox, UiGoodsInfo },
data(){
@ -174,7 +175,14 @@ export default {
uni.$u.toast(error.message);
return false;
}
const {error:er, result:res} = await ApiPostCashierPrepay({orderId:result.orderId});
let payType = 'wxjsapi'
if(!this.$store.state.openId){
payType = 'h5'
}
const {error:er, result:res} = await ApiPostCashierPrepay({
orderId:result.orderId,
returnUrl : `${ENV.VUE_APP_STATIC_URL}/payResult?orderId=${result.orderId}&payType=${payType}`
});
if(er){
uni.$u.toast(er.message);
return false;

Loading…
Cancel
Save