Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sss宋
unidocs-zh
提交
16ec2f4e
unidocs-zh
项目概览
sss宋
/
unidocs-zh
与 Fork 源项目一致
Fork自
DCloud / unidocs-zh
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
unidocs-zh
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
16ec2f4e
编写于
8月 24, 2023
作者:
D
DCloud_LXH
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: uts api
上级
5c38b259
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
665 addition
and
10 deletion
+665
-10
docs/.vuepress/config.js
docs/.vuepress/config.js
+11
-1
docs/.vuepress/markdown/inject-json-to-md.js
docs/.vuepress/markdown/inject-json-to-md.js
+25
-9
docs/.vuepress/utils/utsApiJson.json
docs/.vuepress/utils/utsApiJson.json
+1
-0
docs/uni-app-x/_sidebar.md
docs/uni-app-x/_sidebar.md
+1
-0
docs/uni-app-x/api.md
docs/uni-app-x/api.md
+627
-0
未找到文件。
docs/.vuepress/config.js
浏览文件 @
16ec2f4e
...
...
@@ -106,7 +106,17 @@ const config = {
},
plugins
:
[
[
"
vuepress-plugin-juejin-style-copy
"
,
copyOptions
]
]
],
/**
*
* @param {string} path path: js 资源文件路径
* @param {string} type type: 资源文件类型,取值有 script 等
* @returns
*/
shouldPrefetch
:
(
path
,
type
)
=>
{
if
(
type
===
'
script
'
&&
path
.
indexOf
(
'
/docs/
'
)
>
-
1
)
return
false
return
true
}
}
module
.
exports
=
config
\ No newline at end of file
docs/.vuepress/markdown/inject-json-to-md.js
浏览文件 @
16ec2f4e
let
cssJson
=
{};
let
utsJson
=
{};
let
utsApiJson
=
{};
try
{
cssJson
=
require
(
'
../utils/cssJson.json
'
);
}
catch
(
error
)
{}
try
{
utsJson
=
require
(
'
../utils/utsJson.json
'
);
}
catch
(
error
)
{}
try
{
utsApiJson
=
require
(
'
../utils/utsApiJson.json
'
);
}
catch
(
error
)
{}
function
getRegExp
(
key
)
{
return
new
RegExp
(
`<!--\\s*
${
key
}
.([\\w\\W]+[^\\s])\\s*-->`
)
}
const
getJSON
=
text
=>
{
let
match
=
text
.
match
(
/<!--
\s
*CSSJSON.
([\w\W]
+
[^\s])\s
*-->/
);
let
match
=
text
.
match
(
getRegExp
(
'
CSSJSON
'
)
);
if
(
match
)
{
return
{
match
,
json
:
cssJson
,
};
}
match
=
text
.
match
(
/<!--
\s
*UTSJSON.
([\w\W]
+
[^\s])\s
*-->/
);
match
=
text
.
match
(
getRegExp
(
'
UTSJSON
'
)
);
if
(
match
)
{
return
{
match
,
json
:
utsJson
,
};
}
match
=
text
.
match
(
getRegExp
(
'
UTSAPIJSON
'
));
if
(
match
)
{
return
{
match
,
json
:
utsApiJson
,
};
}
return
{
match
:
null
,
...
...
@@ -33,8 +49,8 @@ const getJSON = text => {
module
.
exports
=
function
(
md
,
opts
)
{
if
(
Object
.
keys
(
cssJson
)
===
0
)
return
false
;
md
.
core
.
ruler
.
after
(
'
inline
'
,
'
merge-css
'
,
function
(
state
)
{
/*
const ids = []
let idIdx = 1
*/
const
ids
=
[]
let
idIdx
=
1
for
(
let
index
=
0
;
index
<
state
.
tokens
.
length
;
index
++
)
{
const
blockToken
=
state
.
tokens
[
index
];
if
(
blockToken
.
type
===
'
html_block
'
)
{
...
...
@@ -47,9 +63,9 @@ module.exports = function (md, opts) {
if
(
!
temp
)
return
false
;
temp
=
temp
[
key
];
});
if
(
!
temp
)
continue
const
parseTokens
=
md
.
parse
(
temp
,
undefined
,
false
);
/*
parseTokens.forEach(token => {
if
(
!
temp
)
continue
;
const
parseTokens
=
md
.
parse
(
temp
);
parseTokens
.
forEach
(
token
=>
{
if
(
token
.
type
===
'
heading_open
'
)
{
const
id
=
token
.
attrGet
(
'
id
'
)
if
(
ids
.
includes
(
id
))
{
...
...
@@ -58,7 +74,7 @@ module.exports = function (md, opts) {
ids
.
push
(
id
)
}
}
})
*/
})
state
.
tokens
.
splice
(
index
,
1
,
...
parseTokens
);
index
=
index
+
parseTokens
.
length
-
1
;
// blockToken.content = temp
...
...
docs/.vuepress/utils/utsApiJson.json
0 → 100644
浏览文件 @
16ec2f4e
{
"createInnerAudioContext"
:{
"name"
:
"## uni.createInnerAudioContext() @createinneraudiocontext"
,
"description"
:
"创建并返回 audio 上下文 audioContext 对象"
,
"param"
:
""
,
"returnValue"
:
"### 返回值
\n\n
| 类型 | 描述 |
\n
| :-| :-|
\n
| [InnerAudioContext](#inneraudiocontext) | 音频对象 |
\n\n
#### InnerAudioContext
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| duration | number | 是 | 当前音频的长度(单位:s),只有在当前有合法的 src 时返回 |
\n
| currentTime | number | 是 | 当前音频的播放位置(单位:s),只有在当前有合法的 src 时返回 |
\n
| paused | boolean | 是 | 当前是是否暂停或停止状态,true 表示暂停或停止,false 表示正在播放 |
\n
| src | string | 是 | 音频的数据链接,用于直接播放。 |
\n
| startTime | number | 是 | 音频开始播放的位置(单位:s) |
\n
| buffered | number | 是 | 音频缓冲的时间点,仅保证当前播放时间点到此时间点内容已缓冲 |
\n
| autoplay | boolean | 是 | 是否自动开始播放,默认 false |
\n
| loop | boolean | 是 | 是否循环播放,默认 false |
\n
| obeyMuteSwitch | boolean | 是 | 是否遵循系统静音开关,当此参数为 false 时,即使用户打开了静音开关,也能继续发出声音,默认值 true |
\n
| volume | number | 是 | 音量。范围 0~1。 |
\n
| playbackRate | number | 否 | 播放的倍率。可取值: 0.5/0.8/1.0/1.25/1.5/2.0,默认值为1.0。(仅 App 支持) |
\n
| pause | () => void | 是 | 暂停 |
\n
| stop | () => void | 是 | 停止 |
\n
| play | () => void | 是 | 播放 |
\n
| seek | (number) => void | 是 | 跳转到指定位置,单位 s |
\n
| destroy | () => void | 是 | 销毁当前实例 |
\n
| onCanplay | ((any) => void) => void | 是 | 音频进入可以播放状态,但不保证后面可以流畅播放 |
\n
| onPlay | ((any) => void) => void | 是 | 音频播放事件 |
\n
| onPause | ((any) => void) => void | 是 | 音频暂停事件 |
\n
| onStop | ((any) => void) => void | 是 | 音频停止事件 |
\n
| onEnded | ((any) => void) => void | 是 | 音频自然播放结束事件 |
\n
| onTimeUpdate | ((any) => void) => void | 是 | 音频播放进度更新事件 |
\n
| onError | ((any) => void) => void | 是 | 音频播放错误事件 |
\n
| onWaiting | ((any) => void) => void | 是 | 音频加载中事件,当音频因为数据不足,需要停下来加载时会触发 |
\n
| onSeeking | ((any) => void) => void | 是 | 音频进行 seek 操作事件 |
\n
| onSeeked | ((any) => void) => void | 是 | 音频完成 seek 操作事件 |
\n
| offCanplay | ((any) => void) => void | 是 | 取消监听 onCanplay 事件 |
\n
| offPlay | ((any) => void) => void | 是 | 取消监听 onPlay 事件 |
\n
| offPause | ((any) => void) => void | 是 | 取消监听 onPause 事件 |
\n
| offStop | ((any) => void) => void | 是 | 取消监听 onStop 事件 |
\n
| offEnded | ((any) => void) => void | 是 | 取消监听 onEnded 事件 |
\n
| offTimeUpdate | ((any) => void) => void | 是 | 取消监听 onTimeUpdate 事件 |
\n
| offError | ((any) => void) => void | 是 | 取消监听 onWaiting 事件 |
\n
| offWaiting | ((any) => void) => void | 是 | 取消监听 onWaiting 事件 |
\n
| offSeeking | ((any) => void) => void | 是 | 取消监听 onSeeking 事件 |
\n
| offSeeked | ((any) => void) => void | 是 | 取消监听 onSeeked 事件 |
\n
"
,
"compatibility"
:
"### 兼容性
\n\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :-| :-| :-| :-| :-| :-|
\n
| 4.4 | √ | √ | - | - | - |
\n
"
,
"tutorial"
:
"
\n
### 参见
\n
[createInnerAudioContext](http://uniapp.dcloud.io/api/media/audio-context?id=createinneraudiocontext)
\n
"
},
"getBackgroundAudioManager"
:{
"name"
:
"## uni.getBackgroundAudioManager() @getbackgroundaudiomanager"
,
"description"
:
"获取全局唯一的背景音频管理器 backgroundAudioManager"
,
"param"
:
""
,
"returnValue"
:
"### 返回值
\n\n
| 类型 | 描述 |
\n
| :-| :-|
\n
| [BackgroundAudioManager](#backgroundaudiomanager) | 背景音频对象 |
\n\n
#### BackgroundAudioManager
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| duration | number | 是 | 当前音频的长度(单位:s),只有在当前有合法的 src 时返回 |
\n
| currentTime | number | 是 | 当前音频的播放位置(单位:s),只有在当前有合法的 src 时返回 |
\n
| paused | boolean | 是 | 当前是是否暂停或停止状态,true 表示暂停或停止,false 表示正在播放 |
\n
| src | string | 是 | 音频的数据源,默认为空字符串,当设置了新的 src 时,会自动开始播放 ,目前支持的格式有 m4a, aac, mp3, wav |
\n
| startTime | number | 是 | 音频开始播放的位置(单位:s) |
\n
| buffered | number | 是 | 音频缓冲的时间点,仅保证当前播放时间点到此时间点内容已缓冲 |
\n
| title | string | 是 | 音频标题,用于做原生音频播放器音频标题。原生音频播放器中的分享功能,分享出去的卡片标题,也将使用该值。 |
\n
| epname | string | 是 | 专辑名,原生音频播放器中的分享功能,分享出去的卡片简介,也将使用该值 |
\n
| singer | string | 是 | 歌手名,原生音频播放器中的分享功能,分享出去的卡片简介,也将使用该值 |
\n
| coverImgUrl | string | 是 | 封面图url,用于做原生音频播放器背景图。原生音频播放器中的分享功能,分享出去的卡片配图及背景也将使用该图。 |
\n
| webUrl | string | 是 | 页面链接,原生音频播放器中的分享功能,分享出去的卡片简介,也将使用该值 |
\n
| protocol | string | 是 | 音频协议。默认值为 'http',设置 'hls' 可以支持播放 HLS 协议的直播音频 |
\n
| playbackRate | number | 否 | 播放的倍率。可取值: 0.5/0.8/1.0/1.25/1.5/2.0,默认值为1.0。(仅 App 支持) |
\n
| pause | () => void | 是 | 暂停 |
\n
| stop | () => void | 是 | 停止 |
\n
| play | () => void | 是 | 播放 |
\n
| seek | (number) => void | 是 | 跳转到指定位置,单位 s |
\n
| destroy | () => void | 是 | 销毁当前实例 |
\n
| onCanplay | ((any) => void) => void | 是 | 音频进入可以播放状态,但不保证后面可以流畅播放 |
\n
| onPlay | ((any) => void) => void | 是 | 音频播放事件 |
\n
| onPause | ((any) => void) => void | 是 | 音频暂停事件 |
\n
| onStop | ((any) => void) => void | 是 | 音频停止事件 |
\n
| onEnded | ((any) => void) => void | 是 | 音频自然播放结束事件 |
\n
| onTimeUpdate | ((any) => void) => void | 是 | 音频播放进度更新事件 |
\n
| onError | ((any) => void) => void | 是 | 音频播放错误事件 |
\n
| onWaiting | ((any) => void) => void | 是 | 音频加载中事件,当音频因为数据不足,需要停下来加载时会触发 |
\n
| onSeeking | ((any) => void) => void | 是 | 音频进行 seek 操作事件 |
\n
| onSeeked | ((any) => void) => void | 是 | 音频完成 seek 操作事件 |
\n
| offCanplay | ((any) => void) => void | 是 | 取消监听 onCanplay 事件 |
\n
| offPlay | ((any) => void) => void | 是 | 取消监听 onPlay 事件 |
\n
"
,
"compatibility"
:
"### 兼容性
\n\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :-| :-| :-| :-| :-| :-|
\n
| 4.4 | √ | √ | - | - | - |
\n
"
,
"tutorial"
:
"
\n
### 参见
\n
[getBackgroundAudioManager](http://uniapp.dcloud.io/api/media/background-audio-manager?id=getbackgroundaudiomanager)
\n
"
},
"exitApp"
:{
"name"
:
"## uni.exitApp() @exitapp"
,
"description"
:
"
\r\n
退出当前应用"
,
"param"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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"
:
""
},
"getFileSystemManager"
:{
"name"
:
"## uni.getFileSystemManager() @getfilesystemmanager"
,
"description"
:
"
\r\n
获取文件管理器"
,
"param"
:
""
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :-|
\n
| [FileSystemManager](#filesystemmanager) |
\n\n
#### FileSystemManager
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| readFile | ([ReadFileOptions](#readfileoptions)) => void | 是 | - |
\n
| writeFile | ([WriteFileOptions](#writefileoptions)) => void | 是 | - |
\n\n
##### ReadFileOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| encoding | string | 是 | base64 / utf-8 |
\n
| filePath | string | 是 | 文件路径,支持相对地址和绝对地址 |
\n
| success | ([ReadFileSuccessResult](#readfilesuccessresult)) => void | 否 | 接口调用的回调函数 |
\n
| fail | ([ReadFileFailResult](#readfilefailresult)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
###### ReadFileSuccessResult
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| data | string | 是 | - |
\n\n
###### ReadFileFailResult
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errCode | number | 是 | 错误码 |
\n
| errSubject | string | 是 | 调用API的名称 |
\n
| errMsg | string | 是 | 错误的详细信息 |
\n\n
##### WriteFileOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| filePath | string | 是 | 文件路径,只支持绝对地址 |
\n
| data | string | 是 | 写入的文本内容 |
\n
| success | ([WriteFileSuccessResult](#writefilesuccessresult)) => void | 否 | 接口调用的回调函数 |
\n
| fail | ([WriteFileFailResult](#writefilefailresult)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
###### WriteFileSuccessResult
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| filePath | string | 是 | - |
\n\n
###### WriteFileFailResult
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errCode | number | 是 | 错误码 |
\n
| errSubject | string | 是 | 调用API的名称 |
\n
| errMsg | string | 是 | 错误的详细信息 |
\n
"
,
"compatibility"
:
"### 兼容性
\n\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"
:
""
},
"getAccessibilityInfo"
:{
"name"
:
"## uni.getAccessibilityInfo() @getaccessibilityinfo"
,
"description"
:
"获取app基本信息"
,
"param"
:
""
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :-|
\n
| any |
\n
"
,
"compatibility"
:
"### 兼容性
\n\n
| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |
\n
| :-| :-| :-| :-| :-| :-|
\n
| 4.4 | x | 3.9.0 | 9.0 | x | 3.9.0 |
\n
"
,
"tutorial"
:
""
},
"getAppAuthorizeSetting"
:{
"name"
:
"## uni.getAppAuthorizeSetting() @getappauthorizesetting"
,
"description"
:
"获取 APP 授权设置。"
,
"param"
:
""
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :-|
\n
| [GetAppAuthorizeSettingResult](#getappauthorizesettingresult) |
\n\n
#### GetAppAuthorizeSettingResult
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| albumAuthorized | string | 否 | 允许 App 使用相册的开关(仅 iOS 支持) - authorized: 已经获得授权,无需再次请求授权 - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限) - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关) |
\n
| bluetoothAuthorized | string | 否 | 允许 App 使用蓝牙的开关(仅 iOS 支持) - authorized: 已经获得授权,无需再次请求授权 - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限) - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关) - config error: Android平台没有该值;iOS平台:表示没有在 `manifest.json -
\\
> App模块配置` 中配置 `BlueTooth(低功耗蓝牙)` 模块 |
\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
| locationAccuracy | string | 否 | 定位准确度。true 表示模糊定位,false 表示精确定位(仅 iOS 支持) - reduced: 模糊定位 - full: 精准定位 - unsupported: 不支持(包括用户拒绝定位权限和没有在 `manifest.json -
\\
> App模块配置` 中配置 `Geolocation(定位)` 模块) |
\n
| locationReducedAccuracy | boolean | 否 | 定位准确度(推荐使用 locationAccuracy 属性)。true 表示模糊定位,false 表示精确定位(仅 iOS 支持) |
\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
| notificationAlertAuthorized | string | 否 | 允许 App 通知带有提醒的开关(仅 iOS 10.0+ 支持) - authorized: 已经获得授权,无需再次请求授权 - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限) - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关) - config error: 没有在 `manifest.json -
\\
> App模块配置` 中配置 `Push(推送)` 模块 |
\n
| notificationBadgeAuthorized | string | 否 | 允许 App 通知带有标记的开关(仅 iOS 10.0+ 支持) - authorized: 已经获得授权,无需再次请求授权 - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限) - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关) - config error: 没有在 `manifest.json -
\\
> App模块配置` 中配置 `Push(推送)` 模块 |
\n
| notificationSoundAuthorized | string | 否 | 允许 App 通知带有声音的开关(仅 iOS 10.0+ 支持) - authorized: 已经获得授权,无需再次请求授权 - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限) - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关) - config error: 没有在 `manifest.json -
\\
> App模块配置` 中配置 `Push(推送)` 模块 |
\n
| phoneCalendarAuthorized | string | 否 | 允许读写日历的开关(仅微信小程序支持) - authorized: 已经获得授权,无需再次请求授权 - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限) - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关) |
\n
"
,
"compatibility"
:
"### 兼容性
\n\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
[getAppAuthorizeSetting](http://uniapp.dcloud.io/api/system/getappauthorizesetting)
\n
"
},
"getAppBaseInfo"
:{
"name"
:
"## uni.getAppBaseInfo(config?) @getappbaseinfo"
,
"description"
:
"获取app基本信息"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| config | [GetAppBaseInfoOptions](#getappbaseinfooptions) | 否 | - |
\n
#### GetAppBaseInfoOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| filter | Array
\\
<string
\\
> | 是 | - |
\n
"
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :-|
\n
| [GetAppBaseInfoResult](#getappbaseinforesult) |
\n\n
#### GetAppBaseInfoResult
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| appId | string | 否 | manifest.json 中应用appid,即DCloud appid。
\t
|
\n
| appName | string | 否 | manifest.json 中应用名称
\t
|
\n
| appVersion | string | 否 | manifest.json 中应用版本名称。
\t
|
\n
| appVersionCode | string | 否 | manifest.json 中应用版本名号。
\t
|
\n
| appLanguage | string | 否 | 应用设置的语言en、zh-Hans、zh-Hant、fr、es
\t
|
\n
| language | string | 否 | 应用设置的语言
\t
|
\n
| version | string | 否 | 引擎版本号 |
\n
| appWgtVersion | string | 否 | 应用资源(wgt)的版本名称。
\t
|
\n
| hostLanguage | string | 否 | 小程序宿主语言
\t
|
\n
| hostVersion | string | 否 | App、小程序宿主版本。 |
\n
| hostName | string | 否 | 小程序宿主名称
\t
|
\n
| hostPackageName | string | 否 | 小程序宿主包名
\t
|
\n
| hostSDKVersion | string | 否 | uni小程序SDK版本、小程序客户端基础库版本
\t
|
\n
| hostTheme | string | 否 | 系统当前主题,取值为light或dark。微信小程序全局配置
\"
darkmode
\"
:true时才能获取,否则为 null (不支持小游戏) |
\n
| isUniAppX | boolean | 是 | 是否uni-app x |
\n
"
,
"compatibility"
:
"### 兼容性
\n\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
[getAppBaseInfo](https://uniapp.dcloud.net.cn/api/system/getAppBaseInfo.html)
\n
"
},
"getDeviceInfo"
:{
"name"
:
"## uni.getDeviceInfo(config?) @getdeviceinfo"
,
"description"
:
"获取设备信息"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| config | [GetDeviceInfoOptions](#getdeviceinfooptions) | 否 | - |
\n
#### GetDeviceInfoOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| filter | Array
\\
<string
\\
> | 是 | - |
\n
"
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :-|
\n
| [GetDeviceInfoResult](#getdeviceinforesult) |
\n\n
#### GetDeviceInfoResult
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| brand | string | 否 | 设备品牌 |
\n
| deviceBrand | string | 否 | 设备品牌 |
\n
| deviceId | string | 否 | 设备 id 。由 uni-app 框架生成并存储,清空 Storage 会导致改变 |
\n
| model | string | 否 | 设备型号
\t
|
\n
| deviceModel | string | 否 | 设备型号
\t
|
\n
| deviceType | string | 否 | 设备类型phone、pad、pc
\t
|
\n
| deviceOrientation | string | 否 | 设备方向 竖屏 portrait、横屏 landscape
\t
|
\n
| devicePixelRatio | string | 否 | 设备像素比
\t
|
\n
| system | string | 否 | 操作系统及版本
\t
|
\n
| platform | string | 否 | 客户端平台
\t
|
\n
| oaid | string | 否 | oaid标识 Android专有 |
\n
| isRoot | boolean | 否 | 是否root |
\n
| isSimulator | boolean | 否 | 是否是模拟器 |
\n
| isUSBDebugging | boolean | 否 | adb是否开启 |
\n
| idfa | string | 否 | idfa标识 iOS专有 |
\n
"
,
"compatibility"
:
"### 兼容性
\n\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
[getDeviceInfo](https://uniapp.dcloud.net.cn/api/system/getDeviceInfo.html)
\n
"
},
"getLocation"
:{
"name"
:
"## uni.getLocation(options) @getlocation"
,
"description"
:
"
\r\n
获取当前的地理位置、速度
\r\n
"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [GetLocationOptions](#getlocationoptions) | 是 | - |
\n
#### GetLocationOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| type | string | 否 | 默认为 wgs84 返回 gps 坐标,gcj02 返回可用于uni.openLocation的坐标 |
\n
| altitude | boolean | 否 | 传入 true 会返回高度信息,由于获取高度需要较高精确度,会减慢接口返回速度 |
\n
| geocode | boolean | 否 | 传入 true 会解析地址 |
\n
| highAccuracyExpireTime | number | 否 | 高精度定位超时时间(ms),指定时间内返回最高精度,该值3000ms以上高精度定位才有效果 |
\n
| isHighAccuracy | boolean | 否 | 开启高精度定位 |
\n
| success | ([GetLocationSuccess](#getlocationsuccess)) => void | 否 | 接口调用成功的回调函数 |
\n
| fail | ([UniError](#unierror)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### GetLocationSuccess
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| latitude | number | 是 | 纬度,浮点数,范围为-90~90,负数表示南纬 |
\n
| longitude | number | 是 | 经度,范围为-180~180,负数表示西经 |
\n
| speed | number | 是 | 速度,浮点数,单位m/s |
\n
| accuracy | number | 是 | 位置的精确度 |
\n
| altitude | number | 是 | 高度,单位 m |
\n
| verticalAccuracy | number | 是 | 垂直精度,单位 m(Android 无法获取,返回 0) |
\n
| horizontalAccuracy | number | 是 | 水平精度,单位 m |
\n
| address | any | 否 | 地址信息 |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
""
,
"tutorial"
:
"
\n
### 参见
\n
[getLocation](http://uniapp.dcloud.io/api/location/location?id=getlocation)
\n
"
},
"getNetworkType"
:{
"name"
:
"## uni.getNetworkType(options) @getnetworktype"
,
"description"
:
"获取网络类型"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [GetNetworkTypeOptions](#getnetworktypeoptions) | 是 | - |
\n
#### GetNetworkTypeOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| success | ([GetNetworkTypeSuccess](#getnetworktypesuccess)) => void | 否 | 接口调用成功的回调函数 |
\n
| fail | ([UniError](#unierror)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### GetNetworkTypeSuccess
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| networkType | string | 是 | 网络类型 |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
[getNetworkType](http://uniapp.dcloud.io/api/system/network?id=getnetworktype)
\n
"
},
"getRecorderManager"
:{
"name"
:
"## uni.getRecorderManager() @getrecordermanager"
,
"description"
:
"录音管理"
,
"param"
:
""
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :-|
\n
| [RecorderManager](#recordermanager) |
\n\n
#### RecorderManager
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| start | ([RecorderManagerStartOptions](#recordermanagerstartoptions)) => void | 是 | 开始录音 |
\n
| pause | () => void | 是 | 暂停录音 |
\n
| resume | () => void | 是 | 暂停录音 |
\n
| stop | () => void | 是 | 停止录音 |
\n
| onStart | ((any) => void) => void | 是 | 录音开始事件 |
\n
| onPause | ((any) => void) => void | 是 | 录音暂停事件 |
\n
| onResume | ((any) => void) => void | 是 | 录音恢复事件 |
\n
| onStop | ((any) => void) => void | 是 | 录音停止事件,会回调文件地址 |
\n
| onFrameRecorded | ((any) => void) => void | 是 | 已录制完指定帧大小的文件,会回调录音分片结果数据。如果设置了 frameSize ,则会回调此事件 |
\n
| onError | ((any) => void) => void | 是 | 录音错误事件, 会回调错误信息 |
\n\n
##### RecorderManagerStartOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| duration | number | 否 | 指定录音的时长,单位 ms ,如果传入了合法的 duration ,在到达指定的 duration 后会自动停止录音,最大值 600000(10 分钟),默认值 60000(1 分钟) |
\n
| sampleRate | number | 否 | 采样率,有效值 8000/16000/44100 |
\n
| numberOfChannels | number | 否 | 录音通道数,有效值 1/2 |
\n
| encodeBitRate | number | 否 | 编码码率,有效值见下表格 |
\n
| format | string | 否 | 音频格式,有效值 aac/mp3 |
\n
| frameSize | number | 否 | 指定帧大小,单位 KB。传入 frameSize 后,每录制指定帧大小的内容后,会回调录制的文件内容,不指定则不会回调。暂仅支持 mp3 格式。 |
\n
"
,
"compatibility"
:
"### 兼容性
\n\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
[getRecorderManager](http://uniapp.dcloud.io/api/media/record-manager?id=getrecordermanager)
\n
"
},
"getSystemInfo"
:{
"name"
:
"## uni.getSystemInfo(options) @getsysteminfo"
,
"description"
:
"异步获取系统信息"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [GetSystemInfoOptions](#getsysteminfooptions) | 是 | - |
\n
#### GetSystemInfoOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| success | ([GetSystemInfoResult](#getsysteminforesult)) => void | 否 | 接口调用成功的回调函数 |
\n
| fail | ([UniError](#unierror)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### GetSystemInfoResult
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| SDKVersion | string | 是 | 客户端基础库版本 |
\n
| app | string | 否 | 当前运行的客户端 |
\n
| appId | string | 是 | `manifest.json` 中应用appid。 |
\n
| appLanguage | string | 否 | 应用设置的语言。仅 App、H5 支持 |
\n
| appName | string | 是 | `manifest.json` 中应用名称。和`字节跳动小程序、飞书小程序`字段冲突,原字端与`hostName`一致 |
\n
| appVersion | string | 是 | `manifest.json` 中应用版本名称。 |
\n
| appVersionCode | number | 是 | `manifest.json` 中应用版本名号 |
\n
| appWgtVersion | string | 否 | 应用资源(wgt)的版本名称。(仅 App 支持) |
\n
| brand | string | 否 | 手机品牌。H5 不支持 |
\n
| browserName | string | 是 | 浏览器名称。`App` 端是系统 webview 的名字,比如 wkwebview、chrome。小程序端为空 |
\n
| browserVersion | string | 是 | 浏览器版本、webview 版本。小程序端为空 |
\n
| deviceId | string | 是 | 设备 ID |
\n
| deviceBrand | string | 否 | 设备品牌。如:`apple`、`huawei`。H5 不支持 |
\n
| deviceModel | string | 是 | 设备型号 |
\n
| deviceType | string | 是 | 设备类型。`phone`、`pad`、`pc` |
\n
| devicePixelRatio | number | 是 | 设备像素比 |
\n
| deviceOrientation | string | 是 | 设备方向。如:`竖屏 portrait`、`横屏 landscape` - portrait: 竖屏 - landscape: 横屏 |
\n
| fontSizeSetting | number | 否 | 用户字体大小设置 |
\n
| host | string | 否 | 宿主平台 |
\n
| hostFontSizeSetting | number | 否 | 用户字体大小设置 |
\n
| hostSDKVersion | string | 否 | 客户端基础库版本 |
\n
| hostName | string | 否 | App、小程序宿主名称,如:`WeChat`、`FeiShu`、`alipay`、`DINGTALK`。H5 不支持 |
\n
| hostVersion | string | 否 | App、小程序宿主版本。如:微信版本号。H5 不支持 |
\n
| hostLanguage | string | 否 | 小程序宿主语言、app 语言 |
\n
| hostTheme | string | 否 | App 主题 `light`、`dark`。H5 端为空,小程序端为系统当前主题 |
\n
| hostPackageName | string | 否 | 小程序宿主包名。仅 App 支持,其他平台为空 |
\n
| language | string | 否 | 程序设置的语言 |
\n
| model | string | 是 | 手机型号 |
\n
| osName | string | 是 | ios、android、windows、mac、linux |
\n
| osVersion | string | 是 | 操作系统版本。如 ios 版本,andriod 版本 |
\n
| osLanguage | string | 否 | 操作系统语言,小程序端与 `version` 相同,H5 与浏览器语言一致 |
\n
| osTheme | string | 否 | |操作系统主题 light、dark。小程序端为小程序主题,H5 端为空 |
\n
| pixelRatio | number | 是 | 设备像素比 |
\n
| platform | string | 是 | 客户端平台 |
\n
| screenWidth | number | 是 | 屏幕宽度 |
\n
| screenHeight | number | 是 | 屏幕高度 |
\n
| statusBarHeight | number | 否 | 状态栏的高度 |
\n
| storage | string | 否 | 设备磁盘容量 |
\n
| swanNativeVersion | string | 否 | 宿主平台版本号 |
\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
| version | string | 是 | 引擎版本号 |
\n
| romName | string | 否 | rom 名称。Android 部分机型获取不到值。iOS 恒为 `ios` |
\n
| romVersion | string | 否 | rom 版本号。Android 部分机型获取不到值。iOS 恒为 `ios 版本号` |
\n
| windowWidth | number | 是 | 可使用窗口宽度 |
\n
| windowHeight | number | 是 | 可使用窗口高度 |
\n
| navigationBarHeight | number | 否 | 导航栏的高度 |
\n
| titleBarHeight | number | 否 | 标题栏高度 |
\n
| currentBattery | string | 否 | 当前电量百分比 |
\n
| AppPlatform | string | 否 | App平台 |
\n
| windowTop | number | 是 | 可使用窗口的顶部位置 |
\n
| windowBottom | number | 是 | 可使用窗口的底部位置 |
\n
| albumAuthorized | boolean | 否 | 允许微信使用相册的开关(仅 iOS 有效) |
\n
| cameraAuthorized | boolean | 否 | 允许微信使用摄像头的开关 |
\n
| locationAuthorized | boolean | 否 | 允许微信使用定位的开关 |
\n
| microphoneAuthorized | boolean | 否 | 允许微信使用麦克风的开关 |
\n
| notificationAuthorized | boolean | 否 | 允许微信通知的开关 |
\n
| notificationAlertAuthorized | boolean | 否 | 允许微信通知带有提醒的开关(仅 iOS 有效) |
\n
| notificationBadgeAuthorized | boolean | 否 | 允许微信通知带有标记的开关(仅 iOS 有效) |
\n
| notificationSoundAuthorized | boolean | 否 | 允许微信通知带有声音的开关(仅 iOS 有效) |
\n
| bluetoothEnabled | boolean | 否 | 蓝牙的系统开关 |
\n
| locationEnabled | boolean | 否 | 地理位置的系统开关 |
\n
| wifiEnabled | boolean | 否 | Wi-Fi 的系统开关 |
\n
| cacheLocation | any | 否 | 上一次缓存的位置信息 |
\n
| theme | string | 否 | 系统当前主题,取值为light或dark。仅微信小程序支持 |
\n
| oaid | string | 否 | oaid |
\n
| osAndroidAPILevel | number | 否 | Android 系统API库的版本。 |
\n\n
###### 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
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| left | number | 是 | 安全区域左侧插入位置 |
\n
| right | number | 是 | 安全区域右侧插入位置 |
\n
| top | number | 是 | 安全区顶部插入位置 |
\n
| bottom | number | 是 | 安全区域底部插入位置 |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
[getSystemInfo](http://uniapp.dcloud.io/api/system/info?id=getsysteminfo)
\n
"
},
"getSystemInfoSync"
:{
"name"
:
"## uni.getSystemInfoSync() @getsysteminfosync"
,
"description"
:
"同步获取系统信息"
,
"param"
:
""
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :-|
\n
| [GetSystemInfoResult](#getsysteminforesult) |
\n\n
#### GetSystemInfoResult
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| SDKVersion | string | 是 | 客户端基础库版本 |
\n
| app | string | 否 | 当前运行的客户端 |
\n
| appId | string | 是 | `manifest.json` 中应用appid。 |
\n
| appLanguage | string | 否 | 应用设置的语言。仅 App、H5 支持 |
\n
| appName | string | 是 | `manifest.json` 中应用名称。和`字节跳动小程序、飞书小程序`字段冲突,原字端与`hostName`一致 |
\n
| appVersion | string | 是 | `manifest.json` 中应用版本名称。 |
\n
| appVersionCode | number | 是 | `manifest.json` 中应用版本名号 |
\n
| appWgtVersion | string | 否 | 应用资源(wgt)的版本名称。(仅 App 支持) |
\n
| brand | string | 否 | 手机品牌。H5 不支持 |
\n
| browserName | string | 是 | 浏览器名称。`App` 端是系统 webview 的名字,比如 wkwebview、chrome。小程序端为空 |
\n
| browserVersion | string | 是 | 浏览器版本、webview 版本。小程序端为空 |
\n
| deviceId | string | 是 | 设备 ID |
\n
| deviceBrand | string | 否 | 设备品牌。如:`apple`、`huawei`。H5 不支持 |
\n
| deviceModel | string | 是 | 设备型号 |
\n
| deviceType | string | 是 | 设备类型。`phone`、`pad`、`pc` |
\n
| devicePixelRatio | number | 是 | 设备像素比 |
\n
| deviceOrientation | string | 是 | 设备方向。如:`竖屏 portrait`、`横屏 landscape` - portrait: 竖屏 - landscape: 横屏 |
\n
| fontSizeSetting | number | 否 | 用户字体大小设置 |
\n
| host | string | 否 | 宿主平台 |
\n
| hostFontSizeSetting | number | 否 | 用户字体大小设置 |
\n
| hostSDKVersion | string | 否 | 客户端基础库版本 |
\n
| hostName | string | 否 | App、小程序宿主名称,如:`WeChat`、`FeiShu`、`alipay`、`DINGTALK`。H5 不支持 |
\n
| hostVersion | string | 否 | App、小程序宿主版本。如:微信版本号。H5 不支持 |
\n
| hostLanguage | string | 否 | 小程序宿主语言、app 语言 |
\n
| hostTheme | string | 否 | App 主题 `light`、`dark`。H5 端为空,小程序端为系统当前主题 |
\n
| hostPackageName | string | 否 | 小程序宿主包名。仅 App 支持,其他平台为空 |
\n
| language | string | 否 | 程序设置的语言 |
\n
| model | string | 是 | 手机型号 |
\n
| osName | string | 是 | ios、android、windows、mac、linux |
\n
| osVersion | string | 是 | 操作系统版本。如 ios 版本,andriod 版本 |
\n
| osLanguage | string | 否 | 操作系统语言,小程序端与 `version` 相同,H5 与浏览器语言一致 |
\n
| osTheme | string | 否 | |操作系统主题 light、dark。小程序端为小程序主题,H5 端为空 |
\n
| pixelRatio | number | 是 | 设备像素比 |
\n
| platform | string | 是 | 客户端平台 |
\n
| screenWidth | number | 是 | 屏幕宽度 |
\n
| screenHeight | number | 是 | 屏幕高度 |
\n
| statusBarHeight | number | 否 | 状态栏的高度 |
\n
| storage | string | 否 | 设备磁盘容量 |
\n
| swanNativeVersion | string | 否 | 宿主平台版本号 |
\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
| version | string | 是 | 引擎版本号 |
\n
| romName | string | 否 | rom 名称。Android 部分机型获取不到值。iOS 恒为 `ios` |
\n
| romVersion | string | 否 | rom 版本号。Android 部分机型获取不到值。iOS 恒为 `ios 版本号` |
\n
| windowWidth | number | 是 | 可使用窗口宽度 |
\n
| windowHeight | number | 是 | 可使用窗口高度 |
\n
| navigationBarHeight | number | 否 | 导航栏的高度 |
\n
| titleBarHeight | number | 否 | 标题栏高度 |
\n
| currentBattery | string | 否 | 当前电量百分比 |
\n
| AppPlatform | string | 否 | App平台 |
\n
| windowTop | number | 是 | 可使用窗口的顶部位置 |
\n
| windowBottom | number | 是 | 可使用窗口的底部位置 |
\n
| albumAuthorized | boolean | 否 | 允许微信使用相册的开关(仅 iOS 有效) |
\n
| cameraAuthorized | boolean | 否 | 允许微信使用摄像头的开关 |
\n
| locationAuthorized | boolean | 否 | 允许微信使用定位的开关 |
\n
| microphoneAuthorized | boolean | 否 | 允许微信使用麦克风的开关 |
\n
| notificationAuthorized | boolean | 否 | 允许微信通知的开关 |
\n
| notificationAlertAuthorized | boolean | 否 | 允许微信通知带有提醒的开关(仅 iOS 有效) |
\n
| notificationBadgeAuthorized | boolean | 否 | 允许微信通知带有标记的开关(仅 iOS 有效) |
\n
| notificationSoundAuthorized | boolean | 否 | 允许微信通知带有声音的开关(仅 iOS 有效) |
\n
| bluetoothEnabled | boolean | 否 | 蓝牙的系统开关 |
\n
| locationEnabled | boolean | 否 | 地理位置的系统开关 |
\n
| wifiEnabled | boolean | 否 | Wi-Fi 的系统开关 |
\n
| cacheLocation | any | 否 | 上一次缓存的位置信息 |
\n
| theme | string | 否 | 系统当前主题,取值为light或dark。仅微信小程序支持 |
\n
| oaid | string | 否 | oaid |
\n
| osAndroidAPILevel | number | 否 | Android 系统API库的版本。 |
\n\n
##### 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
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| left | number | 是 | 安全区域左侧插入位置 |
\n
| right | number | 是 | 安全区域右侧插入位置 |
\n
| top | number | 是 | 安全区顶部插入位置 |
\n
| bottom | number | 是 | 安全区域底部插入位置 |
\n
"
,
"compatibility"
:
"### 兼容性
\n\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
[getSystemInfoSync](http://uniapp.dcloud.io/api/system/info?id=getsysteminfosync)
\n
"
},
"getWindowInfo"
:{
"name"
:
"## uni.getWindowInfo() @getwindowinfo"
,
"description"
:
"同步获取窗口信息"
,
"param"
:
""
,
"returnValue"
:
"### 返回值
\n\n
| 类型 | 描述 |
\n
| :-| :-|
\n
| [GetWindowInfoResult](#getwindowinforesult) | result |
\n\n
#### GetWindowInfoResult
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| pixelRatio | number | 是 | 设备像素比 |
\n
| screenWidth | number | 是 | 屏幕宽度 |
\n
| screenHeight | number | 是 | 屏幕高度 |
\n
| windowWidth | number | 是 | 可使用窗口宽度 |
\n
| windowHeight | number | 是 | 可使用窗口高度 |
\n
| statusBarHeight | number | 是 | 状态栏的高度 |
\n
| windowTop | number | 是 | 可使用窗口的顶部位置 |
\n
| windowBottom | number | 是 | 可使用窗口的底部位置 |
\n
| safeArea | [SafeArea](#safearea) | 是 | 在竖屏正方向下的安全区域 |
\n
| safeAreaInsets | [SafeAreaInsets](#safeareainsets) | 是 | 在竖屏正方向下的安全区域插入位置 |
\n
| screenTop | number | 是 | 窗口上边缘的 y 值 |
\n\n
##### 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
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| left | number | 是 | 安全区域左侧插入位置 |
\n
| right | number | 是 | 安全区域右侧插入位置 |
\n
| top | number | 是 | 安全区顶部插入位置 |
\n
| bottom | number | 是 | 安全区域底部插入位置 |
\n
"
,
"compatibility"
:
"### 兼容性
\n\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
[getWindowInfo](http://uniapp.dcloud.io/api/system/getWindowInfo.html)
\n
"
},
"getSystemSetting"
:{
"name"
:
"## uni.getSystemSetting() @getsystemsetting"
,
"description"
:
"获取系统设置"
,
"param"
:
""
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :-|
\n
| [GetSystemSettingResult](#getsystemsettingresult) |
\n\n
#### GetSystemSettingResult
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| bluetoothEnabled | boolean | 否 | 蓝牙是否开启 |
\n
| bluetoothError | string | 否 | 蓝牙的报错信息 |
\n
| locationEnabled | boolean | 否 | 位置是否开启 |
\n
| wifiEnabled | boolean | 否 | wifi是否开启 |
\n
| wifiError | string | 否 | wifi的报错信息 |
\n
| deviceOrientation | string | 否 | 设备方向 |
\n
"
,
"compatibility"
:
"### 兼容性
\n\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
[getSystemSetting](https://uniapp.dcloud.net.cn/api/system/getsystemsetting.html)
\n
"
},
"chooseImage"
:{
"name"
:
"## uni.chooseImage(options) @chooseimage"
,
"description"
:
"从本地相册选择图片或使用相机拍照"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [ChooseImageOptions](#chooseimageoptions) | 是 | - |
\n
#### ChooseImageOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| count | number | 否 | 最多可以选择的图片张数,默认9 |
\n
| sizeType | Array
\\
<string
\\
> | 否 | original 原图,compressed 压缩图,默认二者都有 |
\n
| sourceType | Array
\\
<string
\\
> | 否 | album 从相册选图,camera 使用相机,默认二者都有 |
\n
| extension | Array
\\
<string
\\
> | 否 | 根据文件拓展名过滤,每一项都不能是空字符串。默认不过滤。 |
\n
| crop | [ChooseImageCropOptions](#chooseimagecropoptions) | 否 | 图像裁剪参数,设置后 sizeType 失效。 |
\n
| success | ([ChooseImageSuccessCallback](#chooseimagesuccesscallback)) => void | 否 | 成功则返回图片的本地文件路径列表 tempFilePaths |
\n
| fail | ([ChooseImageFailCallback](#chooseimagefailcallback)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### ChooseImageCropOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| width | number | 是 | 裁剪的宽度,单位为px,用于计算裁剪宽高比。 |
\n
| height | number | 是 | 裁剪的高度,单位为px,用于计算裁剪宽高比。 |
\n
| quality | number | 否 | 取值范围为1-100,数值越小,质量越低(仅对jpg格式有效)。默认值为80。 |
\n
| resize | boolean | 否 | 是否将width和height作为裁剪保存图片真实的像素值。默认值为true。注:设置为false时在裁剪编辑界面显示图片的像素值,设置为true时不显示。 |
\n
| saveToAlbum | boolean | 否 | 是否将裁剪的图片保存到手机相册里,默认值为false。 |
\n\n
##### ChooseImageSuccessCallback
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errSubject | string | 是 | 调用API的名称 |
\n
| errMsg | string | 是 | - |
\n
| tempFilePaths | Array
\\
<string
\\
> | 是 | - |
\n
| tempFiles | any | 是 | - |
\n\n
##### ChooseImageFailCallback
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errCode | number | 是 | 错误码 |
\n
| errSubject | string | 是 | 调用API的名称 |
\n
| errMsg | string | 是 | 错误的详细信息 |
\n
| cause | any | 否 | 错误来源 |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
"
},
"previewImage"
:{
"name"
:
"## uni.previewImage(options) @previewimage"
,
"description"
:
"预览图片"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [PreviewImageOptions](#previewimageoptions) | 是 | - |
\n
#### 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 | ([PreviewImageSuccessCallback](#previewimagesuccesscallback)) => void | 否 | 接口调用成功的回调函数 |
\n
| fail | ([PreviewImageFailCallback](#previewimagefailcallback)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### LongPressActionsOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| itemList | Array
\\
<string
\\
> | 是 | 按钮的文字数组 |
\n
| itemColor | string | 否 | 按钮的文字颜色,字符串格式,默认为
\"
#000000
\"
|
\n
| success | ([LongPressActionsSuccessData](#longpressactionssuccessdata)) => void | 否 | 接口调用成功的回调函数 |
\n
| fail | (any) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
###### LongPressActionsSuccessData
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| tapIndex | number | 是 | 接口调用失败的回调函数 |
\n
| index | number | 是 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### PreviewImageSuccessCallback
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errSubject | string | 是 | - |
\n
| errMsg | string | 是 | - |
\n\n
##### PreviewImageFailCallback
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errCode | number | 是 | 错误码 |
\n
| errSubject | string | 是 | 调用API的名称 |
\n
| errMsg | string | 是 | 错误的详细信息 |
\n
| cause | any | 否 | 错误来源 |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
"
},
"closePreviewImage"
:{
"name"
:
"## uni.closePreviewImage(options) @closepreviewimage"
,
"description"
:
"关闭图片预览"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [ClosePreviewImageOptions](#closepreviewimageoptions) | 是 | - |
\n
#### ClosePreviewImageOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| success | ([ClosePreviewImageSuccessCallback](#closepreviewimagesuccesscallback)) => void | 否 | 接口调用成功的回调函数 |
\n
| fail | ([ClosePreviewImageFailCallback](#closepreviewimagefailcallback)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### ClosePreviewImageSuccessCallback
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errMsg | string | 是 | 错误信息 |
\n\n
##### ClosePreviewImageFailCallback
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errCode | number | 是 | 错误码 |
\n
| errSubject | string | 是 | 调用API的名称 |
\n
| errMsg | string | 是 | 错误的详细信息 |
\n
| cause | any | 否 | 错误来源 |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
[closePreviewImage](http://uniapp.dcloud.io/api/media/image?id=closepreviewimage)
\n
"
},
"getImageInfo"
:{
"name"
:
"## uni.getImageInfo(options) @getimageinfo"
,
"description"
:
"获取图片信息"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [GetImageInfoOptions](#getimageinfooptions) | 是 | - |
\n
#### GetImageInfoOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| src | string | 是 | 图片的路径,可以是相对路径,临时文件路径,存储文件路径,网络图片路径 |
\n
| success | ([GetImageInfoSuccessCallback](#getimageinfosuccesscallback)) => void | 否 | 接口调用成功的回调函数 |
\n
| fail | ([GetImageInfoFailCallback](#getimageinfofailcallback)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### GetImageInfoSuccessCallback
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| width | number | 是 | 图片宽度,单位px |
\n
| height | number | 是 | 图片高度,单位px |
\n
| path | string | 是 | 返回图片的本地路径 |
\n
| orientation | string | 否 | 返回图片的方向 |
\n
| type | string | 否 | 返回图片的格式 |
\n\n
##### GetImageInfoFailCallback
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errCode | number | 是 | 错误码 |
\n
| errSubject | string | 是 | 调用API的名称 |
\n
| errMsg | string | 是 | 错误的详细信息 |
\n
| cause | any | 否 | 错误来源 |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
[getImageInfo](http://uniapp.dcloud.io/api/media/image?id=getimageinfo)
\n
"
},
"saveImageToPhotosAlbum"
:{
"name"
:
"## uni.saveImageToPhotosAlbum(options) @saveimagetophotosalbum"
,
"description"
:
"保存图片到系统相册"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [SaveImageToPhotosAlbumOptions](#saveimagetophotosalbumoptions) | 是 | - |
\n
#### SaveImageToPhotosAlbumOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| filePath | string | 是 | 图片文件路径,可以是临时文件路径也可以是永久文件路径,不支持网络图片路径 |
\n
| success | ([SaveImageToPhotosAlbumSuccessCallback](#saveimagetophotosalbumsuccesscallback)) => void | 否 | 接口调用成功的回调函数 |
\n
| fail | ([GetImageInfoFailCallback](#getimageinfofailcallback)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### SaveImageToPhotosAlbumSuccessCallback
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| path | string | 是 | 保存到相册的图片路径 |
\n\n
##### GetImageInfoFailCallback
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errCode | number | 是 | 错误码 |
\n
| errSubject | string | 是 | 调用API的名称 |
\n
| errMsg | string | 是 | 错误的详细信息 |
\n
| cause | any | 否 | 错误来源 |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
[saveImageToPhotosAlbum](http://uniapp.dcloud.io/api/media/image?id=saveimagetophotosalbum)
\n
"
},
"compressImage"
:{
"name"
:
"## uni.compressImage(options) @compressimage"
,
"description"
:
"压缩图片"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [CompressImageOptions](#compressimageoptions) | 是 | - |
\n
#### CompressImageOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| src | string | 是 | 图片路径,图片的路径,可以是相对路径、临时文件路径、存储文件路径 |
\n
| quality | number | 否 | 压缩质量,范围0~100,数值越小,质量越低,压缩率越高(仅对jpg有效) |
\n
| rotate | number | 否 | 旋转度数,范围0~360 |
\n
| width | string | 否 | 缩放图片的宽度 |
\n
| height | string | 否 | 缩放图片的高度 |
\n
| compressedHeight | number | 否 | 压缩后图片的高度,单位为px,若不填写则默认以compressedWidth为准等比缩放 |
\n
| compressedWidth | number | 否 | 压缩后图片的宽度,单位为px,若不填写则默认以compressedHeight为准等比缩放。 |
\n
| success | ([CompressImageSuccessCallback](#compressimagesuccesscallback)) => void | 否 | 接口调用成功的回调函数 |
\n
| fail | ([GetImageInfoFailCallback](#getimageinfofailcallback)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### CompressImageSuccessCallback
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| tempFilePath | string | 是 | 压缩后图片的临时文件路径 |
\n\n
##### GetImageInfoFailCallback
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errCode | number | 是 | 错误码 |
\n
| errSubject | string | 是 | 调用API的名称 |
\n
| errMsg | string | 是 | 错误的详细信息 |
\n
| cause | any | 否 | 错误来源 |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
[compressImage](http://uniapp.dcloud.io/api/media/image?id=compressimage)
\n
"
},
"chooseVideo"
:{
"name"
:
"## uni.chooseVideo(options) @choosevideo"
,
"description"
:
"拍摄视频或从手机相册中选视频,返回视频的临时文件路径。"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [ChooseVideoOptions](#choosevideooptions) | 是 | - |
\n
#### ChooseVideoOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| sourceType | Array
\\
<string
\\
> | 否 | album 从相册选视频,camera 使用相机拍摄,默认为:
\\
['album', 'camera'
\\
] |
\n
| compressed | boolean | 否 | 是否压缩所选的视频源文件,默认值为true,需要压缩 |
\n
| maxDuration | number | 否 | 拍摄视频最长拍摄时间,单位秒。最长支持 60 秒 |
\n
| camera | string | 否 | 摄像切换 - front: 前置摄像头 - back: 后置摄像头 |
\n
| extension | Array
\\
<string
\\
> | 否 | 根据文件拓展名过滤,每一项都不能是空字符串。默认不过滤。 |
\n
| success | ([ChooseVideoSuccessCallback](#choosevideosuccesscallback)) => void | 否 | 接口调用成功,返回视频文件的临时文件路径,详见返回参数说明 |
\n
| fail | ([ChooseImageFailCallback](#chooseimagefailcallback)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### ChooseVideoSuccessCallback
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| tempFilePath | string | 是 | 选定视频的临时文件路径 |
\n
| duration | number | 是 | 选定的视频文件,仅H5支持 |
\n
| size | number | 是 | 选定视频的数据量大小 |
\n
| height | number | 是 | 返回选定视频的长 |
\n
| width | number | 是 | 返回选定视频的宽 |
\n
| name | string | 否 | 包含扩展名的文件名称(仅H5支持) |
\n\n
##### ChooseImageFailCallback
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errCode | number | 是 | 错误码 |
\n
| errSubject | string | 是 | 调用API的名称 |
\n
| errMsg | string | 是 | 错误的详细信息 |
\n
| cause | any | 否 | 错误来源 |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
[chooseVideo](http://uniapp.dcloud.io/api/media/video?id=choosevideo)
\n
"
},
"getVideoInfo"
:{
"name"
:
"## uni.getVideoInfo(options) @getvideoinfo"
,
"description"
:
"获取视频详细信息"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [GetVideoInfoOptions](#getvideoinfooptions) | 是 | - |
\n
#### GetVideoInfoOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| src | string | 是 | 视频文件路径,可以是临时文件路径也可以是永久文件路径 |
\n
| success | ([GetVideoInfoSuccessCallback](#getvideoinfosuccesscallback)) => void | 否 | 接口调用成功的回调函数 |
\n
| fail | ([ChooseImageFailCallback](#chooseimagefailcallback)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### GetVideoInfoSuccessCallback
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| orientation | string | 否 | 画面方向 |
\n
| type | string | 否 | 视频格式 |
\n
| duration | number | 是 | 视频长度 |
\n
| size | number | 是 | 视频大小,单位 kB |
\n
| height | number | 是 | 视频的长,单位 px |
\n
| width | number | 是 | 视频的宽,单位 px |
\n
| fps | number | 否 | 视频帧率 |
\n
| bitrate | number | 否 | 视频码率,单位 kbps |
\n\n
##### ChooseImageFailCallback
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errCode | number | 是 | 错误码 |
\n
| errSubject | string | 是 | 调用API的名称 |
\n
| errMsg | string | 是 | 错误的详细信息 |
\n
| cause | any | 否 | 错误来源 |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
[getVideoInfo](http://uniapp.dcloud.io/api/media/video?id=getvideoinfo)
\n
"
},
"saveVideoToPhotosAlbum"
:{
"name"
:
"## uni.saveVideoToPhotosAlbum(options) @savevideotophotosalbum"
,
"description"
:
"保存视频到系统相册"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [SaveVideoToPhotosAlbumOptions](#savevideotophotosalbumoptions) | 是 | - |
\n
#### SaveVideoToPhotosAlbumOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| filePath | string | 是 | 视频文件路径,可以是临时文件路径也可以是永久文件路径 |
\n
| success | ([SaveVideoToPhotosAlbumSuccessCallback](#savevideotophotosalbumsuccesscallback)) => void | 否 | 接口调用成功的回调函数 |
\n
| fail | ([ChooseImageFailCallback](#chooseimagefailcallback)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### ChooseImageFailCallback
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errCode | number | 是 | 错误码 |
\n
| errSubject | string | 是 | 调用API的名称 |
\n
| errMsg | string | 是 | 错误的详细信息 |
\n
| cause | any | 否 | 错误来源 |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
[saveVideoToPhotosAlbum](http://uniapp.dcloud.io/api/media/video?id=savevideotophotosalbum)
\n
"
},
"compressVideo"
:{
"name"
:
"## uni.compressVideo(options) @compressvideo"
,
"description"
:
"压缩视频"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [CompressVideoOptions](#compressvideooptions) | 是 | - |
\n
#### CompressVideoOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| src | string | 是 | 视频文件路径,可以是临时文件路径也可以是永久文件路径 |
\n
| quality | string | 否 | 压缩质量 - low: 低 - medium: 中 - high: 高 |
\n
| bitrate | number | 否 | 码率,单位 kbps |
\n
| fps | number | 否 | 帧率 |
\n
| resolution | number | 否 | 相对于原视频的分辨率比例,取值范围(0, 1
\\
] |
\n
| success | ([CompressVideoSuccessCallback](#compressvideosuccesscallback)) => void | 否 | 接口调用成功的回调函数 |
\n
| fail | ([ChooseImageFailCallback](#chooseimagefailcallback)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### CompressVideoSuccessCallback
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| tempFilePath | string | 是 | 压缩后的临时文件地址 |
\n
| size | number | 是 | 压缩后的大小,单位 kB |
\n\n
##### ChooseImageFailCallback
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errCode | number | 是 | 错误码 |
\n
| errSubject | string | 是 | 调用API的名称 |
\n
| errMsg | string | 是 | 错误的详细信息 |
\n
| cause | any | 否 | 错误来源 |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
[compressVideo](http://uniapp.dcloud.io/api/media/video?id=compressvideo)
\n
"
},
"uploadFile"
:{
"name"
:
"## uni.uploadFile(options) @uploadfile"
,
"description"
:
"将本地资源上传到开发者服务器。"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [UploadFileOptions](#uploadfileoptions) | 是 | - |
\n
#### UploadFileOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| url | string | 是 | 开发者服务器 url |
\n
| filePath | string | 否 | 要上传文件资源的路径 |
\n
| name | string | 否 | 文件对应的 key , 开发者在服务器端通过这个 key 可以获取到文件二进制内容 |
\n
| files | Array
\\
<[UploadFileOptionFiles](#uploadfileoptionfiles)
\\
> | 否 | 需要上传的文件列表。 |
\n
| header | any | 否 | HTTP 请求 Header, header 中不能设置 Referer |
\n
| formData | any | 否 | HTTP 请求中其他额外的 form data |
\n
| timeout | number | 否 | 超时时间,单位 ms |
\n
| success | ([UploadFileSuccess](#uploadfilesuccess)) => void | 否 | 成功返回的回调函数 |
\n
| fail | ([UploadFileFail](#uploadfilefail)) => void | 否 | 失败的回调函数 |
\n
| complete | (any) => void | 否 | 结束的回调函数(调用成功、失败都会执行) |
\n\n
##### UploadFileOptionFiles
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| name | string | 否 | multipart 提交时,表单的项目名,默认为 file,如果 name 不填或填的值相同,可能导致服务端读取文件时只能读取到一个文件。 |
\n
| uri | string | 是 | 要上传文件资源的路径 |
\n
| file | any | 否 | 要上传的文件对象,仅H5(2.6.15+)支持 |
\n\n
##### UploadFileSuccess
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| data | string | 是 | 开发者服务器返回的数据 |
\n
| statusCode | number | 是 | 开发者服务器返回的 HTTP 状态码 |
\n\n
##### UploadFileFail
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errMsg | string | 是 | 错误信息 |
\n
| errCode | number | 是 | 错误码 |
\n
| errSubject | string | 是 | 调用API的名称 |
\n
| cause | any | 否 | 错误来源 |
\n
"
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :-|
\n
| [UploadTask](#uploadtask) |
\n\n
#### UploadTask
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| abort | () => void | 是 | 中断上传任务。 |
\n
| onProgressUpdate | (([OnProgressUpdateResult](#onprogressupdateresult)) => void) => void | 是 | 监听上传进度变化。 |
\n\n
##### OnProgressUpdateResult
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| progress | number | 是 | 上传进度百分比 |
\n
| totalBytesSent | number | 是 | 已经上传的数据长度,单位 Bytes |
\n
| totalBytesExpectedToSend | number | 是 | 预期需要上传的数据总长度,单位 Bytes |
\n
"
,
"compatibility"
:
"### 兼容性
\n\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
[uploadFile](https://uniapp.dcloud.net.cn/api/request/network-file.html#uploadfile)
\n
"
},
"downloadFile"
:{
"name"
:
"## uni.downloadFile(options) @downloadfile"
,
"description"
:
"下载文件资源到本地,客户端直接发起一个 HTTP GET 请求,返回文件的本地临时路径。"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [DownloadFileOptions](#downloadfileoptions) | 是 | - |
\n
#### DownloadFileOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| url | string | 是 | 下载资源的 url |
\n
| header | any | 否 | HTTP 请求 Header,header 中不能设置 Referer |
\n
| timeout | number | 否 | 超时时间,单位 ms |
\n
| success | ([DownloadFileSuccess](#downloadfilesuccess)) => void | 否 | 下载成功后以 tempFilePath 的形式传给页面,res = {tempFilePath: '文件的临时路径'} |
\n
| fail | ([DownloadFileFail](#downloadfilefail)) => void | 否 | 失败的回调函数 |
\n
| complete | (any) => void | 否 | 结束的回调函数(调用成功、失败都会执行) |
\n\n
##### DownloadFileSuccess
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| tempFilePath | string | 是 | 临时文件路径,下载后的文件会存储到一个临时文件 |
\n
| statusCode | number | 是 | 开发者服务器返回的 HTTP 状态码 |
\n\n
##### DownloadFileFail
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errSubject | string | 是 | - |
\n
| errCode | number | 是 | - |
\n
| errMsg | string | 是 | - |
\n
| data | any | 否 | - |
\n
| cause | any | 否 | - |
\n
"
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :-|
\n
| [DownloadTask](#downloadtask) |
\n\n
#### DownloadTask
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| abort | () => void | 是 | 中断下载任务。 |
\n
| onProgressUpdate | (([OnProgressDownloadResult](#onprogressdownloadresult)) => void) => void | 是 | 监听下载进度变化。 |
\n\n
##### OnProgressDownloadResult
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| progress | number | 是 | 下载进度百分比 |
\n
| totalBytesWritten | number | 是 | 已经下载的数据长度,单位 Bytes |
\n
| totalBytesExpectedToWrite | number | 是 | 预期需要下载的数据总长度,单位 Bytes |
\n
"
,
"compatibility"
:
"### 兼容性
\n\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
[downloadFile](https://uniapp.dcloud.net.cn/api/request/network-file.html#downloadfile)
\n
"
},
"openAppAuthorizeSetting"
:{
"name"
:
"## uni.openAppAuthorizeSetting(options) @openappauthorizesetting"
,
"description"
:
"跳转系统授权管理页"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [OpenAppAuthorizeSettingOptions](#openappauthorizesettingoptions) | 是 | - |
\n
#### OpenAppAuthorizeSettingOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| success | ([OpenAppAuthorizeSettingSuccess](#openappauthorizesettingsuccess)) => void | 否 | 接口调用成功的回调函数 |
\n
| fail | ([OpenAppAuthorizeSettingFail](#openappauthorizesettingfail)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | ([OpenAppAuthorizeSettingComplete](#openappauthorizesettingcomplete)) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### OpenAppAuthorizeSettingSuccess
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errMsg | string | 是 | 错误信息 |
\n\n
##### OpenAppAuthorizeSettingFail
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errMsg | string | 是 | 错误信息 |
\n\n
##### OpenAppAuthorizeSettingComplete
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errMsg | string | 是 | 错误信息 |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
[openAppAuthorizeSetting](http://uniapp.dcloud.io/api/system/openappauthorizesetting)
\n
"
},
"showToast"
:{
"name"
:
"## uni.showToast(options) @showtoast"
,
"description"
:
"
\r\n
uni.showToast函数定义
\r\n
弹出toast
\r\n
"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [ShowToastOptions](#showtoastoptions) | 是 | uni.showToast参数定义 |
\n
#### 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 | ([ShowToastSuccess](#showtoastsuccess)) => void | 否 | 接口调用成功的回调函数 |
\n
| fail | ([ShowToastFail](#showtoastfail)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### ShowToastFail
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errCode | number | 是 | 错误码 0:成功 1001:title is null |
\n
| errSubject | string | 是 | 调用API的名称 |
\n
| errMsg | string | 是 | 错误的详细信息 |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
""
,
"tutorial"
:
"
\n
### 参见
\n
[showToast](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showtoast)
\n
"
},
"hideToast"
:{
"name"
:
"## uni.hideToast() @hidetoast"
,
"description"
:
"
\r\n
uni.hideToast函数定义
\r\n
隐藏toast
\r\n
"
,
"param"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
""
,
"tutorial"
:
"
\n
### 参见
\n
[hideToast](https://uniapp.dcloud.net.cn/api/ui/prompt.html#hidetoast)
\n
"
},
"showLoading"
:{
"name"
:
"## uni.showLoading(options) @showloading"
,
"description"
:
"
\r\n
uni.showLoading函数定义
\r\n
弹出loading
\r\n
"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [ShowLoadingOptions](#showloadingoptions) | 是 | uni.showLoading参数定义 |
\n
#### ShowLoadingOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| title | string | 是 | 提示的内容,长度与 icon 取值有关。 |
\n
| mask | boolean | 否 | 是否显示透明蒙层,防止触摸穿透,默认:false |
\n
| success | ([ShowLoadingSuccess](#showloadingsuccess)) => void | 否 | 接口调用成功的回调函数 |
\n
| fail | ([ShowLoadingFail](#showloadingfail)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### ShowLoadingFail
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errCode | number | 是 | 错误码 0:成功 1001:title is null |
\n
| errSubject | string | 是 | 调用API的名称 |
\n
| errMsg | string | 是 | 错误的详细信息 |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
""
,
"tutorial"
:
"
\n
### 参见
\n
[showLoading](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showloading)
\n
"
},
"hideLoading"
:{
"name"
:
"## uni.hideLoading() @hideloading"
,
"description"
:
"
\r\n
uni.hideLoading函数定义
\r\n
隐藏loading
\r\n
"
,
"param"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
""
,
"tutorial"
:
"
\n
### 参见
\n
[hideLoading](https://uniapp.dcloud.net.cn/api/ui/prompt.html#hideloading)
\n
"
},
"showModal"
:{
"name"
:
"## uni.showModal(options) @showmodal"
,
"description"
:
"
\r\n
uni.showModal 函数定义
\r\n\r\n
弹出modal
\r\n
"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [ShowModalOptions](#showmodaloptions) | 是 | uni.showModal 参数定义 |
\n
#### ShowModalOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| title | string | 否 | 提示的标题 |
\n
| content | string | 否 | 提示的内容 |
\n
| showCancel | boolean | 否 | |
\n
| cancelText | string | 否 | 取消按钮的文字,默认为
\"
取消
\"
|
\n
| cancelColor | string | 否 | 取消按钮的文字颜色,默认为
\"
#000000
\"
|
\n
| confirmText | string | 否 | 确定按钮的文字,默认为
\"
确定
\"
|
\n
| confirmColor | string | 否 | 确定按钮的文字颜色 |
\n
| editable | boolean | 否 | |
\n
| placeholderText | string | 否 | 显示输入框时的提示文本 |
\n
| success | ([ShowModalSuccess](#showmodalsuccess)) => void | 否 | 接口调用成功的回调函数 |
\n
| fail | ([ShowModalFail](#showmodalfail)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### ShowModalSuccess
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| confirm | boolean | 是 | 为 true 时,表示用户点击了确定按钮 |
\n
| cancel | boolean | 是 | 为 true 时,表示用户点击了取消(用于 Android 系统区分点击蒙层关闭还是点击取消按钮关闭) |
\n
| content | string | 否 | editable 为 true 时,用户输入的文本 |
\n\n
##### ShowModalFail
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errCode | number | 是 | 错误码 0:成功 |
\n
| errSubject | string | 是 | 调用API的名称 |
\n
| errMsg | string | 是 | 错误的详细信息 |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
""
,
"tutorial"
:
"
\n
### 参见
\n
[showModal](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showmodal)
\n
"
},
"showActionSheet"
:{
"name"
:
"## uni.showActionSheet(options) @showactionsheet"
,
"description"
:
"
\r\n
uni.showActionSheet函数定义
\r\n\r\n
弹出actionSheet
\r\n
"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [ShowActionSheetOptions](#showactionsheetoptions) | 是 | uni.showActionSheet函数参数定义 |
\n
#### 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 | ([ShowActionSheetSuccess](#showactionsheetsuccess)) => void | 否 | 接口调用成功的回调函数 |
\n
| fail | ([ShowActionSheetFail](#showactionsheetfail)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### Popover
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| top | number | 是 | 指示区域坐标,使用原生 navigationBar 时一般需要加上 navigationBar 的高度 |
\n
| left | number | 是 | 指示区域坐标 |
\n
| width | number | 是 | 指示区域宽度 |
\n
| height | number | 是 | 指示区域高度 |
\n\n
##### ShowActionSheetSuccess
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| tapIndex | number | 否 | 用户点击的按钮,从上到下的顺序,从0开始 |
\n\n
##### ShowActionSheetFail
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errCode | number | 是 | 错误码 0:成功 1001:parameter.itemList should have at least 1 item 1002:cancel |
\n
| errSubject | string | 是 | 调用API的名称 |
\n
| errMsg | string | 是 | 错误的详细信息 |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
""
,
"tutorial"
:
"
\n
### 参见
\n
[showActionSheet](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showactionsheet)
\n
"
},
"setStorage"
:{
"name"
:
"## uni.setStorage(options) @setstorage"
,
"description"
:
"
\r\n
uni.setStorage函数定义
\r\n
将数据存储在本地缓存中指定的 key 中,会覆盖掉原来该 key 对应的内容,这是一个异步接口。
\r\n
"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [SetStorageOptions](#setstorageoptions) | 是 | uni.setStorage参数定义 |
\n
#### SetStorageOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| key | string | 是 | 本地缓存中的指定的 key |
\n
| data | any | 是 | 需要存储的内容,只支持原生类型、及能够通过 JSON.stringify 序列化的对象 |
\n
| success | ([SetStorageSuccess](#setstoragesuccess)) => void | 否 | 接口调用成功的回调函数 |
\n
| fail | ([SetStorageFail](#setstoragefail)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### SetStorageFail
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errCode | number | 是 | 错误码 |
\n
| errSubject | string | 是 | 调用API的名称 |
\n
| errMsg | string | 是 | 错误的详细信息 |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
[setStorage](https://uniapp.dcloud.net.cn/api/storage/storage.html#setstorage)
\n
"
},
"setStorageSync"
:{
"name"
:
"## uni.setStorageSync(key, data) @setstoragesync"
,
"description"
:
"
\r\n
uni.setStorageSync函数定义
\r\n
将 data 存储在本地缓存中指定的 key 中,会覆盖掉原来该 key 对应的内容,这是一个同步接口。
\r\n
"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| key | string | 是 | 本地缓存中的指定的 key |
\n
| data | any | 是 | 需要存储的内容,只支持原生类型、及能够通过 JSON.stringify 序列化的对象 |"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
[setStorageSync](https://uniapp.dcloud.net.cn/api/storage/storage.html#setstoragesync)
\n
"
},
"getStorage"
:{
"name"
:
"## uni.getStorage(options) @getstorage"
,
"description"
:
"
\r\n
uni.getStorage函数定义
\r\n
从本地缓存中异步获取指定 key 对应的内容。
\r\n
"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [GetStorageOptions](#getstorageoptions) | 是 | uni.getStorage参数定义 |
\n
#### GetStorageOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| key | string | 是 | 本地缓存中的指定的 key |
\n
| success | ([GetStorageSuccess](#getstoragesuccess)) => void | 否 | 接口调用成功的回调函数 |
\n
| fail | ([GetStorageFail](#getstoragefail)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### GetStorageSuccess
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| data | any | 否 | key 对应的内容 |
\n\n
##### GetStorageFail
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errCode | number | 是 | 错误码 |
\n
| errSubject | string | 是 | 调用API的名称 |
\n
| errMsg | string | 是 | 错误的详细信息 |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
"
},
"getStorageSync"
:{
"name"
:
"## uni.getStorageSync(key) @getstoragesync"
,
"description"
:
"
\r\n
uni.getStorageSync函数定义
\r\n
从本地缓存中同步获取指定 key 对应的内容。
\r\n
"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| key | string | 是 | 本地缓存中的指定的 key |"
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :-|
\n
| any |
\n
"
,
"compatibility"
:
"### 兼容性
\n\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
[getStorageSync](https://uniapp.dcloud.net.cn/api/storage/storage.html#getstoragesync)
\n
"
},
"getStorageInfo"
:{
"name"
:
"## uni.getStorageInfo(options) @getstorageinfo"
,
"description"
:
"
\r\n
uni.getStorageInfo函数定义
\r\n
异步获取当前 storage 的相关信息。
\r\n
"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [GetStorageInfoOptions](#getstorageinfooptions) | 是 | uni.getStorageInfo参数定义 |
\n
#### GetStorageInfoOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| success | ([GetStorageInfoSuccess](#getstorageinfosuccess)) => void | 否 | 接口调用成功的回调函数 |
\n
| fail | ([GetStorageInfoFail](#getstorageinfofail)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### GetStorageInfoSuccess
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| keys | Array
\\
<string
\\
> | 是 | 当前 storage 中所有的 key |
\n
| currentSize | number | 是 | 当前占用的空间大小, 单位:kb |
\n
| limitSize | number | 是 | 限制的空间大小, 单位:kb |
\n\n
##### GetStorageInfoFail
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errCode | number | 是 | 错误码 |
\n
| errSubject | string | 是 | 调用API的名称 |
\n
| errMsg | string | 是 | 错误的详细信息 |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
"
},
"getStorageInfoSync"
:{
"name"
:
"## uni.getStorageInfoSync() @getstorageinfosync"
,
"description"
:
"
\r\n
uni.getStorageInfoSync函数定义
\r\n
同步获取当前 storage 的相关信息。
\r\n\r\n
"
,
"param"
:
""
,
"returnValue"
:
"### 返回值
\n\n
| 类型 | 描述 |
\n
| :-| :-|
\n
| [GetStorageInfoSuccess](#getstorageinfosuccess) |
\r\n
uni.getStorageInfo成功回调参数 |
\n\n
#### GetStorageInfoSuccess
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| keys | Array
\\
<string
\\
> | 是 | 当前 storage 中所有的 key |
\n
| currentSize | number | 是 | 当前占用的空间大小, 单位:kb |
\n
| limitSize | number | 是 | 限制的空间大小, 单位:kb |
\n
"
,
"compatibility"
:
"### 兼容性
\n\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
"
},
"removeStorage"
:{
"name"
:
"## uni.removeStorage(options) @removestorage"
,
"description"
:
"
\r\n
uni.removeStorage函数定义
\r\n
从本地缓存中异步移除指定 key。
\r\n
"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [RemoveStorageOptions](#removestorageoptions) | 是 | uni.removeStorage参数定义 |
\n
#### RemoveStorageOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| key | string | 是 | 本地缓存中的指定的 key |
\n
| success | ([RemoveStorageSuccess](#removestoragesuccess)) => void | 否 | 接口调用的回调函数 |
\n
| fail | ([RemoveStorageFail](#removestoragefail)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### RemoveStorageFail
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errCode | number | 是 | 错误码 |
\n
| errSubject | string | 是 | 调用API的名称 |
\n
| errMsg | string | 是 | 错误的详细信息 |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
[removeStorage](hhttps://uniapp.dcloud.net.cn/api/storage/storage.html#removestorage)
\n
"
},
"removeStorageSync"
:{
"name"
:
"## uni.removeStorageSync(key) @removestoragesync"
,
"description"
:
"
\r\n
uni.removeStorageSync函数定义
\r\n
从本地缓存中同步移除指定 key。
\r\n
"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| key | string | 是 | 本地缓存中的指定的 key |"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
[removeStorageSync](https://uniapp.dcloud.net.cn/api/storage/storage.html#removestoragesync)
\n
"
},
"clearStorage"
:{
"name"
:
"## uni.clearStorage(option?) @clearstorage"
,
"description"
:
"
\r\n
uni.clearStorage函数定义
\r\n
清理本地数据缓存。
\r\n
"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| option | [ClearStorageOptions](#clearstorageoptions) | 否 | - |
\n
#### ClearStorageOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| success | ([ClearStorageSuccess](#clearstoragesuccess)) => void | 否 | 接口调用的回调函数 |
\n
| fail | ([ClearStorageFail](#clearstoragefail)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### ClearStorageFail
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errCode | number | 是 | 错误码 |
\n
| errSubject | string | 是 | 调用API的名称 |
\n
| errMsg | string | 是 | 错误的详细信息 |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
[clearStorage](https://uniapp.dcloud.net.cn/api/storage/storage.html#clearstorage)
\n
"
},
"clearStorageSync"
:{
"name"
:
"## uni.clearStorageSync() @clearstoragesync"
,
"description"
:
"
\r\n
uni.clearStorageSync函数定义
\r\n
清理本地数据缓存。
\r\n
"
,
"param"
:
""
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
[clearStorageSync](https://uniapp.dcloud.net.cn/api/storage/storage.html#clearstoragesync)
\n
"
},
"connectSocket"
:{
"name"
:
"## uni.connectSocket(options) @connectsocket"
,
"description"
:
"创建一个 WebSocket 连接。"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [ConnectSocketOptions](#connectsocketoptions) | 是 | - |
\n
#### ConnectSocketOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| url | string | 是 | 开发者服务器接口地址,必须是 wss 协议,且域名必须是后台配置的合法域名 |
\n
| header | any | 否 | HTTP 请求 Header,header 中不能设置 Referer |
\n
| protocols | Array
\\
<string
\\
> | 否 | 子协议数组 |
\n
| success | ([ConnectSocketSuccess](#connectsocketsuccess)) => void | 否 | 接口调用成功的回调函数 |
\n
| fail | ([UniError](#unierror)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | (any) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### ConnectSocketSuccess
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errMsg | string | 是 | - |
\n
"
,
"returnValue"
:
"### 返回值
\n\n
| 类型 |
\n
| :-|
\n
| [SocketTask](#sockettask) |
\n\n
#### SocketTask
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| send | ([SendSocketMessageOptions](#sendsocketmessageoptions)) => void | 是 | 通过 WebSocket 连接发送数据 |
\n
| close | ([CloseSocketOptions](#closesocketoptions)) => void | 是 | 关闭 WebSocket 连接 |
\n
| onOpen | (([OnSocketOpenCallbackResult](#onsocketopencallbackresult)) => void) => void | 是 | 监听 WebSocket 连接打开事件 |
\n
| onClose | ((any) => void) => void | 是 | 监听 WebSocket 连接关闭事件 |
\n
| onError | (([GeneralCallbackResult](#generalcallbackresult)) => void) => void | 是 | 监听 WebSocket 错误 |
\n
| onMessage | (([OnSocketMessageCallbackResult](#onsocketmessagecallbackresult)) => void) => void | 是 | 监听 WebSocket 接受到服务器的消息事件 |
\n\n
##### SendSocketMessageOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| data | any | 是 | 需要发送的内容 |
\n
| success | ([GeneralCallbackResult](#generalcallbackresult)) => void | 否 | 接口调用成功的回调函数 |
\n
| fail | ([GeneralCallbackResult](#generalcallbackresult)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | ([GeneralCallbackResult](#generalcallbackresult)) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### CloseSocketOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| code | number | 否 | 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。如果这个参数没有被指定,默认的取值是1000 (表示正常连接关闭) |
\n
| reason | string | 否 | 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于123字节的UTF-8 文本(不是字符) |
\n
| success | ([GeneralCallbackResult](#generalcallbackresult)) => void | 否 | 接口调用成功的回调函数 |
\n
| fail | ([GeneralCallbackResult](#generalcallbackresult)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | ([GeneralCallbackResult](#generalcallbackresult)) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n\n
##### OnSocketOpenCallbackResult
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| header | any | 是 | 连接成功的 HTTP 响应 Header |
\n\n
##### OnSocketMessageCallbackResult
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| data | any | 是 | 服务器返回的消息 |
\n
"
,
"compatibility"
:
"### 兼容性
\n\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
[connectSocket](https://uniapp.dcloud.net.cn/api/request/websocket.html#connectsocket)
\n
"
},
"onSocketOpen"
:{
"name"
:
"## uni.onSocketOpen(options) @onsocketopen"
,
"description"
:
"监听WebSocket连接打开事件。"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | ([OnSocketOpenCallbackResult](#onsocketopencallbackresult)) => void | 是 | - |
\n
#### OnSocketOpenCallbackResult
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| header | any | 是 | 连接成功的 HTTP 响应 Header |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
[onSocketOpen](https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketopen)
\n
"
},
"onSocketError"
:{
"name"
:
"## uni.onSocketError(callback) @onsocketerror"
,
"description"
:
"下载文件资源到本地,客户端直接发起一个 HTTP GET 请求,返回文件的本地临时路径。"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| callback | ([OnSocketErrorCallbackResult](#onsocketerrorcallbackresult)) => void | 是 | - |
\n
#### OnSocketErrorCallbackResult
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errMsg | string | 是 | 错误信息 |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
[onSocketError](https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketerror)
\n
"
},
"sendSocketMessage"
:{
"name"
:
"## uni.sendSocketMessage(options) @sendsocketmessage"
,
"description"
:
"通过 WebSocket 连接发送数据,需要先 uni.connectSocket,并在 uni.onSocketOpen 回调之后才能发送。"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [SendSocketMessageOptions](#sendsocketmessageoptions) | 是 | - |
\n
#### SendSocketMessageOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| data | any | 是 | 需要发送的内容 |
\n
| success | ([GeneralCallbackResult](#generalcallbackresult)) => void | 否 | 接口调用成功的回调函数 |
\n
| fail | ([GeneralCallbackResult](#generalcallbackresult)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | ([GeneralCallbackResult](#generalcallbackresult)) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
[sendSocketMessage](https://uniapp.dcloud.net.cn/api/request/websocket.html#sendsocketmessage)
\n
"
},
"onSocketMessage"
:{
"name"
:
"## uni.onSocketMessage(callback) @onsocketmessage"
,
"description"
:
"监听WebSocket接受到服务器的消息事件。"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| callback | ([OnSocketMessageCallbackResult](#onsocketmessagecallbackresult)) => void | 是 | - |
\n
#### OnSocketMessageCallbackResult
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| data | any | 是 | 服务器返回的消息 |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
[onSocketMessage](https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketmessage)
\n
"
},
"closeSocket"
:{
"name"
:
"## uni.closeSocket(options) @closesocket"
,
"description"
:
"关闭 WebSocket 连接。"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| options | [CloseSocketOptions](#closesocketoptions) | 是 | - |
\n
#### CloseSocketOptions
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| code | number | 否 | 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。如果这个参数没有被指定,默认的取值是1000 (表示正常连接关闭) |
\n
| reason | string | 否 | 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于123字节的UTF-8 文本(不是字符) |
\n
| success | ([GeneralCallbackResult](#generalcallbackresult)) => void | 否 | 接口调用成功的回调函数 |
\n
| fail | ([GeneralCallbackResult](#generalcallbackresult)) => void | 否 | 接口调用失败的回调函数 |
\n
| complete | ([GeneralCallbackResult](#generalcallbackresult)) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
[closeSocket](https://uniapp.dcloud.net.cn/api/request/websocket.html#closesocket)
\n
"
},
"onSocketClose"
:{
"name"
:
"## uni.onSocketClose(callback) @onsocketclose"
,
"description"
:
"监听WebSocket关闭。"
,
"param"
:
"### 参数
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| callback | ([OnSocketCloseCallbackResult](#onsocketclosecallbackresult)) => void | 是 | - |
\n
#### OnSocketCloseCallbackResult
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| code | number | 是 | 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。
\t
|
\n
| reason | string | 是 | 一个可读的字符串,表示连接被关闭的原因。
\t
|
\n
"
,
"returnValue"
:
""
,
"compatibility"
:
"### 兼容性
\n\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
[onSocketClose](https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketclose)
\n
"
},
"general_type"
:{
"name"
:
"## 通用类型
\n
"
,
"param"
:
"### UniError
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errSubject | string | 是 | - |
\n
| errCode | number | 是 | - |
\n
| errMsg | string | 是 | - |
\n
| data | any | 否 | - |
\n
| cause | any | 否 | - |
\n\n
### GeneralCallbackResult
\n\n
| 参数名 | 参数类型 | 是否必填 | 描述 |
\n
| :-| :-| :-| :-|
\n
| errMsg | string | 是 | 错误信息 |
\n
"
}}
\ No newline at end of file
docs/uni-app-x/_sidebar.md
浏览文件 @
16ec2f4e
...
...
@@ -89,6 +89,7 @@
*
[
text-decoration-thickness
](
css/text-decoration-thickness.md
)
*
[
visibility
](
css/visibility.md
)
*
[
lines
](
css/lines.md
)
*
[
API
](
api.md
)
*
[
事件
](
event.md
)
<!--
*
[
新建项目
](
)
*
[
1. 通过 HBuilderX 可视化界面
](
quickstart-hx.md
)
...
...
docs/uni-app-x/api.md
0 → 100644
浏览文件 @
16ec2f4e
## uni.createInnerAudioContext() @createinneraudiocontext
<!-- UTSAPIJSON.createInnerAudioContext.description -->
<!-- UTSAPIJSON.createInnerAudioContext.param -->
<!-- UTSAPIJSON.createInnerAudioContext.returnValue -->
<!-- UTSAPIJSON.createInnerAudioContext.compatibility -->
<!-- UTSAPIJSON.createInnerAudioContext.tutorial -->
## uni.getBackgroundAudioManager() @getbackgroundaudiomanager
<!-- UTSAPIJSON.getBackgroundAudioManager.description -->
<!-- UTSAPIJSON.getBackgroundAudioManager.param -->
<!-- UTSAPIJSON.getBackgroundAudioManager.returnValue -->
<!-- UTSAPIJSON.getBackgroundAudioManager.compatibility -->
<!-- UTSAPIJSON.getBackgroundAudioManager.tutorial -->
## uni.exitApp() @exitapp
<!-- UTSAPIJSON.exitApp.description -->
<!-- UTSAPIJSON.exitApp.param -->
<!-- UTSAPIJSON.exitApp.returnValue -->
<!-- UTSAPIJSON.exitApp.compatibility -->
<!-- UTSAPIJSON.exitApp.tutorial -->
## uni.getFileSystemManager() @getfilesystemmanager
<!-- UTSAPIJSON.getFileSystemManager.description -->
<!-- UTSAPIJSON.getFileSystemManager.param -->
<!-- UTSAPIJSON.getFileSystemManager.returnValue -->
<!-- UTSAPIJSON.getFileSystemManager.compatibility -->
<!-- UTSAPIJSON.getFileSystemManager.tutorial -->
## uni.getAccessibilityInfo() @getaccessibilityinfo
<!-- UTSAPIJSON.getAccessibilityInfo.description -->
<!-- UTSAPIJSON.getAccessibilityInfo.param -->
<!-- UTSAPIJSON.getAccessibilityInfo.returnValue -->
<!-- UTSAPIJSON.getAccessibilityInfo.compatibility -->
<!-- UTSAPIJSON.getAccessibilityInfo.tutorial -->
## uni.getAppAuthorizeSetting() @getappauthorizesetting
<!-- UTSAPIJSON.getAppAuthorizeSetting.description -->
<!-- UTSAPIJSON.getAppAuthorizeSetting.param -->
<!-- UTSAPIJSON.getAppAuthorizeSetting.returnValue -->
<!-- UTSAPIJSON.getAppAuthorizeSetting.compatibility -->
<!-- UTSAPIJSON.getAppAuthorizeSetting.tutorial -->
## uni.getAppBaseInfo(config?) @getappbaseinfo
<!-- UTSAPIJSON.getAppBaseInfo.description -->
<!-- UTSAPIJSON.getAppBaseInfo.param -->
<!-- UTSAPIJSON.getAppBaseInfo.returnValue -->
<!-- UTSAPIJSON.getAppBaseInfo.compatibility -->
<!-- UTSAPIJSON.getAppBaseInfo.tutorial -->
## uni.getDeviceInfo(config?) @getdeviceinfo
<!-- UTSAPIJSON.getDeviceInfo.description -->
<!-- UTSAPIJSON.getDeviceInfo.param -->
<!-- UTSAPIJSON.getDeviceInfo.returnValue -->
<!-- UTSAPIJSON.getDeviceInfo.compatibility -->
<!-- UTSAPIJSON.getDeviceInfo.tutorial -->
## uni.getLocation(options) @getlocation
<!-- UTSAPIJSON.getLocation.description -->
<!-- UTSAPIJSON.getLocation.param -->
<!-- UTSAPIJSON.getLocation.returnValue -->
<!-- UTSAPIJSON.getLocation.compatibility -->
<!-- UTSAPIJSON.getLocation.tutorial -->
## uni.getLocation(options) @getlocation
<!-- UTSAPIJSON.getLocation.description -->
<!-- UTSAPIJSON.getLocation.param -->
<!-- UTSAPIJSON.getLocation.returnValue -->
<!-- UTSAPIJSON.getLocation.compatibility -->
<!-- UTSAPIJSON.getLocation.tutorial -->
## uni.getNetworkType(options) @getnetworktype
<!-- UTSAPIJSON.getNetworkType.description -->
<!-- UTSAPIJSON.getNetworkType.param -->
<!-- UTSAPIJSON.getNetworkType.returnValue -->
<!-- UTSAPIJSON.getNetworkType.compatibility -->
<!-- UTSAPIJSON.getNetworkType.tutorial -->
## uni.getRecorderManager() @getrecordermanager
<!-- UTSAPIJSON.getRecorderManager.description -->
<!-- UTSAPIJSON.getRecorderManager.param -->
<!-- UTSAPIJSON.getRecorderManager.returnValue -->
<!-- UTSAPIJSON.getRecorderManager.compatibility -->
<!-- UTSAPIJSON.getRecorderManager.tutorial -->
## uni.getSystemInfo(options) @getsysteminfo
<!-- UTSAPIJSON.getSystemInfo.description -->
<!-- UTSAPIJSON.getSystemInfo.param -->
<!-- UTSAPIJSON.getSystemInfo.returnValue -->
<!-- UTSAPIJSON.getSystemInfo.compatibility -->
<!-- UTSAPIJSON.getSystemInfo.tutorial -->
## uni.getSystemInfoSync() @getsysteminfosync
<!-- UTSAPIJSON.getSystemInfoSync.description -->
<!-- UTSAPIJSON.getSystemInfoSync.param -->
<!-- UTSAPIJSON.getSystemInfoSync.returnValue -->
<!-- UTSAPIJSON.getSystemInfoSync.compatibility -->
<!-- UTSAPIJSON.getSystemInfoSync.tutorial -->
## uni.getWindowInfo() @getwindowinfo
<!-- UTSAPIJSON.getWindowInfo.description -->
<!-- UTSAPIJSON.getWindowInfo.param -->
<!-- UTSAPIJSON.getWindowInfo.returnValue -->
<!-- UTSAPIJSON.getWindowInfo.compatibility -->
<!-- UTSAPIJSON.getWindowInfo.tutorial -->
## uni.getSystemSetting() @getsystemsetting
<!-- UTSAPIJSON.getSystemSetting.description -->
<!-- UTSAPIJSON.getSystemSetting.param -->
<!-- UTSAPIJSON.getSystemSetting.returnValue -->
<!-- UTSAPIJSON.getSystemSetting.compatibility -->
<!-- UTSAPIJSON.getSystemSetting.tutorial -->
## uni.chooseImage(options) @chooseimage
<!-- UTSAPIJSON.chooseImage.description -->
<!-- UTSAPIJSON.chooseImage.param -->
<!-- UTSAPIJSON.chooseImage.returnValue -->
<!-- UTSAPIJSON.chooseImage.compatibility -->
<!-- UTSAPIJSON.chooseImage.tutorial -->
## uni.previewImage(options) @previewimage
<!-- UTSAPIJSON.previewImage.description -->
<!-- UTSAPIJSON.previewImage.param -->
<!-- UTSAPIJSON.previewImage.returnValue -->
<!-- UTSAPIJSON.previewImage.compatibility -->
<!-- UTSAPIJSON.previewImage.tutorial -->
## uni.closePreviewImage(options) @closepreviewimage
<!-- UTSAPIJSON.closePreviewImage.description -->
<!-- UTSAPIJSON.closePreviewImage.param -->
<!-- UTSAPIJSON.closePreviewImage.returnValue -->
<!-- UTSAPIJSON.closePreviewImage.compatibility -->
<!-- UTSAPIJSON.closePreviewImage.tutorial -->
## uni.getImageInfo(options) @getimageinfo
<!-- UTSAPIJSON.getImageInfo.description -->
<!-- UTSAPIJSON.getImageInfo.param -->
<!-- UTSAPIJSON.getImageInfo.returnValue -->
<!-- UTSAPIJSON.getImageInfo.compatibility -->
<!-- UTSAPIJSON.getImageInfo.tutorial -->
## uni.saveImageToPhotosAlbum(options) @saveimagetophotosalbum
<!-- UTSAPIJSON.saveImageToPhotosAlbum.description -->
<!-- UTSAPIJSON.saveImageToPhotosAlbum.param -->
<!-- UTSAPIJSON.saveImageToPhotosAlbum.returnValue -->
<!-- UTSAPIJSON.saveImageToPhotosAlbum.compatibility -->
<!-- UTSAPIJSON.saveImageToPhotosAlbum.tutorial -->
## uni.compressImage(options) @compressimage
<!-- UTSAPIJSON.compressImage.description -->
<!-- UTSAPIJSON.compressImage.param -->
<!-- UTSAPIJSON.compressImage.returnValue -->
<!-- UTSAPIJSON.compressImage.compatibility -->
<!-- UTSAPIJSON.compressImage.tutorial -->
## uni.chooseVideo(options) @choosevideo
<!-- UTSAPIJSON.chooseVideo.description -->
<!-- UTSAPIJSON.chooseVideo.param -->
<!-- UTSAPIJSON.chooseVideo.returnValue -->
<!-- UTSAPIJSON.chooseVideo.compatibility -->
<!-- UTSAPIJSON.chooseVideo.tutorial -->
## uni.getVideoInfo(options) @getvideoinfo
<!-- UTSAPIJSON.getVideoInfo.description -->
<!-- UTSAPIJSON.getVideoInfo.param -->
<!-- UTSAPIJSON.getVideoInfo.returnValue -->
<!-- UTSAPIJSON.getVideoInfo.compatibility -->
<!-- UTSAPIJSON.getVideoInfo.tutorial -->
## uni.saveVideoToPhotosAlbum(options) @savevideotophotosalbum
<!-- UTSAPIJSON.saveVideoToPhotosAlbum.description -->
<!-- UTSAPIJSON.saveVideoToPhotosAlbum.param -->
<!-- UTSAPIJSON.saveVideoToPhotosAlbum.returnValue -->
<!-- UTSAPIJSON.saveVideoToPhotosAlbum.compatibility -->
<!-- UTSAPIJSON.saveVideoToPhotosAlbum.tutorial -->
## uni.compressVideo(options) @compressvideo
<!-- UTSAPIJSON.compressVideo.description -->
<!-- UTSAPIJSON.compressVideo.param -->
<!-- UTSAPIJSON.compressVideo.returnValue -->
<!-- UTSAPIJSON.compressVideo.compatibility -->
<!-- UTSAPIJSON.compressVideo.tutorial -->
## uni.uploadFile(options) @uploadfile
<!-- UTSAPIJSON.uploadFile.description -->
<!-- UTSAPIJSON.uploadFile.param -->
<!-- UTSAPIJSON.uploadFile.returnValue -->
<!-- UTSAPIJSON.uploadFile.compatibility -->
<!-- UTSAPIJSON.uploadFile.tutorial -->
## uni.downloadFile(options) @downloadfile
<!-- UTSAPIJSON.downloadFile.description -->
<!-- UTSAPIJSON.downloadFile.param -->
<!-- UTSAPIJSON.downloadFile.returnValue -->
<!-- UTSAPIJSON.downloadFile.compatibility -->
<!-- UTSAPIJSON.downloadFile.tutorial -->
## uni.openAppAuthorizeSetting(options) @openappauthorizesetting
<!-- UTSAPIJSON.openAppAuthorizeSetting.description -->
<!-- UTSAPIJSON.openAppAuthorizeSetting.param -->
<!-- UTSAPIJSON.openAppAuthorizeSetting.returnValue -->
<!-- UTSAPIJSON.openAppAuthorizeSetting.compatibility -->
<!-- UTSAPIJSON.openAppAuthorizeSetting.tutorial -->
## uni.showToast(options) @showtoast
<!-- UTSAPIJSON.showToast.description -->
<!-- UTSAPIJSON.showToast.param -->
<!-- UTSAPIJSON.showToast.returnValue -->
<!-- UTSAPIJSON.showToast.compatibility -->
<!-- UTSAPIJSON.showToast.tutorial -->
## uni.hideToast() @hidetoast
<!-- UTSAPIJSON.hideToast.description -->
<!-- UTSAPIJSON.hideToast.param -->
<!-- UTSAPIJSON.hideToast.returnValue -->
<!-- UTSAPIJSON.hideToast.compatibility -->
<!-- UTSAPIJSON.hideToast.tutorial -->
## uni.showLoading(options) @showloading
<!-- UTSAPIJSON.showLoading.description -->
<!-- UTSAPIJSON.showLoading.param -->
<!-- UTSAPIJSON.showLoading.returnValue -->
<!-- UTSAPIJSON.showLoading.compatibility -->
<!-- UTSAPIJSON.showLoading.tutorial -->
## uni.hideLoading() @hideloading
<!-- UTSAPIJSON.hideLoading.description -->
<!-- UTSAPIJSON.hideLoading.param -->
<!-- UTSAPIJSON.hideLoading.returnValue -->
<!-- UTSAPIJSON.hideLoading.compatibility -->
<!-- UTSAPIJSON.hideLoading.tutorial -->
## uni.showModal(options) @showmodal
<!-- UTSAPIJSON.showModal.description -->
<!-- UTSAPIJSON.showModal.param -->
<!-- UTSAPIJSON.showModal.returnValue -->
<!-- UTSAPIJSON.showModal.compatibility -->
<!-- UTSAPIJSON.showModal.tutorial -->
## uni.showActionSheet(options) @showactionsheet
<!-- UTSAPIJSON.showActionSheet.description -->
<!-- UTSAPIJSON.showActionSheet.param -->
<!-- UTSAPIJSON.showActionSheet.returnValue -->
<!-- UTSAPIJSON.showActionSheet.compatibility -->
<!-- UTSAPIJSON.showActionSheet.tutorial -->
## uni.setStorage(options) @setstorage
<!-- UTSAPIJSON.setStorage.description -->
<!-- UTSAPIJSON.setStorage.param -->
<!-- UTSAPIJSON.setStorage.returnValue -->
<!-- UTSAPIJSON.setStorage.compatibility -->
<!-- UTSAPIJSON.setStorage.tutorial -->
## uni.setStorageSync(key, data) @setstoragesync
<!-- UTSAPIJSON.setStorageSync.description -->
<!-- UTSAPIJSON.setStorageSync.param -->
<!-- UTSAPIJSON.setStorageSync.returnValue -->
<!-- UTSAPIJSON.setStorageSync.compatibility -->
<!-- UTSAPIJSON.setStorageSync.tutorial -->
## uni.getStorage(options) @getstorage
<!-- UTSAPIJSON.getStorage.description -->
<!-- UTSAPIJSON.getStorage.param -->
<!-- UTSAPIJSON.getStorage.returnValue -->
<!-- UTSAPIJSON.getStorage.compatibility -->
<!-- UTSAPIJSON.getStorage.tutorial -->
## uni.getStorageSync(key) @getstoragesync
<!-- UTSAPIJSON.getStorageSync.description -->
<!-- UTSAPIJSON.getStorageSync.param -->
<!-- UTSAPIJSON.getStorageSync.returnValue -->
<!-- UTSAPIJSON.getStorageSync.compatibility -->
<!-- UTSAPIJSON.getStorageSync.tutorial -->
## uni.getStorageInfo(options) @getstorageinfo
<!-- UTSAPIJSON.getStorageInfo.description -->
<!-- UTSAPIJSON.getStorageInfo.param -->
<!-- UTSAPIJSON.getStorageInfo.returnValue -->
<!-- UTSAPIJSON.getStorageInfo.compatibility -->
<!-- UTSAPIJSON.getStorageInfo.tutorial -->
## uni.getStorageInfoSync() @getstorageinfosync
<!-- UTSAPIJSON.getStorageInfoSync.description -->
<!-- UTSAPIJSON.getStorageInfoSync.param -->
<!-- UTSAPIJSON.getStorageInfoSync.returnValue -->
<!-- UTSAPIJSON.getStorageInfoSync.compatibility -->
<!-- UTSAPIJSON.getStorageInfoSync.tutorial -->
## uni.removeStorage(options) @removestorage
<!-- UTSAPIJSON.removeStorage.description -->
<!-- UTSAPIJSON.removeStorage.param -->
<!-- UTSAPIJSON.removeStorage.returnValue -->
<!-- UTSAPIJSON.removeStorage.compatibility -->
<!-- UTSAPIJSON.removeStorage.tutorial -->
## uni.removeStorageSync(key) @removestoragesync
<!-- UTSAPIJSON.removeStorageSync.description -->
<!-- UTSAPIJSON.removeStorageSync.param -->
<!-- UTSAPIJSON.removeStorageSync.returnValue -->
<!-- UTSAPIJSON.removeStorageSync.compatibility -->
<!-- UTSAPIJSON.removeStorageSync.tutorial -->
## uni.clearStorage(option?) @clearstorage
<!-- UTSAPIJSON.clearStorage.description -->
<!-- UTSAPIJSON.clearStorage.param -->
<!-- UTSAPIJSON.clearStorage.returnValue -->
<!-- UTSAPIJSON.clearStorage.compatibility -->
<!-- UTSAPIJSON.clearStorage.tutorial -->
## uni.clearStorageSync() @clearstoragesync
<!-- UTSAPIJSON.clearStorageSync.description -->
<!-- UTSAPIJSON.clearStorageSync.param -->
<!-- UTSAPIJSON.clearStorageSync.returnValue -->
<!-- UTSAPIJSON.clearStorageSync.compatibility -->
<!-- UTSAPIJSON.clearStorageSync.tutorial -->
## uni.connectSocket(options) @connectsocket
<!-- UTSAPIJSON.connectSocket.description -->
<!-- UTSAPIJSON.connectSocket.param -->
<!-- UTSAPIJSON.connectSocket.returnValue -->
<!-- UTSAPIJSON.connectSocket.compatibility -->
<!-- UTSAPIJSON.connectSocket.tutorial -->
## uni.onSocketOpen(options) @onsocketopen
<!-- UTSAPIJSON.onSocketOpen.description -->
<!-- UTSAPIJSON.onSocketOpen.param -->
<!-- UTSAPIJSON.onSocketOpen.returnValue -->
<!-- UTSAPIJSON.onSocketOpen.compatibility -->
<!-- UTSAPIJSON.onSocketOpen.tutorial -->
## uni.onSocketError(callback) @onsocketerror
<!-- UTSAPIJSON.onSocketError.description -->
<!-- UTSAPIJSON.onSocketError.param -->
<!-- UTSAPIJSON.onSocketError.returnValue -->
<!-- UTSAPIJSON.onSocketError.compatibility -->
<!-- UTSAPIJSON.onSocketError.tutorial -->
## uni.sendSocketMessage(options) @sendsocketmessage
<!-- UTSAPIJSON.sendSocketMessage.description -->
<!-- UTSAPIJSON.sendSocketMessage.param -->
<!-- UTSAPIJSON.sendSocketMessage.returnValue -->
<!-- UTSAPIJSON.sendSocketMessage.compatibility -->
<!-- UTSAPIJSON.sendSocketMessage.tutorial -->
## uni.onSocketMessage(callback) @onsocketmessage
<!-- UTSAPIJSON.onSocketMessage.description -->
<!-- UTSAPIJSON.onSocketMessage.param -->
<!-- UTSAPIJSON.onSocketMessage.returnValue -->
<!-- UTSAPIJSON.onSocketMessage.compatibility -->
<!-- UTSAPIJSON.onSocketMessage.tutorial -->
## uni.closeSocket(options) @closesocket
<!-- UTSAPIJSON.closeSocket.description -->
<!-- UTSAPIJSON.closeSocket.param -->
<!-- UTSAPIJSON.closeSocket.returnValue -->
<!-- UTSAPIJSON.closeSocket.compatibility -->
<!-- UTSAPIJSON.closeSocket.tutorial -->
## uni.onSocketClose(callback) @onsocketclose
<!-- UTSAPIJSON.onSocketClose.description -->
<!-- UTSAPIJSON.onSocketClose.param -->
<!-- UTSAPIJSON.onSocketClose.returnValue -->
<!-- UTSAPIJSON.onSocketClose.compatibility -->
<!-- UTSAPIJSON.onSocketClose.tutorial -->
<!-- UTSAPIJSON.general_type.name -->
<!-- UTSAPIJSON.general_type.param -->
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录