Global

Members

AbstractDialog

通用弹窗容器,包括头部标题和底部按钮,内容自定义

accessibilityLabel

The text that's read by the screen reader when the user interacts with the image.

See https://facebook.github.io/react-native/docs/image.html#accessibilitylabel

accessible

When true, indicates the image is an accessibility element.

See https://facebook.github.io/react-native/docs/image.html#accessible

ActionSheet

选项弹窗,无选择态,点击后弹窗消失

blurRadius

blurRadius: the blur radius of the blur filter added to the image

See https://facebook.github.io/react-native/docs/image.html#blurradius

blurRadius

blurRadius: the blur radius of the blur filter added to the image

See https://facebook.github.io/react-native/docs/image.html#blurradius

capInsets

See https://facebook.github.io/react-native/docs/image.html#capinsets

(constant) CARD_RADIUS_TYPE :string

卡片圆角类型

Properties:
Name Type Description
ALL string

四角都是圆角

NONE string

四角都是直角

TOP string

上方圆角下方直角

BOTTOM string

上方直角下方圆角

(constant) CARD_TYPE :string

卡片类型

Properties:
Name Type Description
NORMAL string

普通卡片,卡片右侧不是开关

SWITCH string

开关卡片,卡片右侧是开关

ChoiceDialog

选项弹窗,有选择态,可以定义是单选还是多选

defaultSource

A static image to display while loading the image source.

See https://facebook.github.io/react-native/docs/image.html#defaultsource

deviceID

获取设备ID,same as Device.deviceID

Since:
  • 10020

(constant) excludeOptions

某些特殊设备类型不显示某些设置项 key: 设置项的key value: 不显示该设置项的设备类型列表, 用 pid 表示设备类型, [] 表示支持所有设备 0: wifi单模设备 1: yunyi设备 2: 云接入设备 3: zigbee设备 5: 虚拟设备 6: 蓝牙单模设备 7: 本地AP设备 8: 蓝牙wifi双模设备 9: 其他 10: 功能插件 11: SIM卡设备 12: 网线设备 13: NB-IoT 14: 第三方云接入 15: 红外遥控器 16: BLE Mesh 17: 虚拟设备(新设备组)

(constant) firstAllOptionsWeight

20190708 / SDK_10023 所有设置项顺序固定 权重值越大,排序越靠后,为了可扩展性,权重不能依次递增+1

(constant) firstSharedOptions

分享设备的设置项 0: 不显示 1: 显示

InputDialog

输入弹窗,提示用户录入信息并记录

layerScaleFilter

layerScaleFilter iOS only

LoadingDialog

加载弹窗,显示加载旋转动画和提示信息

loadingIndicatorSource

See https://facebook.github.io/react-native/docs/image.html#loadingindicatorsource

MessageDialog

消息弹窗,用于提示用户

miot/ui/MultiChoseDialog :func

回调会带一个 object 的参数,object.position为点击第几个条目,object.check 为选中状态

Properties:
Name Type Description
visible bool

是否可见

cancelable bool

是否允许点击空白区域取消显示,仅限Android

title string

标题

timeout number

超时自动隐藏,设置0或者不设置不会自动隐藏

dataSource array

数据源,建议 array 的每个item 是一个 object,object 至少有展示条目名称、选中状态两个字段

dataKey string

用于表示显示的字段名,dataSource每个条目显示名称 object 的字段名

checkKey string

用于表示选中的字段名,dataSource每个条目选中状态 object 的字段名

cancel string

取消标题

confirm string

确认标题

onConfirm func

确认点击回调

onCancel func

取消点击回调

onDismiss func

对话框消失回调

onCheck func

某一行选中状态变更回调

Examples
import {MultiChoseDialog} from 'miot/ui'
//dataSource列表数据中,dataKey所定义的值('dataKeyName') 对应项为展示的名称, 与checkKey所定义的值('checkKeyName') 对应的boolean值表示是否选中
<MultiChoseDialog 
dataSource = {[{'dataKeyName':'displayName1','checkKeyName':false}, {'dataKeyName':'displayName2','checkKeyName':true} ]}
dataKey = {'dataKeyName'}
checkKey = {'checkKeyName'}
/>
某一行选中状态变更回调
import {MultiChoseDialog} from 'miot/ui'
<MultiChoseDialog 
...
onCheck={res => {
 console.log('click at row ', res.position, ' with checked ', res.check)
}}
/>

