ty.outdoor.openOutdoorCyclingNavigation
跳转骑行导航页面
引入
import { openOutdoorCyclingNavigation } from '@ray-js/ray';
注意:当前功能仅在
智慧出行App开通使用,需要在基础库2.15.14及以上版本使用。
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| devId | string | 否 | 设备 id | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
请求示例
openOutdoorCyclingNavigation({
devId: "devId"
}).then(() => {
console.log('调用成功跳转骑行导航页面');
});
ty.outdoor.getBoundDeviceIdList
获取已绑定设备 ID 集合
需引入
OutdoorKit,且在>=1.0.1版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
object.success 回调参数
参数
Object res
| 属性 | 类型 | 说明 |
|---|---|---|
| devIdList | array | 返回已绑定的设备 ID 集合 |
object.fail 回调参数
参数
Object res
| 属性 | 类型 | 说明 |
|---|---|---|
| errorMsg | string | 插件错误信息 |
| errorCode | string | 错误码 |
| innerError | object | 插件外部依赖错误信息 {errorMsg: string, errorCode: string } |
函数定义示例
/**
* 获取已绑定设备ID集合
*/
export function getBoundDeviceIdList(params?: {
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
complete?: () => void;
/** 接口调用成功的回调函数 */
success?: (params: {
/** 返回已绑定的设备ID集合 */
devIdList: string[];
}) => void;
/** 接口调用失败的回调函数 */
fail?: (params: {
errorMsg: string;
errorCode: string | number;
innerError: {
errorCode: string | number;
errorMsg: string;
};
}) => void;
}): void;
👉 立即开发。
ty.outdoor.getUnbindDeviceIdList
获取可绑定设备 ID 集合
需引入
OutdoorKit,且在>=1.0.1版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
object.success 回调参数
参数
Object res
| 属性 | 类型 | 说明 |
|---|---|---|
| devIdList | array | 返回可绑定的设备 ID 集合 |
object.fail 回调参数
参数
Object res
| 属性 | 类型 | 说明 |
|---|---|---|
| errorMsg | string | 插件错误信息 |
| errorCode | string | 错误码 |
| innerError | object | 插件外部依赖错误信息 {errorMsg: string, errorCode: string } |
A函数定义示例
/**
* 获取可绑定设备ID集合
*/
export function getUnbindDeviceIdList(params?: {
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
complete?: () => void;
/** 接口调用成功的回调函数 */
success?: (params: {
/** 返回可绑定的设备ID集合 */
devIdList: string[];
}) => void;
/** 接口调用失败的回调函数 */
fail?: (params: {
errorMsg: string;
errorCode: string | number;
innerError: {
errorCode: string | number;
errorMsg: string;
};
}) => void;
}): void;
ty.outdoor.bindSlaveDevice
从设备绑定
需引入
OutdoorKit,且在>=1.0.1版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| slaveDevId | string | 是 | 从设备 ID | |
| masterDevId | string | 是 | 主设备 ID | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
函数定义示例
/**
* 从设备绑定
*/
export function bindSlaveDevice(params: {
/** 从设备ID */
slaveDevId: string;
/** 主设备ID */
masterDevId: string;
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
complete?: () => void;
/** 接口调用成功的回调函数 */
success?: (params: boolean) => void;
/** 接口调用失败的回调函数 */
fail?: (params: {
errorMsg: string;
errorCode: string | number;
innerError: {
errorCode: string | number;
errorMsg: string;
};
}) => void;
}): void;
ty.outdoor.unbindDevice
从设备移除
需引入
OutdoorKit,且在>=1.0.1版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| devId | string | 是 | 从设备 ID | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
函数定义示例
/**
* 从设备移除
*/
export function unbindDevice(params: {
/** 从设备ID */
devId: string;
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
complete?: () => void;
/** 接口调用成功的回调函数 */
success?: (params: boolean) => void;
/** 接口调用失败的回调函数 */
fail?: (params: {
errorMsg: string;
errorCode: string | number;
innerError: {
errorCode: string | number;
errorMsg: string;
};
}) => void;
}): void;
ty.outdoor.saveTTSData
保存骑行语音播报数据
需引入
OutdoorKit,且在>=1.0.1版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| ttsMainSwitch | boolean | 是 | 骑行数据播报总开关 | |
| weather | boolean | 是 | 天气 | |
| abnormalWear | boolean | 是 | 骑行数据播报总开关 | |
| cyclingMileage | boolean | 是 | 骑行里程 | |
| lowBattery | boolean | 是 | 低电量 | |
| electricThreshold | number | 是 | 具体电量数值 | |
| callReminder | boolean | 是 | 骑行里程 | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
函数定义示例
/**
* 保存骑行语音播报数据
*/
export function saveTTSData(params: {
/** 骑行数据播报总开关 */
ttsMainSwitch: boolean;
/** 天气 */
weather: boolean;
/** 骑行数据播报总开关 */
abnormalWear: boolean;
/** 骑行里程 */
cyclingMileage: boolean;
/** 低电量 */
lowBattery: boolean;
/** 具体电量数值 */
electricThreshold: number;
/** 骑行里程 */
callReminder: boolean;
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
complete?: () => void;
/** 接口调用成功的回调函数 */
success?: (params: boolean) => void;
/** 接口调用失败的回调函数 */
fail?: (params: {
errorMsg: string;
errorCode: string | number;
innerError: {
errorCode: string | number;
errorMsg: string;
};
}) => void;
}): void;
👉 立即开发。
本文介绍了Ray.js框架中的户外骑行导航API,包括openOutdoorCyclingNavigation函数,用于导航页面跳转,以及getBoundDeviceIdList、getUnbindDeviceIdList、bindSlaveDevice、unbindDevice和saveTTSData等方法,涉及设备绑定、解绑和骑行语音数据设置等功能。
&spm=1001.2101.3001.5002&articleId=136809366&d=1&t=3&u=89063e24db1643dba7199c360550d521)
472

被折叠的 条评论
为什么被折叠?



