Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
unidocs-zh
提交
758227fa
unidocs-zh
项目概览
DCloud
/
unidocs-zh
通知
3597
Star
108
Fork
921
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
120
列表
看板
标记
里程碑
合并请求
109
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
unidocs-zh
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
120
Issue
120
列表
看板
标记
里程碑
合并请求
109
合并请求
109
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
758227fa
编写于
9月 22, 2023
作者:
D
DCloud_LXH
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: utsApiJson
上级
1419438e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
33 addition
and
33 deletion
+33
-33
docs/.vuepress/utils/utsApiJson.json
docs/.vuepress/utils/utsApiJson.json
+33
-33
未找到文件。
docs/.vuepress/utils/utsApiJson.json
浏览文件 @
758227fa
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
"$emit"
:
{
"$emit"
:
{
"name"
:
"## uni.$emit(eventName, args?) @$emit"
,
"name"
:
"## uni.$emit(eventName, args?) @$emit"
,
"description"
:
"
\r\n
触发自定义事件,附加的参数会传递给事件监听器。
\r\n
"
,
"description"
:
"
\r\n
触发自定义事件,附加的参数会传递给事件监听器。
\r\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| eventName | string | 是 | - | - |
\n
| args | any | 否 | - |
页面间通信接口,用于监听被打开页面发送到当前页面的数据 |
\n
#### 兼容性
\n
| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- | :- |
\n
| args | 5.0 | √ | x | 10.0 | √ | x |
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| eventName | string | 是 | - | - |
\n
| args | any | 否 | - |
- |
"
,
"returnValue"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
""
,
"compatibility"
:
""
,
"tutorial"
:
"
\n
### 参见
\n
[$emit](http://uniapp.dcloud.io/api/window/communication?id=emit)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[$emit](http://uniapp.dcloud.io/api/window/communication?id=emit)
\n
"
...
@@ -98,7 +98,7 @@
...
@@ -98,7 +98,7 @@
"navigateBack"
:
{
"navigateBack"
:
{
"name"
:
"## uni.navigateBack(options?) @navigateback"
,
"name"
:
"## uni.navigateBack(options?) @navigateback"
,
"description"
:
"
\r\n
关闭当前页面,返回上一页面或多级页面
\r\n
"
,
"description"
:
"
\r\n
关闭当前页面,返回上一页面或多级页面
\r\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [NavigateBackOptions](#navigatebackoptions) | 否 | - | - |
\n
#### NavigateBackOptions 属性值 @navigatebackoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
|
success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: [AsyncApiResult](#asyncapiresult)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n\n
##### AsyncApiResult 属性值 @asyncapiresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n\n
##### NavigateBackOptions 兼容性
\n
| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- | :-
|
\n
| success | 5.0 | √ | √ | 10.0 | √ | x |
\n
| fail | 5.0 | √ | √ | 10.0 | √ | x |
\n
| complete | 5.0 | √ | √ | 10.0 | √ | x |
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [NavigateBackOptions](#navigatebackoptions) | 否 | - | - |
\n
#### NavigateBackOptions 属性值 @navigatebackoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
|
delta | number | 否 | - | 返回的页面数,如果 delta 大于现有页面数,则返回到首页 |
\n
| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: [AsyncApiResult](#asyncapiresult)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n\n
##### AsyncApiResult 属性值 @asyncapiresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n\n
##### NavigateBackOptions 兼容性
\n
| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- | :- |
\n
| delta | 5.0 | √ | √ | 10.0 | √ | x
|
\n
| success | 5.0 | √ | √ | 10.0 | √ | x |
\n
| fail | 5.0 | √ | √ | 10.0 | √ | x |
\n
| complete | 5.0 | √ | √ | 10.0 | √ | x |
\n
"
,
"returnValue"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
"### navigateBack 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 5.0 | √ | √ | 10.0 | √ | x |
\n
"
,
"compatibility"
:
"### navigateBack 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 5.0 | √ | √ | 10.0 | √ | x |
\n
"
,
"tutorial"
:
"
\n
### 参见
\n
[navigateBack](http://uniapp.dcloud.io/api/router?id=navigateback)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[navigateBack](http://uniapp.dcloud.io/api/router?id=navigateback)
\n
"
...
@@ -114,7 +114,7 @@
...
@@ -114,7 +114,7 @@
"setTabBarBadge"
:
{
"setTabBarBadge"
:
{
"name"
:
"## uni.setTabBarBadge(options) @settabbarbadge"
,
"name"
:
"## uni.setTabBarBadge(options) @settabbarbadge"
,
"description"
:
"
\r\n
为 tabBar 某一项的右上角添加文本
\r\n
"
,
"description"
:
"
\r\n
为 tabBar 某一项的右上角添加文本
\r\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [SetTabBarBadgeOptions](#settabbarbadgeoptions) | 是 | - | - |
\n
#### SetTabBarBadgeOptions 属性值 @settabbarbadgeoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| index | number | 是 | - | tabBar的哪一项,从左边算起,索引从0开始 |
\n
| text | string | 是 | - | 显示的文本,不超过 3 个半角字符 |
\n
| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: [SetTabBarError](#settabbarerror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: [AsyncApiResult](#asyncapiresult)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n\n
##### SetTabBarError 属性值 @settabbarerror
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errCode | SetTabBarErrCode | 是 | - | - |
\n
| errSubject | string | 是 | - | 统一错误主题(模块)名称 |
\n
| errMsg | string | 是 | - | 统一错误描述信息 |
\n
|
cause | Error
| 否 | - | 源错误信息,可以包含多个错误,详见SourceError |
\n
| name | string | 是 | - | - |
\n
| message | string | 是 | - | - |
\n\n
##### AsyncApiResult 属性值 @asyncapiresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [SetTabBarBadgeOptions](#settabbarbadgeoptions) | 是 | - | - |
\n
#### SetTabBarBadgeOptions 属性值 @settabbarbadgeoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| index | number | 是 | - | tabBar的哪一项,从左边算起,索引从0开始 |
\n
| text | string | 是 | - | 显示的文本,不超过 3 个半角字符 |
\n
| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: [SetTabBarError](#settabbarerror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: [AsyncApiResult](#asyncapiresult)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n\n
##### SetTabBarError 属性值 @settabbarerror
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errCode | SetTabBarErrCode | 是 | - | - |
\n
| errSubject | string | 是 | - | 统一错误主题(模块)名称 |
\n
| errMsg | string | 是 | - | 统一错误描述信息 |
\n
|
data | any | 否 | - | 错误信息中包含的数据 |
\n
| cause | [Error](/tutorial/err-spec.html#unierror)
| 否 | - | 源错误信息,可以包含多个错误,详见SourceError |
\n
| name | string | 是 | - | - |
\n
| message | string | 是 | - | - |
\n\n
##### AsyncApiResult 属性值 @asyncapiresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"returnValue"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
""
,
"compatibility"
:
""
,
"tutorial"
:
"
\n
### 参见
\n
[setTabBarBadge](http://uniapp.dcloud.io/api/ui/tabbar?id=settabbarbadge)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[setTabBarBadge](http://uniapp.dcloud.io/api/ui/tabbar?id=settabbarbadge)
\n
"
...
@@ -122,7 +122,7 @@
...
@@ -122,7 +122,7 @@
"removeTabBarBadge"
:
{
"removeTabBarBadge"
:
{
"name"
:
"## uni.removeTabBarBadge(options) @removetabbarbadge"
,
"name"
:
"## uni.removeTabBarBadge(options) @removetabbarbadge"
,
"description"
:
"
\r\n
移除 tabBar 某一项右上角的文本
\r\n
"
,
"description"
:
"
\r\n
移除 tabBar 某一项右上角的文本
\r\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [RemoveTabBarBadgeOptions](#removetabbarbadgeoptions) | 是 | - | - |
\n
#### RemoveTabBarBadgeOptions 属性值 @removetabbarbadgeoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| index | number | 是 | - | tabBar的哪一项,从左边算起,索引从0开始 |
\n
| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: [SetTabBarError](#settabbarerror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: [AsyncApiResult](#asyncapiresult)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n\n
##### SetTabBarError 属性值 @settabbarerror
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errCode | SetTabBarErrCode | 是 | - | - |
\n
| errSubject | string | 是 | - | 统一错误主题(模块)名称 |
\n
| errMsg | string | 是 | - | 统一错误描述信息 |
\n
|
cause | Error
| 否 | - | 源错误信息,可以包含多个错误,详见SourceError |
\n
| name | string | 是 | - | - |
\n
| message | string | 是 | - | - |
\n\n
##### AsyncApiResult 属性值 @asyncapiresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [RemoveTabBarBadgeOptions](#removetabbarbadgeoptions) | 是 | - | - |
\n
#### RemoveTabBarBadgeOptions 属性值 @removetabbarbadgeoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| index | number | 是 | - | tabBar的哪一项,从左边算起,索引从0开始 |
\n
| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: [SetTabBarError](#settabbarerror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: [AsyncApiResult](#asyncapiresult)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n\n
##### SetTabBarError 属性值 @settabbarerror
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errCode | SetTabBarErrCode | 是 | - | - |
\n
| errSubject | string | 是 | - | 统一错误主题(模块)名称 |
\n
| errMsg | string | 是 | - | 统一错误描述信息 |
\n
|
data | any | 否 | - | 错误信息中包含的数据 |
\n
| cause | [Error](/tutorial/err-spec.html#unierror)
| 否 | - | 源错误信息,可以包含多个错误,详见SourceError |
\n
| name | string | 是 | - | - |
\n
| message | string | 是 | - | - |
\n\n
##### AsyncApiResult 属性值 @asyncapiresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"returnValue"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
""
,
"compatibility"
:
""
,
"tutorial"
:
"
\n
### 参见
\n
[removeTabBarBadge](http://uniapp.dcloud.io/api/ui/tabbar?id=removetabbarbadge)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[removeTabBarBadge](http://uniapp.dcloud.io/api/ui/tabbar?id=removetabbarbadge)
\n
"
...
@@ -130,7 +130,7 @@
...
@@ -130,7 +130,7 @@
"setTabBarItem"
:
{
"setTabBarItem"
:
{
"name"
:
"## uni.setTabBarItem(options) @settabbaritem"
,
"name"
:
"## uni.setTabBarItem(options) @settabbaritem"
,
"description"
:
"
\r\n
动态设置 tabBar 某一项的内容
\r\n
"
,
"description"
:
"
\r\n
动态设置 tabBar 某一项的内容
\r\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [SetTabBarItemOptions](#settabbaritemoptions) | 是 | - | - |
\n
#### SetTabBarItemOptions 属性值 @settabbaritemoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| index | number | 是 | - | tabBar 的哪一项,从左边算起,索引从0开始 |
\n
| text | string | 否 | - | tab 上按钮文字 |
\n
| iconPath | string | 否 | - | 图片路径 |
\n
| selectedIconPath | string | 否 | - | 选中时的图片路径 |
\n
| pagePath | string | 否 | - | 页面绝对路径 |
\n
| iconfont | [SetTabBarItemIconFontOptions](#settabbaritemiconfontoptions) | 否 | - | 字体图标,优先级高于 iconPath |
\n
| visible | boolean | 否 | - | tab 是否显示 |
\n
| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: [SetTabBarError](#settabbarerror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: [AsyncApiResult](#asyncapiresult)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### SetTabBarItemIconFontOptions 属性值 @settabbaritemiconfontoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| text | string | 是 | - | 字库 Unicode 码 |
\n
| selectedText | string | 是 | - | 选中后字库 Unicode 码 |
\n
| fontSize | string | 否 | - | 字体图标字号(px) |
\n
| color | string | 否 | - | 字体图标颜色 |
\n
| selectedColor | string | 否 | - | 字体图标选中颜色 |
\n\n
##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n\n
##### SetTabBarError 属性值 @settabbarerror
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errCode | SetTabBarErrCode | 是 | - | - |
\n
| errSubject | string | 是 | - | 统一错误主题(模块)名称 |
\n
| errMsg | string | 是 | - | 统一错误描述信息 |
\n
|
cause | Error
| 否 | - | 源错误信息,可以包含多个错误,详见SourceError |
\n
| name | string | 是 | - | - |
\n
| message | string | 是 | - | - |
\n\n
##### AsyncApiResult 属性值 @asyncapiresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [SetTabBarItemOptions](#settabbaritemoptions) | 是 | - | - |
\n
#### SetTabBarItemOptions 属性值 @settabbaritemoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| index | number | 是 | - | tabBar 的哪一项,从左边算起,索引从0开始 |
\n
| text | string | 否 | - | tab 上按钮文字 |
\n
| iconPath | string | 否 | - | 图片路径 |
\n
| selectedIconPath | string | 否 | - | 选中时的图片路径 |
\n
| pagePath | string | 否 | - | 页面绝对路径 |
\n
| iconfont | [SetTabBarItemIconFontOptions](#settabbaritemiconfontoptions) | 否 | - | 字体图标,优先级高于 iconPath |
\n
| visible | boolean | 否 | - | tab 是否显示 |
\n
| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: [SetTabBarError](#settabbarerror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: [AsyncApiResult](#asyncapiresult)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### SetTabBarItemIconFontOptions 属性值 @settabbaritemiconfontoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| text | string | 是 | - | 字库 Unicode 码 |
\n
| selectedText | string | 是 | - | 选中后字库 Unicode 码 |
\n
| fontSize | string | 否 | - | 字体图标字号(px) |
\n
| color | string | 否 | - | 字体图标颜色 |
\n
| selectedColor | string | 否 | - | 字体图标选中颜色 |
\n\n
##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n\n
##### SetTabBarError 属性值 @settabbarerror
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errCode | SetTabBarErrCode | 是 | - | - |
\n
| errSubject | string | 是 | - | 统一错误主题(模块)名称 |
\n
| errMsg | string | 是 | - | 统一错误描述信息 |
\n
|
data | any | 否 | - | 错误信息中包含的数据 |
\n
| cause | [Error](/tutorial/err-spec.html#unierror)
| 否 | - | 源错误信息,可以包含多个错误,详见SourceError |
\n
| name | string | 是 | - | - |
\n
| message | string | 是 | - | - |
\n\n
##### AsyncApiResult 属性值 @asyncapiresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"returnValue"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
""
,
"compatibility"
:
""
,
"tutorial"
:
"
\n
### 参见
\n
[setTabBarItem](http://uniapp.dcloud.io/api/ui/tabbar?id=settabbaritem)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[setTabBarItem](http://uniapp.dcloud.io/api/ui/tabbar?id=settabbaritem)
\n
"
...
@@ -138,7 +138,7 @@
...
@@ -138,7 +138,7 @@
"setTabBarStyle"
:
{
"setTabBarStyle"
:
{
"name"
:
"## uni.setTabBarStyle(options) @settabbarstyle"
,
"name"
:
"## uni.setTabBarStyle(options) @settabbarstyle"
,
"description"
:
"
\r\n
动态设置 tabBar 的整体样式
\r\n
"
,
"description"
:
"
\r\n
动态设置 tabBar 的整体样式
\r\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [SetTabBarStyleOptions](#settabbarstyleoptions) | 是 | - | - |
\n
#### SetTabBarStyleOptions 属性值 @settabbarstyleoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| color | string | 否 | - | tab 上的文字默认颜色 |
\n
| selectedColor | string | 否 | - | tab 上的文字选中时的颜色 {HBuilderX.ColorString} |
\n
| backgroundColor | string | 否 | - | tab 的背景色 |
\n
| backgroundImage | string | 否 | - | 图片背景 |
\n
| backgroundRepeat | string | 否 | - | 背景图平铺方式 |
\n
| borderStyle | string | 否 | - | tabbar上边框的颜色 |
\n
| midButton | [MidButtonOptions](#midbuttonoptions) | 否 | - | tabbar 中间按钮 仅在 list 项为偶数时有效 |
\n
| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: [SetTabBarError](#settabbarerror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: [AsyncApiResult](#asyncapiresult)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### MidButtonOptions 属性值 @midbuttonoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| width | string | 否 | - | 中间按钮的宽度,tabBar 其它项为减去此宽度后平分,默认值为与其它项平分宽度。默认 80px |
\n
| height | string | 否 | - | 中间按钮的高度,可以大于 tabBar 高度,达到中间凸起的效果。默认 50px |
\n
| text | string | 否 | - | 中间按钮的文字 |
\n
| iconPath | string | 否 | - | 中间按钮的图片路径 |
\n
| iconWidth | string | 否 | - | 图片宽度(高度等比例缩放)。默认 24px |
\n
| backgroundImage | string | 否 | - | 中间按钮的背景图片路径 |
\n
| iconfont | [MidButtonIconFont](#midbuttoniconfont) | 否 | - | 字体图标,优先级高于 iconPath |
\n\n
###### MidButtonIconFont 属性值 @midbuttoniconfont
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| text | string | 否 | - | 字库 Unicode 码 |
\n
| selectedText | string | 否 | - | 选中后字库 Unicode 码 |
\n
| fontSize | string | 否 | - | 字体图标字号(px) |
\n
| color | string | 否 | - | 字体图标颜色 |
\n
| selectedColor | string | 否 | - | 字体图标选中颜色 |
\n\n
##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n\n
##### SetTabBarError 属性值 @settabbarerror
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errCode | SetTabBarErrCode | 是 | - | - |
\n
| errSubject | string | 是 | - | 统一错误主题(模块)名称 |
\n
| errMsg | string | 是 | - | 统一错误描述信息 |
\n
|
cause | Error
| 否 | - | 源错误信息,可以包含多个错误,详见SourceError |
\n
| name | string | 是 | - | - |
\n
| message | string | 是 | - | - |
\n\n
##### AsyncApiResult 属性值 @asyncapiresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [SetTabBarStyleOptions](#settabbarstyleoptions) | 是 | - | - |
\n
#### SetTabBarStyleOptions 属性值 @settabbarstyleoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| color | string | 否 | - | tab 上的文字默认颜色 |
\n
| selectedColor | string | 否 | - | tab 上的文字选中时的颜色 {HBuilderX.ColorString} |
\n
| backgroundColor | string | 否 | - | tab 的背景色 |
\n
| backgroundImage | string | 否 | - | 图片背景 |
\n
| backgroundRepeat | string | 否 | - | 背景图平铺方式 |
\n
| borderStyle | string | 否 | - | tabbar上边框的颜色 |
\n
| midButton | [MidButtonOptions](#midbuttonoptions) | 否 | - | tabbar 中间按钮 仅在 list 项为偶数时有效 |
\n
| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: [SetTabBarError](#settabbarerror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: [AsyncApiResult](#asyncapiresult)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### MidButtonOptions 属性值 @midbuttonoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| width | string | 否 | - | 中间按钮的宽度,tabBar 其它项为减去此宽度后平分,默认值为与其它项平分宽度。默认 80px |
\n
| height | string | 否 | - | 中间按钮的高度,可以大于 tabBar 高度,达到中间凸起的效果。默认 50px |
\n
| text | string | 否 | - | 中间按钮的文字 |
\n
| iconPath | string | 否 | - | 中间按钮的图片路径 |
\n
| iconWidth | string | 否 | - | 图片宽度(高度等比例缩放)。默认 24px |
\n
| backgroundImage | string | 否 | - | 中间按钮的背景图片路径 |
\n
| iconfont | [MidButtonIconFont](#midbuttoniconfont) | 否 | - | 字体图标,优先级高于 iconPath |
\n\n
###### MidButtonIconFont 属性值 @midbuttoniconfont
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| text | string | 否 | - | 字库 Unicode 码 |
\n
| selectedText | string | 否 | - | 选中后字库 Unicode 码 |
\n
| fontSize | string | 否 | - | 字体图标字号(px) |
\n
| color | string | 否 | - | 字体图标颜色 |
\n
| selectedColor | string | 否 | - | 字体图标选中颜色 |
\n\n
##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n\n
##### SetTabBarError 属性值 @settabbarerror
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errCode | SetTabBarErrCode | 是 | - | - |
\n
| errSubject | string | 是 | - | 统一错误主题(模块)名称 |
\n
| errMsg | string | 是 | - | 统一错误描述信息 |
\n
|
data | any | 否 | - | 错误信息中包含的数据 |
\n
| cause | [Error](/tutorial/err-spec.html#unierror)
| 否 | - | 源错误信息,可以包含多个错误,详见SourceError |
\n
| name | string | 是 | - | - |
\n
| message | string | 是 | - | - |
\n\n
##### AsyncApiResult 属性值 @asyncapiresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"returnValue"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
""
,
"compatibility"
:
""
,
"tutorial"
:
"
\n
### 参见
\n
[setTabBarStyle](http://uniapp.dcloud.io/api/ui/tabbar?id=settabbarstyle)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[setTabBarStyle](http://uniapp.dcloud.io/api/ui/tabbar?id=settabbarstyle)
\n
"
...
@@ -146,7 +146,7 @@
...
@@ -146,7 +146,7 @@
"hideTabBar"
:
{
"hideTabBar"
:
{
"name"
:
"## uni.hideTabBar(options?) @hidetabbar"
,
"name"
:
"## uni.hideTabBar(options?) @hidetabbar"
,
"description"
:
"
\r\n
隐藏 tabBar
\r\n
"
,
"description"
:
"
\r\n
隐藏 tabBar
\r\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [HideTabBarOptions](#hidetabbaroptions) | 否 | - | - |
\n
#### HideTabBarOptions 属性值 @hidetabbaroptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| animation | boolean | 否 | - | 是否需要动画效果 |
\n
| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: [SetTabBarError](#settabbarerror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: [AsyncApiResult](#asyncapiresult)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n\n
##### SetTabBarError 属性值 @settabbarerror
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errCode | SetTabBarErrCode | 是 | - | - |
\n
| errSubject | string | 是 | - | 统一错误主题(模块)名称 |
\n
| errMsg | string | 是 | - | 统一错误描述信息 |
\n
|
cause | Error
| 否 | - | 源错误信息,可以包含多个错误,详见SourceError |
\n
| name | string | 是 | - | - |
\n
| message | string | 是 | - | - |
\n\n
##### AsyncApiResult 属性值 @asyncapiresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [HideTabBarOptions](#hidetabbaroptions) | 否 | - | - |
\n
#### HideTabBarOptions 属性值 @hidetabbaroptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| animation | boolean | 否 | - | 是否需要动画效果 |
\n
| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: [SetTabBarError](#settabbarerror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: [AsyncApiResult](#asyncapiresult)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n\n
##### SetTabBarError 属性值 @settabbarerror
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errCode | SetTabBarErrCode | 是 | - | - |
\n
| errSubject | string | 是 | - | 统一错误主题(模块)名称 |
\n
| errMsg | string | 是 | - | 统一错误描述信息 |
\n
|
data | any | 否 | - | 错误信息中包含的数据 |
\n
| cause | [Error](/tutorial/err-spec.html#unierror)
| 否 | - | 源错误信息,可以包含多个错误,详见SourceError |
\n
| name | string | 是 | - | - |
\n
| message | string | 是 | - | - |
\n\n
##### AsyncApiResult 属性值 @asyncapiresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"returnValue"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
""
,
"compatibility"
:
""
,
"tutorial"
:
"
\n
### 参见
\n
[hideTabBar](http://uniapp.dcloud.io/api/ui/tabbar?id=hidetabbar)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[hideTabBar](http://uniapp.dcloud.io/api/ui/tabbar?id=hidetabbar)
\n
"
...
@@ -154,7 +154,7 @@
...
@@ -154,7 +154,7 @@
"showTabBar"
:
{
"showTabBar"
:
{
"name"
:
"## uni.showTabBar(options?) @showtabbar"
,
"name"
:
"## uni.showTabBar(options?) @showtabbar"
,
"description"
:
"
\r\n
显示 tabBar
\r\n
"
,
"description"
:
"
\r\n
显示 tabBar
\r\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [ShowTabBarOptions](#showtabbaroptions) | 否 | - | - |
\n
#### ShowTabBarOptions 属性值 @showtabbaroptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| animation | boolean | 否 | - | 是否需要动画效果 |
\n
| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: [SetTabBarError](#settabbarerror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: [AsyncApiResult](#asyncapiresult)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n\n
##### SetTabBarError 属性值 @settabbarerror
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errCode | SetTabBarErrCode | 是 | - | - |
\n
| errSubject | string | 是 | - | 统一错误主题(模块)名称 |
\n
| errMsg | string | 是 | - | 统一错误描述信息 |
\n
|
cause | Error
| 否 | - | 源错误信息,可以包含多个错误,详见SourceError |
\n
| name | string | 是 | - | - |
\n
| message | string | 是 | - | - |
\n\n
##### AsyncApiResult 属性值 @asyncapiresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [ShowTabBarOptions](#showtabbaroptions) | 否 | - | - |
\n
#### ShowTabBarOptions 属性值 @showtabbaroptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| animation | boolean | 否 | - | 是否需要动画效果 |
\n
| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: [SetTabBarError](#settabbarerror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: [AsyncApiResult](#asyncapiresult)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n\n
##### SetTabBarError 属性值 @settabbarerror
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errCode | SetTabBarErrCode | 是 | - | - |
\n
| errSubject | string | 是 | - | 统一错误主题(模块)名称 |
\n
| errMsg | string | 是 | - | 统一错误描述信息 |
\n
|
data | any | 否 | - | 错误信息中包含的数据 |
\n
| cause | [Error](/tutorial/err-spec.html#unierror)
| 否 | - | 源错误信息,可以包含多个错误,详见SourceError |
\n
| name | string | 是 | - | - |
\n
| message | string | 是 | - | - |
\n\n
##### AsyncApiResult 属性值 @asyncapiresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"returnValue"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
""
,
"compatibility"
:
""
,
"tutorial"
:
"
\n
### 参见
\n
[showTabBar](http://uniapp.dcloud.io/api/ui/tabbar?id=showtabbar)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[showTabBar](http://uniapp.dcloud.io/api/ui/tabbar?id=showtabbar)
\n
"
...
@@ -162,7 +162,7 @@
...
@@ -162,7 +162,7 @@
"showTabBarRedDot"
:
{
"showTabBarRedDot"
:
{
"name"
:
"## uni.showTabBarRedDot(options) @showtabbarreddot"
,
"name"
:
"## uni.showTabBarRedDot(options) @showtabbarreddot"
,
"description"
:
"
\r\n
显示 tabBar 某一项的右上角的红点
\r\n
"
,
"description"
:
"
\r\n
显示 tabBar 某一项的右上角的红点
\r\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [ShowTabBarRedDotOptions](#showtabbarreddotoptions) | 是 | - | - |
\n
#### ShowTabBarRedDotOptions 属性值 @showtabbarreddotoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| index | number | 是 | - | tabBar的哪一项,从左边算起,索引从0开始 |
\n
| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: [SetTabBarError](#settabbarerror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: [AsyncApiResult](#asyncapiresult)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n\n
##### SetTabBarError 属性值 @settabbarerror
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errCode | SetTabBarErrCode | 是 | - | - |
\n
| errSubject | string | 是 | - | 统一错误主题(模块)名称 |
\n
| errMsg | string | 是 | - | 统一错误描述信息 |
\n
|
cause | Error
| 否 | - | 源错误信息,可以包含多个错误,详见SourceError |
\n
| name | string | 是 | - | - |
\n
| message | string | 是 | - | - |
\n\n
##### AsyncApiResult 属性值 @asyncapiresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [ShowTabBarRedDotOptions](#showtabbarreddotoptions) | 是 | - | - |
\n
#### ShowTabBarRedDotOptions 属性值 @showtabbarreddotoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| index | number | 是 | - | tabBar的哪一项,从左边算起,索引从0开始 |
\n
| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: [SetTabBarError](#settabbarerror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: [AsyncApiResult](#asyncapiresult)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n\n
##### SetTabBarError 属性值 @settabbarerror
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errCode | SetTabBarErrCode | 是 | - | - |
\n
| errSubject | string | 是 | - | 统一错误主题(模块)名称 |
\n
| errMsg | string | 是 | - | 统一错误描述信息 |
\n
|
data | any | 否 | - | 错误信息中包含的数据 |
\n
| cause | [Error](/tutorial/err-spec.html#unierror)
| 否 | - | 源错误信息,可以包含多个错误,详见SourceError |
\n
| name | string | 是 | - | - |
\n
| message | string | 是 | - | - |
\n\n
##### AsyncApiResult 属性值 @asyncapiresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"returnValue"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
""
,
"compatibility"
:
""
,
"tutorial"
:
"
\n
### 参见
\n
[showTabBarRedDot](http://uniapp.dcloud.io/api/ui/tabbar?id=showtabbarreddot)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[showTabBarRedDot](http://uniapp.dcloud.io/api/ui/tabbar?id=showtabbarreddot)
\n
"
...
@@ -170,7 +170,7 @@
...
@@ -170,7 +170,7 @@
"hideTabBarRedDot"
:
{
"hideTabBarRedDot"
:
{
"name"
:
"## uni.hideTabBarRedDot(options) @hidetabbarreddot"
,
"name"
:
"## uni.hideTabBarRedDot(options) @hidetabbarreddot"
,
"description"
:
"
\r\n
隐藏 tabBar 某一项的右上角的红点
\r\n
"
,
"description"
:
"
\r\n
隐藏 tabBar 某一项的右上角的红点
\r\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [HideTabBarRedDotOptions](#hidetabbarreddotoptions) | 是 | - | - |
\n
#### HideTabBarRedDotOptions 属性值 @hidetabbarreddotoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| index | number | 是 | - | tabBar的哪一项,从左边算起,索引从0开始 |
\n
| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: [SetTabBarError](#settabbarerror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: [AsyncApiResult](#asyncapiresult)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n\n
##### SetTabBarError 属性值 @settabbarerror
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errCode | SetTabBarErrCode | 是 | - | - |
\n
| errSubject | string | 是 | - | 统一错误主题(模块)名称 |
\n
| errMsg | string | 是 | - | 统一错误描述信息 |
\n
|
cause | Error
| 否 | - | 源错误信息,可以包含多个错误,详见SourceError |
\n
| name | string | 是 | - | - |
\n
| message | string | 是 | - | - |
\n\n
##### AsyncApiResult 属性值 @asyncapiresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [HideTabBarRedDotOptions](#hidetabbarreddotoptions) | 是 | - | - |
\n
#### HideTabBarRedDotOptions 属性值 @hidetabbarreddotoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| index | number | 是 | - | tabBar的哪一项,从左边算起,索引从0开始 |
\n
| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: [SetTabBarError](#settabbarerror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: [AsyncApiResult](#asyncapiresult)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n\n
##### SetTabBarError 属性值 @settabbarerror
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errCode | SetTabBarErrCode | 是 | - | - |
\n
| errSubject | string | 是 | - | 统一错误主题(模块)名称 |
\n
| errMsg | string | 是 | - | 统一错误描述信息 |
\n
|
data | any | 否 | - | 错误信息中包含的数据 |
\n
| cause | [Error](/tutorial/err-spec.html#unierror)
| 否 | - | 源错误信息,可以包含多个错误,详见SourceError |
\n
| name | string | 是 | - | - |
\n
| message | string | 是 | - | - |
\n\n
##### AsyncApiResult 属性值 @asyncapiresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"returnValue"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
""
,
"compatibility"
:
""
,
"tutorial"
:
"
\n
### 参见
\n
[hideTabBarRedDot](http://uniapp.dcloud.io/api/ui/tabbar?id=hidetabbarreddot)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[hideTabBarRedDot](http://uniapp.dcloud.io/api/ui/tabbar?id=hidetabbarreddot)
\n
"
...
@@ -186,7 +186,7 @@
...
@@ -186,7 +186,7 @@
"pageScrollTo"
:
{
"pageScrollTo"
:
{
"name"
:
"## uni.pageScrollTo(options) @pagescrollto"
,
"name"
:
"## uni.pageScrollTo(options) @pagescrollto"
,
"description"
:
"
\r\n
将页面滚动到目标位置
\r\n
"
,
"description"
:
"
\r\n
将页面滚动到目标位置
\r\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [PageScrollToOptions](#pagescrolltooptions) | 是 | - | - |
\n
#### PageScrollToOptions 属性值 @pagescrolltooptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: [AsyncApiResult](#asyncapiresult)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n\n
##### AsyncApiResult 属性值 @asyncapiresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [PageScrollToOptions](#pagescrolltooptions) | 是 | - | - |
\n
#### PageScrollToOptions 属性值 @pagescrolltooptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| s
crollTop | number | 否 | - | 滚动到页面的目标位置 |
\n
| selector | string | 否 | - | 选择器 |
\n
| offsetTop | number | 否 | - | 偏移距离,可以滚动到 selector 加偏移距离的位置 |
\n
| duration | number | 否 | - | 滚动动画的时长 |
\n
| s
uccess | (result: [AsyncApiSuccessResult](#asyncapisuccessresult)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: [AsyncApiResult](#asyncapiresult)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n\n
##### AsyncApiResult 属性值 @asyncapiresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"returnValue"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
""
,
"compatibility"
:
""
,
"tutorial"
:
"
\n
### 参见
\n
[pageScrollTo](http://uniapp.dcloud.io/api/ui/scroll?id=pagescrollto)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[pageScrollTo](http://uniapp.dcloud.io/api/ui/scroll?id=pagescrollto)
\n
"
...
@@ -194,7 +194,7 @@
...
@@ -194,7 +194,7 @@
"request"
:
{
"request"
:
{
"name"
:
"## uni.request(param) @request"
,
"name"
:
"## uni.request(param) @request"
,
"description"
:
"发起网络请求。"
,
"description"
:
"发起网络请求。"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| param | [RequestOptions
\\
<T
\\
>](#requestoptions) | 是 | - | 网络请求参数 |
\n
#### RequestOptions
\\
<T
\\
> 属性值 @requestoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| url | string | 是 | - | 开发者服务器接口地址 |
\n
|
header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 否 | null | HTTP 请求 Header,header 中不能设置 Referer |
\n
| method | string | 否 |
\"
GET
\"
| 请求类型 默认值GET
\t
GET
\\
|POST
\\
|PUT
\\
|DELETE
\\
|HEAD
\\
|OPTIONS |
\n
| sslVerify | boolean | 否 | - | 是否返回节点 id |
\n
| withCredentials | boolean | 否 | - | 是否返回节点 id |
\n
| firstIpv4 | boolean | 否 | - | 是否返回节点 id |
\n
| success | (option: [RequestSuccess
\\
<T
\\
>](#requestsuccess)) => void | 否 | null | 网络请求成功回调。 |
\n
| fail | (option: [RequestFail](#requestfail)) => void | 否 | null | 网络请求失败回调。 |
\n
| complete | (option: any) => void | 否 | null | 网络请求完成回调,成功或者失败都会调用。 |
\n\n
##### RequestSuccess
\\
<T
\\
> 属性值 @requestsuccess
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| data | any | 否 | - | 开发者服务器返回的数据 |
\n
| statusCode | number | 是 | - | 开发者服务器返回的 HTTP 状态码 |
\n
| header | any | 是 | - | 开发者服务器返回的 HTTP Response Header |
\n
| cookies | Array
\\
<string
\\
> | 是 | - | - |
\n\n
##### RequestFail 属性值 @requestfail
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errCode | RequestErrorCode | 是 | - | - |
\n
| errSubject | string | 是 | - | 统一错误主题(模块)名称 |
\n
| cause | Error
| 否 | - | 源错误信息,可以包含多个错误,详见SourceError |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| param | [RequestOptions
\\
<T
\\
>](#requestoptions) | 是 | - | 网络请求参数 |
\n
#### RequestOptions
\\
<T
\\
> 属性值 @requestoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| url | string | 是 | - | 开发者服务器接口地址 |
\n
|
data | any | 否 | null | 请求的参数 Object
\\
|String类型 |
\n
| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 否 | null | 设置请求的 header,header 中不能设置 Referer |
\n
| method | string | 否 |
\"
GET
\"
| 请求类型 默认值GET
\t
GET
\\
|POST
\\
|PUT
\\
|DELETE
\\
|HEAD
\\
|OPTIONS |
\n
| timeout | number | 否 | 60000 | 超时时间,单位 ms |
\n
| dataType | string | 否 |
\"
json
\"
| 如果设为 json,会对返回的数据进行一次 JSON.parse,非 json 不会进行 JSON.parse |
\n
| responseType | string | 否 | - | 设置响应的数据类型。 |
\n
| sslVerify | boolean | 否 | - | 验证 ssl 证书 |
\n
| firstIpv4 | boolean | 否 | false | DNS解析时优先使用ipv4 |
\n
| success | (option: [RequestSuccess
\\
<T
\\
>](#requestsuccess)) => void | 否 | null | 网络请求成功回调。 |
\n
| fail | (option: [RequestFail](#requestfail)) => void | 否 | null | 网络请求失败回调。 |
\n
| complete | (option: any) => void | 否 | null | 网络请求完成回调,成功或者失败都会调用。 |
\n\n
##### RequestSuccess
\\
<T
\\
> 属性值 @requestsuccess
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| data | any | 否 | - | 开发者服务器返回的数据 |
\n
| statusCode | number | 是 | - | 开发者服务器返回的 HTTP 状态码 |
\n
| header | any | 是 | - | 开发者服务器返回的 HTTP Response Header |
\n
| cookies | Array
\\
<string
\\
> | 是 | - | 开发者服务器返回的 cookies,格式为字符串数组 |
\n\n
##### RequestFail 属性值 @requestfail
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errCode | RequestErrorCode | 是 | - | - |
\n
| errSubject | string | 是 | - | 统一错误主题(模块)名称 |
\n
| data | any | 否 | - | 错误信息中包含的数据 |
\n
| cause | [Error](/tutorial/err-spec.html#unierror)
| 否 | - | 源错误信息,可以包含多个错误,详见SourceError |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :- |
\n
| [RequestTask](#requesttask) |
\n\n
#### RequestTask 属性值 @requesttask
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| abort | () => void | 是 | - | 中断网络请求。 |
\n\n
##### RequestTask 兼容性
\n
| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- | :- |
\n
| abort | 4.4 | √ | 3.9.0 | 9.0 | √ | 3.9.0 |
\n
"
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :- |
\n
| [RequestTask](#requesttask) |
\n\n
#### RequestTask 属性值 @requesttask
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| abort | () => void | 是 | - | 中断网络请求。 |
\n\n
##### RequestTask 兼容性
\n
| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- | :- |
\n
| abort | 4.4 | √ | 3.9.0 | 9.0 | √ | 3.9.0 |
\n
"
,
"compatibility"
:
"### request 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4 | √ | 3.9.0 | 9.0 | √ | 3.9.0 |
\n
"
,
"compatibility"
:
"### request 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4 | √ | 3.9.0 | 9.0 | √ | 3.9.0 |
\n
"
,
"tutorial"
:
"
\n
### 参见
\n
[request](https://uniapp.dcloud.net.cn/api/request/request.html)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[request](https://uniapp.dcloud.net.cn/api/request/request.html)
\n
"
...
@@ -202,7 +202,7 @@
...
@@ -202,7 +202,7 @@
"uploadFile"
:
{
"uploadFile"
:
{
"name"
:
"## uni.uploadFile(options) @uploadfile"
,
"name"
:
"## uni.uploadFile(options) @uploadfile"
,
"description"
:
"将本地资源上传到开发者服务器。"
,
"description"
:
"将本地资源上传到开发者服务器。"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [UploadFileOptions](#uploadfileoptions) | 是 | - | - |
\n
#### UploadFileOptions 属性值 @uploadfileoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| url | string | 是 | - | 开发者服务器 url |
\n
| file
s | Array
\\
<[UploadFileOptionFiles](#uploadfileoptionfiles)
\\
> | 否 | null | 需要上传的文件列表。 |
\n
| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 否 | null | HTTP 请求 Header,header 中不能设置 Referer |
\n
| formData | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 否 | null | HTTP 请求 Header,header 中不能设置 Referer |
\n
| success | (result: [UploadFileSuccess](#uploadfilesuccess)) => void | 否 | null | 成功返回的回调函数 |
\n
| fail | (result: [UploadFileFail](#uploadfilefail)) => void | 否 | null | 失败的回调函数 |
\n
| complete | (result: any) => void | 否 | null | 结束的回调函数(调用成功、失败都会执行) |
\n\n
##### UploadFileOptionFiles 属性值 @uploadfileoptionfiles
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| uri | string | 是 | - | 要上传文件资源的路径 |
\n\n
##### UploadFileSuccess 属性值 @uploadfilesuccess
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| data | string | 是 | - | 开发者服务器返回的数据 |
\n
| statusCode | number | 是 | - | 开发者服务器返回的 HTTP 状态码 |
\n\n
##### UploadFileFail 属性值 @uploadfilefail
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errCode | RequestErrorCode | 是 | - | - |
\n
| errSubject | string | 是 | - | 统一错误主题(模块)名称 |
\n
| cause | Error
| 否 | - | 源错误信息,可以包含多个错误,详见SourceError |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [UploadFileOptions](#uploadfileoptions) | 是 | - | - |
\n
#### UploadFileOptions 属性值 @uploadfileoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| url | string | 是 | - | 开发者服务器 url |
\n
| file
Path | string | 否 | null | 要上传文件资源的路径 |
\n
| name | string | 否 | null | 文件对应的 key , 开发者在服务器端通过这个 key 可以获取到文件二进制内容 |
\n
| files | Array
\\
<[UploadFileOptionFiles](#uploadfileoptionfiles)
\\
> | 否 | null | 需要上传的文件列表。 |
\n
| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 否 | null | HTTP 请求 Header, header 中不能设置 Referer |
\n
| formData | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 否 | null | HTTP 请求中其他额外的 form data |
\n
| timeout | number | 否 | 120000 | 超时时间,单位 ms |
\n
| success | (result: [UploadFileSuccess](#uploadfilesuccess)) => void | 否 | null | 成功返回的回调函数 |
\n
| fail | (result: [UploadFileFail](#uploadfilefail)) => void | 否 | null | 失败的回调函数 |
\n
| complete | (result: any) => void | 否 | null | 结束的回调函数(调用成功、失败都会执行) |
\n\n
##### UploadFileOptionFiles 属性值 @uploadfileoptionfiles
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| name | string | 否 |
\"
file
\"
| multipart 提交时,表单的项目名,默认为 file,如果 name 不填或填的值相同,可能导致服务端读取文件时只能读取到一个文件。 |
\n
| uri | string | 是 | - | 要上传文件资源的路径 |
\n\n
##### UploadFileSuccess 属性值 @uploadfilesuccess
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| data | string | 是 | - | 开发者服务器返回的数据 |
\n
| statusCode | number | 是 | - | 开发者服务器返回的 HTTP 状态码 |
\n\n
##### UploadFileFail 属性值 @uploadfilefail
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errCode | RequestErrorCode | 是 | - | - |
\n
| errSubject | string | 是 | - | 统一错误主题(模块)名称 |
\n
| data | any | 否 | - | 错误信息中包含的数据 |
\n
| cause | [Error](/tutorial/err-spec.html#unierror)
| 否 | - | 源错误信息,可以包含多个错误,详见SourceError |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :- |
\n
| [UploadTask](#uploadtask) |
\n\n
#### UploadTask 属性值 @uploadtask
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| abort | () => void | 是 | - | 中断上传任务。 |
\n
| onProgressUpdate | (callback: (result: [OnProgressUpdateResult](#onprogressupdateresult)) => void) => void | 是 | - | 监听上传进度变化。 |
\n\n
##### OnProgressUpdateResult 属性值 @onprogressupdateresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| progress | number | 是 | - | 上传进度百分比 |
\n
| totalBytesSent | number | 是 | - | 已经上传的数据长度,单位 Bytes |
\n
| totalBytesExpectedToSend | number | 是 | - | 预期需要上传的数据总长度,单位 Bytes |
\n\n
##### UploadTask 兼容性
\n
| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- | :- |
\n
| abort | 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
| onProgressUpdate | 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
"
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :- |
\n
| [UploadTask](#uploadtask) |
\n\n
#### UploadTask 属性值 @uploadtask
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| abort | () => void | 是 | - | 中断上传任务。 |
\n
| onProgressUpdate | (callback: (result: [OnProgressUpdateResult](#onprogressupdateresult)) => void) => void | 是 | - | 监听上传进度变化。 |
\n\n
##### OnProgressUpdateResult 属性值 @onprogressupdateresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| progress | number | 是 | - | 上传进度百分比 |
\n
| totalBytesSent | number | 是 | - | 已经上传的数据长度,单位 Bytes |
\n
| totalBytesExpectedToSend | number | 是 | - | 预期需要上传的数据总长度,单位 Bytes |
\n\n
##### UploadTask 兼容性
\n
| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- | :- |
\n
| abort | 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
| onProgressUpdate | 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
"
,
"compatibility"
:
"### uploadFile 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
"
,
"compatibility"
:
"### uploadFile 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
"
,
"tutorial"
:
"
\n
### 参见
\n
[uploadFile](https://uniapp.dcloud.net.cn/api/request/network-file.html#uploadfile)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[uploadFile](https://uniapp.dcloud.net.cn/api/request/network-file.html#uploadfile)
\n
"
...
@@ -210,7 +210,7 @@
...
@@ -210,7 +210,7 @@
"downloadFile"
:
{
"downloadFile"
:
{
"name"
:
"## uni.downloadFile(options) @downloadfile"
,
"name"
:
"## uni.downloadFile(options) @downloadfile"
,
"description"
:
"下载文件资源到本地,客户端直接发起一个 HTTP GET 请求,返回文件的本地临时路径。"
,
"description"
:
"下载文件资源到本地,客户端直接发起一个 HTTP GET 请求,返回文件的本地临时路径。"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [DownloadFileOptions](#downloadfileoptions) | 是 | - | - |
\n
#### DownloadFileOptions 属性值 @downloadfileoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| url | string | 是 | - | 下载资源的 url |
\n
| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 否 | null | HTTP 请求 Header,header 中不能设置 Referer |
\n
|
success | (result: [DownloadFileSuccess](#downloadfilesuccess)) => void | 否 | null | 下载成功后以 tempFilePath 的形式传给页面,res = {tempFilePath: '文件的临时路径'} |
\n
| fail | (result: [DownloadFileFail](#downloadfilefail)) => void | 否 | null | 失败的回调函数 |
\n
| complete | (result: any) => void | 否 | null | 结束的回调函数(调用成功、失败都会执行) |
\n\n
##### DownloadFileSuccess 属性值 @downloadfilesuccess
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| tempFilePath | string | 是 | - | 临时文件路径,下载后的文件会存储到一个临时文件 |
\n
| statusCode | number | 是 | - | 开发者服务器返回的 HTTP 状态码 |
\n\n
##### DownloadFileFail 属性值 @downloadfilefail
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errCode | RequestErrorCode | 是 | - | - |
\n
| errSubject | string | 是 | - | 统一错误主题(模块)名称 |
\n
| cause | Error
| 否 | - | 源错误信息,可以包含多个错误,详见SourceError |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [DownloadFileOptions](#downloadfileoptions) | 是 | - | - |
\n
#### DownloadFileOptions 属性值 @downloadfileoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| url | string | 是 | - | 下载资源的 url |
\n
| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 否 | null | HTTP 请求 Header,header 中不能设置 Referer |
\n
|
timeout | number | 否 | 120000 | 超时时间,单位 ms |
\n
| success | (result: [DownloadFileSuccess](#downloadfilesuccess)) => void | 否 | null | 下载成功后以 tempFilePath 的形式传给页面,res = {tempFilePath: '文件的临时路径'} |
\n
| fail | (result: [DownloadFileFail](#downloadfilefail)) => void | 否 | null | 失败的回调函数 |
\n
| complete | (result: any) => void | 否 | null | 结束的回调函数(调用成功、失败都会执行) |
\n\n
##### DownloadFileSuccess 属性值 @downloadfilesuccess
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| tempFilePath | string | 是 | - | 临时文件路径,下载后的文件会存储到一个临时文件 |
\n
| statusCode | number | 是 | - | 开发者服务器返回的 HTTP 状态码 |
\n\n
##### DownloadFileFail 属性值 @downloadfilefail
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errCode | RequestErrorCode | 是 | - | - |
\n
| errSubject | string | 是 | - | 统一错误主题(模块)名称 |
\n
| data | any | 否 | - | 错误信息中包含的数据 |
\n
| cause | [Error](/tutorial/err-spec.html#unierror)
| 否 | - | 源错误信息,可以包含多个错误,详见SourceError |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :- |
\n
| [DownloadTask](#downloadtask) |
\n\n
#### DownloadTask 属性值 @downloadtask
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| abort | () => void | 是 | - | 中断下载任务。 |
\n
| onProgressUpdate | (callback: (result: [OnProgressDownloadResult](#onprogressdownloadresult)) => void) => void | 是 | - | 监听下载进度变化。 |
\n\n
##### OnProgressDownloadResult 属性值 @onprogressdownloadresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| progress | number | 是 | - | 下载进度百分比 |
\n
| totalBytesWritten | number | 是 | - | 已经下载的数据长度,单位 Bytes |
\n
| totalBytesExpectedToWrite | number | 是 | - | 预期需要下载的数据总长度,单位 Bytes |
\n\n
##### DownloadTask 兼容性
\n
| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- | :- |
\n
| abort | 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
| onProgressUpdate | 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
"
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :- |
\n
| [DownloadTask](#downloadtask) |
\n\n
#### DownloadTask 属性值 @downloadtask
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| abort | () => void | 是 | - | 中断下载任务。 |
\n
| onProgressUpdate | (callback: (result: [OnProgressDownloadResult](#onprogressdownloadresult)) => void) => void | 是 | - | 监听下载进度变化。 |
\n\n
##### OnProgressDownloadResult 属性值 @onprogressdownloadresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| progress | number | 是 | - | 下载进度百分比 |
\n
| totalBytesWritten | number | 是 | - | 已经下载的数据长度,单位 Bytes |
\n
| totalBytesExpectedToWrite | number | 是 | - | 预期需要下载的数据总长度,单位 Bytes |
\n\n
##### DownloadTask 兼容性
\n
| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- | :- |
\n
| abort | 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
| onProgressUpdate | 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
"
,
"compatibility"
:
"### downloadFile 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
"
,
"compatibility"
:
"### downloadFile 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
"
,
"tutorial"
:
"
\n
### 参见
\n
[downloadFile](https://uniapp.dcloud.net.cn/api/request/network-file.html#downloadfile)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[downloadFile](https://uniapp.dcloud.net.cn/api/request/network-file.html#downloadfile)
\n
"
...
@@ -226,8 +226,8 @@
...
@@ -226,8 +226,8 @@
"connectSocket"
:
{
"connectSocket"
:
{
"name"
:
"## uni.connectSocket(options) @connectsocket"
,
"name"
:
"## uni.connectSocket(options) @connectsocket"
,
"description"
:
"创建一个 WebSocket 连接。"
,
"description"
:
"创建一个 WebSocket 连接。"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [ConnectSocketOptions](#connectsocketoptions) | 是 | - | - |
\n
#### ConnectSocketOptions 属性值 @connectsocketoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| url | string | 是 | - | 开发者服务器接口地址,必须是 wss 协议,且域名必须是后台配置的合法域名 |
\n
| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 否 | null | HTTP 请求 Header,header 中不能设置 Referer |
\n
| protocols | Array
\\
<string
\\
> | 否 | null | 子协议数组 |
\n
| success | (result: [ConnectSocketSuccess](#connectsocketsuccess)) => void | 否 | null | 接口调用成功的回调函数 |
\n
| fail | (result: [ConnectSocketFail](#connectsocketfail)) => void | 否 | null | 接口调用失败的回调函数 |
\n
| complete | (result: any) => void | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### ConnectSocketSuccess 属性值 @connectsocketsuccess
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n\n
##### ConnectSocketFail 属性值 @connectsocketfail
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errCode | 600009 | 是 | - | - |
\n
| errSubject | string | 是 | - | 统一错误主题(模块)名称 |
\n
|
cause | Error
| 否 | - | 源错误信息,可以包含多个错误,详见SourceError |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [ConnectSocketOptions](#connectsocketoptions) | 是 | - | - |
\n
#### ConnectSocketOptions 属性值 @connectsocketoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| url | string | 是 | - | 开发者服务器接口地址,必须是 wss 协议,且域名必须是后台配置的合法域名 |
\n
| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 否 | null | HTTP 请求 Header,header 中不能设置 Referer |
\n
| protocols | Array
\\
<string
\\
> | 否 | null | 子协议数组 |
\n
| success | (result: [ConnectSocketSuccess](#connectsocketsuccess)) => void | 否 | null | 接口调用成功的回调函数 |
\n
| fail | (result: [ConnectSocketFail](#connectsocketfail)) => void | 否 | null | 接口调用失败的回调函数 |
\n
| complete | (result: any) => void | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### ConnectSocketSuccess 属性值 @connectsocketsuccess
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errMsg | string | 是 | - | - |
\n\n
##### ConnectSocketFail 属性值 @connectsocketfail
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errCode | 600009 | 是 | - | - |
\n
| errSubject | string | 是 | - | 统一错误主题(模块)名称 |
\n
|
data | any | 否 | - | 错误信息中包含的数据 |
\n
| cause | [Error](/tutorial/err-spec.html#unierror)
| 否 | - | 源错误信息,可以包含多个错误,详见SourceError |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :- |
\n
| [SocketTask](#sockettask) |
\n\n
#### SocketTask 属性值 @sockettask
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| send | (options: [SendSocketMessageOptions](#sendsocketmessageoptions)) => void | 是 | - | 通过 WebSocket 连接发送数据 |
\n
| close | (options: [CloseSocketOptions](#closesocketoptions)) => void | 是 | - | 关闭 WebSocket 连接 |
\n
| onOpen | (callback: (result: [OnSocketOpenCallbackResult](#onsocketopencallbackresult)) => void) => void | 是 | - | 监听 WebSocket 连接打开事件 |
\n
| onClose | (callback: (result: any) => void) => void | 是 | - | 监听 WebSocket 连接关闭事件 |
\n
| onError | (callback: (result: [GeneralCallbackResult](#generalcallbackresult)) => void) => void | 是 | - | 监听 WebSocket 错误 |
\n
| onMessage | (callback: (result: [OnSocketMessageCallbackResult](#onsocketmessagecallbackresult)) => void) => void | 是 | - | 监听 WebSocket 接受到服务器的消息事件 |
\n\n
##### SendSocketMessageOptions 属性值 @sendsocketmessageoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| data | any | 是 | - | 需要发送的内容 |
\n
| success | (result: [GeneralCallbackResult](#generalcallbackresult)) => void | 否 | null | 接口调用成功的回调函数 |
\n
| fail | (result: [GeneralCallbackResult](#generalcallbackresult)) => void | 否 | null | 接口调用失败的回调函数 |
\n
| complete | (result: [GeneralCallbackResult](#generalcallbackresult)) => void | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### CloseSocketOptions 属性值 @closesocketoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| success | (result: [GeneralCallbackResult](#generalcallbackresult)) => void | 否 | null | 接口调用成功的回调函数 |
\n
| fail | (result: [GeneralCallbackResult](#generalcallbackresult)) => void | 否 | null | 接口调用失败的回调函数 |
\n
| complete | (result: [GeneralCallbackResult](#generalcallbackresult)) => void | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### OnSocketOpenCallbackResult 属性值 @onsocketopencallbackresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| header | any | 是 | - | 连接成功的 HTTP 响应 Header |
\n\n
##### OnSocketMessageCallbackResult 属性值 @onsocketmessagecallbackresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| data | any | 是 | - | 服务器返回的消息 |
\n\n
##### SocketTask 兼容性
\n
| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- | :- |
\n
| send | 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
| close | 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
| onOpen | 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
| onClose | 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
| onError | 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
| onMessage | 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
"
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :- |
\n
| [SocketTask](#sockettask) |
\n\n
#### SocketTask 属性值 @sockettask
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| send | (options: [SendSocketMessageOptions](#sendsocketmessageoptions)) => void | 是 | - | 通过 WebSocket 连接发送数据 |
\n
| close | (options: [CloseSocketOptions](#closesocketoptions)) => void | 是 | - | 关闭 WebSocket 连接 |
\n
| onOpen | (callback: (result: [OnSocketOpenCallbackResult](#onsocketopencallbackresult)) => void) => void | 是 | - | 监听 WebSocket 连接打开事件 |
\n
| onClose | (callback: (result: any) => void) => void | 是 | - | 监听 WebSocket 连接关闭事件 |
\n
| onError | (callback: (result: [GeneralCallbackResult](#generalcallbackresult)) => void) => void | 是 | - | 监听 WebSocket 错误 |
\n
| onMessage | (callback: (result: [OnSocketMessageCallbackResult](#onsocketmessagecallbackresult)) => void) => void | 是 | - | 监听 WebSocket 接受到服务器的消息事件 |
\n\n
##### SendSocketMessageOptions 属性值 @sendsocketmessageoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| data | any | 是 | - | 需要发送的内容 |
\n
| success | (result: [GeneralCallbackResult](#generalcallbackresult)) => void | 否 | null | 接口调用成功的回调函数 |
\n
| fail | (result: [GeneralCallbackResult](#generalcallbackresult)) => void | 否 | null | 接口调用失败的回调函数 |
\n
| complete | (result: [GeneralCallbackResult](#generalcallbackresult)) => void | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### CloseSocketOptions 属性值 @closesocketoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
|
code | number | 否 | 1000 | 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。如果这个参数没有被指定,默认的取值是1000 (表示正常连接关闭) |
\n
| reason | string | 否 |
\"\"
| 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于123字节的UTF-8 文本(不是字符) |
\n
|
success | (result: [GeneralCallbackResult](#generalcallbackresult)) => void | 否 | null | 接口调用成功的回调函数 |
\n
| fail | (result: [GeneralCallbackResult](#generalcallbackresult)) => void | 否 | null | 接口调用失败的回调函数 |
\n
| complete | (result: [GeneralCallbackResult](#generalcallbackresult)) => void | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### OnSocketOpenCallbackResult 属性值 @onsocketopencallbackresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| header | any | 是 | - | 连接成功的 HTTP 响应 Header |
\n\n
##### OnSocketMessageCallbackResult 属性值 @onsocketmessagecallbackresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| data | any | 是 | - | 服务器返回的消息 |
\n\n
##### SocketTask 兼容性
\n
| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- | :- |
\n
| send | 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
| close | 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
| onOpen | 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
| onClose | 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
| onError | 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
| onMessage | 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
"
,
"compatibility"
:
"### connectSocket 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
"
,
"compatibility"
:
"### connectSocket 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
"
,
"tutorial"
:
"
\n
### 参见
\n
[connectSocket](https://uniapp.dcloud.net.cn/api/request/websocket.html#connectsocket)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[connectSocket](https://uniapp.dcloud.net.cn/api/request/websocket.html#connectsocket)
\n
"
},
},
...
@@ -266,7 +266,7 @@
...
@@ -266,7 +266,7 @@
"closeSocket"
:
{
"closeSocket"
:
{
"name"
:
"## uni.closeSocket(options) @closesocket"
,
"name"
:
"## uni.closeSocket(options) @closesocket"
,
"description"
:
"关闭 WebSocket 连接。"
,
"description"
:
"关闭 WebSocket 连接。"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [CloseSocketOptions](#closesocketoptions) | 是 | - | - |
\n
#### CloseSocketOptions 属性值 @closesocketoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| success | (result: [GeneralCallbackResult](#generalcallbackresult)) => void | 否 | null | 接口调用成功的回调函数 |
\n
| fail | (result: [GeneralCallbackResult](#generalcallbackresult)) => void | 否 | null | 接口调用失败的回调函数 |
\n
| complete | (result: [GeneralCallbackResult](#generalcallbackresult)) => void | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [CloseSocketOptions](#closesocketoptions) | 是 | - | - |
\n
#### CloseSocketOptions 属性值 @closesocketoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
|
code | number | 否 | 1000 | 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。如果这个参数没有被指定,默认的取值是1000 (表示正常连接关闭) |
\n
| reason | string | 否 |
\"\"
| 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于123字节的UTF-8 文本(不是字符) |
\n
|
success | (result: [GeneralCallbackResult](#generalcallbackresult)) => void | 否 | null | 接口调用成功的回调函数 |
\n
| fail | (result: [GeneralCallbackResult](#generalcallbackresult)) => void | 否 | null | 接口调用失败的回调函数 |
\n
| complete | (result: [GeneralCallbackResult](#generalcallbackresult)) => void | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n
"
,
"returnValue"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
"### closeSocket 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
"
,
"compatibility"
:
"### closeSocket 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
"
,
"tutorial"
:
"
\n
### 参见
\n
[closeSocket](https://uniapp.dcloud.net.cn/api/request/websocket.html#closesocket)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[closeSocket](https://uniapp.dcloud.net.cn/api/request/websocket.html#closesocket)
\n
"
...
@@ -283,7 +283,7 @@
...
@@ -283,7 +283,7 @@
"name"
:
"## uni.createSelectorQuery() @createselectorquery"
,
"name"
:
"## uni.createSelectorQuery() @createselectorquery"
,
"description"
:
"
\r\n
返回一个SelectorQuery对象实例
\r\n
"
,
"description"
:
"
\r\n
返回一个SelectorQuery对象实例
\r\n
"
,
"param"
:
""
,
"param"
:
""
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :- |
\n
| [SelectorQuery](#selectorquery) |
\n\n
#### SelectorQuery 属性值 @selectorquery
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| in | (component?: any) => [SelectorQuery](#selectorquery) | 是 | - | 将选择器的选取范围更改为自定义组件component内 |
\n
| select | (selector: string) => [NodesRef](#nodesref) | 是 | - | 在当前页面下选择第一个匹配选择器selector的节点 |
\n
| selectAll | (selector: string) => [NodesRef](#nodesref) | 是 | - | 在当前页面下选择匹配选择器selector的所有节点 |
\n
| selectViewport | () => [NodesRef](#nodesref) | 是 | - | 选择显示区域 |
\n
| exec | (callback: (result: Array
\\
<any
\\
>) => void) => [NodesRef](#nodesref) | 是 | - | 执行所有的请求 |
\n
"
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :- |
\n
| [SelectorQuery](#selectorquery) |
\n\n
#### SelectorQuery 属性值 @selectorquery
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| in | (component?: any) => [SelectorQuery](#selectorquery) | 是 | - | 将选择器的选取范围更改为自定义组件component内 |
\n
| select | (selector: string) => [NodesRef](#nodesref) | 是 | - | 在当前页面下选择第一个匹配选择器selector的节点 |
\n
| selectAll | (selector: string) => [NodesRef](#nodesref) | 是 | - | 在当前页面下选择匹配选择器selector的所有节点 |
\n
| selectViewport | () => [NodesRef](#nodesref) | 是 | - | 选择显示区域 |
\n
| exec | (callback: (result: Array
\\
<any
\\
>) => void) => [NodesRef](#nodesref) | 是 | - | 执行所有的请求 |
\n
\n
##### NodesRef 属性值 @nodesref
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| boundingClientRect | (callback?: (result: any) => void) => [SelectorQuery](#selectorquery) | 是 | - | 添加节点的布局位置的查询请求,相对于显示区域,以像素为单位 |
\n
| scrollOffset | (callback: (result: any) => void) => [SelectorQuery](#selectorquery) | 是 | - | 添加节点的滚动位置查询请求,以像素为单位 |
\n
| fields | (fields: [NodeField](#nodefield), callback: (result: any) => void) => [SelectorQuery](#selectorquery) | 是 | - | 获取节点的相关信息,需要获取的字段在fields中指定 |
\n
| context | (callback: (result: any) => void) => [SelectorQuery](#selectorquery) | 是 | - | 添加节点的 Context 对象查询请求 |
\n
| node | (callback: (result: any) => void) => [SelectorQuery](#selectorquery) | 是 | - | 获取 Node 节点实例。目前支持 Canvas 的获取。 |
\n\n
###### NodeField 属性值 @nodefield
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| id | boolean | 否 | - | 是否返回节点 id |
\n
| dataset | boolean | 否 | - | 是否返回节点 dataset |
\n
| rect | boolean | 否 | - | 是否返回节点布局位置(left right top bottom) |
\n
| size | boolean | 否 | - | 是否返回节点尺寸(width height) |
\n
| scrollOffset | boolean | 否 | - | 是否返回节点的 scrollLeft scrollTop,节点必须是 scroll-view 或者 viewport |
\n
| properties | Array
\\
<string
\\
> | 否 | - | 指定属性名列表,返回节点对应属性名的当前属性值(只能获得组件文档中标注的常规属性值,id class style 和事件绑定的属性值不可获取) |
\n
| computedStyle | Array
\\
<string
\\
> | 否 | - | 指定样式名列表,返回节点对应样式名的当前值 |
\n
| context | boolean | 否 | - | 是否返回节点对应的 Context 对象 |
\n
"
,
"compatibility"
:
""
,
"compatibility"
:
""
,
"tutorial"
:
"
\n
### 参见
\n
[createSelectorQuery](http://uniapp.dcloud.io/api/ui/nodes-info?id=createselectorquery)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[createSelectorQuery](http://uniapp.dcloud.io/api/ui/nodes-info?id=createselectorquery)
\n
"
},
},
...
@@ -291,14 +291,14 @@
...
@@ -291,14 +291,14 @@
"name"
:
"## uni.getElementById(id) @getelementbyid"
,
"name"
:
"## uni.getElementById(id) @getelementbyid"
,
"description"
:
"
\r\n
返回一个匹配特定 ID 的元素, 如果不存在,返回 null。
\\\r\n
如果需要获取指定的节点类型,需要使用 as 进行类型转换。
\\\r\n
ID 区分大小写,且应该是唯一的。如果存在多个匹配的元素,则返回第一个匹配的元素。
\r\n
"
,
"description"
:
"
\r\n
返回一个匹配特定 ID 的元素, 如果不存在,返回 null。
\\\r\n
如果需要获取指定的节点类型,需要使用 as 进行类型转换。
\\\r\n
ID 区分大小写,且应该是唯一的。如果存在多个匹配的元素,则返回第一个匹配的元素。
\r\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| id | string | 是 | - | - |"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| id | string | 是 | - | - |"
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :- |
\n
|
Element
|
\n
"
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :- |
\n
|
[Element](/uni-app-x/dom/element.md)
|
\n
"
,
"compatibility"
:
"### getElementById 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 5.0 | x | 3.91 | 10.0 | x | x |
\n
"
,
"compatibility"
:
"### getElementById 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 5.0 | x | 3.91 | 10.0 | x | x |
\n
"
,
"tutorial"
:
"
\n
### 参见
\n
[getElementById](https://uniapp.dcloud.net.cn/uni-app-x/api/get-element-by-id.html)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[getElementById](https://uniapp.dcloud.net.cn/uni-app-x/api/get-element-by-id.html)
\n
"
},
},
"showActionSheet"
:
{
"showActionSheet"
:
{
"name"
:
"## uni.showActionSheet(options) @showactionsheet"
,
"name"
:
"## uni.showActionSheet(options) @showactionsheet"
,
"description"
:
"
\r\n
uni.showActionSheet函数定义
\r\n\r\n
弹出actionSheet
\r\n
"
,
"description"
:
"
\r\n
uni.showActionSheet函数定义
\r\n\r\n
弹出actionSheet
\r\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [ShowActionSheetOptions](#showactionsheetoptions) | 是 | - | uni.showActionSheet函数参数定义 |
\n
#### ShowActionSheetOptions 属性值 @showactionsheetoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
|
itemList | Array
\\
<string
\\
> | 是 | - | - |
\n
| popover | [Popover](#popover) | 否 | - | 大屏设备弹出原生选择按钮框的指示区域,默认居中显示 |
\n
| success | (res: [ShowActionSheetSuccess](#showactionsheetsuccess)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (res: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (res: any) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### Popover 属性值 @popover
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| top | number | 是 | - | 指示区域坐标,使用原生 navigationBar 时一般需要加上 navigationBar 的高度 |
\n
| left | number | 是 | - | 指示区域坐标 |
\n
| width | number | 是 | - | 指示区域宽度 |
\n
| height | number | 是 | - | 指示区域高度
|
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [ShowActionSheetOptions](#showactionsheetoptions) | 是 | - | uni.showActionSheet函数参数定义 |
\n
#### ShowActionSheetOptions 属性值 @showactionsheetoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
|
title | string | 否 | - | 菜单标题 |
\n
| alertText | string | 否 | - | 警示文案(同菜单标题, app无效) |
\n
| itemList | Array
\\
<string
\\
> | 是 | - | 按钮的文字数组 |
\n
| itemColor | string | 否 | - | 按钮的文字颜色,字符串格式(iOS默认为系统控件颜色) |
\n
| popover | [Popover](#popover) | 否 | - | 大屏设备弹出原生选择按钮框的指示区域,默认居中显示 |
\n
| success | (res: [ShowActionSheetSuccess](#showactionsheetsuccess)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (res: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (res: any) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### Popover 属性值 @popover
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| top | number | 是 | - | 指示区域坐标,使用原生 navigationBar 时一般需要加上 navigationBar 的高度 |
\n
| left | number | 是 | - | 指示区域坐标 |
\n
| width | number | 是 | - | 指示区域宽度 |
\n
| height | number | 是 | - | 指示区域高度 |
\n\n
##### ShowActionSheetSuccess 属性值 @showactionsheetsuccess
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| tapIndex | number | 否 | - | 用户点击的按钮,从上到下的顺序,从0开始
|
\n
"
,
"returnValue"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
"### showActionSheet 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4.4 | √ | 3.9.0 | 9.0 | √ | 3.9.0 |
\n
"
,
"compatibility"
:
"### showActionSheet 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4.4 | √ | 3.9.0 | 9.0 | √ | 3.9.0 |
\n
"
,
"tutorial"
:
"
\n
### 参见
\n
[showActionSheet](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showactionsheet)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[showActionSheet](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showactionsheet)
\n
"
...
@@ -306,7 +306,7 @@
...
@@ -306,7 +306,7 @@
"showModal"
:
{
"showModal"
:
{
"name"
:
"## uni.showModal(options) @showmodal"
,
"name"
:
"## uni.showModal(options) @showmodal"
,
"description"
:
"
\r\n
uni.showModal 函数定义
\r\n\r\n
弹出modal
\r\n
"
,
"description"
:
"
\r\n
uni.showModal 函数定义
\r\n\r\n
弹出modal
\r\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [ShowModalOptions](#showmodaloptions) | 是 | - | uni.showModal 参数定义 |
\n
#### ShowModalOptions 属性值 @showmodaloptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
|
showCancel | boolean | 否 | - | 是否返回节点 id |
\n
| editable | boolean | 否 | - | 是否返回节点 id |
\n
| success | (res: [ShowModalSuccess](#showmodalsuccess)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (res: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (res: any) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### ShowModalSuccess 属性值 @showmodalsuccess
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| confirm | boolean | 是 | - | 为 true 时,表示用户点击了确定按钮 |
\n
| cancel | boolean | 是 | - | 为 true 时,表示用户点击了取消(用于 Android 系统区分点击蒙层关闭还是点击取消按钮关闭)
|
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [ShowModalOptions](#showmodaloptions) | 是 | - | uni.showModal 参数定义 |
\n
#### ShowModalOptions 属性值 @showmodaloptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
|
title | string | 否 | - | 提示的标题 |
\n
| content | string | 否 | - | 提示的内容 |
\n
| showCancel | boolean | 否 | true
\r\n
是否显示取消按钮,默认为 true | |
\n
| cancelText | string | 否 | - | 取消按钮的文字,默认为
\"
取消
\"
|
\n
| cancelColor | string | 否 | - | 取消按钮的文字颜色,默认为
\"
#000000
\"
|
\n
| confirmText | string | 否 | - | 确定按钮的文字,默认为
\"
确定
\"
|
\n
| confirmColor | string | 否 | - | 确定按钮的文字颜色 |
\n
| editable | boolean | 否 | false
\r\n
是否显示输入框 | |
\n
| placeholderText | string | 否 | - | 显示输入框时的提示文本 |
\n
| success | (res: [ShowModalSuccess](#showmodalsuccess)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (res: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (res: any) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### ShowModalSuccess 属性值 @showmodalsuccess
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| confirm | boolean | 是 | - | 为 true 时,表示用户点击了确定按钮 |
\n
| cancel | boolean | 是 | - | 为 true 时,表示用户点击了取消(用于 Android 系统区分点击蒙层关闭还是点击取消按钮关闭) |
\n
| content | string | 否 | - | editable 为 true 时,用户输入的文本
|
\n
"
,
"returnValue"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
"### showModal 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4.4 | √ | 3.9.0 | 9.0 | √ | 3.9.0 |
\n
"
,
"compatibility"
:
"### showModal 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4.4 | √ | 3.9.0 | 9.0 | √ | 3.9.0 |
\n
"
,
"tutorial"
:
"
\n
### 参见
\n
[showModal](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showmodal)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[showModal](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showmodal)
\n
"
...
@@ -314,7 +314,7 @@
...
@@ -314,7 +314,7 @@
"showLoading"
:
{
"showLoading"
:
{
"name"
:
"## uni.showLoading(options) @showloading"
,
"name"
:
"## uni.showLoading(options) @showloading"
,
"description"
:
"
\r\n
uni.showLoading函数定义
\r\n
弹出loading
\r\n
"
,
"description"
:
"
\r\n
uni.showLoading函数定义
\r\n
弹出loading
\r\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [ShowLoadingOptions](#showloadingoptions) | 是 | - | uni.showLoading参数定义 |
\n
#### ShowLoadingOptions 属性值 @showloadingoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| title | string | 是 | - | 提示的内容,长度与 icon 取值有关。 |
\n
| mask | boolean | 否 | - | 是否
返回节点 id
|
\n
| success | (res: [ShowLoadingSuccess](#showloadingsuccess)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (res: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (res: any) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [ShowLoadingOptions](#showloadingoptions) | 是 | - | uni.showLoading参数定义 |
\n
#### ShowLoadingOptions 属性值 @showloadingoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| title | string | 是 | - | 提示的内容,长度与 icon 取值有关。 |
\n
| mask | boolean | 否 | - | 是否
显示透明蒙层,防止触摸穿透,默认:false
|
\n
| success | (res: [ShowLoadingSuccess](#showloadingsuccess)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (res: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (res: any) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n
"
,
"returnValue"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
"### showLoading 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4.4 | √ | 3.9.0 | 9.0 | √ | 3.9.0 |
\n
"
,
"compatibility"
:
"### showLoading 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4.4 | √ | 3.9.0 | 9.0 | √ | 3.9.0 |
\n
"
,
"tutorial"
:
"
\n
### 参见
\n
[showLoading](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showloading)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[showLoading](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showloading)
\n
"
...
@@ -322,7 +322,7 @@
...
@@ -322,7 +322,7 @@
"showToast"
:
{
"showToast"
:
{
"name"
:
"## uni.showToast(options) @showtoast"
,
"name"
:
"## uni.showToast(options) @showtoast"
,
"description"
:
"
\r\n
uni.showToast函数定义
\r\n
弹出toast
\r\n
"
,
"description"
:
"
\r\n
uni.showToast函数定义
\r\n
弹出toast
\r\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [ShowToastOptions](#showtoastoptions) | 是 | - | uni.showToast参数定义 |
\n
#### ShowToastOptions 属性值 @showtoastoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| title | string | 是 | - | 提示的内容,长度与 icon 取值有关。 |
\n
|
mask | boolean | 否 | - | 是否返回节点 id
|
\n
| success | (res: [ShowToastSuccess](#showtoastsuccess)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (res: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (res: any) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [ShowToastOptions](#showtoastoptions) | 是 | - | uni.showToast参数定义 |
\n
#### ShowToastOptions 属性值 @showtoastoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| title | string | 是 | - | 提示的内容,长度与 icon 取值有关。 |
\n
|
icon | string | 否 | - | icon值说明 success: 显示成功图标,error: 显示错误图标; fail: 显示错误图标,此时title文本无长度显示; exception: 显示异常图标,此时title文本无长度显示; loading: 显示加载图标;none: 不显示图标。 |
\n
| image | string | 否 | - | 自定义图标的本地路径(app端暂不支持gif) |
\n
| mask | boolean | 否 | - | 是否显示透明蒙层,防止触摸穿透,默认:false |
\n
| duration | number | 否 | - | 提示的延迟时间,单位毫秒,默认:1500 |
\n
| position | string | 否 | - | position值说明(仅App生效) top: 居上显示; center: 居中显示;bottom: 居底显示
|
\n
| success | (res: [ShowToastSuccess](#showtoastsuccess)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (res: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (res: any) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n
"
,
"returnValue"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
"### showToast 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4.4 | √ | 3.9.0 | 9.0 | √ | 3.9.0 |
\n
"
,
"compatibility"
:
"### showToast 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4.4 | √ | 3.9.0 | 9.0 | √ | 3.9.0 |
\n
"
,
"tutorial"
:
"
\n
### 参见
\n
[showToast](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showtoast)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[showToast](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showtoast)
\n
"
...
@@ -338,7 +338,7 @@
...
@@ -338,7 +338,7 @@
"getSystemInfo"
:
{
"getSystemInfo"
:
{
"name"
:
"## uni.getSystemInfo(options) @getsysteminfo"
,
"name"
:
"## uni.getSystemInfo(options) @getsysteminfo"
,
"description"
:
"异步获取系统信息"
,
"description"
:
"异步获取系统信息"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [GetSystemInfoOptions](#getsysteminfooptions) | 是 | - | - |
\n
#### GetSystemInfoOptions 属性值 @getsysteminfooptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| success | (result: [GetSystemInfoResult](#getsysteminforesult)) => void | 否 | null | 接口调用成功的回调函数 |
\n
| fail | (result: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | null | 接口调用失败的回调函数 |
\n
| complete | (result: any) => void | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### GetSystemInfoResult 属性值 @getsysteminforesult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| SDKVersion | string | 是 | - | 客户端基础库版本 |
\n
| appId | string | 是 | - | `manifest.json` 中应用appid。 |
\n
| appLanguage | string | 是 | - | 应用设置的语言。 |
\n
| appName | string | 是 | - | `manifest.json` 中应用名称。 |
\n
| appVersion | string | 是 | - | `manifest.json` 中应用版本名称(真机运行时,为基座的版本名称)。 |
\n
| appVersionCode | number | 是 | - | `manifest.json` 中应用版本名号(真机运行时,为基座的版本号)。 |
\n
| brand | string | 是 | - | 手机品牌。 |
\n
| browserName | string | 是 | - | 浏览器名称。`App` 端是系统 webview 的名字,比如 wkwebview、chrome。小程序端为空 |
\n
| browserVersion | string | 是 | - | 浏览器版本、webview 版本。 |
\n
| deviceId | string | 是 | - | 设备 ID |
\n
| deviceBrand | string | 是 | - | 设备品牌。如:`apple`、`huawei`。 |
\n
| deviceModel | string | 是 | - | 设备型号 |
\n
| deviceType | string | 是 | - | 设备类型。`phone`、`pad`、`pc` |
\n
| devicePixelRatio | number | 是 | - | 设备像素比 |
\n
| deviceOrientation | string | 是 | - | 设备方向。如:`竖屏 portrait`、`横屏 landscape` - portrait: 竖屏 - landscape: 横屏 |
\n
| language | string | 是 | - | 程序设置的语言 |
\n
| model | string | 是 | - | 手机型号 |
\n
| osName | string | 是 | - | ios、android、windows、mac、linux |
\n
| osVersion | string | 是 | - | 操作系统版本。如 ios 版本,andriod 版本 |
\n
| osLanguage | string | 是 | - | 操作系统语言 |
\n
| pixelRatio | number | 是 | - | 设备像素比 |
\n
| platform | string | 是 | - | 客户端平台 |
\n
| screenWidth | number | 是 | - | 屏幕宽度 |
\n
| screenHeight | number | 是 | - | 屏幕高度 |
\n
| statusBarHeight | number | 是 | - | 状态栏的高度 |
\n
| system | string | 是 | - | 操作系统版本 |
\n
| safeArea | [SafeArea](#safearea) | 是 | - | 在竖屏正方向下的安全区域 |
\n
| safeAreaInsets | [SafeAreaInsets](#safeareainsets) | 是 | - | 在竖屏正方向下的安全区域插入位置 |
\n
| ua | string | 是 | - | 用户标识。小程序端为空 |
\n
| uniCompileVersion | string | 是 | - | uni 编译器版本 |
\n
| uniPlatform | string | 是 | - | uni-app 运行平台。如:`app`、`mp-weixin`、`web` |
\n
| uniRuntimeVersion | string | 是 | - | uni 运行时版本 |
\n
| uniCompileVersionCode | number | 是 | - | uni 编译器版本号 |
\n
| uniRuntimeVersionCode | number | 是 | - | uni 运行时版本号 |
\n
| version | string | 是 | - | 引擎版本号 |
\n
| romName | string | 是 | - | rom 名称。Android 部分机型获取不到值。iOS 恒为 `ios` |
\n
| romVersion | string | 是 | - | rom 版本号。Android 部分机型获取不到值。iOS 恒为 `ios 版本号` |
\n
| windowWidth | number | 是 | - | 可使用窗口宽度 |
\n
| windowHeight | number | 是 | - | 可使用窗口高度 |
\n
| windowTop | number | 是 | - | 可使用窗口的顶部位置 |
\n
| windowBottom | number | 是 | - | 可使用窗口的底部位置 |
\n
\n
###### SafeArea 属性值 @safearea
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| left | number | 是 | - | 安全区域左上角横坐标 |
\n
| right | number | 是 | - | 安全区域右下角横坐标 |
\n
| top | number | 是 | - | 安全区域左上角纵坐标 |
\n
| bottom | number | 是 | - | 安全区域右下角纵坐标 |
\n
| width | number | 是 | - | 安全区域的宽度,单位逻辑像素 |
\n
| height | number | 是 | - | 安全区域的高度,单位逻辑像素 |
\n\n
###### SafeAreaInsets 属性值 @safeareainsets
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| left | number | 是 | - | 安全区域左侧插入位置 |
\n
| right | number | 是 | - | 安全区域右侧插入位置 |
\n
| top | number | 是 | - | 安全区顶部插入位置 |
\n
| bottom | number | 是 | - | 安全区域底部插入位置
|
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [GetSystemInfoOptions](#getsysteminfooptions) | 是 | - | - |
\n
#### GetSystemInfoOptions 属性值 @getsysteminfooptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| success | (result: [GetSystemInfoResult](#getsysteminforesult)) => void | 否 | null | 接口调用成功的回调函数 |
\n
| fail | (result: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | null | 接口调用失败的回调函数 |
\n
| complete | (result: any) => void | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### GetSystemInfoResult 属性值 @getsysteminforesult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| SDKVersion | string | 是 | - | 客户端基础库版本 |
\n
| appId | string | 是 | - | `manifest.json` 中应用appid。 |
\n
| appLanguage | string | 是 | - | 应用设置的语言。 |
\n
| appName | string | 是 | - | `manifest.json` 中应用名称。 |
\n
| appVersion | string | 是 | - | `manifest.json` 中应用版本名称(真机运行时,为基座的版本名称)。 |
\n
| appVersionCode | number | 是 | - | `manifest.json` 中应用版本名号(真机运行时,为基座的版本号)。 |
\n
| brand | string | 是 | - | 手机品牌。 |
\n
| browserName | string | 是 | - | 浏览器名称。`App` 端是系统 webview 的名字,比如 wkwebview、chrome。小程序端为空 |
\n
| browserVersion | string | 是 | - | 浏览器版本、webview 版本。 |
\n
| deviceId | string | 是 | - | 设备 ID |
\n
| deviceBrand | string | 是 | - | 设备品牌。如:`apple`、`huawei`。 |
\n
| deviceModel | string | 是 | - | 设备型号 |
\n
| deviceType | string | 是 | - | 设备类型。`phone`、`pad`、`pc` |
\n
| devicePixelRatio | number | 是 | - | 设备像素比 |
\n
| deviceOrientation | string | 是 | - | 设备方向。如:`竖屏 portrait`、`横屏 landscape` - portrait: 竖屏 - landscape: 横屏 |
\n
| language | string | 是 | - | 程序设置的语言 |
\n
| model | string | 是 | - | 手机型号 |
\n
| osName | string | 是 | - | ios、android、windows、mac、linux |
\n
| osVersion | string | 是 | - | 操作系统版本。如 ios 版本,andriod 版本 |
\n
| osLanguage | string | 是 | - | 操作系统语言 |
\n
| pixelRatio | number | 是 | - | 设备像素比 |
\n
| platform | string | 是 | - | 客户端平台 |
\n
| screenWidth | number | 是 | - | 屏幕宽度 |
\n
| screenHeight | number | 是 | - | 屏幕高度 |
\n
| statusBarHeight | number | 是 | - | 状态栏的高度 |
\n
| system | string | 是 | - | 操作系统版本 |
\n
| safeArea | [SafeArea](#safearea) | 是 | - | 在竖屏正方向下的安全区域 |
\n
| safeAreaInsets | [SafeAreaInsets](#safeareainsets) | 是 | - | 在竖屏正方向下的安全区域插入位置 |
\n
| ua | string | 是 | - | 用户标识。小程序端为空 |
\n
| uniCompileVersion | string | 是 | - | uni 编译器版本 |
\n
| uniPlatform | string | 是 | - | uni-app 运行平台。如:`app`、`mp-weixin`、`web` |
\n
| uniRuntimeVersion | string | 是 | - | uni 运行时版本 |
\n
| uniCompileVersionCode | number | 是 | - | uni 编译器版本号 |
\n
| uniRuntimeVersionCode | number | 是 | - | uni 运行时版本号 |
\n
| version | string | 是 | - | 引擎版本号 |
\n
| romName | string | 是 | - | rom 名称。Android 部分机型获取不到值。iOS 恒为 `ios` |
\n
| romVersion | string | 是 | - | rom 版本号。Android 部分机型获取不到值。iOS 恒为 `ios 版本号` |
\n
| windowWidth | number | 是 | - | 可使用窗口宽度 |
\n
| windowHeight | number | 是 | - | 可使用窗口高度 |
\n
| windowTop | number | 是 | - | 可使用窗口的顶部位置 |
\n
| windowBottom | number | 是 | - | 可使用窗口的底部位置 |
\n
| oaid | string | 否 | - | oaid |
\n
| osAndroidAPILevel | number | 否 | - | Android 系统API库的版本。 |
\n\n
###### SafeArea 属性值 @safearea
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| left | number | 是 | - | 安全区域左上角横坐标 |
\n
| right | number | 是 | - | 安全区域右下角横坐标 |
\n
| top | number | 是 | - | 安全区域左上角纵坐标 |
\n
| bottom | number | 是 | - | 安全区域右下角纵坐标 |
\n
| width | number | 是 | - | 安全区域的宽度,单位逻辑像素 |
\n
| height | number | 是 | - | 安全区域的高度,单位逻辑像素 |
\n\n
###### SafeAreaInsets 属性值 @safeareainsets
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| left | number | 是 | - | 安全区域左侧插入位置 |
\n
| right | number | 是 | - | 安全区域右侧插入位置 |
\n
| top | number | 是 | - | 安全区顶部插入位置 |
\n
| bottom | number | 是 | - | 安全区域底部插入位置 |
\n\n
###### GetSystemInfoResult 兼容性
\n
| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- | :- |
\n
| oaid | 4.4 | √ | √ | x | x | x |
\n
| osAndroidAPILevel | 4.4 | √ | √ | x | x | x
|
\n
"
,
"returnValue"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
"### getSystemInfo 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
"
,
"compatibility"
:
"### getSystemInfo 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
"
,
"tutorial"
:
"
\n
### 参见
\n
[getSystemInfo](http://uniapp.dcloud.io/api/system/info?id=getsysteminfo)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[getSystemInfo](http://uniapp.dcloud.io/api/system/info?id=getsysteminfo)
\n
"
...
@@ -347,7 +347,7 @@
...
@@ -347,7 +347,7 @@
"name"
:
"## uni.getSystemInfoSync() @getsysteminfosync"
,
"name"
:
"## uni.getSystemInfoSync() @getsysteminfosync"
,
"description"
:
"同步获取系统信息"
,
"description"
:
"同步获取系统信息"
,
"param"
:
""
,
"param"
:
""
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :- |
\n
| [GetSystemInfoResult](#getsysteminforesult) |
\n\n
#### GetSystemInfoResult 属性值 @getsysteminforesult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| SDKVersion | string | 是 | - | 客户端基础库版本 |
\n
| appId | string | 是 | - | `manifest.json` 中应用appid。 |
\n
| appLanguage | string | 是 | - | 应用设置的语言。 |
\n
| appName | string | 是 | - | `manifest.json` 中应用名称。 |
\n
| appVersion | string | 是 | - | `manifest.json` 中应用版本名称(真机运行时,为基座的版本名称)。 |
\n
| appVersionCode | number | 是 | - | `manifest.json` 中应用版本名号(真机运行时,为基座的版本号)。 |
\n
| brand | string | 是 | - | 手机品牌。 |
\n
| browserName | string | 是 | - | 浏览器名称。`App` 端是系统 webview 的名字,比如 wkwebview、chrome。小程序端为空 |
\n
| browserVersion | string | 是 | - | 浏览器版本、webview 版本。 |
\n
| deviceId | string | 是 | - | 设备 ID |
\n
| deviceBrand | string | 是 | - | 设备品牌。如:`apple`、`huawei`。 |
\n
| deviceModel | string | 是 | - | 设备型号 |
\n
| deviceType | string | 是 | - | 设备类型。`phone`、`pad`、`pc` |
\n
| devicePixelRatio | number | 是 | - | 设备像素比 |
\n
| deviceOrientation | string | 是 | - | 设备方向。如:`竖屏 portrait`、`横屏 landscape` - portrait: 竖屏 - landscape: 横屏 |
\n
| language | string | 是 | - | 程序设置的语言 |
\n
| model | string | 是 | - | 手机型号 |
\n
| osName | string | 是 | - | ios、android、windows、mac、linux |
\n
| osVersion | string | 是 | - | 操作系统版本。如 ios 版本,andriod 版本 |
\n
| osLanguage | string | 是 | - | 操作系统语言 |
\n
| pixelRatio | number | 是 | - | 设备像素比 |
\n
| platform | string | 是 | - | 客户端平台 |
\n
| screenWidth | number | 是 | - | 屏幕宽度 |
\n
| screenHeight | number | 是 | - | 屏幕高度 |
\n
| statusBarHeight | number | 是 | - | 状态栏的高度 |
\n
| system | string | 是 | - | 操作系统版本 |
\n
| safeArea | [SafeArea](#safearea) | 是 | - | 在竖屏正方向下的安全区域 |
\n
| safeAreaInsets | [SafeAreaInsets](#safeareainsets) | 是 | - | 在竖屏正方向下的安全区域插入位置 |
\n
| ua | string | 是 | - | 用户标识。小程序端为空 |
\n
| uniCompileVersion | string | 是 | - | uni 编译器版本 |
\n
| uniPlatform | string | 是 | - | uni-app 运行平台。如:`app`、`mp-weixin`、`web` |
\n
| uniRuntimeVersion | string | 是 | - | uni 运行时版本 |
\n
| uniCompileVersionCode | number | 是 | - | uni 编译器版本号 |
\n
| uniRuntimeVersionCode | number | 是 | - | uni 运行时版本号 |
\n
| version | string | 是 | - | 引擎版本号 |
\n
| romName | string | 是 | - | rom 名称。Android 部分机型获取不到值。iOS 恒为 `ios` |
\n
| romVersion | string | 是 | - | rom 版本号。Android 部分机型获取不到值。iOS 恒为 `ios 版本号` |
\n
| windowWidth | number | 是 | - | 可使用窗口宽度 |
\n
| windowHeight | number | 是 | - | 可使用窗口高度 |
\n
| windowTop | number | 是 | - | 可使用窗口的顶部位置 |
\n
| windowBottom | number | 是 | - | 可使用窗口的底部位置 |
\n
\n
##### SafeArea 属性值 @safearea
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| left | number | 是 | - | 安全区域左上角横坐标 |
\n
| right | number | 是 | - | 安全区域右下角横坐标 |
\n
| top | number | 是 | - | 安全区域左上角纵坐标 |
\n
| bottom | number | 是 | - | 安全区域右下角纵坐标 |
\n
| width | number | 是 | - | 安全区域的宽度,单位逻辑像素 |
\n
| height | number | 是 | - | 安全区域的高度,单位逻辑像素 |
\n\n
##### SafeAreaInsets 属性值 @safeareainsets
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| left | number | 是 | - | 安全区域左侧插入位置 |
\n
| right | number | 是 | - | 安全区域右侧插入位置 |
\n
| top | number | 是 | - | 安全区顶部插入位置 |
\n
| bottom | number | 是 | - | 安全区域底部插入位置
|
\n
"
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :- |
\n
| [GetSystemInfoResult](#getsysteminforesult) |
\n\n
#### GetSystemInfoResult 属性值 @getsysteminforesult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| SDKVersion | string | 是 | - | 客户端基础库版本 |
\n
| appId | string | 是 | - | `manifest.json` 中应用appid。 |
\n
| appLanguage | string | 是 | - | 应用设置的语言。 |
\n
| appName | string | 是 | - | `manifest.json` 中应用名称。 |
\n
| appVersion | string | 是 | - | `manifest.json` 中应用版本名称(真机运行时,为基座的版本名称)。 |
\n
| appVersionCode | number | 是 | - | `manifest.json` 中应用版本名号(真机运行时,为基座的版本号)。 |
\n
| brand | string | 是 | - | 手机品牌。 |
\n
| browserName | string | 是 | - | 浏览器名称。`App` 端是系统 webview 的名字,比如 wkwebview、chrome。小程序端为空 |
\n
| browserVersion | string | 是 | - | 浏览器版本、webview 版本。 |
\n
| deviceId | string | 是 | - | 设备 ID |
\n
| deviceBrand | string | 是 | - | 设备品牌。如:`apple`、`huawei`。 |
\n
| deviceModel | string | 是 | - | 设备型号 |
\n
| deviceType | string | 是 | - | 设备类型。`phone`、`pad`、`pc` |
\n
| devicePixelRatio | number | 是 | - | 设备像素比 |
\n
| deviceOrientation | string | 是 | - | 设备方向。如:`竖屏 portrait`、`横屏 landscape` - portrait: 竖屏 - landscape: 横屏 |
\n
| language | string | 是 | - | 程序设置的语言 |
\n
| model | string | 是 | - | 手机型号 |
\n
| osName | string | 是 | - | ios、android、windows、mac、linux |
\n
| osVersion | string | 是 | - | 操作系统版本。如 ios 版本,andriod 版本 |
\n
| osLanguage | string | 是 | - | 操作系统语言 |
\n
| pixelRatio | number | 是 | - | 设备像素比 |
\n
| platform | string | 是 | - | 客户端平台 |
\n
| screenWidth | number | 是 | - | 屏幕宽度 |
\n
| screenHeight | number | 是 | - | 屏幕高度 |
\n
| statusBarHeight | number | 是 | - | 状态栏的高度 |
\n
| system | string | 是 | - | 操作系统版本 |
\n
| safeArea | [SafeArea](#safearea) | 是 | - | 在竖屏正方向下的安全区域 |
\n
| safeAreaInsets | [SafeAreaInsets](#safeareainsets) | 是 | - | 在竖屏正方向下的安全区域插入位置 |
\n
| ua | string | 是 | - | 用户标识。小程序端为空 |
\n
| uniCompileVersion | string | 是 | - | uni 编译器版本 |
\n
| uniPlatform | string | 是 | - | uni-app 运行平台。如:`app`、`mp-weixin`、`web` |
\n
| uniRuntimeVersion | string | 是 | - | uni 运行时版本 |
\n
| uniCompileVersionCode | number | 是 | - | uni 编译器版本号 |
\n
| uniRuntimeVersionCode | number | 是 | - | uni 运行时版本号 |
\n
| version | string | 是 | - | 引擎版本号 |
\n
| romName | string | 是 | - | rom 名称。Android 部分机型获取不到值。iOS 恒为 `ios` |
\n
| romVersion | string | 是 | - | rom 版本号。Android 部分机型获取不到值。iOS 恒为 `ios 版本号` |
\n
| windowWidth | number | 是 | - | 可使用窗口宽度 |
\n
| windowHeight | number | 是 | - | 可使用窗口高度 |
\n
| windowTop | number | 是 | - | 可使用窗口的顶部位置 |
\n
| windowBottom | number | 是 | - | 可使用窗口的底部位置 |
\n
| oaid | string | 否 | - | oaid |
\n
| osAndroidAPILevel | number | 否 | - | Android 系统API库的版本。 |
\n\n
##### SafeArea 属性值 @safearea
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| left | number | 是 | - | 安全区域左上角横坐标 |
\n
| right | number | 是 | - | 安全区域右下角横坐标 |
\n
| top | number | 是 | - | 安全区域左上角纵坐标 |
\n
| bottom | number | 是 | - | 安全区域右下角纵坐标 |
\n
| width | number | 是 | - | 安全区域的宽度,单位逻辑像素 |
\n
| height | number | 是 | - | 安全区域的高度,单位逻辑像素 |
\n\n
##### SafeAreaInsets 属性值 @safeareainsets
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| left | number | 是 | - | 安全区域左侧插入位置 |
\n
| right | number | 是 | - | 安全区域右侧插入位置 |
\n
| top | number | 是 | - | 安全区顶部插入位置 |
\n
| bottom | number | 是 | - | 安全区域底部插入位置 |
\n\n
##### GetSystemInfoResult 兼容性
\n
| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- | :- |
\n
| oaid | 4.4 | √ | √ | x | x | x |
\n
| osAndroidAPILevel | 4.4 | √ | √ | x | x | x
|
\n
"
,
"compatibility"
:
"### getSystemInfoSync 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
"
,
"compatibility"
:
"### getSystemInfoSync 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
"
,
"tutorial"
:
"
\n
### 参见
\n
[getSystemInfoSync](http://uniapp.dcloud.io/api/system/info?id=getsysteminfosync)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[getSystemInfoSync](http://uniapp.dcloud.io/api/system/info?id=getsysteminfosync)
\n
"
},
},
...
@@ -379,7 +379,7 @@
...
@@ -379,7 +379,7 @@
"name"
:
"## uni.getAppAuthorizeSetting() @getappauthorizesetting"
,
"name"
:
"## uni.getAppAuthorizeSetting() @getappauthorizesetting"
,
"description"
:
"获取 APP 授权设置。"
,
"description"
:
"获取 APP 授权设置。"
,
"param"
:
""
,
"param"
:
""
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :- |
\n
| [GetAppAuthorizeSettingResult](#getappauthorizesettingresult) |
\n\n
#### GetAppAuthorizeSettingResult 属性值 @getappauthorizesettingresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| cameraAuthorized | string | 是 | - | 允许 App 使用摄像头的开关 - authorized: 已经获得授权,无需再次请求授权 - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限) - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关) - config error: Android平台:表示没有授予 `android.permission.CAMERA` 权限;iOS平台没有该值 |
\n
| locationAuthorized | string | 是 | - | 允许 App 使用定位的开关 - authorized: 已经获得授权,无需再次请求授权 - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限) - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关) - config error: Android平台:表示没有授予 `android.permission.ACCESS_COARSE_LOCATION` 权限;iOS平台:表示没有在 `manifest.json -
\\
> App模块配置` 中配置 `Geolocation(定位)` 模块 |
\n
| location
ReducedAccuracy | boolean | 否 | - | 是否返回节点 id
|
\n
| microphoneAuthorized | string | 是 | - | 允许 App 使用麦克风的开关 - authorized: 已经获得授权,无需再次请求授权 - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限) - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关) - config error: Android平台:表示没有授予 `android.permission.RECORD_AUDIO` 权限;iOS平台没有该值 |
\n
| notificationAuthorized | string | 是 | - | 允许 App 通知的开关 - authorized: 已经获得授权,无需再次请求授权 - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限) - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关) - config error: Android平台没有该值;iOS平台:表示没有在 `manifest.json -
\\
> App模块配置` 中配置 `Push(推送)` 模块 |
\n
"
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :- |
\n
| [GetAppAuthorizeSettingResult](#getappauthorizesettingresult) |
\n\n
#### GetAppAuthorizeSettingResult 属性值 @getappauthorizesettingresult
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| cameraAuthorized | string | 是 | - | 允许 App 使用摄像头的开关 - authorized: 已经获得授权,无需再次请求授权 - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限) - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关) - config error: Android平台:表示没有授予 `android.permission.CAMERA` 权限;iOS平台没有该值 |
\n
| locationAuthorized | string | 是 | - | 允许 App 使用定位的开关 - authorized: 已经获得授权,无需再次请求授权 - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限) - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关) - config error: Android平台:表示没有授予 `android.permission.ACCESS_COARSE_LOCATION` 权限;iOS平台:表示没有在 `manifest.json -
\\
> App模块配置` 中配置 `Geolocation(定位)` 模块 |
\n
| location
Accuracy | string | 否 | - | 定位准确度。true 表示模糊定位,false 表示精确定位 - reduced: 模糊定位 - full: 精准定位 - unsupported: 不支持(包括用户拒绝定位权限和没有在 `manifest.json -
\\
> App模块配置` 中配置 `Geolocation(定位)` 模块)
|
\n
| microphoneAuthorized | string | 是 | - | 允许 App 使用麦克风的开关 - authorized: 已经获得授权,无需再次请求授权 - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限) - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关) - config error: Android平台:表示没有授予 `android.permission.RECORD_AUDIO` 权限;iOS平台没有该值 |
\n
| notificationAuthorized | string | 是 | - | 允许 App 通知的开关 - authorized: 已经获得授权,无需再次请求授权 - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限) - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关) - config error: Android平台没有该值;iOS平台:表示没有在 `manifest.json -
\\
> App模块配置` 中配置 `Push(推送)` 模块 |
\n
"
,
"compatibility"
:
"### getAppAuthorizeSetting 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
"
,
"compatibility"
:
"### getAppAuthorizeSetting 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4 | √ | 3.9.0 | 9.0 | √ | x |
\n
"
,
"tutorial"
:
"
\n
### 参见
\n
[getAppAuthorizeSetting](http://uniapp.dcloud.io/api/system/getappauthorizesetting)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[getAppAuthorizeSetting](http://uniapp.dcloud.io/api/system/getappauthorizesetting)
\n
"
},
},
...
@@ -394,7 +394,7 @@
...
@@ -394,7 +394,7 @@
"chooseImage"
:
{
"chooseImage"
:
{
"name"
:
"## uni.chooseImage(options) @chooseimage"
,
"name"
:
"## uni.chooseImage(options) @chooseimage"
,
"description"
:
"从本地相册选择图片或使用相机拍照"
,
"description"
:
"从本地相册选择图片或使用相机拍照"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [ChooseImageOptions](#chooseimageoptions) | 是 | - | - |
\n
#### ChooseImageOptions 属性值 @chooseimageoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| count | number | 否 | 9 | 最多可以选择的图片张数,app端不限制,微信小程序最多可支持20个。 |
\n
| sizeType | Array
\\
<string
\\
> | 否 |
null | 子协议数组 |
\n
| sourceType | Array
\\
<string
\\
> | 否 | null | 子协议数组 |
\n
| extension | Array
\\
<string
\\
> | 否 | null | 子协议数组 |
\n
| crop | [ChooseImageCropOptions](#chooseimagecropoptions) | 否 | - | 图像裁剪参数,设置后 sizeType 失效。 |
\n
| success | (callback: [ChooseImageSuccessCallback](#chooseimagesuccesscallback)) => void | 否 | - | 成功则返回图片的本地文件路径列表 tempFilePaths |
\n
| fail | (callback: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (callback: any) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### ChooseImageCropOptions 属性值 @chooseimagecropoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| width | number | 是 | - | 裁剪的宽度,单位为px,用于计算裁剪宽高比。 |
\n
| height | number | 是 | - | 裁剪的高度,单位为px,用于计算裁剪宽高比。 |
\n
| quality | number | 否 | 9 | 最多可以选择的图片张数,app端不限制,微信小程序最多可支持20个
。 |
\n
| resize | boolean | 否 | - | 是否将width和height作为裁剪保存图片真实的像素值。默认值为true。注:设置为false时在裁剪编辑界面显示图片的像素值,设置为true时不显示。 |
\n\n
##### ChooseImageSuccessCallback 属性值 @chooseimagesuccesscallback
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errSubject | string | 是 | - | 调用API的名称 |
\n
| errMsg | string | 是 | - | - |
\n
| tempFilePaths | Array
\\
<string
\\
> | 是 | - | - |
\n
| tempFiles | any | 是 | - | - |
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [ChooseImageOptions](#chooseimageoptions) | 是 | - | - |
\n
#### ChooseImageOptions 属性值 @chooseimageoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| count | number | 否 | 9 | 最多可以选择的图片张数,app端不限制,微信小程序最多可支持20个。 |
\n
| sizeType | Array
\\
<string
\\
> | 否 |
['original','compressed'
\\
] | original 原图,compressed 压缩图,默认二者都有 |
\n
| sourceType | Array
\\
<string
\\
> | 否 | ['album','camera'
\\
] | album 从相册选图,camera 使用相机,默认二者都有 |
\n
| extension | Array
\\
<string
\\
> | 否 | - | 根据文件拓展名过滤,每一项都不能是空字符串。默认不过滤。仅H5支持 |
\n
| crop | [ChooseImageCropOptions](#chooseimagecropoptions) | 否 | - | 图像裁剪参数,设置后 sizeType 失效。 |
\n
| success | (callback: [ChooseImageSuccessCallback](#chooseimagesuccesscallback)) => void | 否 | - | 成功则返回图片的本地文件路径列表 tempFilePaths |
\n
| fail | (callback: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (callback: any) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### ChooseImageCropOptions 属性值 @chooseimagecropoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| width | number | 是 | - | 裁剪的宽度,单位为px,用于计算裁剪宽高比。 |
\n
| height | number | 是 | - | 裁剪的高度,单位为px,用于计算裁剪宽高比。 |
\n
| quality | number | 否 | 80 | 取值范围为1-100,数值越小,质量越低(仅对jpg格式有效)。默认值为80
。 |
\n
| resize | boolean | 否 | - | 是否将width和height作为裁剪保存图片真实的像素值。默认值为true。注:设置为false时在裁剪编辑界面显示图片的像素值,设置为true时不显示。 |
\n\n
##### ChooseImageSuccessCallback 属性值 @chooseimagesuccesscallback
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errSubject | string | 是 | - | 调用API的名称 |
\n
| errMsg | string | 是 | - | - |
\n
| tempFilePaths | Array
\\
<string
\\
> | 是 | - | - |
\n
| tempFiles | any | 是 | - | - |
\n
"
,
"returnValue"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
"### chooseImage 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4 | √ | 3.9.0 | - | - | - |
\n
"
,
"compatibility"
:
"### chooseImage 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4 | √ | 3.9.0 | - | - | - |
\n
"
,
"tutorial"
:
"
\n
### 参见
\n
[chooseImage](http://uniapp.dcloud.io/api/media/image?id=chooseimage)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[chooseImage](http://uniapp.dcloud.io/api/media/image?id=chooseimage)
\n
"
...
@@ -402,7 +402,7 @@
...
@@ -402,7 +402,7 @@
"previewImage"
:
{
"previewImage"
:
{
"name"
:
"## uni.previewImage(options) @previewimage"
,
"name"
:
"## uni.previewImage(options) @previewimage"
,
"description"
:
"预览图片"
,
"description"
:
"预览图片"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [PreviewImageOptions](#previewimageoptions) | 是 | - | - |
\n
#### PreviewImageOptions 属性值 @previewimageoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
|
urls | Array
\\
<string
\\
> | 是 | - | - |
\n
| loop | boolean | 否 | - | 是否返回节点 id |
\n
| longPressActions | [LongPressActionsOptions](#longpressactionsoptions) | 否 | - | 长按图片显示操作菜单,如不填默认为保存相册,1.9.5 起支持。 |
\n
| success | (result: [PreviewImageSuccessCallback](#previewimagesuccesscallback)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: any) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### LongPressActionsOptions 属性值 @longpressactionsoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| itemList | Array
\\
<string
\\
> | 是 | - | -
|
\n
| success | (result: [LongPressActionsSuccessData](#longpressactionssuccessdata)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: any) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: any) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
###### LongPressActionsSuccessData 属性值 @longpressactionssuccessdata
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| tapIndex | number | 是 | - | 接口调用失败的回调函数 |
\n
| index | number | 是 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### PreviewImageSuccessCallback 属性值 @previewimagesuccesscallback
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errSubject | string | 是 | - | - |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [PreviewImageOptions](#previewimageoptions) | 是 | - | - |
\n
#### PreviewImageOptions 属性值 @previewimageoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
|
count | string | 否 | - | 当前显示图片的链接,不填则默认为 urls 的第一张 |
\n
| current | any | 否 | - | current 为当前显示图片的链接/索引值,不填或填写的值无效则为 urls 的第一张。App平台在 1.9.5至1.9.8之间,current为必填。不填会报错 |
\n
| urls | Array
\\
<string
\\
> | 是 | - | 需要预览的图片链接列表 |
\n
| indicator | string | 否 | - | 图片指示器样式 - default: 底部圆点指示器 - number: 顶部数字指示器 - none: 不显示指示器 |
\n
| loop | boolean | 否 | - | 是否可循环预览 |
\n
| longPressActions | [LongPressActionsOptions](#longpressactionsoptions) | 否 | - | 长按图片显示操作菜单,如不填默认为保存相册,1.9.5 起支持。 |
\n
| success | (result: [PreviewImageSuccessCallback](#previewimagesuccesscallback)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: any) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### LongPressActionsOptions 属性值 @longpressactionsoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| itemList | Array
\\
<string
\\
> | 是 | - | 按钮的文字数组 |
\n
| itemColor | string | 否 | - | 按钮的文字颜色,字符串格式,默认为
\"
#000000
\"
|
\n
| success | (result: [LongPressActionsSuccessData](#longpressactionssuccessdata)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: any) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: any) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
###### LongPressActionsSuccessData 属性值 @longpressactionssuccessdata
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| tapIndex | number | 是 | - | 接口调用失败的回调函数 |
\n
| index | number | 是 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### PreviewImageSuccessCallback 属性值 @previewimagesuccesscallback
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| errSubject | string | 是 | - | - |
\n
| errMsg | string | 是 | - | - |
\n
"
,
"returnValue"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
"### previewImage 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4 | √ | 3.9.0 | - | - | - |
\n
"
,
"compatibility"
:
"### previewImage 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4 | √ | 3.9.0 | - | - | - |
\n
"
,
"tutorial"
:
"
\n
### 参见
\n
[previewImage](http://uniapp.dcloud.io/api/media/image?id=previewimage)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[previewImage](http://uniapp.dcloud.io/api/media/image?id=previewimage)
\n
"
...
@@ -426,7 +426,7 @@
...
@@ -426,7 +426,7 @@
"getLocation"
:
{
"getLocation"
:
{
"name"
:
"## uni.getLocation(options) @getlocation"
,
"name"
:
"## uni.getLocation(options) @getlocation"
,
"description"
:
"获取当前的地理位置、速度"
,
"description"
:
"获取当前的地理位置、速度"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [GetLocationOptions](#getlocationoptions) | 是 | - | - |
\n
#### GetLocationOptions 属性值 @getlocationoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
|
altitude | boolean | 否 | - | 是否返回节点 id |
\n
| geocode | boolean | 否 | - | 是否返回节点 id |
\n
| isHighAccuracy | boolean | 否 | - | 是否返回节点 id |
\n
| success | (result: [GetLocationSuccess](#getlocationsuccess)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: any) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### GetLocationSuccess 属性值 @getlocationsuccess
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| latitude | number | 是 | 0 | 纬度,浮点数,范围为-90~90,负数表示南纬 |
\n
| longitude | number | 是 | 0 | 经度,范围为-180~180,负数表示西经 |
\n
| speed | number | 是 | 0 | 速度,浮点数,单位m/s |
\n
| accuracy | number | 是 | - | 位置的精确度 |
\n
| altitude | number | 是 | 0 | 高度,单位 m |
\n
| verticalAccuracy | number | 是 | 0 | 垂直精度,单位 m(Android 无法获取,返回 0) |
\n
| horizontalAccuracy | number | 是 | 0 | 水平精度,单位 m
|
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [GetLocationOptions](#getlocationoptions) | 是 | - | - |
\n
#### GetLocationOptions 属性值 @getlocationoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
|
type | string | 否 | wgs84 | 默认为 wgs84 返回 gps 坐标,gcj02 返回可用于uni.openLocation的坐标 |
\n
| altitude | boolean | 否 | false | 传入 true 会返回高度信息,由于获取高度需要较高精确度,会减慢接口返回速度 |
\n
| geocode | boolean | 否 | false | 传入 true 会解析地址 |
\n
| highAccuracyExpireTime | number | 否 | 3000 | 高精度定位超时时间(ms),指定时间内返回最高精度,该值3000ms以上高精度定位才有效果 |
\n
| isHighAccuracy | boolean | 否 | false | 开启高精度定位 |
\n
| success | (result: [GetLocationSuccess](#getlocationsuccess)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (result: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (result: any) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### GetLocationSuccess 属性值 @getlocationsuccess
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| latitude | number | 是 | 0 | 纬度,浮点数,范围为-90~90,负数表示南纬 |
\n
| longitude | number | 是 | 0 | 经度,范围为-180~180,负数表示西经 |
\n
| speed | number | 是 | 0 | 速度,浮点数,单位m/s |
\n
| accuracy | number | 是 | - | 位置的精确度 |
\n
| altitude | number | 是 | 0 | 高度,单位 m |
\n
| verticalAccuracy | number | 是 | 0 | 垂直精度,单位 m(Android 无法获取,返回 0) |
\n
| horizontalAccuracy | number | 是 | 0 | 水平精度,单位 m |
\n
| address | any | 否 | null | 地址信息
|
\n
"
,
"returnValue"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
"### getLocation 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4.4 | √ | 3.9.0 | x | x | x |
\n
"
,
"compatibility"
:
"### getLocation 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4.4 | √ | 3.9.0 | x | x | x |
\n
"
,
"tutorial"
:
"
\n
### 参见
\n
[getLocation]([](http://uniapp.dcloud.io/api/location/location?id=getlocation))
\n
"
"tutorial"
:
"
\n
### 参见
\n
[getLocation]([](http://uniapp.dcloud.io/api/location/location?id=getlocation))
\n
"
...
@@ -450,7 +450,7 @@
...
@@ -450,7 +450,7 @@
"getStorage"
:
{
"getStorage"
:
{
"name"
:
"## uni.getStorage(options) @getstorage"
,
"name"
:
"## uni.getStorage(options) @getstorage"
,
"description"
:
"
\r\n
uni.getStorage函数定义
\r\n
从本地存储中异步获取指定 key 对应的内容。
\r\n
"
,
"description"
:
"
\r\n
uni.getStorage函数定义
\r\n
从本地存储中异步获取指定 key 对应的内容。
\r\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [GetStorageOptions](#getstorageoptions) | 是 | - | uni.getStorage参数定义 |
\n
#### GetStorageOptions 属性值 @getstorageoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| key | string | 是 | - | 本地存储中的指定的 key |
\n
| success | (res: [GetStorageSuccess](#getstoragesuccess)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (res: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (res: any) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [GetStorageOptions](#getstorageoptions) | 是 | - | uni.getStorage参数定义 |
\n
#### GetStorageOptions 属性值 @getstorageoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| key | string | 是 | - | 本地存储中的指定的 key |
\n
| success | (res: [GetStorageSuccess](#getstoragesuccess)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (res: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (res: any) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n
\n
##### GetStorageSuccess 属性值 @getstoragesuccess
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| data | any | 否 | - | key 对应的内容 |
\n
"
,
"returnValue"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
"### getStorage 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4.4 | 2.0.3 | 3.9.0 | 9.0 | 2.0.3 | 3.9.0 |
\n
"
,
"compatibility"
:
"### getStorage 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4.4 | 2.0.3 | 3.9.0 | 9.0 | 2.0.3 | 3.9.0 |
\n
"
,
"tutorial"
:
"
\n
### 参见
\n
[getStorage](https://uniapp.dcloud.net.cn/api/storage/storage.html#getstorage)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[getStorage](https://uniapp.dcloud.net.cn/api/storage/storage.html#getstorage)
\n
"
...
@@ -466,7 +466,7 @@
...
@@ -466,7 +466,7 @@
"getStorageInfo"
:
{
"getStorageInfo"
:
{
"name"
:
"## uni.getStorageInfo(options) @getstorageinfo"
,
"name"
:
"## uni.getStorageInfo(options) @getstorageinfo"
,
"description"
:
"
\r\n
uni.getStorageInfo函数定义
\r\n
异步获取当前 storage 的相关信息。
\r\n
"
,
"description"
:
"
\r\n
uni.getStorageInfo函数定义
\r\n
异步获取当前 storage 的相关信息。
\r\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [GetStorageInfoOptions](#getstorageinfooptions) | 是 | - | uni.getStorageInfo参数定义 |
\n
#### GetStorageInfoOptions 属性值 @getstorageinfooptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| success | (res: [GetStorageInfoSuccess](#getstorageinfosuccess)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (res: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (res: any) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### GetStorageInfoSuccess 属性值 @getstorageinfosuccess
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| keys | Array
\\
<string
\\
> | 是 | - |
-
|
\n
| currentSize | number | 是 | - | 当前占用的空间大小, 单位:kb |
\n
| limitSize | number | 是 | - | 限制的空间大小, 单位:kb |
\n
"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| options | [GetStorageInfoOptions](#getstorageinfooptions) | 是 | - | uni.getStorageInfo参数定义 |
\n
#### GetStorageInfoOptions 属性值 @getstorageinfooptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| success | (res: [GetStorageInfoSuccess](#getstorageinfosuccess)) => void | 否 | - | 接口调用成功的回调函数 |
\n
| fail | (res: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |
\n
| complete | (res: any) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### GetStorageInfoSuccess 属性值 @getstorageinfosuccess
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| keys | Array
\\
<string
\\
> | 是 | - |
当前 storage 中所有的 key
|
\n
| currentSize | number | 是 | - | 当前占用的空间大小, 单位:kb |
\n
| limitSize | number | 是 | - | 限制的空间大小, 单位:kb |
\n
"
,
"returnValue"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
"### getStorageInfo 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4.4 | 2.0.3 | 3.9.0 | 9.0 | 2.0.3 | 3.9.0 |
\n
"
,
"compatibility"
:
"### getStorageInfo 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4.4 | 2.0.3 | 3.9.0 | 9.0 | 2.0.3 | 3.9.0 |
\n
"
,
"tutorial"
:
"
\n
### 参见
\n
[getStorageInfo](https://uniapp.dcloud.net.cn/api/storage/storage.html#getstorageinfo)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[getStorageInfo](https://uniapp.dcloud.net.cn/api/storage/storage.html#getstorageinfo)
\n
"
...
@@ -475,7 +475,7 @@
...
@@ -475,7 +475,7 @@
"name"
:
"## uni.getStorageInfoSync() @getstorageinfosync"
,
"name"
:
"## uni.getStorageInfoSync() @getstorageinfosync"
,
"description"
:
"
\r\n
uni.getStorageInfoSync函数定义
\r\n
同步获取当前 storage 的相关信息。
\r\n\r\n
"
,
"description"
:
"
\r\n
uni.getStorageInfoSync函数定义
\r\n
同步获取当前 storage 的相关信息。
\r\n\r\n
"
,
"param"
:
""
,
"param"
:
""
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :- |
\n
| [GetStorageInfoSuccess](#getstorageinfosuccess) |
\n\n
#### GetStorageInfoSuccess 属性值 @getstorageinfosuccess
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| keys | Array
\\
<string
\\
> | 是 | - |
-
|
\n
| currentSize | number | 是 | - | 当前占用的空间大小, 单位:kb |
\n
| limitSize | number | 是 | - | 限制的空间大小, 单位:kb |
\n
"
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :- |
\n
| [GetStorageInfoSuccess](#getstorageinfosuccess) |
\n\n
#### GetStorageInfoSuccess 属性值 @getstorageinfosuccess
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| keys | Array
\\
<string
\\
> | 是 | - |
当前 storage 中所有的 key
|
\n
| currentSize | number | 是 | - | 当前占用的空间大小, 单位:kb |
\n
| limitSize | number | 是 | - | 限制的空间大小, 单位:kb |
\n
"
,
"compatibility"
:
"### getStorageInfoSync 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4.4 | 2.0.3 | 3.9.0 | 9.0 | 2.0.3 | 3.9.0 |
\n
"
,
"compatibility"
:
"### getStorageInfoSync 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4.4 | 2.0.3 | 3.9.0 | 9.0 | 2.0.3 | 3.9.0 |
\n
"
,
"tutorial"
:
"
\n
### 参见
\n
[getStorageInfoSync](https://uniapp.dcloud.net.cn/api/storage/storage.html#getstorageinfosync)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[getStorageInfoSync](https://uniapp.dcloud.net.cn/api/storage/storage.html#getstorageinfosync)
\n
"
},
},
...
@@ -523,7 +523,7 @@
...
@@ -523,7 +523,7 @@
"name"
:
"## uni.createVideoContext(videoId, component?) @createvideocontext"
,
"name"
:
"## uni.createVideoContext(videoId, component?) @createvideocontext"
,
"description"
:
"创建并返回 video 上下文 videoContext 对象"
,
"description"
:
"创建并返回 video 上下文 videoContext 对象"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| videoId | VideoIdString | 是 | - | - |
\n
| component | ComponentPublicInstance | 否 | - | - |"
,
"param"
:
"### 参数
\n\n
| 名称 | 类型 | 必填 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| videoId | VideoIdString | 是 | - | - |
\n
| component | ComponentPublicInstance | 否 | - | - |"
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :- |
\n
| [VideoContext](#videocontext) |
\n\n
#### VideoContext 属性值 @videocontext
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| play | () => void | 是 | - | 播放 |
\n
| pause | () => void | 是 | - | 暂停 |
\n
| seek | (position: number) => void | 是 | - | 跳转到指定位置 |
\n
| stop | () => void | 是 | - | 停止视频 |
\n
| sendDanmu | (danmu: [Danmu](#danmu)) => void | 是 | - | 发送弹幕 |
\n
| playbackRate | (rate: number) => void | 是 | - | 设置倍速播放 |
\n
| requestFullScreen | (direction?: [RequestFullScreenOptions](#requestfullscreenoptions)) => void | 是 | - | 进入全屏 |
\n
| exitFullScreen | () => void | 是 | - | 退出全屏 |
\n\n
##### VideoContext 兼容性
\n
| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- | :- |
\n
| play | 4.4 | √ | 3.9.0 | - | - | - |
\n
| pause | 4.4 | √ | 3.9.0 | - | - | - |
\n
| seek | 4.4 | √ | 3.9.0 | - | - | - |
\n
| stop | 4.4 | √ | 3.9.0 | - | - | - |
\n
| sendDanmu | 4.4 | √ | 3.9.0 | - | - | - |
\n
| playbackRate | 4.4 | √ | 3.9.0 | - | - | - |
\n
| requestFullScreen | 4.4 | √ | 3.9.0 | - | - | - |
\n
| exitFullScreen | 4.4 | √ | 3.9.0 | - | - | - |
\n
"
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :- |
\n
| [VideoContext](#videocontext) |
\n\n
#### VideoContext 属性值 @videocontext
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| play | () => void | 是 | - | 播放 |
\n
| pause | () => void | 是 | - | 暂停 |
\n
| seek | (position: number) => void | 是 | - | 跳转到指定位置 |
\n
| stop | () => void | 是 | - | 停止视频 |
\n
| sendDanmu | (danmu: [Danmu](#danmu)) => void | 是 | - | 发送弹幕 |
\n
| playbackRate | (rate: number) => void | 是 | - | 设置倍速播放 |
\n
| requestFullScreen | (direction?: [RequestFullScreenOptions](#requestfullscreenoptions)) => void | 是 | - | 进入全屏 |
\n
| exitFullScreen | () => void | 是 | - | 退出全屏 |
\n\n
#####
Danmu 属性值 @danmu
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| text | string | 否 | - | 弹幕文字 |
\n
| color | string | 否 | - | 弹幕颜色 |
\n
| time | number | 否 | - | 显示时刻 |
\n\n
##### RequestFullScreenOptions 属性值 @requestfullscreenoptions
\n\n
| 名称 | 类型 | 必备 | 默认值 | 描述 |
\n
| :- | :- | :- | :- | :- |
\n
| direction | number | 否 | - | direction - 0: 正常竖向 - 90: 屏幕逆时针90度 - -90: 屏幕顺时针90度 |
\n\n
#####
VideoContext 兼容性
\n
| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- | :- |
\n
| play | 4.4 | √ | 3.9.0 | - | - | - |
\n
| pause | 4.4 | √ | 3.9.0 | - | - | - |
\n
| seek | 4.4 | √ | 3.9.0 | - | - | - |
\n
| stop | 4.4 | √ | 3.9.0 | - | - | - |
\n
| sendDanmu | 4.4 | √ | 3.9.0 | - | - | - |
\n
| playbackRate | 4.4 | √ | 3.9.0 | - | - | - |
\n
| requestFullScreen | 4.4 | √ | 3.9.0 | - | - | - |
\n
| exitFullScreen | 4.4 | √ | 3.9.0 | - | - | - |
\n
"
,
"compatibility"
:
"### createVideoContext 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4 | √ | √ | - | - | - |
\n
"
,
"compatibility"
:
"### createVideoContext 兼容性
\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :- | :- | :- | :- | :- | :- |
\n
| 4.4 | √ | √ | - | - | - |
\n
"
,
"tutorial"
:
"
\n
### 参见
\n
[createVideoContext](http://uniapp.dcloud.io/api/media/video-context?id=createVideoContext)
\n
"
"tutorial"
:
"
\n
### 参见
\n
[createVideoContext](http://uniapp.dcloud.io/api/media/video-context?id=createVideoContext)
\n
"
},
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录