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);
|
||||
},
|
||||
/**
|
||||
* 图片路径转换
|
||||
|
||||
17
pages.json
17
pages.json
@@ -1,12 +1,17 @@
|
||||
{
|
||||
"pages": [
|
||||
// pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
||||
{
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
// "navigationStyle": "custom",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/empty/index",
|
||||
"style": {
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"subPackages": [
|
||||
@@ -932,15 +937,7 @@
|
||||
"text": ""
|
||||
},
|
||||
{
|
||||
"pagePath": "pages_goods/category",
|
||||
"text": ""
|
||||
},
|
||||
{
|
||||
"pagePath": "pages_tool/contact/contact",
|
||||
"text": ""
|
||||
},
|
||||
{
|
||||
"pagePath": "pages_tool/member/index",
|
||||
"pagePath": "pages/empty/index",
|
||||
"text": ""
|
||||
}
|
||||
]
|
||||
|
||||
4
pages/empty/index.vue
Normal file
4
pages/empty/index.vue
Normal file
@@ -0,0 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view/>
|
||||
</template>
|
||||
Reference in New Issue
Block a user