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