Commit 31e46ea0 by 施宇

授权页面无网络提示

parent cbde107e
Showing with 25 additions and 5 deletions
......@@ -106,7 +106,6 @@ Page({
*/
bindGetUserInfo(e) {
let self = this;
if (e.detail.errMsg == 'getUserInfo:ok') {
wx.login({
success(res) {
......@@ -157,11 +156,32 @@ Page({
}
})
} else {
//用户拒绝获取资料
wx.navigateTo({
url: '/pages/person/login/index'
});
wx.getNetworkType({
success(res) {
const networkType = res.networkType;
if (networkType != 'none') {
//有网络
wx.navigateTo({
url: '/pages/person/login/index'
});
} else {
wx.hideNavigationBarLoading();
wx.showToast({
title: '网络出现异常',
icon: 'none',
duration: 2000
});
}
},
fail: function () {
wx.navigateTo({
url: '/pages/person/login/index'
});
}
})
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment