location.js wx.getLocation({ type: 'wgs84', success: function (res) { var latitude = res.latitude; var longitude = res.longitude; wx.login({ }); }, fail: function (res) { //未开启定位权限,拉起授权 if (res.errMsg == 'getLocation
wx.getLocation({ type: 'wgs84', success: function (res) { var latitude = res.latitude; var longitude = res.longitude; wx.login({ }); }, fail: function (res) { //未开启定位权限,拉起授权 if (res.errMsg == 'getLocation:fail auth deny') { //重新拉起授权 wx.openSetting({ success: function (res) { if (res.authSetting['scope.userLocation'] == false) { wx.showModal({ title: '提示', content: '您未开启定位权限,将导致无法使用本软件', showCancel: false }); } else { wx.showModal({ title: '提示', content: '您已开启定位权限,请重新点击登录', showCancel: false }); } } }); } } })