我开发的安卓app,打包为apk,app安装完后在第一次启动时会跳转登录页面,登录页面会显示tabbar,影响用户体验,找了很久不知道什么原因导致的。
现象如图:
我的pages.json主要配置信息如下,首页配置的是pages/index,当app启动时会判断缓存中是否有登录token,没有的话就会跳转到登录页面,但是app安装完第一次启动跳转到登录页面就会显示tabbar,必须点某一个tabbar按钮后才能再次跳转登录页面,然后就不再显示tabbar了:
"pages": [{
"path": "pages/index",
"style": {
"navigationBarTitleText": "%index.myShop%",
"app-plus":{
"titleNView":{
"buttons":[
{
"text":"\ue6cb",
"fontSrc":"/static/font2/iconfont.ttf",
"fontSize":"22px"
}
]
}
}
}
},{
"path": "pages/login",
"style": {
"navigationBarTitleText": "%schema.login%",
"navigationStyle": "custom"
}
}
]
在tabbar中并为配置pages/login页面
"tabBar": {
"color": "#000000",
"selectedColor": "#e50a0b",
"borderStyle": "white",
"backgroundColor": "#ffffff",
"list": [{
"pagePath": "pages/index",
"iconPath": "static/images/tabbar/home.png",
"selectedIconPath": "static/images/tabbar/home.png",
"text": "%index.home%"
}, {
"pagePath": "pages/myAppoint/index",
"iconPath": "static/images/tabbar/hadAppoint.png",
"selectedIconPath": "static/images/tabbar/hadAppoint.png",
"text": "%index.nowAppoint%"
}, {
"pagePath": "pages/myAppoint/history",
"iconPath": "static/images/tabbar/history.png",
"selectedIconPath": "static/images/tabbar/history.png",
"text": "%index.appointHis%"
}, {
"pagePath": "pages/mine/index",
"iconPath": "static/images/tabbar/mine.png",
"selectedIconPath": "static/images/tabbar/mine.png",
"text": "%index.mine%"
}
]
},
编辑器版本:hbuilder x 3.8.5
2***@qq.com (作者)
谢谢帮忙,今天折腾了一天,最后把登录页面定为首页了,每次打开app在登录页面onLoad先判断有没有token,有的话跳转到index首页。
2023-06-20 20:05
喜欢技术的前端
回复 2***@qq.com: 不客气,实现了就好
2023-06-20 22:10