From 30f87e8e76279333a2e79645078b02b0ab0d4f02 Mon Sep 17 00:00:00 2001 From: git_robot Date: Mon, 16 Oct 2023 17:39:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20utsApiJson.json=E3=80=81ut?= =?UTF-8?q?sComJson.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/.vuepress/utils/utsApiJson.json | 2 +- docs/.vuepress/utils/utsComJson.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/.vuepress/utils/utsApiJson.json b/docs/.vuepress/utils/utsApiJson.json index 53628dbe0..9bb4f0df4 100644 --- a/docs/.vuepress/utils/utsApiJson.json +++ b/docs/.vuepress/utils/utsApiJson.json @@ -1 +1 @@ -{"getApp":{"name":"## getApp() @getapp","description":"\r\n`getApp()` 函数用于获取当前应用实例。","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [AppInstance\\ & T](#appinstance-values) | \n\n#### AppInstance\\ & T 属性值 @appinstance-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| onLaunch | (options?: [OnLaunchOptions](#onlaunchoptions-values)) => void | 否 | - | 生命周期回调 监听应用初始化 应用初始化完成时触发,全局只触发一次。 |\n| onShow | (options?: [OnShowOptions](#onshowoptions-values)) => void | 否 | - | 生命周期回调 监听应用显示 应用启动,或从后台进入前台显示时触发 |\n| onHide | () => void | 否 | - | 生命周期回调 监听应用隐藏 应用从前台进入后台时触发 |\n| onExit | () => void | 否 | - | 监听应用退出。app-uvue-android 3.9+ |\n| onLastPageBackPress | () => void | 否 | - | 最后一个页面按下Android back键,常用于自定义退出。app-uvue-android 3.9+ |\n\n##### OnLaunchOptions 属性值 @onlaunchoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| path | string | 是 | - | \t应用启动页面路径 |\n\n##### OnShowOptions 属性值 @onshowoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| path | string | 是 | - | \t应用启动页面路径 |\n\n##### AppInstance & T 兼容性 \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| onLaunch | 5.0 | √ | √ | 10.0 | √ | x |\n| onShow | 5.0 | √ | √ | 10.0 | √ | x |\n| onHide | 5.0 | √ | √ | 10.0 | √ | x |\n| onExit | 5.0 | x | √ | x | x | x |\n| onLastPageBackPress | 5.0 | x | √ | x | x | x |\n","compatibility":"","tutorial":"\n### 参见\n[getApp](https://uniapp.dcloud.net.cn/uni-app-x/api/getapp.html#getapp)\n"},"get-app":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/get-app/get-app.uvue) \n ```html\n\n\n\n\n```"},"getCurrentPages":{"name":"## getCurrentPages() @getcurrentpages","description":"\r\n`getCurrentPages()` 函数用于获取当前页面栈的实例,以数组形式按栈的顺序给出,数组中的元素为页面实例,第一个元素为首页,最后一个元素为当前页面。","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| Array\\<[BasePage](#basepage-values)\\> | \n\n#### BasePage 属性值 @basepage-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| route | string | 是 | - | - |\n| options | Map\\ | 是 | - | - |\n","compatibility":"","tutorial":"\n### 参见\n[getCurrentPages](https://uniapp.dcloud.net.cn/tutorial/page.html#getcurrentpages)\n"},"get-current-pages":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/get-current-pages/get-current-pages.uvue) \n ```html\n\n\n\n\n```"},"$on":{"name":"## uni.$on(eventName, callback) @$on","description":"\n监听自定义事件。事件可以由 uni.$emit 触发。回调函数会接收 uni.$emit 传递的参数。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| eventName | string | 是 | - | - |\n| callback | () => void | 是 | - | - |","returnValue":"","compatibility":"","tutorial":"\n### 参见\n[$on](http://uniapp.dcloud.io/api/window/communication?id=on)\n"},"$off":{"name":"## uni.$off(eventName, callback) @$off","description":"\n移除自定义事件监听器。如果没有指定事件名,则移除所有事件监听器。如果提供事件名,则移除该事件的所有监听器。如果提供了事件名和回调,则只移除这个回调的监听器。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| eventName | string | 是 | - | - |\n| callback | () => void | 是 | - | - |","returnValue":"","compatibility":"","tutorial":"\n### 参见\n[$off](http://uniapp.dcloud.io/api/window/communication?id=off)\n"},"$once":{"name":"## uni.$once(eventName, callback) @$once","description":"\n监听一个自定义事件。事件只触发一次,在第一次触发之后移除事件监听器。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| eventName | string | 是 | - | - |\n| callback | () => void | 是 | - | - |","returnValue":"","compatibility":"","tutorial":"\n### 参见\n[$once](http://uniapp.dcloud.io/api/window/communication?id=once)\n"},"$emit":{"name":"## uni.$emit(eventName, args?) @$emit","description":"\n触发自定义事件,附加的参数会传递给事件监听器。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| eventName | string | 是 | - | - |\n| args | any | 否 | - | - |","returnValue":"","compatibility":"","tutorial":"\n### 参见\n[$emit](http://uniapp.dcloud.io/api/window/communication?id=emit)\n"},"event-bus":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/event-bus/event-bus.uvue) \n ```html\n\r\n\r\n\r\n\r\n\r\n\n```"},"getLaunchOptionsSync":{"name":"## uni.getLaunchOptionsSync() @getlaunchoptionssync","description":"\n获取本次启动时的参数。返回值与App.onLaunch的回调参数一致\n","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [OnLaunchOptions](#onlaunchoptions-values) | \n\n#### OnLaunchOptions 属性值 @onlaunchoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| path | string | 是 | - | - |\n","compatibility":"","tutorial":"\n### 参见\n[getLaunchOptionsSync](http://uniapp.dcloud.io/api/plugins/getLaunchOptionsSync)\n"},"get-launch-options-sync":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/get-launch-options-sync/get-launch-options-sync.uvue) \n ```html\n\n\n\n\n```"},"exit":{"name":"## uni.exit(options?) @exit","description":"\n退出当前应用","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ExitOptions](#exitoptions-values) | 否 | - | - |\n#### ExitOptions 属性值 @exitoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (res: [ExitSuccess](#exitsuccess-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (res: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### ExitSuccess 属性值 @exitsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"### exit 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4.4 | 3.8.15 | 3.9.0 | x | x | x |\n","tutorial":"","example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/exit/exit.uvue) \n ```html\n\n\n\n\n\n```"},"navigateTo":{"name":"## uni.navigateTo(options) @navigateto","description":"\n保留当前页面,跳转到应用内的某个页面\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [NavigateToOptions](#navigatetooptions-values) | 是 | - | - |\n#### NavigateToOptions 属性值 @navigatetooptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string | 是 | - | 需要跳转的应用内非 tabBar 的页面的路径 , 路径后可以带参数 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### NavigateToOptions 兼容性 \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| url | 5.0 | √ | √ | 10.0 | √ | x |\n| success | 5.0 | √ | √ | 10.0 | √ | x |\n| fail | 5.0 | √ | √ | 10.0 | √ | x |\n| complete | 5.0 | √ | √ | 10.0 | √ | x |\n","returnValue":"","compatibility":"### navigateTo 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 5.0 | √ | √ | 10.0 | √ | x |\n","tutorial":"\n### 参见\n[navigateTo](http://uniapp.dcloud.io/api/router?id=navigateto)\n"},"redirectTo":{"name":"## uni.redirectTo(options) @redirectto","description":"\n关闭当前页面,跳转到应用内的某个页面\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [RedirectToOptions](#redirecttooptions-values) | 是 | - | - |\n#### RedirectToOptions 属性值 @redirecttooptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string | 是 | - | 需要跳转的应用内非 tabBar 的页面的路径 , 路径后可以带参数 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### RedirectToOptions 兼容性 \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| url | 5.0 | √ | √ | 10.0 | √ | x |\n| success | 5.0 | √ | √ | 10.0 | √ | x |\n| fail | 5.0 | √ | √ | 10.0 | √ | x |\n| complete | 5.0 | √ | √ | 10.0 | √ | x |\n","returnValue":"","compatibility":"### redirectTo 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 5.0 | √ | √ | 10.0 | √ | x |\n","tutorial":"\n### 参见\n[redirectTo](http://uniapp.dcloud.io/api/router?id=redirectto)\n"},"reLaunch":{"name":"## uni.reLaunch(options) @relaunch","description":"\n关闭所有页面,打开到应用内的某个页面\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ReLaunchOptions](#relaunchoptions-values) | 是 | - | - |\n#### ReLaunchOptions 属性值 @relaunchoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string | 是 | - | 需要跳转的应用内非 tabBar 的页面的路径 , 路径后可以带参数 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### ReLaunchOptions 兼容性 \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| url | 5.0 | √ | √ | 10.0 | √ | x |\n| success | 5.0 | √ | √ | 10.0 | √ | x |\n| fail | 5.0 | √ | √ | 10.0 | √ | x |\n| complete | 5.0 | √ | √ | 10.0 | √ | x |\n","returnValue":"","compatibility":"### reLaunch 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 5.0 | √ | √ | 10.0 | √ | x |\n","tutorial":"\n### 参见\n[reLaunch](http://uniapp.dcloud.io/api/router?id=relaunch)\n"},"switchTab":{"name":"## uni.switchTab(options) @switchtab","description":"\n跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SwitchTabOptions](#switchtaboptions-values) | 是 | - | - |\n#### SwitchTabOptions 属性值 @switchtaboptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string | 是 | - | 需要跳转的 tabBar 页面的路径,路径后不能带参数 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SwitchTabOptions 兼容性 \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| url | 5.0 | √ | √ | 10.0 | √ | x |\n| success | 5.0 | √ | √ | 10.0 | √ | x |\n| fail | 5.0 | √ | √ | 10.0 | √ | x |\n| complete | 5.0 | √ | √ | 10.0 | √ | x |\n","returnValue":"","compatibility":"### switchTab 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 5.0 | √ | √ | 10.0 | √ | x |\n","tutorial":"\n### 参见\n[switchTab](http://uniapp.dcloud.io/api/router?id=switchtab)\n"},"navigateBack":{"name":"## uni.navigateBack(options?) @navigateback","description":"\n关闭当前页面,返回上一页面或多级页面\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [NavigateBackOptions](#navigatebackoptions-values) | 否 | - | - |\n#### NavigateBackOptions 属性值 @navigatebackoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| delta | number | 否 | - | 返回的页面数,如果 delta 大于现有页面数,则返回到首页 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### NavigateBackOptions 兼容性 \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| delta | 5.0 | √ | √ | 10.0 | √ | x |\n| success | 5.0 | √ | √ | 10.0 | √ | x |\n| fail | 5.0 | √ | √ | 10.0 | √ | x |\n| complete | 5.0 | √ | √ | 10.0 | √ | x |\n","returnValue":"","compatibility":"### navigateBack 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 5.0 | √ | √ | 10.0 | √ | x |\n","tutorial":"\n### 参见\n[navigateBack](http://uniapp.dcloud.io/api/router?id=navigateback)\n"},"navigator":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/navigator/navigator.uvue) \n ```html\n\r\n\r\n\r\n\r\n\r\n\n```"},"setNavigationBarColor":{"name":"## uni.setNavigationBarColor(options) @setnavigationbarcolor","description":"\n设置导航条、状态栏颜色\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SetNavigationBarColorOptions](#setnavigationbarcoloroptions-values) | 是 | - | - |\n#### SetNavigationBarColorOptions 属性值 @setnavigationbarcoloroptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| frontColor | #ffffff \\\\| #000000 | 是 | - | 前景颜色值,包括按钮、标题、状态栏的颜色,仅支持 #ffffff 和 #000000 |\n| backgroundColor | string | 是 | - | 背景颜色值,有效值为十六进制颜色 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (error: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetNavigationBarColorOptions 兼容性 \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| frontColor | 5.0 | √ | √ | 10.0 | √ | x |\n| backgroundColor | 5.0 | √ | √ | 10.0 | √ | x |\n| success | 5.0 | √ | √ | 10.0 | √ | x |\n| fail | 5.0 | √ | √ | 10.0 | √ | x |\n| complete | 5.0 | √ | √ | 10.0 | √ | x |\n","returnValue":"","compatibility":"### setNavigationBarColor 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 5.0 | √ | √ | 10.0 | √ | x |\n","tutorial":"\n### 参见\n[setNavigationBarColor](http://uniapp.dcloud.io/api/ui/navigationbar?id=setnavigationbarcolor)\n"},"set-navigation-bar-color":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/set-navigation-bar-color/set-navigation-bar-color.uvue) \n ```html\n\n\n\n\n\n\n```"},"setTabBarBadge":{"name":"## uni.setTabBarBadge(options) @settabbarbadge","description":"\n为 tabBar 某一项的右上角添加文本\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SetTabBarBadgeOptions](#settabbarbadgeoptions-values) | 是 | - | - |\n#### SetTabBarBadgeOptions 属性值 @settabbarbadgeoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| index | number | 是 | - | tabBar的哪一项,从左边算起,索引从0开始 |\n| text | string | 是 | - | 显示的文本,不超过 3 个半角字符 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SetTabBarError](#settabbarerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetTabBarError 属性值 @settabbarerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | SetTabBarErrCode | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](/tutorial/err-spec.html#unierror) | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"","tutorial":"\n### 参见\n[setTabBarBadge](http://uniapp.dcloud.io/api/ui/tabbar?id=settabbarbadge)\n"},"removeTabBarBadge":{"name":"## uni.removeTabBarBadge(options) @removetabbarbadge","description":"\n移除 tabBar 某一项右上角的文本\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [RemoveTabBarBadgeOptions](#removetabbarbadgeoptions-values) | 是 | - | - |\n#### RemoveTabBarBadgeOptions 属性值 @removetabbarbadgeoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| index | number | 是 | - | tabBar的哪一项,从左边算起,索引从0开始 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SetTabBarError](#settabbarerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetTabBarError 属性值 @settabbarerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | SetTabBarErrCode | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](/tutorial/err-spec.html#unierror) | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"","tutorial":"\n### 参见\n[removeTabBarBadge](http://uniapp.dcloud.io/api/ui/tabbar?id=removetabbarbadge)\n"},"setTabBarItem":{"name":"## uni.setTabBarItem(options) @settabbaritem","description":"\n动态设置 tabBar 某一项的内容\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SetTabBarItemOptions](#settabbaritemoptions-values) | 是 | - | - |\n#### SetTabBarItemOptions 属性值 @settabbaritemoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| index | number | 是 | - | tabBar 的哪一项,从左边算起,索引从0开始 |\n| text | string | 否 | - | tab 上按钮文字 |\n| iconPath | string | 否 | - | 图片路径 |\n| selectedIconPath | string | 否 | - | 选中时的图片路径 |\n| pagePath | string | 否 | - | 页面绝对路径 |\n| iconfont | [SetTabBarItemIconFontOptions](#settabbaritemiconfontoptions-values) | 否 | - | 字体图标,优先级高于 iconPath |\n| visible | boolean | 否 | - | tab 是否显示 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SetTabBarError](#settabbarerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### SetTabBarItemIconFontOptions 属性值 @settabbaritemiconfontoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| text | string | 是 | - | 字库 Unicode 码 |\n| selectedText | string | 是 | - | 选中后字库 Unicode 码 |\n| fontSize | string | 否 | - | 字体图标字号(px) |\n| color | string | 否 | - | 字体图标颜色 |\n| selectedColor | string | 否 | - | 字体图标选中颜色 |\n\n##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetTabBarError 属性值 @settabbarerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | SetTabBarErrCode | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](/tutorial/err-spec.html#unierror) | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"","tutorial":"\n### 参见\n[setTabBarItem](http://uniapp.dcloud.io/api/ui/tabbar?id=settabbaritem)\n"},"setTabBarStyle":{"name":"## uni.setTabBarStyle(options) @settabbarstyle","description":"\n动态设置 tabBar 的整体样式\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SetTabBarStyleOptions](#settabbarstyleoptions-values) | 是 | - | - |\n#### SetTabBarStyleOptions 属性值 @settabbarstyleoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| color | string | 否 | - | tab 上的文字默认颜色 |\n| selectedColor | string | 否 | - | tab 上的文字选中时的颜色 {HBuilderX.ColorString} |\n| backgroundColor | string | 否 | - | tab 的背景色 |\n| backgroundImage | string | 否 | - | 图片背景 |\n| backgroundRepeat | string | 否 | - | 背景图平铺方式 |\n| borderStyle | string | 否 | - | tabbar上边框的颜色 |\n| midButton | [MidButtonOptions](#midbuttonoptions-values) | 否 | - | tabbar 中间按钮 仅在 list 项为偶数时有效 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SetTabBarError](#settabbarerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### MidButtonOptions 属性值 @midbuttonoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| width | string | 否 | - | 中间按钮的宽度,tabBar 其它项为减去此宽度后平分,默认值为与其它项平分宽度。默认 80px |\n| height | string | 否 | - | 中间按钮的高度,可以大于 tabBar 高度,达到中间凸起的效果。默认 50px |\n| text | string | 否 | - | 中间按钮的文字 |\n| iconPath | string | 否 | - | 中间按钮的图片路径 |\n| iconWidth | string | 否 | - | 图片宽度(高度等比例缩放)。默认 24px |\n| backgroundImage | string | 否 | - | 中间按钮的背景图片路径 |\n| iconfont | [MidButtonIconFont](#midbuttoniconfont-values) | 否 | - | 字体图标,优先级高于 iconPath |\n\n###### MidButtonIconFont 属性值 @midbuttoniconfont-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| text | string | 否 | - | 字库 Unicode 码 |\n| selectedText | string | 否 | - | 选中后字库 Unicode 码 |\n| fontSize | string | 否 | - | 字体图标字号(px) |\n| color | string | 否 | - | 字体图标颜色 |\n| selectedColor | string | 否 | - | 字体图标选中颜色 |\n\n##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetTabBarError 属性值 @settabbarerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | SetTabBarErrCode | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](/tutorial/err-spec.html#unierror) | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"","tutorial":"\n### 参见\n[setTabBarStyle](http://uniapp.dcloud.io/api/ui/tabbar?id=settabbarstyle)\n"},"hideTabBar":{"name":"## uni.hideTabBar(options?) @hidetabbar","description":"\n隐藏 tabBar\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [HideTabBarOptions](#hidetabbaroptions-values) | 否 | - | - |\n#### HideTabBarOptions 属性值 @hidetabbaroptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| animation | boolean | 否 | - | 是否需要动画效果 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SetTabBarError](#settabbarerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetTabBarError 属性值 @settabbarerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | SetTabBarErrCode | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](/tutorial/err-spec.html#unierror) | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"","tutorial":"\n### 参见\n[hideTabBar](http://uniapp.dcloud.io/api/ui/tabbar?id=hidetabbar)\n"},"showTabBar":{"name":"## uni.showTabBar(options?) @showtabbar","description":"\n显示 tabBar\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ShowTabBarOptions](#showtabbaroptions-values) | 否 | - | - |\n#### ShowTabBarOptions 属性值 @showtabbaroptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| animation | boolean | 否 | - | 是否需要动画效果 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SetTabBarError](#settabbarerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetTabBarError 属性值 @settabbarerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | SetTabBarErrCode | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](/tutorial/err-spec.html#unierror) | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"","tutorial":"\n### 参见\n[showTabBar](http://uniapp.dcloud.io/api/ui/tabbar?id=showtabbar)\n"},"showTabBarRedDot":{"name":"## uni.showTabBarRedDot(options) @showtabbarreddot","description":"\n显示 tabBar 某一项的右上角的红点\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ShowTabBarRedDotOptions](#showtabbarreddotoptions-values) | 是 | - | - |\n#### ShowTabBarRedDotOptions 属性值 @showtabbarreddotoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| index | number | 是 | - | tabBar的哪一项,从左边算起,索引从0开始 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SetTabBarError](#settabbarerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetTabBarError 属性值 @settabbarerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | SetTabBarErrCode | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](/tutorial/err-spec.html#unierror) | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"","tutorial":"\n### 参见\n[showTabBarRedDot](http://uniapp.dcloud.io/api/ui/tabbar?id=showtabbarreddot)\n"},"hideTabBarRedDot":{"name":"## uni.hideTabBarRedDot(options) @hidetabbarreddot","description":"\n隐藏 tabBar 某一项的右上角的红点\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [HideTabBarRedDotOptions](#hidetabbarreddotoptions-values) | 是 | - | - |\n#### HideTabBarRedDotOptions 属性值 @hidetabbarreddotoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| index | number | 是 | - | tabBar的哪一项,从左边算起,索引从0开始 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SetTabBarError](#settabbarerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetTabBarError 属性值 @settabbarerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | SetTabBarErrCode | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](/tutorial/err-spec.html#unierror) | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"","tutorial":"\n### 参见\n[hideTabBarRedDot](http://uniapp.dcloud.io/api/ui/tabbar?id=hidetabbarreddot)\n"},"stopPullDownRefresh":{"name":"## uni.stopPullDownRefresh() @stoppulldownrefresh","description":"\n停止当前页面下拉刷新\n","param":"","returnValue":"","compatibility":"","tutorial":"\n### 参见\n[stopPullDownRefresh](http://uniapp.dcloud.io/api/ui/pulldown?id=stoppulldownrefresh)\n"},"pull-down-refresh":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/pull-down-refresh/pull-down-refresh.uvue) \n ```html\n\n\n\n\n\n```"},"pageScrollTo":{"name":"## uni.pageScrollTo(options) @pagescrollto","description":"\n将页面滚动到目标位置\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [PageScrollToOptions](#pagescrolltooptions-values) | 是 | - | - |\n#### PageScrollToOptions 属性值 @pagescrolltooptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| scrollTop | number | 否 | - | 滚动到页面的目标位置 |\n| selector | string | 否 | - | 选择器 |\n| offsetTop | number | 否 | - | 偏移距离,可以滚动到 selector 加偏移距离的位置 |\n| duration | number | 否 | - | 滚动动画的时长 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### PageScrollToOptions 兼容性 \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| offsetTop | 5.0 | x | 3.91 | 10.0 | x | x |\n","returnValue":"","compatibility":"### pageScrollTo 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 5.0 | √ | 3.91 | 10.0 | √ | √ |\n","tutorial":"\n### 参见\n[pageScrollTo](http://uniapp.dcloud.io/api/ui/scroll?id=pagescrollto)\n"},"page-scroll-to":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/page-scroll-to/page-scroll-to.uvue) \n ```html\n\n\n\n\n\n\n```"},"getElementById":{"name":"## uni.getElementById(id) @getelementbyid","description":"\n返回一个匹配特定 ID 的元素, 如果不存在,返回 null。\\\n如果需要获取指定的节点类型,需要使用 as 进行类型转换。\\\nID 区分大小写,且应该是唯一的。如果存在多个匹配的元素,则返回第一个匹配的元素。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| id | string | 是 | - | - |","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| [Element](/uni-app-x/dom/element.md) | 否 | \n","compatibility":"### getElementById 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 5.0 | x | 3.91 | 10.0 | x | x |\n","tutorial":"\n### 参见\n[getElementById](https://uniapp.dcloud.net.cn/uni-app-x/api/get-element-by-id.html)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/get-element-by-id/get-element-by-id.uvue) \n ```html\n\n\n\n\n```"},"createSelectorQuery":{"name":"## uni.createSelectorQuery() @createselectorquery","description":"\n返回一个SelectorQuery对象实例\n","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) | \n\n#### SelectorQuery 属性值 @selectorquery-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| in | (component?: any) => [SelectorQuery](#selectorquery-values) | 是 | - | 将选择器的选取范围更改为自定义组件component内 |\n| select | (selector: string) => [NodesRef](#nodesref-values) | 是 | - | 在当前页面下选择第一个匹配选择器selector的节点 |\n| selectAll | (selector: string) => [NodesRef](#nodesref-values) | 是 | - | 在当前页面下选择匹配选择器selector的所有节点 |\n| selectViewport | () => [NodesRef](#nodesref-values) | 是 | - | 选择显示区域 |\n| exec | (callback: (result: Array\\) => void) => [NodesRef](#nodesref-values) | 是 | - | 执行所有的请求 |\n\n##### NodesRef 属性值 @nodesref-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| boundingClientRect | (callback?: (result: any) => void) => [SelectorQuery](#selectorquery-values) | 是 | - | 添加节点的布局位置的查询请求,相对于显示区域,以像素为单位 |\n| scrollOffset | (callback: (result: any) => void) => [SelectorQuery](#selectorquery-values) | 是 | - | 添加节点的滚动位置查询请求,以像素为单位 |\n| fields | (fields: [NodeField](#nodefield-values), callback: (result: any) => void) => [SelectorQuery](#selectorquery-values) | 是 | - | 获取节点的相关信息,需要获取的字段在fields中指定 |\n| node | (callback: (result: any) => void) => [SelectorQuery](#selectorquery-values) | 是 | - | 获取 Node 节点实例。目前支持 Canvas 的获取。 |\n\n###### NodeField 属性值 @nodefield-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| id | boolean | 否 | - | 是否返回节点 id |\n| dataset | boolean | 否 | - | 是否返回节点 dataset |\n| rect | boolean | 否 | - | 是否返回节点布局位置(left right top bottom) |\n| size | boolean | 否 | - | 是否返回节点尺寸(width height) |\n| scrollOffset | boolean | 否 | - | 是否返回节点的 scrollLeft scrollTop,节点必须是 scroll-view 或者 viewport |\n| properties | Array\\ | 否 | - | 指定属性名列表,返回节点对应属性名的当前属性值(只能获得组件文档中标注的常规属性值,id class style 和事件绑定的属性值不可获取) |\n| computedStyle | Array\\ | 否 | - | 指定样式名列表,返回节点对应样式名的当前值 |\n","compatibility":"### createSelectorQuery 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 5.0 | √ | 3.91 | 10.0 | √ | √ |\n","tutorial":"\n### 参见\n[createSelectorQuery](http://uniapp.dcloud.io/api/ui/nodes-info?id=createselectorquery)\n"},"nodes-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/nodes-info/nodes-info.uvue) \n ```html\n\n\n\n\n\n```"},"showToast":{"name":"## uni.showToast(options) @showtoast","description":"显示消息提示框","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ShowToastOptions](#showtoastoptions-values) | 是 | - | uni.showToast参数定义 |\n#### ShowToastOptions 属性值 @showtoastoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| title | string | 是 | - | 提示的内容,长度与 icon 取值有关。 |\n| icon | string | 否 | - | icon值说明 success: 显示成功图标,error: 显示错误图标; fail: 显示错误图标,此时title文本无长度显示; exception: 显示异常图标,此时title文本无长度显示; loading: 显示加载图标;none: 不显示图标。 |\n| image | string | 否 | - | 自定义图标的本地路径(app端暂不支持gif) |\n| mask | boolean | 否 | - | 是否显示透明蒙层,防止触摸穿透,默认:false |\n| duration | number | 否 | - | 提示的延迟时间,单位毫秒,默认:1500 |\n| position | string | 否 | - | position值说明(仅App生效) top: 居上显示; center: 居中显示;bottom: 居底显示 |\n| success | (res: [ShowToastSuccess](#showtoastsuccess-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (res: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n","returnValue":"","compatibility":"### showToast 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4.4 | √ | 3.9.0 | 9.0 | √ | 3.9.0 |\n","tutorial":"\n### 参见\n[showToast]([](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showtoast))\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/toast/toast.uvue) \n ```html\n\r\n\n\n```"},"showLoading":{"name":"## uni.showLoading(options) @showloading","description":"显示 loading 提示框, 需主动调用 uni.hideLoading 才能关闭提示框。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ShowLoadingOptions](#showloadingoptions-values) | 是 | - | uni.showLoading参数定义 |\n#### ShowLoadingOptions 属性值 @showloadingoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| title | string | 是 | - | 提示的内容,长度与 icon 取值有关。 |\n| mask | boolean | 否 | - | 是否显示透明蒙层,防止触摸穿透,默认:false |\n| success | (res: [ShowLoadingSuccess](#showloadingsuccess-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (res: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n","returnValue":"","compatibility":"### showLoading 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4.4 | √ | 3.9.0 | 9.0 | √ | 3.9.0 |\n","tutorial":"\n### 参见\n[showLoading]([](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showloading))\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/loading/loading.uvue) \n ```html\n\n\n```"},"showModal":{"name":"## uni.showModal(options) @showmodal","description":"显示模态弹窗,可以只有一个确定按钮,也可以同时有确定和取消按钮。类似于一个API整合了 html 中:alert、confirm。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ShowModalOptions](#showmodaloptions-values) | 是 | - | uni.showModal 参数定义 |\n#### ShowModalOptions 属性值 @showmodaloptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| title | string | 否 | - | 提示的标题 |\n| content | string | 否 | - | 提示的内容 |\n| showCancel | boolean | 否 | true\r\n是否显示取消按钮,默认为 true | |\n| cancelText | string | 否 | - | 取消按钮的文字,默认为\"取消\" |\n| cancelColor | string | 否 | - | 取消按钮的文字颜色,默认为\"#000000\" |\n| confirmText | string | 否 | - | 确定按钮的文字,默认为\"确定\" |\n| confirmColor | string | 否 | - | 确定按钮的文字颜色 |\n| editable | boolean | 否 | false\r\n是否显示输入框 | |\n| placeholderText | string | 否 | - | 显示输入框时的提示文本 |\n| success | (res: [ShowModalSuccess](#showmodalsuccess-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (res: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### ShowModalSuccess 属性值 @showmodalsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| confirm | boolean | 是 | - | 为 true 时,表示用户点击了确定按钮 |\n| cancel | boolean | 是 | - | 为 true 时,表示用户点击了取消(用于 Android 系统区分点击蒙层关闭还是点击取消按钮关闭) |\n| content | string | 否 | - | editable 为 true 时,用户输入的文本 |\n","returnValue":"","compatibility":"### showModal 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4.4 | √ | 3.9.0 | 9.0 | √ | 3.9.0 |\n","tutorial":"\n### 参见\n[showModal]([](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showmodal))\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/modal/modal.uvue) \n ```html\n\r\n\n```"},"showActionSheet":{"name":"## uni.showActionSheet(options) @showactionsheet","description":"从底部向上弹出操作菜单","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ShowActionSheetOptions](#showactionsheetoptions-values) | 是 | - | uni.showActionSheet函数参数定义 |\n#### ShowActionSheetOptions 属性值 @showactionsheetoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| title | string | 否 | - | 菜单标题 |\n| alertText | string | 否 | - | 警示文案(同菜单标题, app无效) |\n| itemList | Array\\ | 是 | - | - |\n| itemColor | string | 否 | - | 按钮的文字颜色,字符串格式(iOS默认为系统控件颜色) |\n| popover | [Popover](#popover-values) | 否 | - | 大屏设备弹出原生选择按钮框的指示区域,默认居中显示 |\n| success | (res: [ShowActionSheetSuccess](#showactionsheetsuccess-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (res: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### Popover 属性值 @popover-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| top | number | 是 | - | 指示区域坐标,使用原生 navigationBar 时一般需要加上 navigationBar 的高度 |\n| left | number | 是 | - | 指示区域坐标 |\n| width | number | 是 | - | 指示区域宽度 |\n| height | number | 是 | - | 指示区域高度 |\n\n##### ShowActionSheetSuccess 属性值 @showactionsheetsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| tapIndex | number | 否 | - | 用户点击的按钮,从上到下的顺序,从0开始 |\n","returnValue":"","compatibility":"### showActionSheet 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4.4 | √ | 3.9.0 | 9.0 | √ | 3.9.0 |\n","tutorial":"\n### 参见\n[showActionSheet]([](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showactionsheet))\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/action-sheet/action-sheet.uvue) \n ```html\n\r\n\n\n```"},"loadFontFace":{"name":"## uni.loadFontFace(options) @loadfontface","description":"\n动态加载网络字体\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [LoadFontFaceOptions](#loadfontfaceoptions-values) | 是 | - | - |\n#### LoadFontFaceOptions 属性值 @loadfontfaceoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| global | boolean | 否 | - | 是否全局生效。微信小程序 '2.10.0'起支持全局生效,需在 app.vue 中调用。 |\n| family | string | 是 | - | 定义的字体名称 |\n| source | string | 是 | - | 字体资源的地址 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (error: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### LoadFontFaceOptions 兼容性 \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| global | 5.0 | √ | √ | 10.0 | √ | x |\n| family | 5.0 | √ | √ | 10.0 | √ | x |\n| source | 5.0 | √ | √ | 10.0 | √ | x |\n| success | 5.0 | √ | √ | 10.0 | √ | x |\n| fail | 5.0 | √ | √ | 10.0 | √ | x |\n| complete | 5.0 | √ | √ | 10.0 | √ | x |\n","returnValue":"","compatibility":"### loadFontFace 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 5.0 | √ | √ | 10.0 | √ | x |\n","tutorial":"\n### 参见\n[loadFontFace](http://uniapp.dcloud.io/api/ui/font?id=loadfontface)\n"},"load-font-face":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/load-font-face/load-font-face.uvue) \n ```html\n\n\n\n\n```"},"request":{"name":"## uni.request(param) @request","description":"发起网络请求。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| param | [RequestOptions\\](#requestoptions-values) | 是 | - | 网络请求参数 |\n#### RequestOptions\\ 属性值 @requestoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string | 是 | - | 开发者服务器接口地址 |\n| data | any | 否 | null | 请求的参数 UTSJSONObject\\|string类型 |\n| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 否 | null | 设置请求的 header,header 中不能设置 Referer |\n| method | RequestMethod | 否 | \"GET\" | 请求方法 如果设置的值不在取值范围内,会以GET方法进行请求。 |\n| timeout | number | 否 | 60000 | 超时时间,单位 ms |\n| dataType | string | 否 | \"json\" | 如果设为 json,会对返回的数据进行一次 JSON.parse,非 json 不会进行 JSON.parse |\n| responseType | string | 否 | - | 设置响应的数据类型。 |\n| sslVerify | boolean | 否 | - | 验证 ssl 证书 |\n| firstIpv4 | boolean | 否 | false | DNS解析时优先使用ipv4 |\n| success | (option: [RequestSuccess\\](#requestsuccess-values)) => void | 否 | null | 网络请求成功回调。 |\n| fail | (option: [RequestFail](#requestfail-values)) => void | 否 | null | 网络请求失败回调。 |\n| complete | (option: any) => void | 否 | null | 网络请求完成回调,成功或者失败都会调用。 |\n\n##### RequestSuccess\\ 属性值 @requestsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | any | 否 | - | 开发者服务器返回的数据 |\n| statusCode | number | 是 | - | 开发者服务器返回的 HTTP 状态码 |\n| header | any | 是 | - | 开发者服务器返回的 HTTP Response Header |\n| cookies | Array\\ | 是 | - | - |\n\n##### RequestFail 属性值 @requestfail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | RequestErrorCode | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](/tutorial/err-spec.html#unierror) | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| [RequestTask](#requesttask-values) | 否 | \n\n#### RequestTask 属性值 @requesttask-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| abort | () => void | 是 | - | 中断网络请求。 |\n\n##### RequestTask 兼容性 \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| abort | 4.4 | √ | 3.9+ | 9.0 | √ | 3.9+ |\n","compatibility":"### request 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9+ | 9.0 | √ | 3.9+ |\n","tutorial":"\n### 参见\n[request](https://uniapp.dcloud.net.cn/api/request/request.html)\n","example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/request/request.uvue) \n ```html\n\r\n\n\n```"},"uploadFile":{"name":"## uni.uploadFile(options) @uploadfile","description":"将本地资源上传到开发者服务器。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [UploadFileOptions](#uploadfileoptions-values) | 是 | - | - |\n#### UploadFileOptions 属性值 @uploadfileoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string | 是 | - | 开发者服务器 url |\n| filePath | string | 否 | null | 要上传文件资源的路径 |\n| name | string | 否 | null | 文件对应的 key , 开发者在服务器端通过这个 key 可以获取到文件二进制内容 |\n| files | Array\\<[UploadFileOptionFiles](#uploadfileoptionfiles-values)\\> | 否 | null | 需要上传的文件列表。 |\n| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 否 | null | HTTP 请求 Header, header 中不能设置 Referer |\n| formData | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 否 | null | HTTP 请求中其他额外的 form data |\n| timeout | number | 否 | 120000 | 超时时间,单位 ms |\n| success | (result: [UploadFileSuccess](#uploadfilesuccess-values)) => void | 否 | null | 成功返回的回调函数 |\n| fail | (result: [UploadFileFail](#uploadfilefail-values)) => void | 否 | null | 失败的回调函数 |\n| complete | (result: any) => void | 否 | null | 结束的回调函数(调用成功、失败都会执行) |\n\n##### UploadFileOptionFiles 属性值 @uploadfileoptionfiles-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| name | string | 否 | \"file\" | multipart 提交时,表单的项目名,默认为 file,如果 name 不填或填的值相同,可能导致服务端读取文件时只能读取到一个文件。 |\n| uri | string | 是 | - | 要上传文件资源的路径 |\n\n##### UploadFileSuccess 属性值 @uploadfilesuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | string | 是 | - | 开发者服务器返回的数据 |\n| statusCode | number | 是 | - | 开发者服务器返回的 HTTP 状态码 |\n\n##### UploadFileFail 属性值 @uploadfilefail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | RequestErrorCode | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](/tutorial/err-spec.html#unierror) | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| [UploadTask](#uploadtask-values) | 否 | \n\n#### UploadTask 属性值 @uploadtask-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| abort | () => void | 是 | - | 中断上传任务。 |\n| onProgressUpdate | (callback: (result: [OnProgressUpdateResult](#onprogressupdateresult-values)) => void) => void | 是 | - | 监听上传进度变化。 |\n\n##### OnProgressUpdateResult 属性值 @onprogressupdateresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| progress | number | 是 | - | 上传进度百分比 |\n| totalBytesSent | number | 是 | - | 已经上传的数据长度,单位 Bytes |\n| totalBytesExpectedToSend | number | 是 | - | 预期需要上传的数据总长度,单位 Bytes |\n\n##### UploadTask 兼容性 \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| abort | 4.4 | √ | 3.9+ | 9.0 | √ | x |\n| onProgressUpdate | 4.4 | √ | 3.9+ | 9.0 | √ | x |\n","compatibility":"### uploadFile 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9+ | 9.0 | √ | x |\n","tutorial":"\n### 参见\n[uploadFile](https://uniapp.dcloud.net.cn/api/request/network-file.html#uploadfile)\n"},"upload-file":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/upload-file/upload-file.uvue) \n ```html\n\r\n\r\n\r\n\r\n\n```"},"downloadFile":{"name":"## uni.downloadFile(options) @downloadfile","description":"下载文件资源到本地,客户端直接发起一个 HTTP GET 请求,返回文件的本地临时路径。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [DownloadFileOptions](#downloadfileoptions-values) | 是 | - | - |\n#### DownloadFileOptions 属性值 @downloadfileoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string | 是 | - | 下载资源的 url |\n| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 否 | null | HTTP 请求 Header,header 中不能设置 Referer |\n| filePath | string | 否 | null | 指定文件下载路径 支持相对路径与绝对路径,例: `/imgs/pic.png`、`/storage/emulated/0/Android/data/io.dcloud.HBuilder/apps/HBuilder/temp/imgs/pic.png` 并且支持指定下载目录,例: `/imgs/` |\n| timeout | number | 否 | 120000 | 超时时间,单位 ms |\n| success | (result: [DownloadFileSuccess](#downloadfilesuccess-values)) => void | 否 | null | 下载成功后以 tempFilePath 的形式传给页面,res = {tempFilePath: '文件的临时路径'} |\n| fail | (result: [DownloadFileFail](#downloadfilefail-values)) => void | 否 | null | 失败的回调函数 |\n| complete | (result: any) => void | 否 | null | 结束的回调函数(调用成功、失败都会执行) |\n\n##### DownloadFileSuccess 属性值 @downloadfilesuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| tempFilePath | string | 是 | - | 临时文件路径,下载后的文件会存储到一个临时文件 |\n| statusCode | number | 是 | - | 开发者服务器返回的 HTTP 状态码 |\n\n##### DownloadFileFail 属性值 @downloadfilefail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | RequestErrorCode | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](/tutorial/err-spec.html#unierror) | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| [DownloadTask](#downloadtask-values) | 否 | \n\n#### DownloadTask 属性值 @downloadtask-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| abort | () => void | 是 | - | 中断下载任务。 |\n| onProgressUpdate | (callback: (result: [OnProgressDownloadResult](#onprogressdownloadresult-values)) => void) => void | 是 | - | 监听下载进度变化。 |\n\n##### OnProgressDownloadResult 属性值 @onprogressdownloadresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| progress | number | 是 | - | 下载进度百分比 |\n| totalBytesWritten | number | 是 | - | 已经下载的数据长度,单位 Bytes |\n| totalBytesExpectedToWrite | number | 是 | - | 预期需要下载的数据总长度,单位 Bytes |\n\n##### DownloadTask 兼容性 \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| abort | 4.4 | √ | 3.9+ | 9.0 | √ | x |\n| onProgressUpdate | 4.4 | √ | 3.9+ | 9.0 | √ | x |\n","compatibility":"### downloadFile 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9+ | 9.0 | √ | x |\n","tutorial":"\n### 参见\n[downloadFile](https://uniapp.dcloud.net.cn/api/request/network-file.html#downloadfile)\n"},"download-file":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/download-file/download-file.uvue) \n ```html\n\r\n\r\n\r\n\r\n\n```"},"getNetworkType":{"name":"## uni.getNetworkType(options) @getnetworktype","description":"获取网络类型","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetNetworkTypeOptions](#getnetworktypeoptions-values) | 是 | - | - |\n#### GetNetworkTypeOptions 属性值 @getnetworktypeoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (result: [GetNetworkTypeSuccess](#getnetworktypesuccess-values)) => void | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: any) => void | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### GetNetworkTypeSuccess 属性值 @getnetworktypesuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| networkType | string | 是 | - | 网络类型 |\n","returnValue":"","compatibility":"### getNetworkType 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9+ | 9.0 | √ | x |\n","tutorial":"\n### 参见\n[getNetworkType](http://uniapp.dcloud.io/api/system/network?id=getnetworktype)\n"},"get-network-type":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/get-network-type/get-network-type.uvue) \n ```html\n\r\n\r\n\r\n\n\n```"},"connectSocket":{"name":"## uni.connectSocket(options) @connectsocket","description":"创建一个 WebSocket 连接。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ConnectSocketOptions](#connectsocketoptions-values) | 是 | - | - |\n#### ConnectSocketOptions 属性值 @connectsocketoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string | 是 | - | 开发者服务器接口地址,必须是 wss 协议,且域名必须是后台配置的合法域名 |\n| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 否 | null | HTTP 请求 Header,header 中不能设置 Referer |\n| protocols | Array\\ | 否 | null | 子协议数组 |\n| success | (result: [ConnectSocketSuccess](#connectsocketsuccess-values)) => void | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [ConnectSocketFail](#connectsocketfail-values)) => void | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: any) => void | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### ConnectSocketSuccess 属性值 @connectsocketsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### ConnectSocketFail 属性值 @connectsocketfail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 600009 | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](/tutorial/err-spec.html#unierror) | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [SocketTask](#sockettask-values) | \n\n#### SocketTask 属性值 @sockettask-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| send | (options: [SendSocketMessageOptions](#sendsocketmessageoptions-values)) => void | 是 | - | 通过 WebSocket 连接发送数据 |\n| close | (options: [CloseSocketOptions](#closesocketoptions-values)) => void | 是 | - | 关闭 WebSocket 连接 |\n| onOpen | (callback: (result: [OnSocketOpenCallbackResult](#onsocketopencallbackresult-values)) => void) => void | 是 | - | 监听 WebSocket 连接打开事件 |\n| onClose | (callback: (result: any) => void) => void | 是 | - | 监听 WebSocket 连接关闭事件 |\n| onError | (callback: (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void) => void | 是 | - | 监听 WebSocket 错误 |\n| onMessage | (callback: (result: [OnSocketMessageCallbackResult](#onsocketmessagecallbackresult-values)) => void) => void | 是 | - | 监听 WebSocket 接受到服务器的消息事件 |\n\n##### SendSocketMessageOptions 属性值 @sendsocketmessageoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | any | 是 | - | 需要发送的内容 |\n| success | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### CloseSocketOptions 属性值 @closesocketoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| code | number | 否 | 1000 | 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。如果这个参数没有被指定,默认的取值是1000 (表示正常连接关闭) |\n| reason | string | 否 | \"\" | 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于123字节的UTF-8 文本(不是字符) |\n| success | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### OnSocketOpenCallbackResult 属性值 @onsocketopencallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| header | any | 是 | - | 连接成功的 HTTP 响应 Header |\n\n##### OnSocketMessageCallbackResult 属性值 @onsocketmessagecallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | any | 是 | - | 服务器返回的消息 |\n\n##### SocketTask 兼容性 \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| send | 4.4 | √ | 3.9+ | 9.0 | √ | x |\n| close | 4.4 | √ | 3.9+ | 9.0 | √ | x |\n| onOpen | 4.4 | √ | 3.9+ | 9.0 | √ | x |\n| onClose | 4.4 | √ | 3.9+ | 9.0 | √ | x |\n| onError | 4.4 | √ | 3.9+ | 9.0 | √ | x |\n| onMessage | 4.4 | √ | 3.9+ | 9.0 | √ | x |\n","compatibility":"### connectSocket 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9+ | 9.0 | √ | x |\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 | (result: [OnSocketOpenCallbackResult](#onsocketopencallbackresult-values)) => void | 是 | - | - |","returnValue":"","compatibility":"### onSocketOpen 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9+ | 9.0 | √ | x |\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 | (result: [OnSocketErrorCallbackResult](#onsocketerrorcallbackresult-values)) => void | 是 | - | - |\n#### OnSocketErrorCallbackResult 属性值 @onsocketerrorcallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | 错误信息 |\n","returnValue":"","compatibility":"### onSocketError 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9+ | 9.0 | √ | x |\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-values) | 是 | - | - |\n#### SendSocketMessageOptions 属性值 @sendsocketmessageoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | any | 是 | - | 需要发送的内容 |\n| success | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n","returnValue":"","compatibility":"### sendSocketMessage 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9+ | 9.0 | √ | x |\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 | (result: [OnSocketMessageCallbackResult](#onsocketmessagecallbackresult-values)) => void | 是 | - | - |\n#### OnSocketMessageCallbackResult 属性值 @onsocketmessagecallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | any | 是 | - | 服务器返回的消息 |\n","returnValue":"","compatibility":"### onSocketMessage 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9+ | 9.0 | √ | x |\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-values) | 是 | - | - |\n#### CloseSocketOptions 属性值 @closesocketoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| code | number | 否 | 1000 | 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。如果这个参数没有被指定,默认的取值是1000 (表示正常连接关闭) |\n| reason | string | 否 | \"\" | 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于123字节的UTF-8 文本(不是字符) |\n| success | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n","returnValue":"","compatibility":"### closeSocket 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9+ | 9.0 | √ | x |\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 | (result: [OnSocketCloseCallbackResult](#onsocketclosecallbackresult-values)) => void | 是 | - | - |\n#### OnSocketCloseCallbackResult 属性值 @onsocketclosecallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| code | number | 是 | - | 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。\t |\n| reason | string | 是 | - | 一个可读的字符串,表示连接被关闭的原因。\t |\n","returnValue":"","compatibility":"### onSocketClose 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9+ | 9.0 | √ | x |\n","tutorial":"\n### 参见\n[onSocketClose](https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketclose)\n"},"websocket-global":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/websocket-global/websocket-global.uvue) \n ```html\n\r\n\r\n\r\n\r\n\r\n\n```"},"getSystemInfo":{"name":"## uni.getSystemInfo(options) @getsysteminfo","description":"异步获取系统信息","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetSystemInfoOptions](#getsysteminfooptions-values) | 是 | - | - |\n#### GetSystemInfoOptions 属性值 @getsysteminfooptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (result: [GetSystemInfoResult](#getsysteminforesult-values)) => void | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: any) => void | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### GetSystemInfoResult 属性值 @getsysteminforesult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| SDKVersion | string | 是 | - | 客户端基础库版本 |\n| appId | string | 是 | - | `manifest.json` 中应用appid。 |\n| appLanguage | string | 是 | - | 应用设置的语言。 |\n| appName | string | 是 | - | `manifest.json` 中应用名称。 |\n| appVersion | string | 是 | - | `manifest.json` 中应用版本名称。 |\n| appVersionCode | string | 是 | - | `manifest.json` 中应用版本名号。 |\n| brand | string | 是 | - | 手机品牌。 |\n| browserName | string | 是 | - | 浏览器名称。`App` 端是系统 webview 的名字,比如 wkwebview、chrome。小程序端为空 |\n| browserVersion | string | 是 | - | 浏览器版本、webview 版本。 |\n| deviceId | string | 是 | - | 设备 ID |\n| deviceBrand | string | 是 | - | 设备品牌。如:`apple`、`huawei`。 |\n| deviceModel | string | 是 | - | 设备型号 |\n| deviceType | string | 是 | - | 设备类型。`phone`、`pad`、`pc` |\n| devicePixelRatio | number | 是 | - | 设备像素比 |\n| deviceOrientation | string | 是 | - | 设备方向。如:`竖屏 portrait`、`横屏 landscape` - portrait: 竖屏 - landscape: 横屏 |\n| language | string | 是 | - | 程序设置的语言 |\n| model | string | 是 | - | 手机型号 |\n| osName | string | 是 | - | ios、android、windows、mac、linux |\n| osVersion | string | 是 | - | 操作系统版本。如 ios 版本,andriod 版本 |\n| osLanguage | string | 是 | - | 操作系统语言 |\n| pixelRatio | number | 是 | - | 设备像素比 |\n| platform | string | 是 | - | 客户端平台 |\n| screenWidth | number | 是 | - | 屏幕宽度 |\n| screenHeight | number | 是 | - | 屏幕高度 |\n| statusBarHeight | number | 是 | - | 状态栏的高度 |\n| system | string | 是 | - | 操作系统版本 |\n| safeArea | [SafeArea](#safearea-values) | 是 | - | 在竖屏正方向下的安全区域 |\n| safeAreaInsets | [SafeAreaInsets](#safeareainsets-values) | 是 | - | 在竖屏正方向下的安全区域插入位置 |\n| ua | string | 是 | - | 用户标识。小程序端为空 |\n| uniCompileVersion | string | 是 | - | uni 编译器版本 |\n| uniPlatform | string | 是 | - | uni-app 运行平台。如:`app`、`mp-weixin`、`web` |\n| uniRuntimeVersion | string | 是 | - | uni 运行时版本 |\n| uniCompileVersionCode | number | 是 | - | uni 编译器版本号 |\n| uniRuntimeVersionCode | number | 是 | - | uni 运行时版本号 |\n| version | string | 是 | - | 引擎版本号。已废弃,仅为了向下兼容保留 |\n| romName | string | 是 | - | rom 名称。Android 部分机型获取不到值。iOS 恒为 `ios` |\n| romVersion | string | 是 | - | rom 版本号。Android 部分机型获取不到值。iOS 恒为 `ios 版本号` |\n| windowWidth | number | 是 | - | 可使用窗口宽度 |\n| windowHeight | number | 是 | - | 可使用窗口高度 |\n| windowTop | number | 是 | - | 可使用窗口的顶部位置 |\n| windowBottom | number | 是 | - | 可使用窗口的底部位置 |\n| oaid | string | 否 | - | oaid |\n| osAndroidAPILevel | number | 否 | - | Android 系统API库的版本。 |\n\n###### SafeArea 属性值 @safearea-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| left | number | 是 | - | 安全区域左上角横坐标 |\n| right | number | 是 | - | 安全区域右下角横坐标 |\n| top | number | 是 | - | 安全区域左上角纵坐标 |\n| bottom | number | 是 | - | 安全区域右下角纵坐标 |\n| width | number | 是 | - | 安全区域的宽度,单位逻辑像素 |\n| height | number | 是 | - | 安全区域的高度,单位逻辑像素 |\n\n###### SafeAreaInsets 属性值 @safeareainsets-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| left | number | 是 | - | 安全区域左侧插入位置 |\n| right | number | 是 | - | 安全区域右侧插入位置 |\n| top | number | 是 | - | 安全区顶部插入位置 |\n| bottom | number | 是 | - | 安全区域底部插入位置 |\n\n###### GetSystemInfoResult 兼容性 \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| oaid | 4.4 | √ | √ | x | x | x |\n| osAndroidAPILevel | 4.4 | √ | √ | x | x | x |\n","returnValue":"","compatibility":"### getSystemInfo 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9+ | 9.0 | √ | x |\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-values) | \n\n#### GetSystemInfoResult 属性值 @getsysteminforesult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| SDKVersion | string | 是 | - | 客户端基础库版本 |\n| appId | string | 是 | - | `manifest.json` 中应用appid。 |\n| appLanguage | string | 是 | - | 应用设置的语言。 |\n| appName | string | 是 | - | `manifest.json` 中应用名称。 |\n| appVersion | string | 是 | - | `manifest.json` 中应用版本名称。 |\n| appVersionCode | string | 是 | - | `manifest.json` 中应用版本名号。 |\n| brand | string | 是 | - | 手机品牌。 |\n| browserName | string | 是 | - | 浏览器名称。`App` 端是系统 webview 的名字,比如 wkwebview、chrome。小程序端为空 |\n| browserVersion | string | 是 | - | 浏览器版本、webview 版本。 |\n| deviceId | string | 是 | - | 设备 ID |\n| deviceBrand | string | 是 | - | 设备品牌。如:`apple`、`huawei`。 |\n| deviceModel | string | 是 | - | 设备型号 |\n| deviceType | string | 是 | - | 设备类型。`phone`、`pad`、`pc` |\n| devicePixelRatio | number | 是 | - | 设备像素比 |\n| deviceOrientation | string | 是 | - | 设备方向。如:`竖屏 portrait`、`横屏 landscape` - portrait: 竖屏 - landscape: 横屏 |\n| language | string | 是 | - | 程序设置的语言 |\n| model | string | 是 | - | 手机型号 |\n| osName | string | 是 | - | ios、android、windows、mac、linux |\n| osVersion | string | 是 | - | 操作系统版本。如 ios 版本,andriod 版本 |\n| osLanguage | string | 是 | - | 操作系统语言 |\n| pixelRatio | number | 是 | - | 设备像素比 |\n| platform | string | 是 | - | 客户端平台 |\n| screenWidth | number | 是 | - | 屏幕宽度 |\n| screenHeight | number | 是 | - | 屏幕高度 |\n| statusBarHeight | number | 是 | - | 状态栏的高度 |\n| system | string | 是 | - | 操作系统版本 |\n| safeArea | [SafeArea](#safearea-values) | 是 | - | 在竖屏正方向下的安全区域 |\n| safeAreaInsets | [SafeAreaInsets](#safeareainsets-values) | 是 | - | 在竖屏正方向下的安全区域插入位置 |\n| ua | string | 是 | - | 用户标识。小程序端为空 |\n| uniCompileVersion | string | 是 | - | uni 编译器版本 |\n| uniPlatform | string | 是 | - | uni-app 运行平台。如:`app`、`mp-weixin`、`web` |\n| uniRuntimeVersion | string | 是 | - | uni 运行时版本 |\n| uniCompileVersionCode | number | 是 | - | uni 编译器版本号 |\n| uniRuntimeVersionCode | number | 是 | - | uni 运行时版本号 |\n| version | string | 是 | - | 引擎版本号。已废弃,仅为了向下兼容保留 |\n| romName | string | 是 | - | rom 名称。Android 部分机型获取不到值。iOS 恒为 `ios` |\n| romVersion | string | 是 | - | rom 版本号。Android 部分机型获取不到值。iOS 恒为 `ios 版本号` |\n| windowWidth | number | 是 | - | 可使用窗口宽度 |\n| windowHeight | number | 是 | - | 可使用窗口高度 |\n| windowTop | number | 是 | - | 可使用窗口的顶部位置 |\n| windowBottom | number | 是 | - | 可使用窗口的底部位置 |\n| oaid | string | 否 | - | oaid |\n| osAndroidAPILevel | number | 否 | - | Android 系统API库的版本。 |\n\n##### SafeArea 属性值 @safearea-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| left | number | 是 | - | 安全区域左上角横坐标 |\n| right | number | 是 | - | 安全区域右下角横坐标 |\n| top | number | 是 | - | 安全区域左上角纵坐标 |\n| bottom | number | 是 | - | 安全区域右下角纵坐标 |\n| width | number | 是 | - | 安全区域的宽度,单位逻辑像素 |\n| height | number | 是 | - | 安全区域的高度,单位逻辑像素 |\n\n##### SafeAreaInsets 属性值 @safeareainsets-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| left | number | 是 | - | 安全区域左侧插入位置 |\n| right | number | 是 | - | 安全区域右侧插入位置 |\n| top | number | 是 | - | 安全区顶部插入位置 |\n| bottom | number | 是 | - | 安全区域底部插入位置 |\n\n##### GetSystemInfoResult 兼容性 \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| oaid | 4.4 | √ | √ | x | x | x |\n| osAndroidAPILevel | 4.4 | √ | √ | x | x | x |\n","compatibility":"### getSystemInfoSync 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9+ | 9.0 | √ | x |\n","tutorial":"\n### 参见\n[getSystemInfoSync](http://uniapp.dcloud.io/api/system/info?id=getsysteminfosync)\n"},"get-system-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/get-system-info/get-system-info.uvue) \n ```html\n\r\n\r\n\r\n\r\n\n```"},"getDeviceInfo":{"name":"## uni.getDeviceInfo(options?) @getdeviceinfo","description":"获取设备信息","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetDeviceInfoOptions](#getdeviceinfooptions-values) | 否 | 包含所有字段的过滤对象 | [options=包含所有字段的过滤对象\\] 过滤的字段对象, 不传参数默认为获取全部字段。 |\n#### GetDeviceInfoOptions 属性值 @getdeviceinfooptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filter | Array\\ | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [GetDeviceInfoResult](#getdeviceinforesult-values) | \n\n#### GetDeviceInfoResult 属性值 @getdeviceinforesult-values \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\n##### GetDeviceInfoResult 兼容性 \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| oaid | 5.0 | √ | √ | 9.0 | x | x |\n| isUSBDebugging | 5.0 | √ | √ | 9.0 | x | x |\n| idfa | 5.0 | x | x | 9.0 | √ | √ |\n","compatibility":"### getDeviceInfo 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9+ | 9.0 | √ | 3.9+ |\n","tutorial":"\n### 参见\n[getDeviceInfo](https://uniapp.dcloud.net.cn/api/system/getDeviceInfo.html)\n"},"get-device-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/get-device-info/get-device-info.uvue) \n ```html\n\r\n\r\n\r\n\r\n\n```"},"getWindowInfo":{"name":"## uni.getWindowInfo() @getwindowinfo","description":"同步获取窗口信息","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [GetWindowInfoResult](#getwindowinforesult-values) | \n\n#### GetWindowInfoResult 属性值 @getwindowinforesult-values \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-values) | 是 | - | 在竖屏正方向下的安全区域 |\n| safeAreaInsets | [SafeAreaInsets](#safeareainsets-values) | 是 | - | 在竖屏正方向下的安全区域插入位置 |\n| screenTop | number | 是 | - | 窗口上边缘的 y 值 |\n\n##### SafeArea 属性值 @safearea-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| left | number | 是 | - | 安全区域左上角横坐标 |\n| right | number | 是 | - | 安全区域右下角横坐标 |\n| top | number | 是 | - | 安全区域左上角纵坐标 |\n| bottom | number | 是 | - | 安全区域右下角纵坐标 |\n| width | number | 是 | - | 安全区域的宽度,单位逻辑像素 |\n| height | number | 是 | - | 安全区域的高度,单位逻辑像素 |\n\n##### SafeAreaInsets 属性值 @safeareainsets-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| left | number | 是 | - | 安全区域左侧插入位置 |\n| right | number | 是 | - | 安全区域右侧插入位置 |\n| top | number | 是 | - | 安全区顶部插入位置 |\n| bottom | number | 是 | - | 安全区域底部插入位置 |\n","compatibility":"### getWindowInfo 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9+ | 9.0 | √ | x |\n","tutorial":"\n### 参见\n[getWindowInfo](http://uniapp.dcloud.io/api/system/getWindowInfo.html)\n"},"get-window-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/get-window-info/get-window-info.uvue) \n ```html\n\r\n\n\n```"},"uploadFile":{"name":"## uni.uploadFile(options) @uploadfile","description":"将本地资源上传到开发者服务器。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [UploadFileOptions](#uploadfileoptions-values) | 是 | - | - |\n#### UploadFileOptions 属性值 @uploadfileoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string | 是 | - | 开发者服务器 url |\n| filePath | string | 否 | null | 要上传文件资源的路径 |\n| name | string | 否 | null | 文件对应的 key , 开发者在服务器端通过这个 key 可以获取到文件二进制内容 |\n| files | Array\\<[UploadFileOptionFiles](#uploadfileoptionfiles-values)\\> | 否 | null | 需要上传的文件列表。 |\n| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 否 | null | HTTP 请求 Header, header 中不能设置 Referer |\n| formData | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 否 | null | HTTP 请求中其他额外的 form data |\n| timeout | number | 否 | 120000 | 超时时间,单位 ms |\n| success | (result: [UploadFileSuccess](#uploadfilesuccess-values)) => void | 否 | null | 成功返回的回调函数 |\n| fail | (result: [UploadFileFail](#uploadfilefail-values)) => void | 否 | null | 失败的回调函数 |\n| complete | (result: any) => void | 否 | null | 结束的回调函数(调用成功、失败都会执行) |\n\n##### UploadFileOptionFiles 属性值 @uploadfileoptionfiles-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| name | string | 否 | \"file\" | multipart 提交时,表单的项目名,默认为 file,如果 name 不填或填的值相同,可能导致服务端读取文件时只能读取到一个文件。 |\n| uri | string | 是 | - | 要上传文件资源的路径 |\n\n##### UploadFileSuccess 属性值 @uploadfilesuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | string | 是 | - | 开发者服务器返回的数据 |\n| statusCode | number | 是 | - | 开发者服务器返回的 HTTP 状态码 |\n\n##### UploadFileFail 属性值 @uploadfilefail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | RequestErrorCode | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](/tutorial/err-spec.html#unierror) | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| [UploadTask](#uploadtask-values) | 否 | \n\n#### UploadTask 属性值 @uploadtask-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| abort | () => void | 是 | - | 中断上传任务。 |\n| onProgressUpdate | (callback: (result: [OnProgressUpdateResult](#onprogressupdateresult-values)) => void) => void | 是 | - | 监听上传进度变化。 |\n\n##### OnProgressUpdateResult 属性值 @onprogressupdateresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| progress | number | 是 | - | 上传进度百分比 |\n| totalBytesSent | number | 是 | - | 已经上传的数据长度,单位 Bytes |\n| totalBytesExpectedToSend | number | 是 | - | 预期需要上传的数据总长度,单位 Bytes |\n\n##### UploadTask 兼容性 \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| abort | 4.4 | √ | 3.9.0 | 9.0 | √ | x |\n| onProgressUpdate | 4.4 | √ | 3.9.0 | 9.0 | √ | x |\n","compatibility":"### uploadFile 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9.0 | 9.0 | √ | x |\n","tutorial":"\n### 参见\n[uploadFile](https://uniapp.dcloud.net.cn/api/request/network-file.html#uploadfile)\n"},"upload-file":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/upload-file/upload-file.uvue) \n ```html\n\r\n\r\n\r\n\r\n\n```"},"downloadFile":{"name":"## uni.downloadFile(options) @downloadfile","description":"下载文件资源到本地,客户端直接发起一个 HTTP GET 请求,返回文件的本地临时路径。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [DownloadFileOptions](#downloadfileoptions-values) | 是 | - | - |\n#### DownloadFileOptions 属性值 @downloadfileoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string | 是 | - | 下载资源的 url |\n| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 否 | null | HTTP 请求 Header,header 中不能设置 Referer |\n| timeout | number | 否 | 120000 | 超时时间,单位 ms |\n| success | (result: [DownloadFileSuccess](#downloadfilesuccess-values)) => void | 否 | null | 下载成功后以 tempFilePath 的形式传给页面,res = {tempFilePath: '文件的临时路径'} |\n| fail | (result: [DownloadFileFail](#downloadfilefail-values)) => void | 否 | null | 失败的回调函数 |\n| complete | (result: any) => void | 否 | null | 结束的回调函数(调用成功、失败都会执行) |\n\n##### DownloadFileSuccess 属性值 @downloadfilesuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| tempFilePath | string | 是 | - | 临时文件路径,下载后的文件会存储到一个临时文件 |\n| statusCode | number | 是 | - | 开发者服务器返回的 HTTP 状态码 |\n\n##### DownloadFileFail 属性值 @downloadfilefail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | RequestErrorCode | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](/tutorial/err-spec.html#unierror) | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| [DownloadTask](#downloadtask-values) | 否 | \n\n#### DownloadTask 属性值 @downloadtask-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| abort | () => void | 是 | - | 中断下载任务。 |\n| onProgressUpdate | (callback: (result: [OnProgressDownloadResult](#onprogressdownloadresult-values)) => void) => void | 是 | - | 监听下载进度变化。 |\n\n##### OnProgressDownloadResult 属性值 @onprogressdownloadresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| progress | number | 是 | - | 下载进度百分比 |\n| totalBytesWritten | number | 是 | - | 已经下载的数据长度,单位 Bytes |\n| totalBytesExpectedToWrite | number | 是 | - | 预期需要下载的数据总长度,单位 Bytes |\n\n##### DownloadTask 兼容性 \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| abort | 4.4 | √ | 3.9.0 | 9.0 | √ | x |\n| onProgressUpdate | 4.4 | √ | 3.9.0 | 9.0 | √ | x |\n","compatibility":"### downloadFile 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9.0 | 9.0 | √ | x |\n","tutorial":"\n### 参见\n[downloadFile](https://uniapp.dcloud.net.cn/api/request/network-file.html#downloadfile)\n"},"download-file":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/download-file/download-file.uvue) \n ```html\n\r\n\r\n\r\n\r\n\n```"},"getNetworkType":{"name":"## uni.getNetworkType(options) @getnetworktype","description":"获取网络类型","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetNetworkTypeOptions](#getnetworktypeoptions-values) | 是 | - | - |\n#### GetNetworkTypeOptions 属性值 @getnetworktypeoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (result: [GetNetworkTypeSuccess](#getnetworktypesuccess-values)) => void | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: any) => void | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### GetNetworkTypeSuccess 属性值 @getnetworktypesuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| networkType | string | 是 | - | 网络类型 |\n","returnValue":"","compatibility":"### getNetworkType 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9.0 | 9.0 | √ | x |\n","tutorial":"\n### 参见\n[getNetworkType](http://uniapp.dcloud.io/api/system/network?id=getnetworktype)\n"},"get-network-type":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/get-network-type/get-network-type.uvue) \n ```html\n\r\n\r\n\r\n\n\n```"},"connectSocket":{"name":"## uni.connectSocket(options) @connectsocket","description":"创建一个 WebSocket 连接。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ConnectSocketOptions](#connectsocketoptions-values) | 是 | - | - |\n#### ConnectSocketOptions 属性值 @connectsocketoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string | 是 | - | 开发者服务器接口地址,必须是 wss 协议,且域名必须是后台配置的合法域名 |\n| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 否 | null | HTTP 请求 Header,header 中不能设置 Referer |\n| protocols | Array\\ | 否 | null | 子协议数组 |\n| success | (result: [ConnectSocketSuccess](#connectsocketsuccess-values)) => void | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [ConnectSocketFail](#connectsocketfail-values)) => void | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: any) => void | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### ConnectSocketSuccess 属性值 @connectsocketsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### ConnectSocketFail 属性值 @connectsocketfail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 600009 | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](/tutorial/err-spec.html#unierror) | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [SocketTask](#sockettask-values) | \n\n#### SocketTask 属性值 @sockettask-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| send | (options: [SendSocketMessageOptions](#sendsocketmessageoptions-values)) => void | 是 | - | 通过 WebSocket 连接发送数据 |\n| close | (options: [CloseSocketOptions](#closesocketoptions-values)) => void | 是 | - | 关闭 WebSocket 连接 |\n| onOpen | (callback: (result: [OnSocketOpenCallbackResult](#onsocketopencallbackresult-values)) => void) => void | 是 | - | 监听 WebSocket 连接打开事件 |\n| onClose | (callback: (result: any) => void) => void | 是 | - | 监听 WebSocket 连接关闭事件 |\n| onError | (callback: (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void) => void | 是 | - | 监听 WebSocket 错误 |\n| onMessage | (callback: (result: [OnSocketMessageCallbackResult](#onsocketmessagecallbackresult-values)) => void) => void | 是 | - | 监听 WebSocket 接受到服务器的消息事件 |\n\n##### SendSocketMessageOptions 属性值 @sendsocketmessageoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | any | 是 | - | 需要发送的内容 |\n| success | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### CloseSocketOptions 属性值 @closesocketoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| code | number | 否 | 1000 | 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。如果这个参数没有被指定,默认的取值是1000 (表示正常连接关闭) |\n| reason | string | 否 | \"\" | 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于123字节的UTF-8 文本(不是字符) |\n| success | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### OnSocketOpenCallbackResult 属性值 @onsocketopencallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| header | any | 是 | - | 连接成功的 HTTP 响应 Header |\n\n##### OnSocketMessageCallbackResult 属性值 @onsocketmessagecallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | any | 是 | - | 服务器返回的消息 |\n\n##### SocketTask 兼容性 \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| send | 4.4 | √ | 3.9.0 | 9.0 | √ | x |\n| close | 4.4 | √ | 3.9.0 | 9.0 | √ | x |\n| onOpen | 4.4 | √ | 3.9.0 | 9.0 | √ | x |\n| onClose | 4.4 | √ | 3.9.0 | 9.0 | √ | x |\n| onError | 4.4 | √ | 3.9.0 | 9.0 | √ | x |\n| onMessage | 4.4 | √ | 3.9.0 | 9.0 | √ | x |\n","compatibility":"### connectSocket 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9.0 | 9.0 | √ | x |\n","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 | (result: [OnSocketOpenCallbackResult](#onsocketopencallbackresult-values)) => void | 是 | - | - |","returnValue":"","compatibility":"### onSocketOpen 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9.0 | 9.0 | √ | x |\n","tutorial":"\n### 参见\n[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 | (result: [OnSocketErrorCallbackResult](#onsocketerrorcallbackresult-values)) => void | 是 | - | - |\n#### OnSocketErrorCallbackResult 属性值 @onsocketerrorcallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | 错误信息 |\n","returnValue":"","compatibility":"### onSocketError 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9.0 | 9.0 | √ | x |\n","tutorial":"\n### 参见\n[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-values) | 是 | - | - |\n#### SendSocketMessageOptions 属性值 @sendsocketmessageoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | any | 是 | - | 需要发送的内容 |\n| success | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n","returnValue":"","compatibility":"### sendSocketMessage 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9.0 | 9.0 | √ | x |\n","tutorial":"\n### 参见\n[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 | (result: [OnSocketMessageCallbackResult](#onsocketmessagecallbackresult-values)) => void | 是 | - | - |\n#### OnSocketMessageCallbackResult 属性值 @onsocketmessagecallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | any | 是 | - | 服务器返回的消息 |\n","returnValue":"","compatibility":"### onSocketMessage 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9.0 | 9.0 | √ | x |\n","tutorial":"\n### 参见\n[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-values) | 是 | - | - |\n#### CloseSocketOptions 属性值 @closesocketoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| code | number | 否 | 1000 | 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。如果这个参数没有被指定,默认的取值是1000 (表示正常连接关闭) |\n| reason | string | 否 | \"\" | 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于123字节的UTF-8 文本(不是字符) |\n| success | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n","returnValue":"","compatibility":"### closeSocket 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9.0 | 9.0 | √ | x |\n","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 | (result: [OnSocketCloseCallbackResult](#onsocketclosecallbackresult-values)) => void | 是 | - | - |\n#### OnSocketCloseCallbackResult 属性值 @onsocketclosecallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| code | number | 是 | - | 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。\t |\n| reason | string | 是 | - | 一个可读的字符串,表示连接被关闭的原因。\t |\n","returnValue":"","compatibility":"### onSocketClose 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9.0 | 9.0 | √ | x |\n","tutorial":"\n### 参见\n[onSocketClose](https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketclose)\n"},"websocket-global":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/websocket-global/websocket-global.uvue) \n ```html\n\r\n\r\n\r\n\r\n\r\n\n```"},"getSystemInfo":{"name":"## uni.getSystemInfo(options) @getsysteminfo","description":"异步获取系统信息","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetSystemInfoOptions](#getsysteminfooptions-values) | 是 | - | - |\n#### GetSystemInfoOptions 属性值 @getsysteminfooptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (result: [GetSystemInfoResult](#getsysteminforesult-values)) => void | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [UniError](/tutorial/err-spec.html#unierror)) => void | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: any) => void | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### GetSystemInfoResult 属性值 @getsysteminforesult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| SDKVersion | string | 是 | - | 客户端基础库版本 |\n| appId | string | 是 | - | `manifest.json` 中应用appid。 |\n| appLanguage | string | 是 | - | 应用设置的语言。 |\n| appName | string | 是 | - | `manifest.json` 中应用名称(真机运行时,为基座的应用名称)。 |\n| appVersion | string | 是 | - | `manifest.json` 中应用版本名称(真机运行时,为基座的版本名称)。 |\n| appVersionCode | number | 是 | - | `manifest.json` 中应用版本名号(真机运行时,为基座的版本号)。 |\n| brand | string | 是 | - | 手机品牌。 |\n| browserName | string | 是 | - | 浏览器名称。`App` 端是系统 webview 的名字,比如 wkwebview、chrome。小程序端为空 |\n| browserVersion | string | 是 | - | 浏览器版本、webview 版本。 |\n| deviceId | string | 是 | - | 设备 ID |\n| deviceBrand | string | 是 | - | 设备品牌。如:`apple`、`huawei`。 |\n| deviceModel | string | 是 | - | 设备型号 |\n| deviceType | string | 是 | - | 设备类型。`phone`、`pad`、`pc` |\n| devicePixelRatio | number | 是 | - | 设备像素比 |\n| deviceOrientation | string | 是 | - | 设备方向。如:`竖屏 portrait`、`横屏 landscape` - portrait: 竖屏 - landscape: 横屏 |\n| language | string | 是 | - | 程序设置的语言 |\n| model | string | 是 | - | 手机型号 |\n| osName | string | 是 | - | ios、android、windows、mac、linux |\n| osVersion | string | 是 | - | 操作系统版本。如 ios 版本,andriod 版本 |\n| osLanguage | string | 是 | - | 操作系统语言 |\n| pixelRatio | number | 是 | - | 设备像素比 |\n| platform | string | 是 | - | 客户端平台 |\n| screenWidth | number | 是 | - | 屏幕宽度 |\n| screenHeight | number | 是 | - | 屏幕高度 |\n| statusBarHeight | number | 是 | - | 状态栏的高度 |\n| system | string | 是 | - | 操作系统版本 |\n| safeArea | [SafeArea](#safearea-values) | 是 | - | 在竖屏正方向下的安全区域 |\n| safeAreaInsets | [SafeAreaInsets](#safeareainsets-values) | 是 | - | 在竖屏正方向下的安全区域插入位置 |\n| ua | string | 是 | - | 用户标识。小程序端为空 |\n| uniCompileVersion | string | 是 | - | uni 编译器版本 |\n| uniPlatform | string | 是 | - | uni-app 运行平台。如:`app`、`mp-weixin`、`web` |\n| uniRuntimeVersion | string | 是 | - | uni 运行时版本 |\n| uniCompileVersionCode | number | 是 | - | uni 编译器版本号 |\n| uniRuntimeVersionCode | number | 是 | - | uni 运行时版本号 |\n| version | string | 是 | - | 引擎版本号 |\n| romName | string | 是 | - | rom 名称。Android 部分机型获取不到值。iOS 恒为 `ios` |\n| romVersion | string | 是 | - | rom 版本号。Android 部分机型获取不到值。iOS 恒为 `ios 版本号` |\n| windowWidth | number | 是 | - | 可使用窗口宽度 |\n| windowHeight | number | 是 | - | 可使用窗口高度 |\n| windowTop | number | 是 | - | 可使用窗口的顶部位置 |\n| windowBottom | number | 是 | - | 可使用窗口的底部位置 |\n| oaid | string | 否 | - | oaid |\n| osAndroidAPILevel | number | 否 | - | Android 系统API库的版本。 |\n\n###### SafeArea 属性值 @safearea-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| left | number | 是 | - | 安全区域左上角横坐标 |\n| right | number | 是 | - | 安全区域右下角横坐标 |\n| top | number | 是 | - | 安全区域左上角纵坐标 |\n| bottom | number | 是 | - | 安全区域右下角纵坐标 |\n| width | number | 是 | - | 安全区域的宽度,单位逻辑像素 |\n| height | number | 是 | - | 安全区域的高度,单位逻辑像素 |\n\n###### SafeAreaInsets 属性值 @safeareainsets-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| left | number | 是 | - | 安全区域左侧插入位置 |\n| right | number | 是 | - | 安全区域右侧插入位置 |\n| top | number | 是 | - | 安全区顶部插入位置 |\n| bottom | number | 是 | - | 安全区域底部插入位置 |\n\n###### GetSystemInfoResult 兼容性 \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| oaid | 4.4 | √ | √ | x | x | x |\n| osAndroidAPILevel | 4.4 | √ | √ | x | x | x |\n","returnValue":"","compatibility":"### getSystemInfo 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9.0 | 9.0 | √ | x |\n","tutorial":"\n### 参见\n[getSystemInfo](http://uniapp.dcloud.io/api/system/info?id=getsysteminfo)\n"},"getSystemInfoSync":{"name":"## uni.getSystemInfoSync() @getsysteminfosync","description":"同步获取系统信息","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [GetSystemInfoResult](#getsysteminforesult-values) | \n\n#### GetSystemInfoResult 属性值 @getsysteminforesult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| SDKVersion | string | 是 | - | 客户端基础库版本 |\n| appId | string | 是 | - | `manifest.json` 中应用appid。 |\n| appLanguage | string | 是 | - | 应用设置的语言。 |\n| appName | string | 是 | - | `manifest.json` 中应用名称(真机运行时,为基座的应用名称)。 |\n| appVersion | string | 是 | - | `manifest.json` 中应用版本名称(真机运行时,为基座的版本名称)。 |\n| appVersionCode | number | 是 | - | `manifest.json` 中应用版本名号(真机运行时,为基座的版本号)。 |\n| brand | string | 是 | - | 手机品牌。 |\n| browserName | string | 是 | - | 浏览器名称。`App` 端是系统 webview 的名字,比如 wkwebview、chrome。小程序端为空 |\n| browserVersion | string | 是 | - | 浏览器版本、webview 版本。 |\n| deviceId | string | 是 | - | 设备 ID |\n| deviceBrand | string | 是 | - | 设备品牌。如:`apple`、`huawei`。 |\n| deviceModel | string | 是 | - | 设备型号 |\n| deviceType | string | 是 | - | 设备类型。`phone`、`pad`、`pc` |\n| devicePixelRatio | number | 是 | - | 设备像素比 |\n| deviceOrientation | string | 是 | - | 设备方向。如:`竖屏 portrait`、`横屏 landscape` - portrait: 竖屏 - landscape: 横屏 |\n| language | string | 是 | - | 程序设置的语言 |\n| model | string | 是 | - | 手机型号 |\n| osName | string | 是 | - | ios、android、windows、mac、linux |\n| osVersion | string | 是 | - | 操作系统版本。如 ios 版本,andriod 版本 |\n| osLanguage | string | 是 | - | 操作系统语言 |\n| pixelRatio | number | 是 | - | 设备像素比 |\n| platform | string | 是 | - | 客户端平台 |\n| screenWidth | number | 是 | - | 屏幕宽度 |\n| screenHeight | number | 是 | - | 屏幕高度 |\n| statusBarHeight | number | 是 | - | 状态栏的高度 |\n| system | string | 是 | - | 操作系统版本 |\n| safeArea | [SafeArea](#safearea-values) | 是 | - | 在竖屏正方向下的安全区域 |\n| safeAreaInsets | [SafeAreaInsets](#safeareainsets-values) | 是 | - | 在竖屏正方向下的安全区域插入位置 |\n| ua | string | 是 | - | 用户标识。小程序端为空 |\n| uniCompileVersion | string | 是 | - | uni 编译器版本 |\n| uniPlatform | string | 是 | - | uni-app 运行平台。如:`app`、`mp-weixin`、`web` |\n| uniRuntimeVersion | string | 是 | - | uni 运行时版本 |\n| uniCompileVersionCode | number | 是 | - | uni 编译器版本号 |\n| uniRuntimeVersionCode | number | 是 | - | uni 运行时版本号 |\n| version | string | 是 | - | 引擎版本号 |\n| romName | string | 是 | - | rom 名称。Android 部分机型获取不到值。iOS 恒为 `ios` |\n| romVersion | string | 是 | - | rom 版本号。Android 部分机型获取不到值。iOS 恒为 `ios 版本号` |\n| windowWidth | number | 是 | - | 可使用窗口宽度 |\n| windowHeight | number | 是 | - | 可使用窗口高度 |\n| windowTop | number | 是 | - | 可使用窗口的顶部位置 |\n| windowBottom | number | 是 | - | 可使用窗口的底部位置 |\n| oaid | string | 否 | - | oaid |\n| osAndroidAPILevel | number | 否 | - | Android 系统API库的版本。 |\n\n##### SafeArea 属性值 @safearea-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| left | number | 是 | - | 安全区域左上角横坐标 |\n| right | number | 是 | - | 安全区域右下角横坐标 |\n| top | number | 是 | - | 安全区域左上角纵坐标 |\n| bottom | number | 是 | - | 安全区域右下角纵坐标 |\n| width | number | 是 | - | 安全区域的宽度,单位逻辑像素 |\n| height | number | 是 | - | 安全区域的高度,单位逻辑像素 |\n\n##### SafeAreaInsets 属性值 @safeareainsets-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| left | number | 是 | - | 安全区域左侧插入位置 |\n| right | number | 是 | - | 安全区域右侧插入位置 |\n| top | number | 是 | - | 安全区顶部插入位置 |\n| bottom | number | 是 | - | 安全区域底部插入位置 |\n\n##### GetSystemInfoResult 兼容性 \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| oaid | 4.4 | √ | √ | x | x | x |\n| osAndroidAPILevel | 4.4 | √ | √ | x | x | x |\n","compatibility":"### getSystemInfoSync 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9.0 | 9.0 | √ | x |\n","tutorial":"\n### 参见\n[getSystemInfoSync](http://uniapp.dcloud.io/api/system/info?id=getsysteminfosync)\n"},"get-system-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/get-system-info/get-system-info.uvue) \n ```html\n\r\n\r\n\r\n\r\n\n```"},"getDeviceInfo":{"name":"## uni.getDeviceInfo(options?) @getdeviceinfo","description":"获取设备信息","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetDeviceInfoOptions](#getdeviceinfooptions-values) | 否 | 包含所有字段的过滤对象 | [options=包含所有字段的过滤对象\\] 过滤的字段对象, 不传参数默认为获取全部字段。 |\n#### GetDeviceInfoOptions 属性值 @getdeviceinfooptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filter | Array\\ | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [GetDeviceInfoResult](#getdeviceinforesult-values) | \n\n#### GetDeviceInfoResult 属性值 @getdeviceinforesult-values \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\n##### GetDeviceInfoResult 兼容性 \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| oaid | 5.0 | √ | √ | 9.0 | x | x |\n| isUSBDebugging | 5.0 | √ | √ | 9.0 | x | x |\n| idfa | 5.0 | x | x | 9.0 | √ | √ |\n","compatibility":"### getDeviceInfo 兼容性 \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"},"get-device-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/get-device-info/get-device-info.uvue) \n ```html\n\r\n\r\n\r\n\r\n\n```"},"getWindowInfo":{"name":"## uni.getWindowInfo() @getwindowinfo","description":"同步获取窗口信息","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [GetWindowInfoResult](#getwindowinforesult-values) | \n\n#### GetWindowInfoResult 属性值 @getwindowinforesult-values \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-values) | 是 | - | 在竖屏正方向下的安全区域 |\n| safeAreaInsets | [SafeAreaInsets](#safeareainsets-values) | 是 | - | 在竖屏正方向下的安全区域插入位置 |\n| screenTop | number | 是 | - | 窗口上边缘的 y 值 |\n\n##### SafeArea 属性值 @safearea-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| left | number | 是 | - | 安全区域左上角横坐标 |\n| right | number | 是 | - | 安全区域右下角横坐标 |\n| top | number | 是 | - | 安全区域左上角纵坐标 |\n| bottom | number | 是 | - | 安全区域右下角纵坐标 |\n| width | number | 是 | - | 安全区域的宽度,单位逻辑像素 |\n| height | number | 是 | - | 安全区域的高度,单位逻辑像素 |\n\n##### SafeAreaInsets 属性值 @safeareainsets-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| left | number | 是 | - | 安全区域左侧插入位置 |\n| right | number | 是 | - | 安全区域右侧插入位置 |\n| top | number | 是 | - | 安全区顶部插入位置 |\n| bottom | number | 是 | - | 安全区域底部插入位置 |\n","compatibility":"### getWindowInfo 兼容性 \n| 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- |\n| 4.4 | √ | 3.9.0 | 9.0 | √ | x |\n","tutorial":"\n### 参见\n[getWindowInfo](http://uniapp.dcloud.io/api/system/getWindowInfo.html)\n"},"get-window-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/master/pages/API/get-window-info/get-window-info.uvue) \n ```html\n