onError

Invoked on load error

onError

Invoked on load error with {nativeEvent: {error}}.

onLayout

Invoked on mount and layout changes with {nativeEvent: {layout: {x, y, width, height}}}.

onLoad

Invoked when load completes successfully

onLoad

Invoked when load completes successfully.

onLoadEnd

Invoked when load either succeeds or fails

onLoadEnd

Invoked when load either succeeds or fails.

onLoadStart

Invoked on load start

onLoadStart

Invoked on load start.

onPartialLoad

Invoked when a partial load of the image is complete.

onProgress

Invoked on download progress with {nativeEvent: {loaded, total}}.

PinCodeDialog

密码/验证码弹窗,用于输入密码/验证码

ProgressDialog

进度条弹窗,显示进度条和提示信息

resizeMethod

See https://facebook.github.io/react-native/docs/image.html#resizemethod

resizeMethod

The mechanism that should be used to resize the image when the image's dimensions differ from the image view's dimensions. Defaults to auto.

See https://facebook.github.io/react-native/docs/image.html#resizemethod

resizeMode

Determines how to resize the image when the frame doesn't match the raw image dimensions.

See https://facebook.github.io/react-native/docs/image.html#resizemode

resizeMode

Determines how to resize the image when the frame doesn't match the raw image dimensions.

See https://facebook.github.io/react-native/docs/image.html#resizemode

(constant) secondSharedOptions

分享设备的设置项 0: 不显示 1: 显示

ShareDialog

分享弹窗,弹窗让用户指定分享渠道

(constant) SINGLE_TYPE :string

单个picker时选择器的类型,也就是显示的单位

Properties:
Name Type Description
MONTH string

DAY string

HOUR string

MINUTE string

SECOND string

source

See https://facebook.github.io/react-native/docs/image.html#source

source

The image source (either a remote URL or a local file resource).

See https://facebook.github.io/react-native/docs/image.html#source

style

See https://facebook.github.io/react-native/docs/image.html#style

testID

A unique identifier for this element to be used in UI Automation testing scripts.

testID

Used to locate this view in end-to-end tests.

(constant) TYPE :string

空白页面底部视图类型

Properties:
Name Type Description
BUTTON string

底部是按钮

UNDERLINE string

底部是下划线超链接

(constant) TYPE :string

输入弹窗的类型

Properties:
Name Type Description
SIMPLE string

普通,只有输入框

UNDERLINE string

输入框上方有文字说明和下划线超链接

CHECKBOX string

输入框下方有勾选框和文字

BOTH string

输入框上方有文字说明和下划线超链接 输入框下方有勾选框和文字

(constant) TYPE :string

选择弹窗的类型

Properties:
Name Type Description
SINGLE string

单选弹窗,将不显示底部按钮,点击某项之后弹窗消失

MULTIPLE string

多选弹窗

(constant) TYPE :string

选择列表项的类型

Properties:
Name Type Description
STATELESS string

无状态列表项

SINGLE string

单选列表项

MULTIPLE string

多选列表项

(constant) TYPE :string

容器和滑块的圆角类型

Properties:
Name Type Description
CIRCLE string

圆形 ⭕️

RECTANGLE string

方形 ⬜️

(constant) TYPE :string

消息弹窗的类型

Properties:
Name Type Description
SIMPLE string

普通,只有提示文字

UNDERLINE string

带下划线超链接

CHECKBOX string

带勾选框

(constant) TYPE

分割线类型

(constant) TYPE :string

时间选择器类型

Properties:
Name Type Description
SINGLE string

单个picker

TIME24 string

选择小时分钟,24小时制

TIME12 string

选择小时分钟,12小时制

DATE string

选择年月日

Methods

constructArray(length, zeroPrefix, fromZero)

Parameters:
Name Type Default Description
length number
zeroPrefix bool true

是否前补0

fromZero bool false

是否从0开始

getLinkedBTDevices(didopt) → {Promise}

