7***@qq.com
7***@qq.com
  • 发布:2021-10-11 16:07
  • 更新:2021-10-11 16:07
  • 阅读:878

【报Bug】uni.getLocation定位失效

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

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

HBuilderX类型: 正式

HBuilderX版本号: 3.2.2

手机系统: Android

手机系统版本号: Android 7.0

手机厂商: 华为

手机机型: cpn_aloo

页面类型: vue

打包方式: 云端

项目创建方式: HBuilderX

App下载地址或H5⽹址: https://m.taotanzhang.com/

示例代码:

open() {
var that = this
uni.getLocation({
type: 'gcj02',
geocode: true,
success: function(res) {
console.log('当前位置的经度:' + res.longitude);
console.log('当前位置的纬度:' + res.latitude);
uni.showToast({
icon: 'none',
duration: 10000,
title: res.longitude + "____" + res.latitude
})
that.address = res
that.latitude = res.latitude
that.longitude = res.longitude

                },  
                fail(err) {  
                    uni.showToast({  
                        icon: 'none',  
                        title: err,  
                        duration: 10000  
                    })  
                }  
            });  

        },  

操作步骤:
onShow(opt) {  
        this.open()  
    },  

在onShow 调用open 方法

预期结果:

获取到经纬度定位等信息

实际结果:

进入页面,没有任何数据展示,没有提示失败还是成功

bug描述:

使用uni.getLocation 开通了高德地图的权限,点击获取信息,在没有高德地图APP 的情况下,获取的数据都是失败的,下载安装了高德地图开通的权限,就能获取到定位信息

2021-10-11 16:07 负责人:无 分享
已邀请:

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