Files
ebiz-h5/src/assets/js/utils/jump.js
2022-11-23 13:49:55 +08:00

34 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 */
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') {
this.$router.replace(options.routerInfo)
} else if (options.routerInfo && options.routerInfo.type == '2') {
this.$router.go(options.routerInfo.index || -1)
} else if (options.routerInfo) {
this.$router.push(options.routerInfo)
}
}
}