群组属性 API
setGroupProperty
设置群组的属性
引入
import { setGroupProperty } from '@ray-js/ray';
需引入
DeviceKit,且在>=2.3.1版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| groupId | string | 是 | 群组 id | |
| code | string | 是 | code 属性 code | |
| value | string | 是 | value | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
getGroupProperty
获取群组的属性
引入
import { getGroupProperty } from '@ray-js/ray';
需引入
DeviceKit,且在>=2.3.1版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| groupId | string | 是 | 群组 id | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
object.success 回调参数
参数
Object res
| 属性 | 类型 | 说明 |
|---|---|---|
| result | any | 群组属性信息 |
object.fail 回调参数
参数
Object res
| 属性 | 类型 | 说明 |
|---|---|---|
| errorMsg | string | 插件错误信息 |
| errorCode | string | 错误码 |
| innerError | object | 插件外部依赖错误信息 {errorMsg: string, errorCode: string } |
👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。
群组功能页 API
onOpenGroupCreate
跳转创建群组保存成功回调事件
引入
import { onOpenGroupCreate } from '@ray-js/ray';
需引入
DeviceKit,且在>=3.9.0版本才可使用
@ray-js/ray 需在
>=1.4.22版本才可使用
参数
监听跳转创建群组保存成功的回调函数
请求示例
onOpenGroupCreate(()=>{
console.log('创建群组保存完成')
})
openGroupCreate({
deviceId: "vdevo170107648877238"
}).then(() => {
console.log('调用成功打开创建群组页面');
});
openGroupCreate
跳转创建群组
引入
import { openGroupCreate } from '@ray-js/ray';
需引入
DeviceKit,且在>=3.9.0版本才可使用,开发者工具环境无法使用,需要打包后或真机调试使用。
@ray-js/ray 需在
>=1.4.22版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| deviceId | string | 是 | 设备 id | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
请求示例
openGroupCreate({
deviceId: "vdevo170107648877238"
}).then(() => {
console.log('调用成功打开创建群组页面');
});
openGroupDetailPage
跳转群组详情
引入
import { openGroupDetailPage } from '@ray-js/ray';
需引入
DeviceKit,且在>=2.3.1版本才可使用,开发者工具环境无法使用,需要打包后或真机调试使用。
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| groupId | string | 是 | groupId 群组 id | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
openGroupEdit
跳转群组编辑页面
引入
import { openGroupEdit } from '@ray-js/ray';
需引入
DeviceKit,且在>=2.3.1版本才可使用,开发者工具环境无法使用,需要打包后或真机调试使用。
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| groupId | string | 是 | groupId 设备 id | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
openGroupTimerPage
跳转定时界面
引入
import { openGroupTimerPage } from '@ray-js/ray';
需引入
DeviceKit,且在>=2.3.1版本才可使用,开发者工具环境无法使用,需要打包后或真机调试使用。
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| groupId | string | 是 | groupId 群组 id | |
| category | string | 是 | category 定时分类 | |
| repeat | number | 否 | repeat 0 表示需要选择重复,1 表示不需要 | |
| data | array | 是 | data dp 数据 { "dpName": dp 点名称,string "dpId": dp 点 id,string "selected": dp 点默认值的 index,t.Integer "rangeKeys": dp 点的值范围,Array<object> "rangeValues": dp 点的显示数据范围,Array<string> } | |
| timerConfig | TimerConfig | 否 | timerConfig UI 配置 | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
TimerConfig
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| background | string | 否 | background 定时界面导航栏的背景颜色,十六进制,例如:FFFFFF |
👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。

1414

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



