108 lines
2.8 KiB
JavaScript
108 lines
2.8 KiB
JavaScript
import Vue from "vue";
|
|
import Router from "vue-router";
|
|
|
|
Vue.use(Router);
|
|
|
|
const router = new Router({
|
|
mode: "hash",
|
|
routes: [{
|
|
path: "/",
|
|
name: "index",
|
|
meta: { index: 1, title: "宁波房屋征收" },
|
|
component: () =>
|
|
import("../views/transit")
|
|
},
|
|
// 选择项目页面
|
|
{
|
|
path: "/project-select",
|
|
name: "projectSelect",
|
|
meta: { index: 2, title: "征收信息查询" },
|
|
component: () =>
|
|
import("../views/project")
|
|
},
|
|
// 评估结果一级页面
|
|
{
|
|
path: "/report/evalute",
|
|
name: "evalute",
|
|
meta: { index: 3, title: "评估结果" },
|
|
component: () =>
|
|
import("../views/report/evalute")
|
|
},
|
|
// 协议结果页面
|
|
{
|
|
path: "/report/agreement",
|
|
name: "reportAgreement",
|
|
meta: { index: 4, title: "协议结果" },
|
|
component: () =>
|
|
import("../views/report/agreement")
|
|
},
|
|
// 补偿协议pdf
|
|
{
|
|
path: "/showPdf",
|
|
name: "showPdf",
|
|
meta: { index: 5, title: "协议详情" },
|
|
component: () =>
|
|
import("../views/pdf/pdf")
|
|
},
|
|
// 评估结果二级页面(表格页面)
|
|
{
|
|
path: "/evaluatePage",
|
|
name: "evaluatePage",
|
|
meta: { index: 6, title: "评估报告" },
|
|
component: () =>
|
|
import("../views/report/evaluatePage")
|
|
},
|
|
// 评估结果二级页面(pdf页面)
|
|
{
|
|
path: "/evaluateResultPdf",
|
|
name: "evaluateResultPdf",
|
|
meta: { index: 7, title: "评估报告" },
|
|
component: () =>
|
|
import("../views/pdf/evaluateResultPdf")
|
|
},
|
|
// 政策详情页面
|
|
{
|
|
path: "/policyInfo",
|
|
name: "policyInfo",
|
|
meta: { index: 8, title: "政策详情" },
|
|
component: () =>
|
|
import("../views/policyInfo/policyInfo")
|
|
}, {
|
|
path: "/final",
|
|
name: "final",
|
|
meta: { index: 9, title: "宁波房屋征收" },
|
|
component: () =>
|
|
import("../views")
|
|
}
|
|
]
|
|
});
|
|
|
|
router.beforeEach((to, from, next) => {
|
|
//debugger
|
|
console.log('1201-进入路由1--form-to:' + from.name + "->" + to.name);
|
|
if (to.meta.title) {
|
|
document.title = to.meta.title;
|
|
}
|
|
// if (from.name == null && to.name == 'index') {
|
|
// router.push('/transit');
|
|
// next();
|
|
// } else {
|
|
if (from.name == 'final' && to.name == 'index') {
|
|
console.log('1201-进入判断2--form-to:' + from.name + "->" + to.name);
|
|
ZWJSBridge.close().then((result) => {
|
|
console.log('1201-进入close回调3--form-to:' + from.name + "->" + to.name);
|
|
console.log(result);
|
|
}).catch((error) => {
|
|
console.log('1201-进入close回调异常4--form-to:' + from.name + "->" + to.name);
|
|
console.log(error);
|
|
});
|
|
console.log('1201-退出之前5--form-to:' + from.name + "->" + to.name);
|
|
}
|
|
else {
|
|
console.log('1201-next之前6--form-to:' + from.name + "->" + to.name);
|
|
next();
|
|
}
|
|
// }
|
|
});
|
|
|
|
export default router; |