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"; ...@@ -17,7 +17,7 @@ import Buy from "./Buy";
import Success from "./Success"; import Success from "./Success";
import Question from "./Question"; import Question from "./Question";
import Exclusive from "./Exclusive"; import Exclusive from "./Exclusive";
import { mapState } from "vuex"; import { mapState, mapActions } from "vuex";
import localStorage from "@/service/localStorage"; import localStorage from "@/service/localStorage";
import { getCulOrder, getPayState } from "@/api/consultant"; import { getCulOrder, getPayState } from "@/api/consultant";
export default { export default {
...@@ -57,9 +57,11 @@ export default { ...@@ -57,9 +57,11 @@ export default {
} }
}, },
mounted() { mounted() {
this.getOrderInfo(); const fromPay = this.$route.query.from && this.$route.query.from === "wxh5";
this.getOrderInfo(fromPay);
}, },
methods: { methods: {
...mapActions["setIsLoading"],
// 1-待支付,3-支付成功,4-问卷收集完成,方案配置中,5-方案配置完成, -1 -支付失败订单关闭,-2 -支付超过1小时订单关闭,-3 -订单关闭 // 1-待支付,3-支付成功,4-问卷收集完成,方案配置中,5-方案配置完成, -1 -支付失败订单关闭,-2 -支付超过1小时订单关闭,-3 -订单关闭
async getOrderInfo(checkPayState = false) { async getOrderInfo(checkPayState = false) {
if (!this.isLogin) return; if (!this.isLogin) return;
...@@ -74,12 +76,14 @@ export default { ...@@ -74,12 +76,14 @@ export default {
} }
}, },
async getPayState() { async getPayState() {
this.setIsLoading(true);
const res = await getPayState({ consultantOrderNo: this.orderInfo[0].consultantOrderNo }); const res = await getPayState({ consultantOrderNo: this.orderInfo[0].consultantOrderNo });
if (res.state === 2) { if (res.state === 2) {
setTimeout(() => { setTimeout(() => {
this.getPayState(); this.getPayState();
}, 3000); }, 3000);
} else { } else {
this.setIsLoading(false);
this.getOrderInfo(); this.getOrderInfo();
} }
}, },
......
...@@ -28,7 +28,7 @@ export default { ...@@ -28,7 +28,7 @@ export default {
this.orderInfo = this.$route.query; this.orderInfo = this.$route.query;
// 如果存在isXyqb,同时当前不是在信用钱包环境 // 如果存在isXyqb,同时当前不是在信用钱包环境
if (this.orderInfo.isConsultant) { if (this.orderInfo.isConsultant) {
this.$router.replace("/consultant"); this.$router.replace({ path: "/consultant", query: { from: "wxh5" } });
return; return;
} else if ( } else if (
(this.orderInfo.isXyqb == 1 || (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