Files
ebiz-h5/src/assets/js/utils/jump.js
hz a8d13be189 feat(underwriting): 新增路由跳转工具函数并优化跳转逻辑
- 引入 jump 工具函数并调整其内部路由调用方式
- 新增 navigateRouter 函数用于统一管理路由跳转
- 替换原有 add 方法为 navigateDataCollection 并使用新跳转逻辑
- 移除旧有的手动清理 localStorage 的逻辑
- 优化路由查找逻辑,支持多层级 children 路由匹配
- 添加 URL 参数处理函数 processJson 以适配查询字符串拼接
2025-12-11 15:26:13 +08:00

38 lines
1.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* eslint-disable no-undef */
import router from '@/router'
export default function jump(options) {
// eslint-disable
if (window.WebViewJavascriptBridge && options.flag) {
if (
options.flag == 'h5' ||
options.flag == 'service' ||
options.flag == 'home' ||
options.flag == 'mine' ||
options.flag == 'message' ||
options.flag == 'setting'
) {
EWebBridge.webCallAppInJs('bridge', {
flag: options.flag,
extra: options.extra
})
} else {
//extra 参数说明 refresh: '1', //是否返回后刷新01是 index: '-2' //回退两级
if (options.extra) {
EWebBridge.webCallAppInJs(options.flag, options.extra)
} else {
EWebBridge.webCallAppInJs(options.flag)
}
}
} else {
// 1:replace 2:go 默认为push
if (options.routerInfo && options.routerInfo.type == '1') {
router.replace(options.routerInfo)
} else if (options.routerInfo && options.routerInfo.type == '2') {
router.go(options.routerInfo.index || -1)
} else if (options.routerInfo) {
router.push(options.routerInfo)
}
}
}