Commit cc49fe1e authored by 郝聪敏's avatar 郝聪敏

fix: 添加路由历史记录、新增客户告知书页面

parent 39bb04a9
......@@ -26,6 +26,8 @@ import AuthFromXyqb from "@/components/AuthFromXyqb";
import PopupWithIframe from "@/components/PopupWithIframe";
import NetError from "@/components/NetError";
import OpenBrowerTip from "@/components/OpenBrowerTip";
import { routerStorage } from "@/service/routerStorage";
export default {
components: {
LoginModal,
......@@ -44,6 +46,7 @@ export default {
},
watch: {
$route(to, from) {
routerStorage(to.path, from.path);
const firstPath = ["/home", "/goods", "/consultant", "/user"];
if (
[to.path, from.path].every(v => firstPath.includes(v)) ||
......
......@@ -7,5 +7,5 @@ export default {
// basicHost: "http://192.168.29.211:8964/",
wxAppId: "wx514de17b23d53a20",
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`, // 神策数据请求地址
test: true
test: false
};
......@@ -7,5 +7,5 @@ export default {
sharePath: "https://mangguo.qthbx.com/share.html#",
wxAppId: "wx514de17b23d53a20",
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=production`, // 神策数据请求地址
test: true
test: false
};
......@@ -124,6 +124,12 @@ export default [
component: () => import("../views/Policy/VirtualDetail/index.vue"),
meta: { title: "芒果保险" }
},
{
path: "/goods/customer-notification",
name: "CustomerNotification",
component: () => import("../views/Goods/CustomerNotification/index.vue"),
meta: { title: "客户告知书" }
},
{
path: "/policy/success/:orderNo/:productNo",
name: "Sucess",
......
......@@ -23,7 +23,6 @@ export default {
if (key === "mongoToken") {
Cookies.set(key, value, { expires: 3650 });
}
console.log(value);
return window.localStorage.setItem(key, value);
},
remove(key) {
......
import localStorage from "@/service/localStorage";
export function routerStorage(toPath, fromPath) {
let storage = localStorage.get("history") || { isBack: false, paths: [], fromPath: "" };
if (storage.paths.includes(toPath)) {
const toPathIndex = storage.paths.indexOf(toPath);
storage = { ...storage, isBack: true, fromPath };
storage.paths.splice(toPathIndex + 1);
} else {
storage = { ...storage, isBack: false, fromPath };
storage.paths.push(toPath);
}
localStorage.set("history", storage);
}
export function isBack(excludeFromPath = "") {
let storage = localStorage.get("history") || { isBack: false, paths: [], fromPath: "" };
if (storage.isBack && excludeFromPath !== storage.fromPath) {
return true;
}
return false;
}
@import "../../../style/var.less";
@import "../../../style/mixins.less";
.cn-container {
height: 100%;
background: #fff;
}
\ No newline at end of file
<template>
<div class="cn-container">
<cr-image
width=""
height=""
fit="cover"
src="https://activitystatic.lkbang.net/customer_notification.jpg"
/>
</div>
</template>
<script>
export default {
name: "CustomerNotification"
};
</script>
<style lang="less" src="./index.less" scoped></style>
......@@ -21,6 +21,7 @@ import { isXyqb } from "@/service/validation";
import { mapActions, mapState } from "vuex";
import InstructionModal from "./modules/InstructionModal";
import goodsList from "@/api/goodsList.mock";
import { isBack } from "@/service/routerStorage";
const items = [
{ title: "投保操作记录", content: "方便回溯管理让用户更放心" },
......@@ -52,6 +53,7 @@ export default {
created() {
this.items[2].content =
goodsList.find(goods => goods.id === this.$route.query.id)?.company_name || "";
if (isBack("/goods/customer-notification")) this.showInstruction = false;
},
computed: {
...mapState(["showAuthXyqb"])
......
......@@ -23,7 +23,10 @@
</p>
<p class="Ipbi-right-content">
{{ item.content
}}<a v-if="index === 1" href="javascript:;" @click="popupShow = !popupShow"
}}<a
v-if="index === 1"
href="javascript:;"
@click="$router.push('/goods/customer-notification')"
>客户告知书</a
>
</p>
......@@ -36,19 +39,14 @@
<p class="intro-popup-tips">由全天候保险代理股份有限公司提供保险中介服务</p>
</div>
</cr-popup>
<popup-with-iframe v-model="popupShow" title="客户告知书" :url="customerNotificationUrl" />
</div>
</template>
<script>
import settings from "@/api/settings";
import PopupWithIframe from "@/components/PopupWithIframe";
export default {
name: "InstructionModal",
components: {
PopupWithIframe
},
props: {
value: {
type: Boolean,
......
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