获取蓝牙网关关联的普通蓝牙和蓝牙mesh设备列表。

Parameters:
Name Type Attributes Default Description
did string <optional>
Device.deviceID

蓝牙网关的did,可以为空,为空时默认取当前的Device.deviceID

Returns:

返回数组设备信息的promise, {"mesh":[], "normal":""}

Type
Promise

getSize()

Retrieve the width and height (in pixels) of an image prior to displaying it.

See https://facebook.github.io/react-native/docs/image.html#getsize

getSize()

Retrieve the width and height (in pixels) of an image prior to displaying it.

See https://facebook.github.io/react-native/docs/image.html#getsize

getSubDevices()

获取子设备列表

Since:
  • 10020
Returns:

Promise

prefetch()

Prefetches a remote image for later use by downloading it to the disk cache.

See https://facebook.github.io/react-native/docs/image.html#prefetch

prefetch()

Prefetches a remote image for later use by downloading it to the disk cache.

See https://facebook.github.io/react-native/docs/image.html#prefetch

supportModelToConnect()

获取支持连接的model列表

Type Definitions

Button

按钮

Properties:
Name Type Description
text string

按钮的文字

style style

按钮的样式

callback function

点击按钮的回调函数

Button

按钮

Properties:
Name Type Description
text string

按钮的文字

style style

按钮的样式

callback function

点击按钮的回调函数

Button

按钮

Properties:
Name Type Description
text string

按钮的文字

style style

按钮的样式

callback function

点击按钮的回调函数

Button

按钮

Properties:
Name Type Description
text string

按钮的文字

style style

按钮的样式

callback function

点击按钮的回调函数

Button

按钮

Properties:
Name Type Description
text string

按钮文字

buttonStyle ViewPropTypes.style

按钮样式

textStyle ViewPropTypes.style

按钮文字样式

callback function

点击按钮的回调函数

Button

按钮

Properties:
Name Type Description
text string

按钮的文字

style style

按钮的样式

callback function

点击按钮的回调函数

Button

按钮

Properties:
Name Type Description
text string

按钮的文字

style style

按钮的样式

callback function

点击按钮的回调函数

Button

按钮

Properties:
Name Type Description
text string

按钮的文字

style style

按钮的样式

callback function

点击按钮的回调函数

CheckboxData

勾选框相关数据

Properties:
Name Type Description
checked boolean

勾选框的初始勾选状态

text string

勾选框右侧的说明文字

CheckboxData

勾选框相关数据

Properties:
Name Type Description
checked boolean

勾选框的初始勾选状态

text string

勾选框右侧的说明文字

Extra

下划线超链接或者勾选框需要的其他数据

Properties:
Name Type Description
checked boolean

勾选框的初始勾选状态,只对TYPE.CHECKBOX有效

onPress function

点击下划线链接的回调函数,只对TYPE.UNDERLINE有效

Input

输入框

Properties:
Name Type Description
placeholder string

占位文字,参考 https://facebook.github.io/react-native/docs/0.54/textinput#placeholder

defaultValue string

初始默认文字,参考 https://facebook.github.io/react-native/docs/0.54/textinput#defaultvalue

onChangeText function

文字变化回调,参考 https://facebook.github.io/react-native/docs/0.54/textinput#onchangetext

textInputProps Object

其他 TextInput 支持的属性,参考 https://facebook.github.io/react-native/docs/0.54/textinput#props

Opiton

可点击的选项

Properties:
Name Type Description
title string

主文案

subtitle string

副文案

onPress function

点击回调函数

Opiton

分享选项

Properties:
Name Type Description
icon number

图标的资源, require('../xx/xx.png')

text string

图标下方的文字说明

callback function

点击图标的回调函数

Opiton

可选项

Properties:
Name Type Description
title string

主文案

subtitle string

副文案

Underline

下划线

Properties:
Name Type Description
text string

下划线文字

textStyle ViewPropTypes.style

文字样式

callback function

点击下划线的回调函数

UnderlineData

输入框上方的数据

Properties:
Name Type Description
leftText string

左侧说明文字

underlineText string

右侧下划线文字

onPress function

点击下划线文字的回调函数