4***@qq.com
4***@qq.com
  • 发布:2020-09-02 16:55
  • 更新:2020-09-30 13:52
  • 阅读:1126

【报Bug】IOS 调用 plus.geolocation.getCurrentPosition 报错

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

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

HBuilderX类型: 正式

HBuilderX版本号: 2.8.8

手机系统: iOS

手机系统版本号: iOS 13.4

手机厂商: 苹果

手机机型: iPhone 8 Plus

页面类型: vue

打包方式: 云端

项目创建方式: HBuilderX

示例代码:
let posOpts = posOpts =  {provider:'amap',enableHighAccuracy:true,timeout:10000,geocode:true,coordsType:'gcj02'}  
    plus.geolocation.getCurrentPosition(function(result){  
        callback && callback(result)  
    }, function(e){  
        that.geolocation();  
    },posOpts);

操作步骤:
let posOpts = posOpts =  {provider:'amap',enableHighAccuracy:true,timeout:10000,geocode:true,coordsType:'gcj02'}  
    plus.geolocation.getCurrentPosition(function(result){  
        callback && callback(result)  
    }, function(e){  
        that.geolocation();  
    },posOpts);

预期结果:

期望正常运行

实际结果:

现在报错

bug描述:

2.8.8 版本
Android 正常运行
IOS 调用 plus.geolocation.getCurrentPosition 报错如下:
[JS Framework] Failed to execute the callback function:
16:49:58.959 TypeError: n.setTimeout is not a function. (In 'n.setTimeout(function(){c(t),t=null,i(new r(r.TIMEOUT,"Position retrieval timed out."))},o)', 'n.setTimeout' is undefined) __ERROR

编辑器版本切换至2.8.7 代码正常执行

2020-09-02 16:55 负责人:CLP 分享
已邀请:
6***@qq.com

6***@qq.com

2.8.11
同样有问题
加载定位出错 TypeError: n.setTimeout is not a function

    at a (eval at <anonymous> (Runtime.IOS.js:385), <anonymous>:2:27055)  
    at u (eval at <anonymous> (Runtime.IOS.js:385), <anonymous>:2:28107)  
    at Object.watchPosition (eval at <anonymous> (Runtime.IOS.js:385), <anonymous>:2:28592)  
    at o.startPositioning (patrol.vue:235)  
    at o.getUserLoca (patrol.vue:186)  
    at o.mounted (patrol.vue:110)  
    at Ke ()  
    at o.Hr [as __call_hook] ()  
    at Array.<anonymous> ()  
    at Hn.Bu ()  uni-app:///pages/patrol/patrol.vue:112
CLP

CLP

console.log("vvvvvvvvv");
let posOpts = {provider:'amap',enableHighAccuracy:true,timeout:10000,geocode:true,coordsType:'gcj02'} ;
console.log("vvvvvsdfasdvvvv");
plus.geolocation.getCurrentPosition(function(result){
console.log("ak::::" JSON.stringify(result));
}, function(e){
console.log("asdfajlsdfk::::" JSON.stringify(e));
},posOpts);

没有复现你描述的问题

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