Commit a27b5bad authored by 郭志伟's avatar 郭志伟

Merge branch 'fix/policy_add' into 'master'

Fix/policy add

See merge request !214
parents db7d5c38 825c2290
......@@ -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 {
......@@ -57,9 +57,11 @@ export default {
}
},
mounted() {
this.getOrderInfo();
const fromPay = this.$route.query.from && this.$route.query.from === "wxh5";
this.getOrderInfo(fromPay);
},
methods: {
...mapActions["setIsLoading"],
// 1-待支付,3-支付成功,4-问卷收集完成,方案配置中,5-方案配置完成, -1 -支付失败订单关闭,-2 -支付超过1小时订单关闭,-3 -订单关闭
async getOrderInfo(checkPayState = false) {
if (!this.isLogin) return;
......@@ -74,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();
}
},
......
......@@ -28,7 +28,7 @@ export default {
this.orderInfo = this.$route.query;
// 如果存在isXyqb,同时当前不是在信用钱包环境
if (this.orderInfo.isConsultant) {
this.$router.replace("/consultant");
this.$router.replace({ path: "/consultant", query: { from: "wxh5" } });
return;
} else if (
(this.orderInfo.isXyqb == 1 ||
......
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