Payment flow refined

This commit is contained in:
Vion
2022-01-23 19:29:46 +08:00
parent 8ff86279a0
commit c5e5978615
17 changed files with 141 additions and 74 deletions

View File

@@ -87,11 +87,12 @@ import Myheader from "~/components/header.vue";
import tabs from "@/components/tabs.vue";
import vueQr from 'vue-qr'
import { generateOrderAlipay, updateOrderWX } from "../../ajax/getData";
import { generateOrderAlipay, updateOrderWX, monitorOrderNotify } from "../../ajax/getData";
export default {
data() {
return {
activeIndex: 0,
paymentTimer:undefined,
isSucess: false,
dialogSuccess: false,
paytype: "微信",
@@ -122,10 +123,14 @@ export default {
},
methods: {
closeDialogSuccess() {
this.qrtext = '';
// this.$router.push({
// path: "/index",
// });
this.qrtext = '';
this.$router.push({
path: "/myorder/usertion",
query:{
stype:1,
orderNumber:this.userPayData.orderId
}
});
},
closeDialogFail() {
this.qrtext = '';
@@ -148,16 +153,18 @@ export default {
//支付监听
async payOrderWX() {
let res = await updateOrderWX(this.userPayData.orderId);
let res = await monitorOrderNotify(this.userPayData.orderId);
if (res.success) {
this.qrtext = '成功加入群的二维码';
this.dialogSuccess = true;
} else if (res.fail) {
this.dialogFail = true;
}else{
this.payOrderWX()
let _self = this;
this.paymentTimer = setTimeout(function(){
_self.payOrderWX()
},5000);
}
},
},