Commit 825c2290 authored by 郭志伟's avatar 郭志伟

fix: 顾问追加loading

parent 6ffb94e8
......@@ -17,7 +17,7 @@ import Buy from "./Buy";
import Success from "./Success";
import Question from "./Question";
import Exclusive from "./Exclusive";
import { mapState } from "vuex";
import { mapState, mapActions } from "vuex";
import localStorage from "@/service/localStorage";
import { getCulOrder, getPayState } from "@/api/consultant";
export default {
......@@ -61,6 +61,7 @@ export default {
this.getOrderInfo(fromPay);
},
methods: {
...mapActions["setIsLoading"],
// 1-待支付,3-支付成功,4-问卷收集完成,方案配置中,5-方案配置完成, -1 -支付失败订单关闭,-2 -支付超过1小时订单关闭,-3 -订单关闭
async getOrderInfo(checkPayState = false) {
if (!this.isLogin) return;
......@@ -75,12 +76,14 @@ export default {
}
},
async getPayState() {
this.setIsLoading(true);
const res = await getPayState({ consultantOrderNo: this.orderInfo[0].consultantOrderNo });
if (res.state === 2) {
setTimeout(() => {
this.getPayState();
}, 3000);
} else {
this.setIsLoading(false);
this.getOrderInfo();
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment