丨薛
丨薛
  • 发布:2020-09-17 15:57
  • 更新:2020-09-17 15:57
  • 阅读:845

【报Bug】uni.getLocation 当手机不打开定位时,接口调用不成功

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: 10.15.6

HBuilderX类型: 正式

HBuilderX版本号: 2.8.11

手机系统: Android

手机系统版本号: Android 10

手机厂商: 华为

手机机型: mate 20pro

页面类型: vue

打包方式: 云端

项目创建方式: HBuilderX

操作步骤:

当手机没有打开位置服务时

uni.getLocation({  
                    type: 'gcj02',  
                    success: function(res) {  
                        _self.locationObj = res;  
                        console.log(res)  
                        console.log('当前位置的经度:' + res.longitude);  
                        console.log('当前位置的纬度:' + res.latitude);  
                    },

是不走console的,打开位置服务后才正常走入

预期结果:

不打开也是可以成功的

实际结果:

不打开uni.getLocation 调用不成功

bug描述:

当手机没有打开位置服务时

uni.getLocation({  
                    type: 'gcj02',  
                    success: function(res) {  
                        _self.locationObj = res;  
                        console.log(res)  
                        console.log('当前位置的经度:' + res.longitude);  
                        console.log('当前位置的纬度:' + res.latitude);  
                    },

是不走console的,打开位置服务后才正常走入

2020-09-17 15:57 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复