my.startcompass(object object)
基础库 1.24.9 / 2.6.0 或更高版本; 且 支付宝客户端 10.1.98 或更高版本; 若版本较低,建议采取 兼容处理 。
小程序开发者工具: 不支持。
主体: 企业支付宝小程序 、 个人支付宝小程序
开始监听罗盘数据。
object object
查看示例
| 属性 | 类型 | 默认值 | 必填 | 描述 | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| interval | string | normal | 否 | 监听罗盘数据回调函数的执行频率 |
|||||||||||||
|
|||||||||||||||||
| success | function | - | 否 | 调用成功的回调函数 |
|||||||||||||
| fail | function | - | 否 | 调用失败的回调函数 |
|||||||||||||
| complete | function | - | 否 | 调用结束的回调函数(调用成功、失败都会执行) |
|||||||||||||
fail 回调函数
参数
object err
| 属性 | 类型 | 描述 |
|---|---|---|
| error | number | 错误码 |
| errormessage | string | 错误信息 |
my.startcompass(object object)
my.startcompass({
interval: 'normal',
success(res) {
console.log(res)
},
fail(err) {
console.log(err)
}
});