xnzt/xnzt-h5/utils/listeningOnBack.js

28 lines
1.1 KiB
JavaScript
Raw Normal View History

2024-11-11 10:27:27 +08:00
import pages from "@/pages"
export default {
async goBack(didBack) {
// const isDoBack = didBack !== undefined && didBack !== null && didBack !== '' ? didBack : true;
// const tabBar = pages().tabBar
// let canNavBack = getCurrentPages();
// if (canNavBack && canNavBack.length > 1) {
// } else {
// const PATH = new RegExp(canNavBack[canNavBack.length - 1].$route.fullPath)
// let isBack = true
// try {
// await tabBar.list.forEach(element => {
// const PAGEPATH = new RegExp(element.pagePath)
// const isTabBar = canNavBack[canNavBack.length - 1].$route.fullPath.slice(1) === element.pagePath
// if (isTabBar) {
// isBack = false
// throw new String("此次history.back返回操作起点页面为tabBar页面")
// }
// })
// } catch (err) {}
// if (isBack === true && isDoBack === true) {
// history.back();
// }
// return true
// }
}
}