Commit 1c9ccf33 authored by 郭志伟's avatar 郭志伟

Merge branch 'fix/goods' into 'master'

fix: 支付流程问题修复

See merge request !114
parents 7c7407c7 71a336fa
import Vue from "vue"; import Vue from "vue";
import VueRouter from "vue-router"; import VueRouter from "vue-router";
import store from "@/store";
import routes from "./routes"; import routes from "./routes";
import { parseSearch } from "@/service/utils"; import { parseSearch } from "@/service/utils";
import { isXyqb, isWeixinBrower } from "@/service/validation"; import { isXyqb, isWeixinBrower } from "@/service/validation";
...@@ -47,6 +48,9 @@ router.onError(error => { ...@@ -47,6 +48,9 @@ router.onError(error => {
}); });
async function getAuthInfo(xyqbToken) { async function getAuthInfo(xyqbToken) {
if (localStorage.get("xyqbAuthState") == 2) {
store.dispatch("setAuthXyqb", 1);
}
if (!xyqbToken || xyqbToken === localStorage.get("xyqbToken")) return; if (!xyqbToken || xyqbToken === localStorage.get("xyqbToken")) return;
const res = await authByxyqb({ xyqbToken }); const res = await authByxyqb({ xyqbToken });
if (res) { if (res) {
......
...@@ -16,6 +16,8 @@ import aiDetail from "./AIDetail"; ...@@ -16,6 +16,8 @@ import aiDetail from "./AIDetail";
import AdvisorRecDialog from "./modules/AdvisorRecDialog"; import AdvisorRecDialog from "./modules/AdvisorRecDialog";
import { getCulOrder } from "@/api/consultant"; import { getCulOrder } from "@/api/consultant";
import localStorage from "@/service/localStorage"; import localStorage from "@/service/localStorage";
import { isXyqb } from "@/service/validation";
import { mapActions, mapState } from "vuex";
export default { export default {
name: "GoodsDetail", name: "GoodsDetail",
...@@ -37,6 +39,10 @@ export default { ...@@ -37,6 +39,10 @@ export default {
}, },
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
const blackList = ["Goods", "Home", "Detail", "ConsultantPlan"]; const blackList = ["Goods", "Home", "Detail", "ConsultantPlan"];
if (isXyqb && this.showAuthXyqb == 2) {
next(false);
return;
}
if (this.noOrder && !this.userClickState && blackList.includes(to.name)) { if (this.noOrder && !this.userClickState && blackList.includes(to.name)) {
this.showRec = true; this.showRec = true;
next(false); next(false);
...@@ -48,7 +54,11 @@ export default { ...@@ -48,7 +54,11 @@ export default {
this.getOrderInfo(); this.getOrderInfo();
this.detailType = this.$route.query.type; this.detailType = this.$route.query.type;
}, },
computed: {
...mapState(["showAuthXyqb"])
},
methods: { methods: {
...mapActions(["setAuthXyqb"]),
async getOrderInfo() { async getOrderInfo() {
const isLogin = localStorage.get("mongoToken"); const isLogin = localStorage.get("mongoToken");
if (!isLogin) { if (!isLogin) {
......
...@@ -48,8 +48,8 @@ ...@@ -48,8 +48,8 @@
class="cr-button cr-button--warning cr-button--normal cr-button--square cr-button--block insure-btn" class="cr-button cr-button--warning cr-button--normal cr-button--square cr-button--block insure-btn"
type="submit" type="submit"
> >
<!-- <img src="@/assets/images/goods/detail/get-insure.png" alt="立即投保" /> --> 立即投保
<span class="">立即投保</span> <img src="@/assets/images/goods/detail/get-insure.png" alt="立即投保" />
</button> </button>
<div class="det-hd-insured-people"> <div class="det-hd-insured-people">
已有 已有
...@@ -188,10 +188,16 @@ export default { ...@@ -188,10 +188,16 @@ export default {
margin-top: 30px; margin-top: 30px;
height: @button-large-height; height: @button-large-height;
line-height: @button-large-line-height; line-height: @button-large-line-height;
font-size: @font-size-16; font-size: 0px;
border-radius: @border-radius-max !important; border-radius: @border-radius-max !important;
box-shadow: 1px 12px 14px 0px rgba(255, 200, 66, 0.4); box-shadow: 1px 12px 14px 0px rgba(255, 200, 66, 0.4);
position: relative;
img { img {
position: absolute;
top: 0;
z-index: 9;
left: 0;
right: 0;
width: 98px; width: 98px;
height: 27px; height: 27px;
display: block; display: block;
......
...@@ -319,7 +319,7 @@ export default { ...@@ -319,7 +319,7 @@ export default {
} }
}, },
inputClick() { inputClick() {
if (this.showAuthXyqb === 1) { if (!localStorage.get("mongoToken") && this.showAuthXyqb === 1) {
this.setAuthXyqb(2); this.setAuthXyqb(2);
} }
}, },
......
...@@ -65,7 +65,7 @@ export default { ...@@ -65,7 +65,7 @@ export default {
payInfo = res.payInfo; payInfo = res.payInfo;
} else { } else {
payInfo = { payInfo = {
url: res.payInfo.payUrl, url: res.payUrl,
params: { params: {
...orderInfo, ...orderInfo,
tradeType, tradeType,
......
...@@ -767,7 +767,7 @@ export default { ...@@ -767,7 +767,7 @@ export default {
...mapActions(["setAuthXyqb"]), ...mapActions(["setAuthXyqb"]),
...mapActions("user", ["setUserInfo"]), ...mapActions("user", ["setUserInfo"]),
inputClick() { inputClick() {
if (this.showAuthXyqb === 1) { if (!localStorage.get("mongoToken") && this.showAuthXyqb === 1) {
this.setAuthXyqb(2); this.setAuthXyqb(2);
} }
}, },
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<script> <script>
import detailPayMixin from "@/views/Goods/Detail/modules/detailPay.mixin"; import detailPayMixin from "@/views/Goods/Detail/modules/detailPay.mixin";
import qs from "qs";
import { isXyqb } from "@/service/validation"; import { isXyqb } from "@/service/validation";
export default { export default {
name: "PayWaiting", name: "PayWaiting",
...@@ -14,6 +15,12 @@ export default { ...@@ -14,6 +15,12 @@ export default {
}; };
}, },
mounted() { mounted() {
if (document.referrer.indexOf("tenpay") > -1) {
window.location.href =
window.location.origin +
"/payWaiting" +
qs.stringify(this.$route.query, { encode: true, addQueryPrefix: true });
}
this.setIsPayWait(true); this.setIsPayWait(true);
this.orderInfo = this.$route.query; this.orderInfo = this.$route.query;
if (this.orderInfo.isXyqb == 1 && !isXyqb) { if (this.orderInfo.isXyqb == 1 && !isXyqb) {
...@@ -23,7 +30,7 @@ export default { ...@@ -23,7 +30,7 @@ export default {
if (!this.orderInfo.payOrderNo) { if (!this.orderInfo.payOrderNo) {
this.$notify({ type: "warning", message: "正在跳转..." }); this.$notify({ type: "warning", message: "正在跳转..." });
setTimeout(() => { setTimeout(() => {
this.$router.replace("/"); window.location.href = "/policy";
}, 1000); }, 1000);
return; return;
} }
......
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