chore(分包): tarBar达到分包前效果
This commit is contained in:
@@ -6,13 +6,17 @@ import {
|
||||
} from 'common/js/wx-jssdk.js';
|
||||
|
||||
|
||||
|
||||
// 首页路径
|
||||
export const INDEX_PAGE_URL = '/pages/index/index';
|
||||
|
||||
// 当前最新的tabBar.list (参见pages.json 中的tabBar.list 配置)
|
||||
export const systemTabBarList = [
|
||||
'/pages/index/index',
|
||||
'/pages_goods/category',
|
||||
'/pages_tool/contact/contact',
|
||||
'/pages_tool/member/index'
|
||||
];
|
||||
INDEX_PAGE_URL,
|
||||
'/pages_goods/category',
|
||||
'/pages_tool/contact/contact',
|
||||
'/pages_tool/member/index'
|
||||
];
|
||||
|
||||
/**
|
||||
* 适配子包路径
|
||||
@@ -86,9 +90,8 @@ export default {
|
||||
for (let i = 0; i < systemTabBarList.length; i++) {
|
||||
const tabBarUrl = systemTabBarList[i];
|
||||
if (url.indexOf(tabBarUrl) == 0) {
|
||||
uni.switchTab({
|
||||
url
|
||||
});
|
||||
// 首页特殊处理,采用switchTab, 其他页面采用redirectTo, 不能返回,不能退回
|
||||
(tabBarUrl == INDEX_PAGE_URL ? uni.switchTab : uni.redirectTo)({url});
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -115,12 +118,11 @@ export default {
|
||||
break;
|
||||
default:
|
||||
// 保留当前页面,跳转到应用内的某个页面
|
||||
console.log('保留当前页面,跳转到应用内的某个页面', url);
|
||||
uni.navigateTo({
|
||||
url
|
||||
});
|
||||
}
|
||||
|
||||
console.log('无任何处理', url);
|
||||
},
|
||||
/**
|
||||
* 图片路径转换
|
||||
|
||||
Reference in New Issue
Block a user