uni-app拒绝授权后再次授权


getLocation(){
				uni.getLocation({
				    type: 'wgs84',
				    success: function (res) {
				        console.log('当前位置的经度:' + res.longitude);
				        console.log('当前位置的纬度:' + res.latitude);
				    },
					fail(){
						uni.showModal({
							content: '检测到您没打开获取位置功能权限,是否去设置打开?',
							confirmText: "确认",
							cancelText: '取消',
							success: (res) => {
								if (res.confirm) {
									uni.openSetting({
										success: (res) => {
											uni.showToast({
												title: '授权后请重新打开此页面',
												icon: 'none',
												success:function(){
													
												}
											})
										},
										fail: (err) => {
											console.log(err)
										}
									})
								} else {
									uni.showToast({
										title: '获取地理位置授权失败',
										icon: 'none',
										success:function() {
											
										}
									})
								}
							}
						})
					}
					
				});
			},

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM