uni.onLocationChange(function(res) {
//这持续输出当前的gps位置信息
that.nowlat = res.latitude;
that.nowlng = res.longitude;
});
uni.startLocationUpdate({
success: res => console.log('开启接收位置消息成功'),
fail: err => console.error('开启接收位置消息失败:', err),
complete: msg => console.log('调用开启接收位置消息 API 完成')
});
网友回复