mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-22 10:27:01 +08:00
Payment flow refined
This commit is contained in:
@@ -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);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user