小程序
小游戏
企业微信
微信支付
扫描小程序码分享
录制了一个视频,里面有描述的问题,点击链接
iPhone6P,预览打开小程序,tabBar开始有的,然后授权登录再跳回到首页,tabBar不显示了,再次扫码进入小程序会显示,或者打开调试也显示tabBar。换成安卓机器或者iPhoneX都没有问题。请问,有遇到类似问题的吗?
2 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
你好,麻烦提供复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
首页,app.js里判断是否登录,未登录的话,wx.reLaunch 到登录页面,完成授权后wx.reLaunch 到首页pages/index/index 。就是这个过程后,回到首页,tabBar不显示了,只能重新编译一个新二维码的扫码进入才可以出现tabBar。
这个是判断是否登录的方法:
checkLogin:
function
() {
this
.globalData.openid = wx.getStorageSync(
'openid'
)
if
(!
.globalData.openid) {
wx.reLaunch({
url:
'/pages/common/login'
})
}
else
{
wx.request({
.globalData.apiUrl +
"&do=AppUserInfo"
,
data: {
openid:
.globalData.openid
},
method:
'post'
success:
(res) {
(res.data ==
""
){
wx.clearStorage()
wx.setStorageSync(
"userInfo"
, res.data.userInfo)
onGotUserInfo: function (e) {
onGotUserInfo:
(e) {
(e.detail.rawData) {
wx.showLoading({
title:
'正在登录……'
mask:
true
wx.login({
//login流程
//登录成功
(res.code) {
//请求服务器
var
agent_openid =
(wx.getStorageSync(
'agent_openid'
))
agent_openid = wx.getStorageSync(
url: appInfo.globalData.apiUrl +
"&do=AppWechatLogin"
code: res.code,
userInfo: e.detail.rawData,
agent_openid: agent_openid
(res2) {
// success
, res2.data.openid)
wx.hideLoading()
'/pages/index/index'
});
wx.showToast({
'登陆失败!'
icon:
'none'
以上是登录的方法
先看下代码片段的介绍,然后提供可复现问题的demohttps://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html
刚用6P试了下没有复现
问题复现 ,点击查看
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
你好,麻烦提供复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
首页,app.js里判断是否登录,未登录的话,wx.reLaunch 到登录页面,完成授权后wx.reLaunch 到首页pages/index/index 。就是这个过程后,回到首页,tabBar不显示了,只能重新编译一个新二维码的扫码进入才可以出现tabBar。
这个是判断是否登录的方法:
checkLogin:
function
() {
this
.globalData.openid = wx.getStorageSync(
'openid'
)
if
(!
this
.globalData.openid) {
wx.reLaunch({
url:
'/pages/common/login'
})
}
else
{
wx.request({
url:
this
.globalData.apiUrl +
"&do=AppUserInfo"
,
data: {
openid:
this
.globalData.openid
},
method:
'post'
,
success:
function
(res) {
if
(res.data ==
""
){
wx.clearStorage()
wx.reLaunch({
url:
'/pages/common/login'
})
}
else
{
wx.setStorageSync(
"userInfo"
, res.data.userInfo)
}
}
})
}
}
onGotUserInfo:
function
(e) {
if
(e.detail.rawData) {
wx.showLoading({
title:
'正在登录……'
,
mask:
true
})
wx.login({
//login流程
success:
function
(res) {
//登录成功
if
(res.code) {
//请求服务器
var
agent_openid =
""
if
(wx.getStorageSync(
'agent_openid'
))
agent_openid = wx.getStorageSync(
'agent_openid'
)
wx.request({
url: appInfo.globalData.apiUrl +
"&do=AppWechatLogin"
,
data: {
code: res.code,
userInfo: e.detail.rawData,
agent_openid: agent_openid
},
method:
'post'
,
success:
function
(res2) {
// success
wx.setStorageSync(
'openid'
, res2.data.openid)
wx.hideLoading()
wx.reLaunch({
url:
'/pages/index/index'
})
}
});
}
else
{
wx.showToast({
title:
'登陆失败!'
,
mask:
true
,
icon:
'none'
})
}
}
});
}
else
{
wx.showToast({
title:
'登陆失败!'
,
icon:
'none'
})
}
},
以上是登录的方法
先看下代码片段的介绍,然后提供可复现问题的demohttps://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html
刚用6P试了下没有复现
问题复现 ,点击查看