2***@qq.com
2***@qq.com
  • 发布:2023-06-20 09:21
  • 更新:2023-06-20 17:18
  • 阅读:237

安卓app安装完后在第一次启动时会跳转登录页面,登录页面会显示tabbar

分类:uni-app

我开发的安卓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

2023-06-20 09:21 负责人:无 分享
已邀请:
喜欢技术的前端

喜欢技术的前端 - QQ---445849201

可以定义一个空页面作为首页,在这个页面onLoad 判断token,如果没有 uni.redirectTo 跳转 登录,有uni.switchTab跳转tabbar页面 ☺☺

  • 2***@qq.com (作者)

    谢谢帮忙,今天折腾了一天,最后把登录页面定为首页了,每次打开app在登录页面onLoad先判断有没有token,有的话跳转到index首页。

    2023-06-20 20:05

  • 喜欢技术的前端

    回复 2***@qq.com: 不客气,实现了就好

    2023-06-20 22:10

要回复问题请先登录注册