openPanel

版本要求:
BizKit≥3.0.0@ray-js/ray≥0.3.23
支持平台:
iOSAndroid
import { openPanel } from '@ray-js/ray';

// Promise 调用
try {
  const res = await openPanel({ ...params });
  console.log(res);
} catch (err) {
  console.log(err.errorMsg);
}

方法签名
openPanel(params: )
SDK 最低版本
iOSThingSmartBizKitBizBundle
≥ 5.2.1
Androidcom.thingclips.smart:thingsmart-bizbundle-bizkit
≥ 5.2.0

描述

跳转打开面板 不关心是跳转RN面板还是面板小程序

参数

属性类型必填说明SDK 最低版本
deviceIdstring是设备信息Id—
否额外面板信息 当跳转的是二级面板时, 需要传递的额外信息—
initialPropsRecord<string, Record<string, any>>否面板携带业务启动参数—
complete() => void否接口调用结束的回调函数(调用成功、失败都会执行)—
success() => void否接口调用成功的回调函数—
fail(params: Object) => void否接口调用失败的回调函数—
fail 回调参数
属性类型说明
errorMsgstring错误信息
errorCodestring | number错误码
错误扩展

返回值

无

示例代码

import { openPanel } from '@ray-js/ray'

openPanel({
  deviceId: "xx",
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});