diff --git a/docs/.vuepress/utils/utsApiJson.json b/docs/.vuepress/utils/utsApiJson.json index 567a2429f5e2ebac40593bdacf4b9e7b7abe453c..3ca9bb7a838a10a925d981f8fa4a8143d324ad7c 100644 --- a/docs/.vuepress/utils/utsApiJson.json +++ b/docs/.vuepress/utils/utsApiJson.json @@ -1 +1 @@ -{"getApp":{"name":"## getApp() @getapp","description":"`getApp()` 函数用于获å–当å‰åº”用实例,å¯é€šè¿‡åº”用实例调用 App.uvue methods ä¸å®šä¹‰çš„方法。","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| any |\n \n","compatibility":"### getApp 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/tutorial/page.html#getapp)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.global.get-app)\n"},"get-app":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-app/get-app.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-app/get-app\n>Template\n```vue\n<template>\r\n <!-- #ifdef APP -->\r\n <scroll-view style=\"flex: 1; padding-bottom: 20px\">\r\n <!-- #endif -->\r\n <view>\r\n <page-head title=\"getApp\"></page-head>\r\n <view class=\"uni-padding-wrap\">\r\n <button @click=\"getGlobalData\">get globalData</button>\r\n <template v-if=\"originGlobalData.str.length\">\r\n <text class=\"uni-common-mt bold\">åˆå§‹çš„ globalData:</text>\r\n <text class=\"uni-common-mt\">globalData string: {{ originGlobalData.str }}</text>\r\n <text class=\"uni-common-mt\">globalData number: {{ originGlobalData.num }}</text>\r\n <text class=\"uni-common-mt\">globalData boolean: {{ originGlobalData.bool }}</text>\r\n <text class=\"uni-common-mt\">globalData object: {{ originGlobalData.obj }}</text>\r\n <text class=\"uni-common-mt\">globalData null: {{ originGlobalData.null }}</text>\r\n <text class=\"uni-common-mt\">globalData array: {{ originGlobalData.arr }}</text>\r\n <text class=\"uni-common-mt\">globalData Set: {{ originGlobalData.mySet }}</text>\r\n <text class=\"uni-common-mt\">globalData Map: {{ originGlobalData.myMap }}</text>\r\n <text class=\"uni-common-mt\">globalData func 返回值: {{ originGlobalDataFuncRes }}</text>\r\n </template>\r\n <button @click=\"setGlobalData\" class=\"uni-common-mt\">\r\n set globalData\r\n </button>\r\n <template v-if=\"newGlobalData.bool\">\r\n <text class=\"uni-common-mt bold\">æ›´æ–°åŽçš„ globalData:</text>\r\n <text class=\"uni-common-mt\">globalData string: {{ newGlobalData.str }}</text>\r\n <text class=\"uni-common-mt\">globalData number: {{ newGlobalData.num }}</text>\r\n <text class=\"uni-common-mt\">globalData boolean: {{ newGlobalData.bool }}</text>\r\n <text class=\"uni-common-mt\">globalData object: {{ newGlobalData.obj }}</text>\r\n <text class=\"uni-common-mt\">globalData null: {{ newGlobalData.null }}</text>\r\n <text class=\"uni-common-mt\">globalData array: {{ newGlobalData.arr }}</text>\r\n <text class=\"uni-common-mt\">globalData Set: {{ newGlobalData.mySet }}</text>\r\n <text class=\"uni-common-mt\">globalData Map: {{ newGlobalData.myMap }}</text>\r\n <text class=\"uni-common-mt\">globalData func 返回值: {{ newGlobalDataFuncRes }}</text>\r\n </template>\r\n <text class=\"uni-common-mt\">点击按钮调用 App.uvue methods</text>\r\n <text class=\"uni-common-mt\">increasetLifeCycleNum 方法</text>\r\n <button class=\"uni-common-mt\" @click=\"_increasetLifeCycleNum\">\r\n increase lifeCycleNum\r\n </button>\r\n <text class=\"uni-common-mt\">lifeCycleNum: {{ lifeCycleNum }}</text>\r\n </view>\r\n </view>\r\n <!-- #ifdef APP -->\r\n </scroll-view>\r\n <!-- #endif -->\r\n</template>\r\n\r\n\r\n\r\n<style>\r\n .bold {\r\n font-weight: bold;\r\n }\r\n\r\n .hr {\r\n border-bottom: 1px solid #ccc;\r\n }\r\n</style>\n\n```\n>Script\n```uts\n\r\n import { state, setLifeCycleNum } from '@/store/index.uts'\r\n\r\n type MyGlobalData = {\r\n str : string,\r\n num : number,\r\n bool : boolean,\r\n obj : UTSJSONObject,\r\n null : string | null,\r\n arr : number[],\r\n mySet : string[],\r\n myMap : UTSJSONObject,\r\n func : () => string\r\n }\r\n\r\n export default {\r\n data() {\r\n return {\r\n originGlobalData: {\r\n str: '',\r\n num: 0,\r\n bool: false,\r\n obj: {\r\n str: '',\r\n num: 0,\r\n bool: false\r\n } as UTSJSONObject,\r\n null: null,\r\n arr: [] as number[],\r\n mySet: [] as string[],\r\n myMap: {},\r\n func: () : string => ''\r\n } as MyGlobalData,\r\n originGlobalDataFuncRes: '',\r\n newGlobalData: {\r\n str: '',\r\n num: 0,\r\n bool: false,\r\n obj: {\r\n str: '',\r\n num: 0,\r\n bool: false\r\n } as UTSJSONObject,\r\n null: null,\r\n arr: [] as number[],\r\n mySet: [] as string[],\r\n myMap: {},\r\n func: () : string => ''\r\n } as MyGlobalData,\r\n newGlobalDataFuncRes: '',\r\n lifeCycleNum: 0,\r\n }\r\n },\r\n onReady() {\r\n this.lifeCycleNum = state.lifeCycleNum\r\n },\r\n methods: {\r\n getGlobalData() {\r\n const app = getApp()\r\n\r\n this.originGlobalData.str = app.globalData.str\r\n this.originGlobalData.num = app.globalData.num\r\n this.originGlobalData.bool = app.globalData.bool\r\n this.originGlobalData.obj = app.globalData.obj\r\n this.originGlobalData.null = app.globalData.null\r\n this.originGlobalData.arr = app.globalData.arr\r\n app.globalData.mySet.forEach((value : string) => {\r\n this.originGlobalData.mySet.push(value)\r\n })\r\n app.globalData.myMap.forEach((value : any, key : string) => {\r\n this.originGlobalData.myMap[key] = value\r\n })\r\n this.originGlobalData.func = app.globalData.func\r\n this.originGlobalDataFuncRes = this.originGlobalData.func()\r\n },\r\n setGlobalData() {\r\n const app = getApp()\r\n\r\n app.globalData.str = 'new globalData str'\r\n app.globalData.num = 100\r\n app.globalData.bool = true\r\n app.globalData.obj = {\r\n str: 'new globalData obj str',\r\n num: 200,\r\n bool: true\r\n }\r\n app.globalData.null = 'not null'\r\n app.globalData.arr = [1, 2, 3]\r\n app.globalData.mySet = new Set(['a', 'b', 'c'])\r\n app.globalData.myMap = new Map([\r\n ['a', 1],\r\n ['b', 2],\r\n ['c', 3]\r\n ])\r\n app.globalData.func = () : string => {\r\n return 'new globalData func'\r\n }\r\n\r\n this.newGlobalData.str = app.globalData.str\r\n this.newGlobalData.num = app.globalData.num\r\n this.newGlobalData.bool = app.globalData.bool\r\n this.newGlobalData.obj = app.globalData.obj\r\n this.newGlobalData.null = app.globalData.null\r\n this.newGlobalData.arr = app.globalData.arr\r\n app.globalData.mySet.forEach((value : string) => {\r\n this.newGlobalData.mySet.push(value)\r\n })\r\n app.globalData.myMap.forEach((value : any, key : string) => {\r\n this.newGlobalData.myMap[key] = value\r\n })\r\n this.newGlobalData.func = app.globalData.func\r\n this.newGlobalDataFuncRes = this.newGlobalData.func()\r\n },\r\n _increasetLifeCycleNum: function () {\r\n const app = getApp()\r\n app.increasetLifeCycleNum()\r\n this.lifeCycleNum = state.lifeCycleNum\r\n },\r\n // 自动化测试\r\n setLifeCycleNum(num : number) {\r\n setLifeCycleNum(num)\r\n }\r\n },\r\n }\r\n\n```\n:::"},"getCurrentPages":{"name":"## getCurrentPages() @getcurrentpages","description":"`getCurrentPages()` 函数用于获å–当å‰é¡µé¢æ ˆçš„实例,以数组形å¼æŒ‰æ ˆçš„顺åºç»™å‡ºï¼Œæ•°ç»„ä¸çš„å…ƒç´ ä¸ºé¡µé¢å®žä¾‹ï¼Œç¬¬ä¸€ä¸ªå…ƒç´ 为首页,最åŽä¸€ä¸ªå…ƒç´ 为当å‰é¡µé¢ã€‚","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| Array\\<[Page](#page-values)\\> |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| route | string | 是 | - | - | 页é¢çš„è·¯ç”±åœ°å€ |\n@| options | Map\\<string, string \\| null> | 是 | - | - | 页é¢çš„路由å‚æ•°ä¿¡æ¯ï¼Œç›®å‰web端options类型为Object,åŽç»å¯èƒ½ä¼šè°ƒæ•´ |\n#### Page 的方法 @page-values \n\n#### $getPageStyle() @$getpagestyle\n获å–当å‰é¡µé¢æ ·å¼ \\<br/>åŒ…å« pages.json 页é¢ä¸‹çš„ style èŠ‚ç‚¹å±žæ€§å’Œæ ¹èŠ‚ç‚¹ globalStyle 属性\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) |\n \n\n##### $getPageStyle 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.13 | 4.13 | 4.13 |\n\n\n##### å‚è§\n- [$getPageStyle](https://doc.dcloud.net.cn/uni-app-x/api/get-current-pages.html#getPageStyle)\n\n#### $setPageStyle(style) @$setpagestyle\n设置当å‰é¡µé¢æ ·å¼ \\<br/>æ”¯æŒ pages.json 页é¢ä¸‹çš„ style èŠ‚ç‚¹å±žæ€§å’Œæ ¹èŠ‚ç‚¹ globalStyle 属性\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| style | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 是 | - | - | 如果属性åå˜åœ¨ï¼Œä¸”类型为UTSJSONObject返回对应的结果,ä¸å˜åœ¨è¿”回null | \n\n\n##### $setPageStyle 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.13 | 4.13 | 4.13 |\n\n\n##### å‚è§\n- [$setPageStyle](https://doc.dcloud.net.cn/uni-app-x/api/get-current-pages.html#setPageStyle)\n \n","compatibility":"### getCurrentPages 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/tutorial/page.html#getcurrentpages)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.global.get-current-pages)\n"},"get-current-pages":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-current-pages/get-current-pages.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-current-pages/get-current-pages\n>Template\n```vue\n<template>\r\n <!-- #ifdef APP -->\r\n <scroll-view class=\"page-scroll-view\">\r\n <!-- #endif -->\r\n <page-head title=\"getCurrentPages\"></page-head>\r\n <view class=\"uni-padding-wrap\">\r\n <button @click=\"_getCurrentPages\">getCurrentPages</button>\r\n <view v-if=\"pages.length\" style=\"padding: 15px 0px\">\r\n <text>当å‰é¡µé¢æ ˆä¸ {{ pages.length }} 个页é¢ï¼Œåˆ—表如下:</text>\r\n <template v-for=\"(page, index) in pages\" :key=\"page.route\">\r\n <text style=\"margin-top: 5px\">index: {{ index }}, route: {{ page.route }}</text>\r\n </template>\r\n </view>\r\n </view>\r\n\r\n <page-head title=\"currentPageStyle\"></page-head>\r\n <template v-for=\"(item, index) in PageStyleArray\">\r\n <view class=\"page-style-item\" v-if=\"currentPageStyle[item.key]!=null\" :key=\"index\">\r\n <view class=\"item-text\">\r\n <text class=\"item-text-key\">{{item.key}}:</text>\r\n <text class=\"item-text-value\">{{currentPageStyle[item.key]}}</text>\r\n </view>\r\n <view class=\"set-value\" v-if=\"item.type == 'boolean'\">\r\n <switch :checked=\"currentPageStyle.getBoolean(item.key)\"\r\n @change=\"switchChange(item.key, $event as UniSwitchChangeEvent)\">\r\n </switch>\r\n </view>\r\n <view class=\"set-value\" v-else-if=\"item.type == 'number'\">\r\n <slider :value=\"currentPageStyle.getNumber(item.key)\" :show-value=\"true\"\r\n @change=\"sliderChange(item.key, $event as UniSliderChangeEvent)\" />\r\n </view>\r\n <view class=\"set-value\" v-else-if=\"item.type == 'string'\">\r\n <radio-group class=\"radio-set-value\" @change=\"radioChange(item.key, $event as RadioGroupChangeEvent)\">\n <radio class=\"radio-value\" v-for=\"(item2, index2) in item.value\" :key=\"index2\" :value=\"item2\" >{{item2}}</radio>\n </radio-group>\r\n </view>\r\n </view>\r\n </template>\r\n <!-- #ifdef APP -->\r\n </scroll-view>\r\n <!-- #endif -->\r\n</template>\r\n\r\n\r\n\r\n<style>\r\n .page {\r\n flex: 1;\r\n padding: 10px;\r\n }\r\n\r\n .page-style {\r\n margin-top: 15px;\r\n }\r\n\r\n .page-style-item {\r\n padding: 10px;\r\n margin-top: 10px;\r\n background-color: #ffffff;\r\n border-radius: 5px;\r\n }\r\n\r\n .item-text {\r\n flex-direction: row;\r\n }\r\n\r\n .item-text-key {\r\n font-weight: bold;\r\n }\r\n\r\n .item-text-value {\r\n margin-left: 5px;\r\n }\r\n\r\n .set-value {\r\n margin-top: 10px;\r\n }\r\n\r\n .radio-set-value {\r\n flex-direction: row;\r\n }\r\n\r\n .radio-value {\n margin-left: 10px;\n }\r\n</style>\n\n```\n>Script\n```uts\n\r\n import { PageStyleItem, PageStyleArray } from './page-style.uts';\r\n\r\n class Page {\r\n constructor(public route : string) {\r\n }\r\n }\r\n\r\n export default {\r\n data() {\r\n return {\r\n checked: false,\r\n pages: [] as Page[],\r\n PageStyleArray: PageStyleArray as PageStyleItem[],\r\n currentPageStyle: {} as UTSJSONObject,\r\n }\r\n },\r\n computed: {\r\n pageStyleText() : string {\r\n return JSON.stringify(this.currentPageStyle)\r\n }\r\n },\r\n onLoad() {\r\n this.getPageStyle();\r\n },\r\n onPullDownRefresh() {\r\n setTimeout(() => {\r\n uni.stopPullDownRefresh()\r\n }, 2000)\r\n },\r\n methods: {\r\n startPullDownRefresh() {\r\n uni.startPullDownRefresh()\r\n },\r\n _getCurrentPages: function () {\r\n this.pages.length = 0\r\n const pages = getCurrentPages()\r\n this.pages.push(new Page(pages[0].route))\r\n if (this.pages[0].route.includes('/tabBar/')) {\r\n this.checked = true\r\n }\r\n for (let i = 1; i < pages.length; i++) {\r\n this.pages.push(new Page(pages[i].route))\r\n if (pages[i].route.includes('/tabBar/')) {\r\n this.checked = false\r\n }\r\n }\r\n },\r\n /// get-set-page-style\r\n radioChange(key : string, e : RadioGroupChangeEvent) {\r\n this.setStyleValue(key, e.detail.value);\r\n },\r\n sliderChange(key : string, e : UniSliderChangeEvent) {\r\n this.setStyleValue(key, e.detail.value);\r\n },\r\n switchChange(key : string, e : UniSwitchChangeEvent) {\r\n this.setStyleValue(key, e.detail.value);\r\n },\r\n setStyleValue(key : string, value : any) {\r\n const style = {}\r\n style[key] = value\r\n this.setPageStyle(style)\r\n this.getPageStyle()\r\n },\r\n getPageStyle() : UTSJSONObject {\r\n const pages = getCurrentPages();\r\n const currentPage = pages[pages.length - 1];\r\n this.currentPageStyle = currentPage.$getPageStyle()\r\n return this.currentPageStyle;\r\n },\r\n setPageStyle(style : UTSJSONObject) {\r\n console.log('setPageStyle:', style);\r\n const pages = getCurrentPages();\r\n const currentPage = pages[pages.length - 1];\r\n currentPage.$setPageStyle(style);\r\n },\r\n // getCurrentPage(): Page {\r\n // const pages = getCurrentPages();\r\n // const currentPage = pages[pages.length - 1];\r\n // return currentPage;\r\n // }\r\n },\r\n }\r\n\n```\n:::"},"$on":{"name":"## uni.$on(eventName, callback) @$on","description":"监å¬è‡ªå®šä¹‰äº‹ä»¶ã€‚事件å¯ä»¥ç”± uni.$emit 触å‘。回调函数会接收 uni.$emit ä¼ é€’çš„å‚数。<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| eventName | string | 是 | - | - | - |\n| callback | () => void | 是 | - | - | - | \n","returnValue":"","compatibility":"### $on 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [$on](https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#on)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.event-bus.$on)\n"},"$once":{"name":"## uni.$once(eventName, callback) @$once","description":"监å¬ä¸€ä¸ªè‡ªå®šä¹‰äº‹ä»¶ã€‚事件åªè§¦å‘一次,在第一次触å‘之åŽç§»é™¤äº‹ä»¶ç›‘å¬å™¨ã€‚<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| eventName | string | 是 | - | - | - |\n| callback | () => void | 是 | - | - | - | \n","returnValue":"","compatibility":"### $once 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [$once](https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#once)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.event-bus.$once)\n"},"$off":{"name":"## uni.$off(eventName, callback?) @$off","description":"移除自定义事件监å¬å™¨ã€‚如果æ供了事件å和回调,则åªç§»é™¤è¿™ä¸ªå›žè°ƒçš„监å¬å™¨ã€‚<br/>4.13+ 开始支æŒç¬¬äºŒä¸ªå‚数为å¯é€‰ï¼Œå¦‚果仅æ供事件å,则移除该事件的所有监å¬å™¨ã€‚","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| eventName | string | 是 | - | - | - |\n| callback | () => void \\| null | å¦ | - | - | | \n","returnValue":"","compatibility":"### $off 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [$off](https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#off)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.event-bus.$off)\n"},"$emit":{"name":"## uni.$emit(eventName, args?) @$emit","description":"触å‘è‡ªå®šä¹‰äº‹ä»¶ï¼Œé™„åŠ çš„å‚æ•°ä¼šä¼ é€’ç»™äº‹ä»¶ç›‘å¬å™¨ã€‚<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| eventName | string | 是 | - | - | - |\n| args | any \\| null | å¦ | - | - | | \n","returnValue":"","compatibility":"### $emit 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [$emit](https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#emit)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.event-bus.$emit)\n"},"event-bus":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/event-bus/event-bus.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/event-bus/event-bus\n>Template\n```vue\n<template>\r\n <!-- #ifdef APP -->\r\n <scroll-view class=\"page-scroll-view\">\r\n <!-- #endif -->\r\n <view>\r\n <button @click=\"on\">开始监å¬</button>\r\n <button @click=\"once\">监å¬ä¸€æ¬¡</button>\r\n <button @click=\"off\">å–消监å¬</button>\n <!-- <button @click=\"offAll\">å–消全部监å¬</button> -->\r\n <button @click=\"emit\">触å‘监å¬</button>\r\n <button @click=\"clear\">清空消æ¯</button>\r\n <view class=\"box\">\r\n <view>收到的消æ¯ï¼š</view>\r\n <view>\r\n <view v-for=\"(item, index) in log\" :key=\"index\">{{ item }}</view>\r\n </view>\r\n </view>\r\n </view>\r\n <!-- #ifdef APP -->\r\n </scroll-view>\r\n <!-- #endif -->\r\n</template>\r\n\r\n\r\n\r\n<style>\r\n .box {\r\n padding: 10px;\r\n }\r\n</style>\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n log: [] as string[],\r\n }\r\n },\r\n methods: {\r\n fn(res : string) {\r\n this.log.push(res)\r\n },\n fn2(res : string) {\n this.log.push(res)\n },\r\n on() {\r\n uni.$on('test', this.fn)\r\n },\n on2() {\n uni.$on('test', this.fn2)\n },\r\n once() {\r\n uni.$once('test', this.fn)\r\n },\r\n off() {\r\n uni.$off('test', this.fn)\r\n },\n offAll() {\n uni.$off('test')\n },\r\n emit() {\r\n uni.$emit('test', 'msg:' + Date.now())\r\n },\r\n clear() {\r\n this.log.length = 0\r\n },\r\n },\r\n }\r\n\n```\n:::"},"addInterceptor":{"name":"## uni.addInterceptor(name, interceptor) @addinterceptor","description":"æ·»åŠ æ‹¦æˆªå™¨","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| name | string | 是 | - | - | 需è¦æ‹¦æˆªçš„ API å称 |\n| interceptor | Interceptor | 是 | - | - | 拦截器 | \n","returnValue":"","compatibility":"### addInterceptor 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.97 | 4.11 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.interceptor.addInterceptor)\n"},"removeInterceptor":{"name":"## uni.removeInterceptor(name, interceptor?) @removeinterceptor","description":"åˆ é™¤æ‹¦æˆªå™¨","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| name | string | 是 | - | - | 需è¦åˆ 除拦截器的 API å称 |\n| interceptor | Interceptor \\| null | å¦ | - | - | 拦截器 | \n","returnValue":"","compatibility":"### removeInterceptor 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.97 | 4.11 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.interceptor.removeInterceptor)\n"},"interceptor":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/interceptor/interceptor.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/interceptor/interceptor\n>Template\n```vue\n<template>\r\n <view style=\"flex: 1;\">\r\n <button @click=\"addInterceptor\">æ·»åŠ è·¯ç”±æ‹¦æˆªå™¨</button>\r\n <button @click=\"removeInterceptor\">移除路由拦截器</button>\r\n <text>点击下方按钮{{msg}}</text>\r\n <button @click=\"navigateTo\">navigatorTo API跳转到测试页é¢</button>\n <navigator url=\"./page1\"><button class=\"navigatorButton\">navigator组件跳转到测试页é¢</button></navigator>\r\n </view>\r\n</template>\r\n\r\n\r\n\r\n<style>\r\n\r\n</style>\n\n```\n>Script\n```uts\n\r\n const interceptor = {\r\n invoke: function (options : NavigateToOptions) {\r\n console.log('拦截 navigateTo 接å£ä¼ å…¥å‚数为:', options)\r\n const url = './page2'\r\n uni.showToast({\r\n title: `é‡å®šå‘到页é¢:${url}`\r\n })\r\n options.url = url\r\n },\r\n success: function (res : NavigateBackSuccess) {\r\n console.log('拦截 navigateTo æŽ¥å£ success 返回å‚数为:', res)\r\n },\r\n fail: function (err : NavigateToFail) {\r\n console.log('拦截 navigateTo æŽ¥å£ fail 返回å‚数为:', err)\r\n },\r\n complete: function (res : NavigateToComplete) {\r\n console.log('拦截 navigateTo æŽ¥å£ complete 返回å‚数为:', res)\r\n }\r\n } as Interceptor\r\n export default {\r\n data() {\r\n return {\r\n msg: \"会跳转到测试页é¢1\"\r\n }\r\n },\r\n beforeUnmount() {\r\n // 移除 navigateTo 所有拦截器\r\n uni.removeInterceptor('navigateTo')\r\n },\r\n methods: {\r\n addInterceptor() {\r\n uni.addInterceptor('navigateTo', interceptor)\r\n uni.showToast({\r\n title: '页é¢è·³è½¬å·²æ‹¦æˆª'\r\n })\r\n this.msg = \",路由被劫æŒåˆ°æµ‹è¯•é¡µé¢2\"\r\n },\r\n removeInterceptor() {\r\n uni.removeInterceptor('navigateTo', interceptor)\r\n uni.showToast({\r\n title: '拦截器已移除'\r\n })\r\n this.msg = \"会跳转到测试页é¢1\"\r\n },\r\n navigateTo() {\r\n uni.navigateTo({\r\n url: './page1',\r\n success(res) {\r\n console.log('res:', res)\r\n },\r\n fail(err) {\r\n console.error('err:', err)\r\n },\r\n complete(res) {\r\n console.log('res:', res)\r\n }\r\n })\r\n }\r\n }\r\n }\r\n\n```\n:::"},"getLaunchOptionsSync":{"name":"## uni.getLaunchOptionsSync() @getlaunchoptionssync","description":"获å–本次å¯åŠ¨æ—¶çš„å‚数。返回值与App.onLaunch的回调å‚数一致<br/>","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| **OnLaunchOptions** |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| path | string | 是 | - | - | - | \n","compatibility":"### getLaunchOptionsSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [getLaunchOptionsSync](https://doc.dcloud.net.cn/uni-app-x/api/get-launch-options-sync.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.get-launch-options-sync)\n"},"get-launch-options-sync":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-launch-options-sync/get-launch-options-sync.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-launch-options-sync/get-launch-options-sync\n>Template\n```vue\n<template>\n <page-head title=\"getLaunchOptionsSync\"></page-head>\n <view class=\"uni-padding-wrap\">\n <button @click=\"getLaunchOptionsSync\">getLaunchOptionsSync</button>\n <view v-if=\"launchOptionsPath.length > 0\" class=\"uni-common-mt\">\n <text>应用å¯åŠ¨è·¯å¾„:</text>\n <text style=\"margin-top: 5px\">{{ launchOptionsPath }}</text>\n </view>\n </view>\n</template>\n\n\n\n```\n>Script\n```uts\n\nexport default {\n data() {\n return {\n checked: false,\n homePagePath: 'pages/tabBar/component',\n launchOptionsPath: '',\n }\n },\n methods: {\n getLaunchOptionsSync() {\n const launchOptions = uni.getLaunchOptionsSync()\n this.launchOptionsPath = launchOptions.path\n\n if (launchOptions.path == this.homePagePath) {\n this.checked = true\n }\n },\n },\n}\n\n```\n:::"},"exit":{"name":"## uni.exit(options?) @exit","description":"退出当å‰åº”用","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ExitOptions](#exitoptions-values) \\| null | å¦ | - | - | uni.exitå‚数定义 |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (res: [ExitSuccess](#exitsuccess-values)) => void \\| null | å¦ | - | - | uni.exitæˆåŠŸå›žè°ƒå‡½æ•°å®šä¹‰ |\n@| fail | (res: [IExitError](#iexiterror-values)) => void \\| null | å¦ | - | - | uni.exit失败回调函数定义 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | uni.exit完æˆå›žè°ƒå‡½æ•°å®šä¹‰ | \n\n##### ExitSuccess 的属性值 @exitsuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n\n##### IExitError 的属性值 @iexiterror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 12001 \\| 12002 | 是 | - | - | 错误ç <br/>- 12001: 系统ä¸æ”¯æŒ<br/>- 12002: 未知错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### exit 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | x |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.exit)\n","example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/exit/exit.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\n\t<view>\n\t\t<button @tap=\"exitAppClick\">退出应用</button>\n\t</view>\n</template>\n\n<script>\n\texport default {\n\t\tmethods: {\n\t\t\texitAppClick:function(){\n\t\t\t\tuni.exit({\n\t\t\t\t\tsuccess:function(res){\n\t\t\t\t\t\tconsole.log(res)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n</script>\n\n<style>\n\n</style>\n```"},"env":{"name":"## env","description":"","param":"### env 的属性值 @env-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| USER_DATA_PATH | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.99\",\"4.11\"]]}' /> | 应用专属å˜å‚¨ç©ºé—´çš„外置å˜å‚¨ç©ºé—´æ ¹ç›®å½•ä¸‹çš„files目录 |\n| CACHE_PATH | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.99\",\"4.11\"]]}' /> | 应用专属å˜å‚¨ç©ºé—´çš„外置å˜å‚¨ç©ºé—´æ ¹ç›®å½•ä¸‹çš„cache目录 |\n| SANDBOX_PATH | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.99\",\"4.11\"]]}' /> | 应用专属å˜å‚¨ç©ºé—´çš„外置å˜å‚¨ç©ºé—´æ ¹ç›®å½•ï¼ˆcaches/files) |\n","compatibility":"","returnValue":"","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.env)\n","example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/env/env.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\n <!-- #ifdef APP -->\n <text>æ“作日志</text><button size=\"mini\" @click=\"log=''\">清空日志</button>\n <text style=\"margin: 2px; padding: 2px; border: 1px solid #000000;\">{{ log }}</text>\n <scroll-view style=\"flex: 1;\">\n <!-- #endif -->\n <!-- #ifdef APP -->\n <button class=\"btnstyle\" type=\"primary\" @tap=\"geAbsPath(sandboxPath)\" id=\"btn-path\">应用外置沙盒目录uni.env.SANDBOX_PATH</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"geAbsPath(cachePath)\" id=\"btn-path\">缓å˜æ–‡ä»¶ç›®å½•uni.env.CACHE_PATH</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"geAbsPath(userPath)\" id=\"btn-path\">用户文件目录uni.env.USER_DATA_PATH</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"geAbsPath(internalSandboxPath)\"\n id=\"btn-path\">应用内置沙盒目录uni.env.ANDROID_INTERNAL_SANDBOX_PATH</button>\n <!-- #endif -->\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n<script>\n export default {\n\n data() {\n return {\n log: \"\",\n userPath: uni.env.USER_DATA_PATH,\n sandboxPath: uni.env.SANDBOX_PATH,\n cachePath: uni.env.CACHE_PATH,\n internalSandboxPath: uni.env.ANDROID_INTERNAL_SANDBOX_PATH,\n }\n },\n onLoad() {\n },\n\n methods: {\n geAbsPath(path ?: Any) {\n // #ifdef APP-ANDROID\n this.log += UTSAndroid.convert2AbsFullPath(path as String) + '\\n'\n // #endif\n\n }\n }\n }\n</script>\n\n<style>\n .btnstyle {\n margin: 4px;\n }\n</style>\n\n```"},"getPerformance":{"name":"## uni.getPerformance() @getperformance","description":"返回一个Performance对象实例<br/>","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [Performance](#performance-values) |\n\n#### Performance 的方法 @performance-values \n\n#### createObserver(callback) @createobserver\n创建全局性能事件监å¬å™¨\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (entries: [PerformanceObserverEntryList](#performanceobserverentrylist-values)) => void | 是 | - | - | - | \n\n##### PerformanceObserverEntryList 的方法 @performanceobserverentrylist-values \n\n##### getEntries() @getentries\n该方法返回当å‰åˆ—表ä¸çš„所有性能数æ®\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| Array\\<**PerformanceEntry**\\> |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| entryType | string | 是 | - | - | æŒ‡æ ‡ç±»åž‹ |\n@| name | string | 是 | - | - | æŒ‡æ ‡å称 |\n@| duration | number | 是 | - | - | 耗时 msã€‚ä»…å¯¹äºŽè¡¨ç¤ºé˜¶æ®µçš„æŒ‡æ ‡æœ‰æ•ˆã€‚ |\n@| startTime | number | 是 | - | - | 开始时间,ä¸åŒæŒ‡æ ‡çš„具体å«ä¹‰ä¼šæœ‰å·®å¼‚。 |\n@| path | string \\| null | å¦ | - | - | 页é¢è·¯å¾„。仅 render å’Œ navigation ç±»åž‹æŒ‡æ ‡æœ‰æ•ˆã€‚ |\n@| referrerPath | string \\| null | å¦ | - | - | 页é¢è·³è½¬æ¥æºé¡µé¢è·¯å¾„。仅 route æŒ‡æ ‡æœ‰æ•ˆã€‚ |\n@| pageId | number \\| null | å¦ | - | - | path 对应页é¢å®žä¾‹ Id(éšæœºç”Ÿæˆï¼Œä¸ä¿è¯é€’增)。仅 render/navigation æŒ‡æ ‡æœ‰æ•ˆã€‚ |\n@| referrerPageId | number \\| null | å¦ | - | - | referrerPath对应页é¢å®žä¾‹ Id(éšæœºç”Ÿæˆï¼Œä¸ä¿è¯é€’增)。仅 route æŒ‡æ ‡æœ‰æ•ˆã€‚ |\n@| navigationStart | number \\| null | å¦ | - | - | 路由真æ£å“应开始时间。仅 navigation ç±»åž‹æŒ‡æ ‡æœ‰æ•ˆã€‚ |\n@| navigationType | string \\| null | å¦ | - | - | 路由详细类型,与路由方法对应。仅 navigation ç±»åž‹æŒ‡æ ‡æœ‰æ•ˆã€‚ |\n@| initDataRecvTime | number \\| null | å¦ | - | - | 首次渲染å‚数在渲染层收到的时间。仅 firstRender æŒ‡æ ‡æœ‰æ•ˆã€‚ |\n@| viewLayerRenderEndTime | number \\| null | å¦ | - | - | 渲染层执行渲染结æŸæ—¶é—´ã€‚ä»… firstRender æŒ‡æ ‡æœ‰æ•ˆã€‚ | \n\n###### getEntries 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n##### getEntriesByType(entryType) @getentriesbytype\n获å–当å‰åˆ—表ä¸æ‰€æœ‰ç±»åž‹ä¸º \\[entryType]的性能数æ®\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| entryType | string | 是 | - | - | - | \n\n###### 返回值 \n\n| 类型 |\n| :- |\n| Array\\<[PerformanceEntry](#performanceentry-values)\\> |\n \n\n###### getEntriesByType 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n##### getEntriesByName(name, entryType) @getentriesbyname\n获å–当å‰åˆ—表ä¸æ‰€æœ‰å称为 \\[name] 且类型为 [entryType]的性能数æ®\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| name | string | 是 | - | - | - |\n| entryType | string | 是 | - | - | - | \n\n###### 返回值 \n\n| 类型 |\n| :- |\n| Array\\<[PerformanceEntry](#performanceentry-values)\\> |\n \n\n###### getEntriesByName 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| [PerformanceObserver](#performanceobserver-values) |\n\n##### PerformanceObserver 的方法 @performanceobserver-values \n\n##### observe(options) @observe\n开始监å¬\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **PerformanceObserverOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| buffered | boolean | å¦ | - | - | - |\n@| entryTypes | Array\\<string\\> | å¦ | - | - | - |\n@| type | string | å¦ | - | - | - | \n\n\n###### observe 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n##### disconnect() @disconnect\nåœæ¢ç›‘å¬\n\n\n###### disconnect 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n \n\n##### createObserver 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### getEntries() @getentries\n该方法返回当å‰ç¼“冲区ä¸çš„所有性能数æ®\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| Array\\<[PerformanceEntry](#performanceentry-values)\\> |\n \n\n##### getEntries 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### getEntriesByType(entryType) @getentriesbytype\n获å–当å‰ç¼“冲区ä¸æ‰€æœ‰ç±»åž‹ä¸º \\[entryType]的性能数æ®\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| entryType | string | 是 | - | - | - | \n\n##### 返回值 \n\n| 类型 |\n| :- |\n| Array\\<[PerformanceEntry](#performanceentry-values)\\> |\n \n\n##### getEntriesByType 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### getEntriesByName(name, entryType) @getentriesbyname\n获å–当å‰ç¼“冲区ä¸æ‰€æœ‰å称为 \\[name] 且类型为 [entryType]的性能数æ®\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| name | string | 是 | - | - | - |\n| entryType | string | 是 | - | - | - | \n\n##### 返回值 \n\n| 类型 |\n| :- |\n| Array\\<[PerformanceEntry](#performanceentry-values)\\> |\n \n\n##### getEntriesByName 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### setBufferSize(size) @setbuffersize\n设置缓冲区大å°ï¼Œé»˜è®¤ç¼“冲 30 æ¡æ€§èƒ½æ•°æ®\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| size | number | 是 | - | - | - | \n\n\n##### setBufferSize 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n \n","compatibility":"### getPerformance 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.91 | x |\n","tutorial":"\n### å‚è§\n- [getPerformance](https://doc.dcloud.net.cn/uni-app-x/api/getPerformance)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.get-performance)\n"},"navigateTo":{"name":"## uni.navigateTo(options) @navigateto","description":"ä¿ç•™å½“å‰é¡µé¢ï¼Œè·³è½¬åˆ°åº”用内的æŸä¸ªé¡µé¢<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [NavigateToOptions](#navigatetooptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| url | string ([string.PageURIString](/uts/data-type.md#ide-string)) | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 需è¦è·³è½¬çš„åº”ç”¨å†…éž tabBar 的页é¢çš„路径 , 路径åŽå¯ä»¥å¸¦å‚æ•° |\n@| animationType | string \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"x\"]]}' /> | 窗å£æ˜¾ç¤ºçš„动画类型<br/>- auto: 自动选择动画效果<br/>- none: æ— åŠ¨ç”»æ•ˆæžœ<br/>- slide-in-right: 从å³ä¾§æ¨ªå‘滑动效果<br/>- slide-in-left: 左侧横å‘滑动效果<br/>- slide-in-top: 从上侧竖å‘滑动效果<br/>- slide-in-bottom: 从下侧竖å‘滑动效果<br/>- fade-in: 从é€æ˜Žåˆ°ä¸é€æ˜Žé€æ¸æ˜¾ç¤ºæ•ˆæžœ<br/>- zoom-out: 从å°åˆ°å¤§é€æ¸æ”¾å¤§æ˜¾ç¤ºæ•ˆæžœ<br/>- zoom-fade-out: 从å°åˆ°å¤§é€æ¸æ”¾å¤§å¹¶ä¸”从é€æ˜Žåˆ°ä¸é€æ˜Žé€æ¸æ˜¾ç¤ºæ•ˆæžœ<br/>- pop-in: 从å³ä¾§å¹³ç§»å…¥æ ˆåŠ¨ç”»æ•ˆæžœ<br/>- UnionType => 'auto' \\| 'none' \\| 'slide-in-right' \\| 'slide-in-left' \\| 'slide-in-top' \\| 'slide-in-bottom' \\| 'fade-in' \\| 'zoom-out' \\| 'zoom-fade-out' \\| 'pop-in' |\n@| events | any \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"x\",\"x\"]]}' /> | 页é¢é—´é€šä¿¡æŽ¥å£ï¼Œç”¨äºŽç›‘å¬è¢«æ‰“开页é¢å‘é€åˆ°å½“å‰é¡µé¢çš„æ•°æ® |\n@| success | (result: AsyncApiSuccessResult) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [NavigateToFail](#navigatetofail-values)) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### NavigateToFail 的属性值 @navigatetofail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | 路由错误ç <br/>- 4: 框架内部异常 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### navigateTo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | √ | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/router?id=navigateto)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.navigator.navigateTo)\n"},"reLaunch":{"name":"## uni.reLaunch(options) @relaunch","description":"å…³é—所有页é¢ï¼Œæ‰“开到应用内的æŸä¸ªé¡µé¢<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ReLaunchOptions](#relaunchoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| url | string ([string.PageURIString](/uts/data-type.md#ide-string)) | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 需è¦è·³è½¬çš„应用内页é¢è·¯å¾„ , 路径åŽå¯ä»¥å¸¦å‚数。å‚数与路径之间使用?分隔,å‚数键与å‚数值用=相连,ä¸åŒå‚数用&分隔;如 'path?key=value&key2=value2',如果跳转的页é¢è·¯å¾„是 tabBar 页é¢åˆ™ä¸èƒ½å¸¦å‚æ•° |\n@| success | (result: AsyncApiSuccessResult) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [ReLaunchFail](#relaunchfail-values)) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### ReLaunchFail 的属性值 @relaunchfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### reLaunch 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | √ | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/router?id=relaunch)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.navigator.reLaunch)\n"},"navigateBack":{"name":"## uni.navigateBack(options?) @navigateback","description":"å…³é—当å‰é¡µé¢ï¼Œè¿”回上一页é¢æˆ–多级页é¢<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [NavigateBackOptions](#navigatebackoptions-values) \\| null | å¦ | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| delta | number \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 返回的页é¢æ•°ï¼Œå¦‚æžœ delta 大于现有页é¢æ•°ï¼Œåˆ™è¿”回到首页 |\n@| animationType | string \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"x\"]]}' /> | 窗å£å…³é—的动画类型<br/>- auto: 自动选择动画效果<br/>- none: æ— åŠ¨ç”»æ•ˆæžœ<br/>- slide-out-right: 横å‘å‘å³ä¾§æ»‘出å±å¹•åŠ¨ç”»<br/>- slide-out-left: 横å‘å‘左侧滑出å±å¹•åŠ¨ç”»<br/>- slide-out-top: ç«–å‘å‘上侧滑出å±å¹•åŠ¨ç”»<br/>- slide-out-bottom: ç«–å‘å‘下侧滑出å±å¹•åŠ¨ç”»<br/>- fade-out: 从ä¸é€æ˜Žåˆ°é€æ˜Žé€æ¸éšè—动画<br/>- zoom-in: 从大é€æ¸ç¼©å°å…³é—动画<br/>- zoom-fade-in: 从大é€æ¸ç¼©å°å¹¶ä¸”从ä¸é€æ˜Žåˆ°é€æ˜Žé€æ¸éšè—å…³é—动画<br/>- pop-out: 从å³ä¾§å¹³ç§»å‡ºæ ˆåŠ¨ç”»æ•ˆæžœ<br/>- UnionType => 'auto' \\| 'none' \\| 'slide-out-right' \\| 'slide-out-left' \\| 'slide-out-top' \\| 'slide-out-bottom' \\| 'fade-out' \\| 'zoom-in' \\| 'zoom-fade-in' \\| 'pop-out' |\n@| success | (result: AsyncApiSuccessResult) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"x\"]]}' /> | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [NavigateBackFail](#navigatebackfail-values)) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### NavigateBackFail 的属性值 @navigatebackfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### navigateBack 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | √ | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/router?id=navigateback)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.navigator.navigateBack)\n"},"redirectTo":{"name":"## uni.redirectTo(options) @redirectto","description":"å…³é—当å‰é¡µé¢ï¼Œè·³è½¬åˆ°åº”用内的æŸä¸ªé¡µé¢<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [RedirectToOptions](#redirecttooptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| url | string ([string.PageURIString](/uts/data-type.md#ide-string)) | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 需è¦è·³è½¬çš„åº”ç”¨å†…éž tabBar 的页é¢çš„路径 , 路径åŽå¯ä»¥å¸¦å‚æ•° |\n@| success | (result: AsyncApiSuccessResult) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [RedirectToFail](#redirecttofail-values)) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### RedirectToFail 的属性值 @redirecttofail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### redirectTo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | √ | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/router?id=redirectto)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.navigator.redirectTo)\n"},"switchTab":{"name":"## uni.switchTab(options) @switchtab","description":"跳转到 tabBar 页é¢ï¼Œå¹¶å…³é—å…¶ä»–æ‰€æœ‰éž tabBar 页é¢<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [SwitchTabOptions](#switchtaboptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| url | string ([string.PageURIString](/uts/data-type.md#ide-string)) | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 需è¦è·³è½¬çš„ tabBar 页é¢çš„路径,路径åŽä¸èƒ½å¸¦å‚æ•° |\n@| success | (result: AsyncApiSuccessResult) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [SwitchTabFail](#switchtabfail-values)) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SwitchTabFail 的属性值 @switchtabfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### switchTab 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | √ | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/router?id=switchtab)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.navigator.switchTab)\n"},"navigator":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/navigator/navigator.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/navigator/navigator\n>Template\n```vue\n<template>\r\n <!-- #ifdef APP -->\r\n <scroll-view style=\"flex: 1\">\r\n <!-- #endif -->\r\n <view>\r\n <page-head title=\"navigate\"></page-head>\r\n <view class=\"uni-padding-wrap uni-common-mt uni-common-mb\">\r\n <view class=\"direction-row\">\r\n <text class=\"label\">onLoad触å‘时间戳:</text>\r\n <text>{{ onLoadTime }}</text>\r\n </view>\r\n <view class=\"direction-row\">\r\n <text class=\"label\">onShow触å‘时间戳:</text>\r\n <text>{{ onShowTime }}</text>\r\n </view>\r\n <view class=\"direction-row\">\r\n <text class=\"label\">onReady触å‘时间戳:</text>\r\n <text>{{ onReadyTime }}</text>\r\n </view>\r\n <view class=\"direction-row\">\r\n <text class=\"label\">onHide触å‘时间戳:</text>\r\n <text>{{ onHideTime }}</text>\r\n </view>\r\n <view class=\"direction-row\">\r\n <text class=\"label\">onBackPress触å‘时间戳:</text>\r\n <text>è§æŽ§åˆ¶å°</text>\r\n </view>\r\n <view class=\"direction-row\">\r\n <text class=\"label\">onUnload触å‘时间戳:</text>\r\n <text>è§æŽ§åˆ¶å°</text>\r\n </view>\r\n <view class=\"uni-btn-v\">\r\n <button @tap=\"navigateTo\" class=\"uni-btn\">\r\n 跳转新页é¢ï¼Œå¹¶ä¼ 递数æ®\r\n </button>\r\n <button @tap=\"navigateBack\" class=\"uni-btn\">返回上一页</button>\r\n <button @tap=\"redirectTo\" class=\"uni-btn\">在当å‰é¡µé¢æ‰“å¼€</button>\r\n <button @tap=\"switchTab\" class=\"uni-btn\">切æ¢åˆ°æ¨¡æ¿é€‰é¡¹å¡</button>\r\n <button @tap=\"reLaunch\" class=\"uni-btn\">\r\n å…³é—所有页é¢ï¼Œæ‰“开首页\r\n </button>\r\n <button @tap=\"navigateToErrorPage\" class=\"uni-btn\">\r\n 打开ä¸å˜åœ¨çš„页é¢\r\n </button>\r\n </view>\r\n </view>\r\n </view>\r\n <!-- #ifdef APP -->\r\n </scroll-view>\r\n <!-- #endif -->\r\n</template>\r\n\r\n\r\n\r\n<style>\r\n .direction-row {\r\n flex-direction: row;\r\n }\r\n\r\n .label {\r\n width: 190px;\r\n }\r\n</style>\n\n```\n>Script\n```uts\n\r\n import { state, setLifeCycleNum } from '@/store/index.uts'\r\n\r\n export default {\r\n data() {\r\n return {\r\n onLoadTime: 0,\r\n onShowTime: 0,\r\n onReadyTime: 0,\r\n onHideTime: 0,\r\n }\r\n },\r\n onLoad() {\r\n this.onLoadTime = Date.now()\r\n console.log('onLoad', this.onLoadTime)\r\n },\r\n onShow() {\r\n this.onShowTime = Date.now()\r\n console.log('onShow', this.onShowTime)\r\n },\r\n onReady() {\r\n this.onReadyTime = Date.now()\r\n console.log('onReady', this.onReadyTime)\r\n },\r\n onHide() {\r\n this.onHideTime = Date.now()\r\n console.log('onHide', this.onHideTime)\r\n },\r\n onBackPress(options : OnBackPressOptions) : boolean | null {\r\n console.log('onBackPress', Date.now())\r\n console.log('onBackPress from', options.from)\r\n return null\r\n },\r\n onUnload() {\r\n console.log('onUnload', Date.now())\r\n },\r\n methods: {\r\n reLaunch() {\r\n uni.reLaunch({\r\n url: '/pages/tabBar/component',\r\n success(result) {\r\n console.log('reLaunch success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('reLaunch fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('reLaunch complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n navigateTo() {\r\n uni.navigateTo({\r\n url: '/pages/API/navigator/new-page/new-page-1?data=Hello',\r\n success(result) {\r\n console.log('navigateTo success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('navigateTo fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('navigateTo complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n navigateToErrorPage() {\r\n uni.navigateTo({\r\n url: '/pages/error-page/error-page',\r\n success(result) {\r\n console.log('navigateTo success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n fail(error) {\r\n console.log('navigateTo fail', error.errMsg)\r\n uni.showToast({\r\n title: error.errMsg,\r\n icon: 'none',\r\n })\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n complete(result) {\r\n console.log('navigateTo complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n navigateToDebounce() {\r\n uni.navigateTo({\r\n url: '/pages/API/navigator/new-page/new-page-1?data=debounce',\r\n success(result) {\r\n console.log('navigateTo success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('navigateTo fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('navigateTo complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n uni.navigateTo({\r\n url: '/pages/API/navigator/new-page/new-page-1?data=debounce',\r\n success(result) {\r\n console.log('navigateTo success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n fail(error) {\r\n console.log('navigateTo fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n complete(result) {\r\n console.log('navigateTo complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n // 自动化测试\r\n navigateToRelativePath1() {\r\n uni.navigateTo({\r\n url: 'new-page/new-page-1?data=new-page/new-page-1',\r\n success() {\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail() {\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete() {\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n // 自动化测试\r\n navigateToRelativePath2() {\r\n uni.navigateTo({\r\n url: './new-page/new-page-1?data=./new-page/new-page-1',\r\n success() {\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail() {\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete() {\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n // 自动化测试\r\n navigateToRelativePath3() {\r\n uni.navigateTo({\r\n url: '../navigator/new-page/new-page-1?data=../navigator/new-page/new-page-1',\r\n success() {\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail() {\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete() {\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n navigateBack() {\r\n uni.navigateBack({\r\n success(result) {\r\n console.log('navigateBack success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('navigateBack fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('navigateBack complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n navigateBackWithDelta1() {\r\n uni.navigateTo({\r\n url: '/pages/API/navigator/new-page/new-page-1',\r\n success() {\r\n uni.navigateBack({\r\n delta: 1,\r\n success(result) {\r\n console.log('navigateBack success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('navigateBack fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('navigateBack complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n })\r\n },\r\n navigateBackWithDelta100() {\r\n uni.navigateTo({\r\n url: '/pages/API/navigator/new-page/new-page-1',\r\n success() {\r\n uni.navigateBack({\r\n delta: 100,\r\n success(result) {\r\n console.log('navigateBack success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('navigateBack fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('navigateBack complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n })\r\n },\r\n redirectTo() {\r\n uni.redirectTo({\r\n url: '/pages/API/navigator/new-page/new-page-1?data=Hello',\r\n success(result) {\r\n console.log('redirectTo success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('redirectTo fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('redirectTo complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n switchTab() {\r\n uni.switchTab({\r\n url: '/pages/tabBar/template',\r\n success(result) {\r\n console.log('switchTab success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('switchTab fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('switchTab complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n // 自动化测试\r\n getLifeCycleNum() : number {\r\n return state.lifeCycleNum\r\n },\r\n // 自动化测试\r\n setLifeCycleNum(num : number) {\r\n setLifeCycleNum(num)\r\n },\r\n },\r\n }\r\n\n```\n:::"},"setNavigationBarColor":{"name":"## uni.setNavigationBarColor(options) @setnavigationbarcolor","description":"设置导航æ¡ã€çŠ¶æ€æ 颜色<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [SetNavigationBarColorOptions](#setnavigationbarcoloroptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| frontColor | \"#ffffff\" \\| \"#000000\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | å‰æ™¯é¢œè‰²å€¼ï¼ŒåŒ…括按钮ã€æ ‡é¢˜ã€çŠ¶æ€æ çš„é¢œè‰²ï¼Œä»…æ”¯æŒ #ffffff å’Œ #000000 |\n@| backgroundColor | [string.ColorString](/uts/data-type.md#ide-string) | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 背景颜色值,有效值为åå…进制颜色 |\n@| success | (result: AsyncApiSuccessResult) => void | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (error: [SetNavigationBarColorFail](#setnavigationbarcolorfail-values)) => void | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: [AsyncApiResult](#asyncapiresult-values)) => void | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SetNavigationBarColorFail 的属性值 @setnavigationbarcolorfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### setNavigationBarColor 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | √ | 4.11 |\n","tutorial":"\n### å‚è§\n- [setNavigationBarColor](https://doc.dcloud.net.cn/uni-app-x/api/set-navigation-bar-color.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-navigation-bar-color)\n"},"set-navigation-bar-color":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/set-navigation-bar-color/set-navigation-bar-color.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/set-navigation-bar-color/set-navigation-bar-color\n>Template\n```vue\n<template>\r\n <page-head title=\"setNavigationBarColor\"></page-head>\r\n <view class=\"uni-padding-wrap uni-common-mt\">\r\n <button @tap=\"setNavigationBarColor1\" class=\"uni-btn\">\r\n 设置导航æ¡èƒŒæ™¯ç»¿è‰²ï¼Œæ ‡é¢˜ç™½è‰²\r\n </button>\r\n <button @tap=\"setNavigationBarColor2\" class=\"uni-btn\">\r\n 设置导航æ¡èƒŒæ™¯çº¢è‰²ï¼Œæ ‡é¢˜é»‘色\r\n </button>\r\n <button @tap=\"goNavbarLite\" class=\"uni-btn\">\r\n 跳转自定义导航æ 页é¢\r\n </button>\r\n </view>\r\n</template>\r\n\r\n\n\n```\n>Script\n```uts\n\r\n import { state, setLifeCycleNum } from '@/store/index.uts'\r\n\r\n export default {\r\n methods: {\r\n setNavigationBarColor1() {\r\n uni.setNavigationBarColor({\r\n frontColor: '#ffffff',\r\n backgroundColor: '#00ff00',\r\n success: () => {\r\n console.log('setNavigationBarColor success')\r\n this.setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail: () => {\r\n console.log('setNavigationBarColor fail')\r\n this.setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete: () => {\r\n console.log('setNavigationBarColor complete')\r\n this.setLifeCycleNum(state.lifeCycleNum + 1)\r\n }\r\n })\r\n },\r\n setNavigationBarColor2() {\r\n uni.setNavigationBarColor({\r\n frontColor: '#000000',\r\n backgroundColor: '#ff0000',\r\n success: () => {\r\n console.log('setNavigationBarColor success')\r\n this.setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail: () => {\r\n console.log('setNavigationBarColor fail')\r\n this.setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete: () => {\r\n console.log('setNavigationBarColor complete')\r\n this.setLifeCycleNum(state.lifeCycleNum + 1)\r\n }\r\n })\r\n },\r\n // 自动化测试\r\n getLifeCycleNum() : number {\r\n return state.lifeCycleNum\r\n },\r\n // 自动化测试\r\n setLifeCycleNum(num : number) {\r\n setLifeCycleNum(num)\r\n },\r\n goNavbarLite() {\r\n uni.navigateTo({\r\n url: '/pages/template/navbar-lite/navbar-lite'\r\n })\r\n }\r\n },\r\n }\r\n\n```\n:::"},"setNavigationBarTitle":{"name":"## uni.setNavigationBarTitle(options) @setnavigationbartitle","description":"动æ€è®¾ç½®å½“å‰é¡µé¢çš„æ ‡é¢˜<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [SetNavigationBarTitleOptions](#setnavigationbartitleoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| title | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.97\",\"4.11\"]]}' /> | 页é¢æ ‡é¢˜ |\n@| success | (result: AsyncApiSuccessResult) => void | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.97\",\"4.11\"]]}' /> | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (error: [SetNavigationBarTitleFail](#setnavigationbartitlefail-values)) => void | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.97\",\"4.11\"]]}' /> | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: [AsyncApiResult](#asyncapiresult-values)) => void | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.97\",\"4.11\"]]}' /> | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SetNavigationBarTitleFail 的属性值 @setnavigationbartitlefail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### setNavigationBarTitle 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.97 | 4.11 |\n","tutorial":"\n### å‚è§\n- [setNavigationBarTitle](https://doc.dcloud.net.cn/uni-app-x/api/set-navigation-bar-title.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-navigation-bar-title)\n"},"set-navigation-bar-title":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/set-navigation-bar-title/set-navigation-bar-title.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/set-navigation-bar-title/set-navigation-bar-title\n>Template\n```vue\n<template>\n <page-head title=\"setNavigationBarTitle\"></page-head>\n <view class=\"uni-padding-wrap uni-common-mt\">\n <button @tap=\"setNavigationBarNewTitle\" class=\"uni-btn\">\n 设置当å‰é¡µé¢æ ‡é¢˜ä¸º: {{ newTitle }}\n </button>\n <button @tap=\"setNavigationBarLongTitle\" class=\"uni-btn\">\n è®¾ç½®è¶…é•¿æ ‡é¢˜\n </button>\n </view>\n</template>\n\n\n\n```\n>Script\n```uts\n\n import { state, setLifeCycleNum } from '@/store/index.uts'\n\n export default {\n data() {\n return {\n newTitle: 'new title',\n longTitle: 'long title long title long title long title long title long title long title long title long title long title'\n }\n },\n methods: {\n setNavigationBarNewTitle() {\n uni.setNavigationBarTitle({\n title: this.newTitle,\n success: () => {\n console.log('setNavigationBarTitle success')\n this.setLifeCycleNum(state.lifeCycleNum + 1)\n },\n fail: () => {\n console.log('setNavigationBarTitle fail')\n this.setLifeCycleNum(state.lifeCycleNum - 1)\n },\n complete: () => {\n console.log('setNavigationBarTitle complete')\n this.setLifeCycleNum(state.lifeCycleNum + 1)\n }\n })\n },\n setNavigationBarLongTitle() {\n uni.setNavigationBarTitle({\n title: this.longTitle,\n success() {\n console.log('setNavigationBarTitle success')\n },\n fail() {\n console.log('setNavigationBarTitle fail')\n },\n complete() {\n console.log('setNavigationBarTitle complete')\n }\n })\n },\n // 自动化测试\n getLifeCycleNum() : number {\n return state.lifeCycleNum\n },\n // 自动化测试\n setLifeCycleNum(num : number) {\n setLifeCycleNum(num)\n }\n },\n }\n\n```\n:::"},"showTabBar":{"name":"## uni.showTabBar(options?) @showtabbar","description":"显示 tabBar<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ShowTabBarOptions](#showtabbaroptions-values) \\| null | å¦ | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| animation | boolean | å¦ | - | - | 是å¦éœ€è¦åŠ¨ç”»æ•ˆæžœ |\n@| success | (result: AsyncApiSuccessResult) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [SetTabBarFail](#settabbarfail-values)) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SetTabBarFail 的属性值 @settabbarfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 100 \\| 200 | 是 | - | - | 错误ç <br/>- 100: TabBar ä¸å˜åœ¨<br/>- 200: å‚数错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### showTabBar 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [showTabBar](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#showtabbar)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.showTabBar)\n"},"hideTabBar":{"name":"## uni.hideTabBar(options?) @hidetabbar","description":"éšè— tabBar<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [HideTabBarOptions](#hidetabbaroptions-values) \\| null | å¦ | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| animation | boolean | å¦ | - | - | 是å¦éœ€è¦åŠ¨ç”»æ•ˆæžœ |\n@| success | (result: AsyncApiSuccessResult) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [SetTabBarFail](#settabbarfail-values)) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SetTabBarFail 的属性值 @settabbarfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 100 \\| 200 | 是 | - | - | 错误ç <br/>- 100: TabBar ä¸å˜åœ¨<br/>- 200: å‚数错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### hideTabBar 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [hideTabBar](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#hidetabbar)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.hideTabBar)\n"},"showTabBarRedDot":{"name":"## uni.showTabBarRedDot(options) @showtabbarreddot","description":"显示 tabBar æŸä¸€é¡¹çš„å³ä¸Šè§’的红点<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ShowTabBarRedDotOptions](#showtabbarreddotoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| index | number | 是 | - | - | tabBar的哪一项,从左边算起,索引从0开始 |\n@| success | (result: AsyncApiSuccessResult) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [SetTabBarFail](#settabbarfail-values)) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SetTabBarFail 的属性值 @settabbarfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 100 \\| 200 | 是 | - | - | 错误ç <br/>- 100: TabBar ä¸å˜åœ¨<br/>- 200: å‚数错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### showTabBarRedDot 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [showTabBarRedDot](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#showtabbarreddot)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.showTabBarRedDot)\n"},"hideTabBarRedDot":{"name":"## uni.hideTabBarRedDot(options) @hidetabbarreddot","description":"éšè— tabBar æŸä¸€é¡¹çš„å³ä¸Šè§’的红点<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [HideTabBarRedDotOptions](#hidetabbarreddotoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| index | number | 是 | - | - | tabBar的哪一项,从左边算起,索引从0开始 |\n@| success | (result: AsyncApiSuccessResult) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [SetTabBarFail](#settabbarfail-values)) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SetTabBarFail 的属性值 @settabbarfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 100 \\| 200 | 是 | - | - | 错误ç <br/>- 100: TabBar ä¸å˜åœ¨<br/>- 200: å‚数错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### hideTabBarRedDot 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [hideTabBarRedDot](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#hidetabbarreddot)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.hideTabBarRedDot)\n"},"setTabBarBadge":{"name":"## uni.setTabBarBadge(options) @settabbarbadge","description":"为 tabBar æŸä¸€é¡¹çš„å³ä¸Šè§’æ·»åŠ æ–‡æœ¬<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [SetTabBarBadgeOptions](#settabbarbadgeoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| index | number | 是 | - | - | tabBar的哪一项,从左边算起,索引从0开始 |\n@| text | string | 是 | - | - | 显示的文本,ä¸è¶…过 3 个åŠè§’å—符 |\n@| success | (result: AsyncApiSuccessResult) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [SetTabBarFail](#settabbarfail-values)) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SetTabBarFail 的属性值 @settabbarfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 100 \\| 200 | 是 | - | - | 错误ç <br/>- 100: TabBar ä¸å˜åœ¨<br/>- 200: å‚数错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### setTabBarBadge 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [setTabBarBadge](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#settabbarbadge)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.setTabBarBadge)\n"},"removeTabBarBadge":{"name":"## uni.removeTabBarBadge(options) @removetabbarbadge","description":"移除 tabBar æŸä¸€é¡¹å³ä¸Šè§’的文本<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [RemoveTabBarBadgeOptions](#removetabbarbadgeoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| index | number | 是 | - | - | tabBar的哪一项,从左边算起,索引从0开始 |\n@| success | (result: AsyncApiSuccessResult) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [SetTabBarFail](#settabbarfail-values)) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SetTabBarFail 的属性值 @settabbarfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 100 \\| 200 | 是 | - | - | 错误ç <br/>- 100: TabBar ä¸å˜åœ¨<br/>- 200: å‚数错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### removeTabBarBadge 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [removeTabBarBadge](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#removetabbarbadge)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.removeTabBarBadge)\n"},"setTabBarStyle":{"name":"## uni.setTabBarStyle(options) @settabbarstyle","description":"动æ€è®¾ç½® tabBar çš„æ•´ä½“æ ·å¼<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [SetTabBarStyleOptions](#settabbarstyleoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| color | string ([string.ColorString](/uts/data-type.md#ide-string)) | å¦ | - | - | tab 上的文å—默认颜色 |\n@| selectedColor | string ([string.ColorString](/uts/data-type.md#ide-string)) | å¦ | - | - | tab 上的文å—选ä¸æ—¶çš„颜色 |\n@| backgroundColor | string ([string.ColorString](/uts/data-type.md#ide-string)) | å¦ | - | - | tab 的背景色 |\n@| backgroundImage | string | å¦ | - | - | 图片背景 |\n@| backgroundRepeat | \"repeat\" \\| \"repeat-x\" \\| \"repeat-y\" \\| \"no-repeat\" | å¦ | - | - | 背景图平铺方å¼<br/>- repeat: 背景图片在垂直方å‘和水平方å‘平铺<br/>- repeat-x: 背景图片在水平方å‘平铺,垂直方å‘拉伸<br/>- repeat-y: 背景图片在垂直方å‘平铺,水平方å‘拉伸<br/>- no-repeat: 背景图片在垂直方å‘和水平方å‘都拉伸 |\n@| borderStyle | string | å¦ | - | - | tabbar上边框的颜色 |\n@| success | (result: AsyncApiSuccessResult) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [SetTabBarFail](#settabbarfail-values)) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SetTabBarFail 的属性值 @settabbarfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 100 \\| 200 | 是 | - | - | 错误ç <br/>- 100: TabBar ä¸å˜åœ¨<br/>- 200: å‚数错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### setTabBarStyle 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [setTabBarStyle](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#settabbarstyle)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.setTabBarStyle)\n"},"setTabBarItem":{"name":"## uni.setTabBarItem(options) @settabbaritem","description":"动æ€è®¾ç½® tabBar æŸä¸€é¡¹çš„内容<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [SetTabBarItemOptions](#settabbaritemoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| index | number | 是 | - | - | tabBar 的哪一项,从左边算起,索引从0开始 |\n@| text | string | å¦ | - | - | tab ä¸ŠæŒ‰é’®æ–‡å— |\n@| iconPath | string | å¦ | - | - | 图片路径 |\n@| selectedIconPath | string | å¦ | - | - | 选ä¸æ—¶çš„图片路径 |\n@| pagePath | string | å¦ | - | - | 页é¢ç»å¯¹è·¯å¾„ |\n@| iconfont | **SetTabBarItemIconFontOptions** | å¦ | - | - | å—ä½“å›¾æ ‡ï¼Œä¼˜å…ˆçº§é«˜äºŽ iconPath |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| text | string | 是 | - | - | å—库 Unicode ç |\n@@| selectedText | string | 是 | - | - | 选ä¸åŽå—库 Unicode ç |\n@@| fontSize | string | å¦ | - | - | å—ä½“å›¾æ ‡å—å·(px) |\n@@| color | string | å¦ | - | - | å—ä½“å›¾æ ‡é¢œè‰² |\n@@| selectedColor | string | å¦ | - | - | å—ä½“å›¾æ ‡é€‰ä¸é¢œè‰² |\n@| visible | boolean | å¦ | - | - | tab 是å¦æ˜¾ç¤º |\n@| success | (result: AsyncApiSuccessResult) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [SetTabBarFail](#settabbarfail-values)) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SetTabBarFail 的属性值 @settabbarfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 100 \\| 200 | 是 | - | - | 错误ç <br/>- 100: TabBar ä¸å˜åœ¨<br/>- 200: å‚数错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### setTabBarItem 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [setTabBarItem](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#settabbaritem)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.setTabBarItem)\n"},"startPullDownRefresh":{"name":"## uni.startPullDownRefresh(options?) @startpulldownrefresh","description":"开始下拉刷新<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [StartPullDownRefreshOptions](#startpulldownrefreshoptions-values) \\| null | å¦ | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (result: AsyncApiSuccessResult) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [StartPullDownRefreshFail](#startpulldownrefreshfail-values)) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### StartPullDownRefreshFail 的属性值 @startpulldownrefreshfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### startPullDownRefresh 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.io/uni-app-x/api/pull-down-refresh.html#startpulldownrefresh)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.pull-down-refresh.startPullDownRefresh)\n"},"stopPullDownRefresh":{"name":"## uni.stopPullDownRefresh() @stoppulldownrefresh","description":"åœæ¢å½“å‰é¡µé¢ä¸‹æ‹‰åˆ·æ–°<br/>","param":"","returnValue":"","compatibility":"### stopPullDownRefresh 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [stopPullDownRefresh](https://doc.dcloud.net.cn/uni-app-x/api/pull-down-refresh.html#stoppulldownrefresh)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.pull-down-refresh.stopPullDownRefresh)\n"},"pull-down-refresh":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/pull-down-refresh/pull-down-refresh.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/pull-down-refresh/pull-down-refresh\n>Template\n```vue\n<template>\n\t<scroll-view style=\"flex: 1;\">\n\t\t<!-- 实际开å‘ä¸ï¼Œé•¿åˆ—表应该使用list-view -->\n\t\t<view class=\"uni-padding-wrap uni-common-mt\">\n\t\t\t<text class=\"text\" v-for=\"(num,index) in data\" :key=\"index\">list - {{num}}</text>\n\t\t\t<view v-if=\"showLoadMore\">{{loadMoreText}}</view>\n\t\t</view>\n\t</scroll-view>\n</template>\n\n\n<style>\n\t.text {\n\t\tmargin: 6px 0;\n\t\twidth:100%;\n\t\tbackground-color: #fff;\n\t\theight: 52px;\n\t\tline-height: 52px;\n\t\ttext-align: center;\n\t\tcolor: #555;\n\t\tborder-radius: 4px;\n\t}\n</style>\n\n```\n>Script\n```uts\n\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\tdata: [] as Array<number>,\n\t\t\t\tloadMoreText: \"åŠ è½½ä¸...\",\n\t\t\t\tshowLoadMore: false,\n\t\t\t\tmax: 0\n\t\t\t}\n\t\t},\n\t\tonReady() {\n uni.startPullDownRefresh();\n\t\t\tthis.initData();\n\t\t},\n\t\tonReachBottom() {\n\t\t\tconsole.log(\"onReachBottom\");\n\t\t\tif (this.max > 40) {\n\t\t\t\tthis.loadMoreText = \"没有更多数æ®äº†!\"\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.showLoadMore = true;\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.setListData();\n\t\t\t}, 300);\n\t\t},\n\t\tonPullDownRefresh() {\n\t\t\tconsole.log('onPullDownRefresh');\n\t\t\tthis.initData();\n\t\t},\n\t\tmethods: {\n\t\t\tinitData(){\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthis.max = 0;\n\t\t\t\t\tthis.data = [];\n\t\t\t\t\tlet data:Array<number> = [];\n\t\t\t\t\tthis.max += 20;\n\t\t\t\t\tfor (let i:number = this.max - 19; i < this.max + 1; i++) {\n\t\t\t\t\t\tdata.push(i)\n\t\t\t\t\t}\n\t\t\t\t\tthis.data = this.data.concat(data);\n\t\t\t\t\tuni.stopPullDownRefresh();\n\t\t\t\t}, 1000);\n\t\t\t},\n\t\t\tsetListData() {\n\t\t\t\tlet data:Array<number> = [];\n\t\t\t\tthis.max += 10;\n\t\t\t\tfor (let i:number = this.max - 9; i < this.max + 1; i++) {\n\t\t\t\t\tdata.push(i)\n\t\t\t\t}\n\t\t\t\tthis.data = this.data.concat(data);\n\t\t\t}\n\t\t}\n\t}\n\n```\n:::"},"pageScrollTo":{"name":"## uni.pageScrollTo(options) @pagescrollto","description":"将页é¢æ»šåŠ¨åˆ°ç›®æ ‡ä½ç½®<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [PageScrollToOptions](#pagescrolltooptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| scrollTop | number \\| null | å¦ | - | - | 滚动到页é¢çš„ç›®æ ‡ä½ç½® |\n@| selector | string \\| null | å¦ | - | - | 选择器 |\n@| offsetTop | number \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.91\",\"4.11\"]]}' /> | å移è·ç¦»ï¼Œå¯ä»¥æ»šåŠ¨åˆ° selector åŠ å移è·ç¦»çš„ä½ç½® |\n@| duration | number \\| null | å¦ | - | - | 滚动动画的时长 |\n@| success | (result: AsyncApiSuccessResult) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [PageScrollToFail](#pagescrolltofail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### PageScrollToFail 的属性值 @pagescrolltofail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### pageScrollTo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [pageScrollTo](https://doc.dcloud.net.cn/uni-app-x/api/page-scroll-to.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.page-scroll-to)\n"},"page-scroll-to":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/page-scroll-to/page-scroll-to.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/page-scroll-to/page-scroll-to\n>Template\n```vue\n<template>\n <!-- #ifdef APP -->\n <scroll-view style=\"flex: 1\" scroll-with-animation=\"true\">\n <!-- #endif -->\n <view class=\"uni-padding-wrap\">\n <page-head :title=\"title\"></page-head>\n <button type=\"default\" class=\"btn-scrollTo\" @click=\"scrollTo\">\n scrollTo\n </button>\n <button type=\"default\" class=\"btn-scrollToElement\" @click=\"scrollToElement\">\n scrollToElement\n </button>\n <view class=\"uni-list\" v-for=\"(_, index) in 10\" :key=\"index\">\n <view class=\"uni-list-cell list-item\">{{ index }}</view>\n </view>\n <view class=\"custom-element\">scrollTo-custom-element</view>\n <view class=\"uni-list\" v-for=\"(_, index2) in 10\" :key=\"index2\">\n <view class=\"uni-list-cell list-item\">{{ index2 }}</view>\n </view>\n </view>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n\n\n<style>\n .list-item {\n height: 100px;\n padding-left: 30px;\n }\n</style>\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n title: 'pageScrollTo',\n }\n },\n methods: {\n scrollTo() {\n uni.pageScrollTo({\n scrollTop: 100,\n duration: 300,\n success: () => {\n console.log('success')\n },\n })\n },\n scrollToElement() {\n uni.pageScrollTo({\n selector: '.custom-element',\n duration: 300,\n success: () => {\n console.log('success')\n },\n })\n },\n },\n }\n\n```\n:::"},"onTabBarMidButtonTap":{"name":"## uni.onTabBarMidButtonTap(options) @ontabbarmidbuttontap","description":"监å¬ä¸é—´æŒ‰é’®çš„点击事件<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | () => void | 是 | - | - | - | \n","returnValue":"","compatibility":"### onTabBarMidButtonTap 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | x | x |\n","tutorial":"\n### å‚è§\n- [onTabBarMidButtonTap](https://doc.dcloud.net.cn/uni-app-x/api/on-tab-bar-mid-button-tap.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.on-tab-bar-mid-button-tap)\n"},"getElementById":{"name":"## uni.getElementById(id) @getelementbyid","description":"返回一个匹é…特定 ID çš„å…ƒç´ ï¼Œ 如果ä¸å˜åœ¨ï¼Œè¿”回 null。\\<br/>如果需è¦èŽ·å–指定的节点类型,需è¦ä½¿ç”¨ as 进行类型转æ¢ã€‚\\<br/>ID 区分大å°å†™ï¼Œä¸”应该是唯一的。如果å˜åœ¨å¤šä¸ªåŒ¹é…çš„å…ƒç´ ï¼Œåˆ™è¿”å›žç¬¬ä¸€ä¸ªåŒ¹é…çš„å…ƒç´ ã€‚<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| id | [string.IDString](/uts/data-type.md#ide-string) \\| string | 是 | - | - | - | \n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| [UniElement](/dom/unielement.md) \\| null | å¦ |\n \n","compatibility":"### getElementById 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [getElementById](https://doc.dcloud.net.cn/uni-app-x/api/get-element.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.dom.get-element.getElementById)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-element-by-id/get-element-by-id.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-element-by-id/get-element-by-id\n>Template\n```vue\n<template>\r\n <page-head id=\"page-head\" title=\"getElementById\"></page-head>\r\n <view style=\"margin: 0 15px;\">\r\n <text id=\"text\">this is text</text>\r\n <view id=\"view\" class=\"uni-common-mt\" style=\"border: 1px solid red\">this is view</view>\r\n <button class=\"uni-btn\" @click=\"changePageHeadBackgroundColor\">\r\n 修改 page-head 背景色\r\n </button>\r\n <button class=\"uni-btn\" @click=\"changeTextColor\">\r\n 修改 text å—体颜色\r\n </button>\r\n <button class=\"uni-btn\" @click=\"changeViewStyle\">\r\n 修改 view 宽高åŠèƒŒæ™¯è‰²\r\n </button>\r\n <button class=\"uni-btn\" @click=\"goMultipleRootNode\">\r\n è·³è½¬å¤šæ ¹èŠ‚ç‚¹ç¤ºä¾‹\r\n </button>\r\n </view>\r\n</template>\r\n\r\n\r\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n checked: false,\r\n homePagePath: '/pages/tabBar/component',\r\n launchOptionsPath: '',\r\n }\r\n },\n methods: {\r\n getElementByNotExistId() : Element | null {\r\n return uni.getElementById('not-exist-id')\r\n },\r\n changePageHeadBackgroundColor() {\r\n const pageHead = uni.getElementById('page-head')!\r\n pageHead.style.setProperty('background-color', 'red')\r\n },\r\n changeTextColor() {\r\n const text = uni.getElementById('text')!\r\n text.style.setProperty('color', 'red')\r\n },\r\n changeViewStyle() {\r\n const view = uni.getElementById<UniViewElement>('view')\r\n if (view !== null) {\r\n view.style.setProperty('width', '90%')\r\n view.style.setProperty('height', '50px')\r\n view.style.setProperty('background-color', '#007AFF')\r\n }\r\n },\r\n goMultipleRootNode() {\r\n uni.navigateTo({ url: '/pages/API/get-element-by-id/get-element-by-id-multiple-root-node' })\r\n },\n //自动化测试获å–textå…ƒç´ çš„offsetLeft属性值\n getTextOffsetLeft(): number {\n const text = uni.getElementById('text')!\n return text.offsetLeft\n }\r\n }\r\n }\r\n\n```\n:::"},"createSelectorQuery":{"name":"## uni.createSelectorQuery() @createselectorquery","description":"返回一个SelectorQuery对象实例<br/>","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) |\n\n#### SelectorQuery 的方法 @selectorquery-values \n\n#### in(component?) @in\n将选择器的选å–范围更改为自定义组件component内\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| component | any \\| null | å¦ | - | - | | \n\n##### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) |\n \n\n##### in 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### select(selector) @select\n在当å‰é¡µé¢ä¸‹é€‰æ‹©ç¬¬ä¸€ä¸ªåŒ¹é…选择器selector的节点\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| selector | string | 是 | - | - | - | \n\n##### 返回值 \n\n| 类型 |\n| :- |\n| [NodesRef](#nodesref-values) |\n\n##### NodesRef 的方法 @nodesref-values \n\n##### boundingClientRect(callback?) @boundingclientrect\næ·»åŠ èŠ‚ç‚¹çš„å¸ƒå±€ä½ç½®çš„查询请求,相对于显示区域,以åƒç´ 为å•ä½\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: any) => void \\| null | å¦ | - | - | | \n\n###### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) |\n \n\n###### boundingClientRect 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n##### scrollOffset(callback) @scrolloffset\næ·»åŠ èŠ‚ç‚¹çš„æ»šåŠ¨ä½ç½®æŸ¥è¯¢è¯·æ±‚,以åƒç´ 为å•ä½\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: any) => void | 是 | - | - | | \n\n###### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) |\n \n\n###### scrollOffset 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n##### fields(fields, callback) @fields\n获å–节点的相关信æ¯ï¼Œéœ€è¦èŽ·å–çš„å—段在fieldsä¸æŒ‡å®š\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| fields | **NodeField** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| id | boolean \\| null | å¦ | - | - | 是å¦è¿”回节点 id |\n@| dataset | boolean \\| null | å¦ | - | - | 是å¦è¿”回节点 dataset |\n@| rect | boolean \\| null | å¦ | - | - | 是å¦è¿”回节点布局ä½ç½®ï¼ˆleft right top bottom) |\n@| size | boolean \\| null | å¦ | - | - | 是å¦è¿”回节点尺寸(width height) |\n@| scrollOffset | boolean \\| null | å¦ | - | - | 是å¦è¿”回节点的 scrollLeft scrollTop,节点必须是 scroll-view 或者 viewport |\n@| properties | Array\\<string\\> \\| null | å¦ | - | - | 指定属性å列表,返回节点对应属性å的当å‰å±žæ€§å€¼ï¼ˆåªèƒ½èŽ·å¾—组件文档ä¸æ ‡æ³¨çš„常规属性值,id class style 和事件绑定的属性值ä¸å¯èŽ·å–) |\n@| computedStyle | Array\\<string\\> \\| null | å¦ | - | - | æŒ‡å®šæ ·å¼ååˆ—è¡¨ï¼Œè¿”å›žèŠ‚ç‚¹å¯¹åº”æ ·å¼å的当å‰å€¼ |\n@| context | boolean \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"x\",\"x\"]]}' /> | 是å¦è¿”回节点对应的 Context 对象 |\n| callback | (result: any) => void | 是 | - | - | | \n\n###### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) |\n \n\n###### fields 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n##### context(callback) @context\næ·»åŠ èŠ‚ç‚¹çš„ Context 对象查询请求\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: any) => void | 是 | - | - | | \n\n###### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) |\n \n\n###### context 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | x | x |\n\n\n##### node(callback) @node\nèŽ·å– Node 节点实例。目å‰æ”¯æŒ Canvas 的获å–。\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: any) => void | 是 | - | - | - | \n\n###### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) |\n \n\n###### node 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n \n\n##### select 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### selectAll(selector) @selectall\n在当å‰é¡µé¢ä¸‹é€‰æ‹©åŒ¹é…选择器selector的所有节点\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| selector | string | 是 | - | - | - | \n\n##### 返回值 \n\n| 类型 |\n| :- |\n| [NodesRef](#nodesref-values) |\n \n\n##### selectAll 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### selectViewport() @selectviewport\n选择显示区域\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| [NodesRef](#nodesref-values) |\n \n\n##### selectViewport 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### exec(callback) @exec\n执行所有的请求\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: Array\\<any\\>) => void \\| null | 是 | - | - | - | \n\n##### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| [NodesRef](#nodesref-values) \\| null | å¦ |\n \n\n##### exec 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n \n","compatibility":"### createSelectorQuery 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [createSelectorQuery](https://doc.dcloud.net.cn/uni-app-x/api/nodes-info.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.dom.nodes-info.createSelectorQuery)\n"},"nodes-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/nodes-info/nodes-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/nodes-info/nodes-info\n>Template\n```vue\n<template>\r\n <view class=\"page\" id=\"page\">\r\n <page-head :title=\"title\"></page-head>\r\n <button class=\"btn btn-get-node-info\" @click=\"getNodeInfo\">getNodeInfo</button>\r\n <button class=\"btn btn-get-all-node-info\" @click=\"getAllNodeInfo\">getAllNodeInfo</button>\r\n <view id=\"rect-1-2\" class=\"rect-1-2\">\r\n <view class=\"rect rect1\"></view>\r\n <view class=\"rect rect2\"></view>\r\n </view>\r\n <view class=\"rect-info-1-2\">\r\n <view class=\"rect-info\" v-for=\"(nodeInfo, index) in nodeInfoList\" :key=\"index\">\r\n <view class=\"node-info-item\">\r\n <text class=\"node-info-item-k\">left: </text>\r\n <text class=\"node-info-item-v\">{{nodeInfo.left}}</text>\r\n </view>\r\n <view class=\"node-info-item\">\r\n <text class=\"node-info-item-k\">top: </text>\r\n <text class=\"node-info-item-v\">{{nodeInfo.top}}</text>\r\n </view>\r\n <view class=\"node-info-item\">\r\n <text class=\"node-info-item-k\">right: </text>\r\n <text class=\"node-info-item-v\">{{nodeInfo.right}}</text>\r\n </view>\r\n <view class=\"node-info-item\">\r\n <text class=\"node-info-item-k\">bottom: </text>\r\n <text class=\"node-info-item-v\">{{nodeInfo.bottom}}</text>\r\n </view>\r\n <view class=\"node-info-item\">\r\n <text class=\"node-info-item-k\">width: </text>\r\n <text class=\"node-info-item-v\">{{nodeInfo.width}}</text>\r\n </view>\r\n <view class=\"node-info-item\">\r\n <text class=\"node-info-item-k\">height: </text>\r\n <text class=\"node-info-item-v\">{{nodeInfo.height}}</text>\r\n </view>\r\n </view>\r\n </view>\n <node-child class=\"node-child\"></node-child>\r\n </view>\r\n</template>\r\n\r\n\r\n\r\n<style>\r\n .page {\r\n padding: 15px;\r\n flex: 1;\r\n }\r\n\r\n .btn {\r\n margin-top: 15px;\r\n }\r\n\r\n .rect-1-2 {\r\n flex-direction: row;\r\n margin-top: 15px;\r\n }\r\n\r\n .rect {\r\n width: 150px;\r\n height: 100px;\r\n }\r\n\r\n .rect1 {\r\n background-color: dodgerblue;\r\n }\r\n\r\n .rect2 {\r\n margin-left: auto;\r\n background-color: seagreen;\r\n }\r\n\r\n .rect-info-1-2 {\r\n flex-direction: row;\r\n margin-top: 15px;\r\n }\r\n\r\n .rect-info {\r\n flex: 1;\r\n flex-direction: column;\r\n }\r\n\r\n .node-info-item {\r\n flex-direction: row;\r\n }\r\n\r\n .node-info-item-k {\r\n width: 72px;\r\n line-height: 2;\r\n }\r\n\r\n .node-info-item-v {\r\n font-weight: bold;\r\n line-height: 2;\r\n }\r\n</style>\n\n```\n>Script\n```uts\n\r\n import nodeChild from './nodes-info-child.uvue'\r\n\r\n type NodeInfoType = {\r\n left : number | null,\r\n top : number | null,\r\n right : number | null,\r\n bottom : number | null,\r\n width : number | null,\r\n height : number | null,\r\n }\r\n\r\n export default {\r\n components: {\r\n nodeChild\r\n },\r\n data() {\r\n return {\r\n title: 'createSelectorQuery',\r\n nodeInfoList: [] as NodeInfoType[],\r\n // 仅用于自动化测试\r\n rootNodeInfo: null as NodeInfoType | null,\r\n //供自动化测试使用\r\n // resizeRectValid: false\r\n }\r\n },\r\n onResize() {\r\n //供自动化测试使用\r\n /* var rect12Element = uni.getElementById(\"rect-1-2\")\r\n if(rect12Element != null) {\r\n var domRect = rect12Element.getBoundingClientRect()\r\n if(domRect.width > 100) {\r\n this.resizeRectValid = true\r\n }\r\n } */\r\n },\r\n methods: {\r\n // 仅用于自动化测试\r\n getRootNodeInfo(selector : string) {\r\n uni.createSelectorQuery().select(selector).boundingClientRect().exec((ret) => {\r\n if (ret.length == 1) {\r\n const nodeInfo = ret[0] as NodeInfo;\r\n const nodeType = {\r\n left: nodeInfo.left,\r\n top: nodeInfo.top,\r\n right: nodeInfo.right,\r\n bottom: nodeInfo.bottom,\r\n width: nodeInfo.width,\r\n height: nodeInfo.height,\r\n } as NodeInfoType;\r\n this.rootNodeInfo = nodeType\r\n }\r\n })\r\n },\r\n getNodeInfo() {\r\n uni.createSelectorQuery().select('.rect1').boundingClientRect().exec((ret) => {\r\n this.nodeInfoList.length = 0\r\n const i = ret[0] as NodeInfo\r\n this.nodeInfoList.push({\r\n left: i.left,\r\n top: i.top,\r\n right: i.right,\r\n bottom: i.bottom,\r\n width: i.width,\r\n height: i.height,\r\n } as NodeInfoType)\r\n })\r\n },\r\n getAllNodeInfo() {\r\n uni.createSelectorQuery().selectAll('.rect').boundingClientRect().exec((ret) => {\r\n this.nodeInfoList.length = 0\r\n const array = ret[0] as NodeInfo[]\r\n array.forEach((i) => {\r\n this.nodeInfoList.push({\r\n left: i.left,\r\n top: i.top,\r\n right: i.right,\r\n bottom: i.bottom,\r\n width: i.width,\r\n height: i.height,\r\n } as NodeInfoType)\r\n })\r\n })\r\n }\r\n }\r\n }\r\n\n```\n:::"},"showActionSheet":{"name":"## uni.showActionSheet(options) @showactionsheet","description":"从底部å‘上弹出æ“作èœå•","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ShowActionSheetOptions](#showactionsheetoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| title | string \\| null | å¦ | - | - | èœå•æ ‡é¢˜ |\n@| alertText | string \\| null | å¦ | - | - | è¦ç¤ºæ–‡æ¡ˆï¼ˆåŒèœå•æ ‡é¢˜, appæ— æ•ˆï¼‰ |\n@| itemList | Array\\<string\\> | 是 | - | - | 按钮的文å—数组 |\n@| itemColor | [string.ColorString](/uts/data-type.md#ide-string) \\| null | å¦ | - | - | 按钮的文å—颜色,å—ç¬¦ä¸²æ ¼å¼ï¼ˆiOS默认为系统控件颜色) |\n@| popover | **Popover** \\| null | å¦ | - | - | 大å±è®¾å¤‡å¼¹å‡ºåŽŸç”Ÿé€‰æ‹©æŒ‰é’®æ¡†çš„指示区域,默认居ä¸æ˜¾ç¤º |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| top | number | 是 | - | - | 指示区域åæ ‡ï¼Œä½¿ç”¨åŽŸç”Ÿ navigationBar 时一般需è¦åŠ 上 navigationBar 的高度 |\n@@| left | number | 是 | - | - | 指示区域åæ ‡ |\n@@| width | number | 是 | - | - | 指示区域宽度 |\n@@| height | number | 是 | - | - | 指示区域高度 |\n@| success | (res: [ShowActionSheetSuccess](#showactionsheetsuccess-values)) => void \\| null | å¦ | - | - | uni.showActionSheetæˆåŠŸå›žè°ƒå‡½æ•°å®šä¹‰ |\n@| fail | (res: [IPromptError](#iprompterror-values)) => void \\| null | å¦ | - | - | uni.showActionSheetæˆåŠŸå›žè°ƒå‡½æ•°å®šä¹‰ |\n@| complete | (res: any) => void \\| null | å¦ | - | - | uni.showActionSheetæˆåŠŸå›žè°ƒå‡½æ•°å®šä¹‰ | \n\n##### ShowActionSheetSuccess 的属性值 @showactionsheetsuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| tapIndex | number \\| null | å¦ | - | - | 用户点击的按钮,从上到下的顺åºï¼Œä»Ž0开始 |\n\n##### IPromptError 的属性值 @iprompterror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1 \\| 1001 | 是 | - | - | 错误ç <br/>- 1\t 撤销<br/>- 1001 请求å‚æ•°éžæ³• |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### showActionSheet 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showactionsheet)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.prompt.showActionSheet)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/action-sheet/action-sheet.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/action-sheet/action-sheet\n>Template\n```vue\n<template>\r\n <view>\r\n <page-head :title=\"title\"></page-head>\r\n <view class=\"uni-list\">\r\n <radio-group @change=\"radioChange\">\r\n <radio class=\"uni-list-cell uni-list-cell-pd\" v-for=\"(item, index) in items\" :key=\"item.value\"\r\n :class=\"index < items.length - 1 ? 'uni-list-cell-line': ''\" :value=\"item.value\" :checked=\"index === current\">\r\n {{item.name}}\r\n </radio>\r\n </radio-group>\r\n </view>\r\n <view class=\"uni-list\">\r\n <view class=\"uni-list-cell uni-list-cell-pd\">\r\n <view class=\"uni-list-cell-db\">自定义itemColor</view>\r\n <switch :checked=\"itemColorCustom\" @change=\"itemColorChange\" />\r\n </view>\r\n <view class=\"uni-list-cell uni-list-cell-pd\">\r\n <view class=\"uni-list-cell-db\">超长文本和空文本item</view>\r\n <switch :checked=\"itemContentLarge\" @change=\"itemContentLargeChange\" />\r\n </view>\r\n <view class=\"uni-list-cell uni-list-cell-pd\">\r\n <view class=\"uni-list-cell-db\">超过6个item</view>\r\n <switch :checked=\"itemNumLargeSelect\" @change=\"itemNumLargeChange\" />\r\n </view>\r\n </view>\r\n <view class=\"uni-padding-wrap\">\r\n <view class=\"uni-btn-v\">\r\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"actionSheetTap\" id=\"btn-action-sheet-show\">弹出action sheet</button>\r\n </view>\r\n </view>\r\n </view>\r\n</template>\r\n\n\n```\n>Script\n```uts\n\r\n type ItemType = {\r\n value : string,\r\n name : string,\r\n }\r\n export default {\r\n data() {\r\n return {\r\n title: 'action-sheet',\r\n itemColorCustom: false,\r\n itemContentLarge: false,\r\n itemNumLargeSelect: false,\n showErrorToast:true,\r\n items: [{\r\n value: 'æ ‡é¢˜',\r\n name: 'æœ‰æ ‡é¢˜'\r\n },\r\n {\r\n value: '',\r\n name: 'æ— æ ‡é¢˜'\r\n },\r\n {\r\n value: 'è¶…é•¿æ ‡é¢˜æµ‹è¯•å†…å®¹ï¼Œæµ‹è¯•è¶…è¿‡æ˜¾ç¤ºæœ€å¤§èŒƒå›´ä¹‹åŽçš„æ ·å¼-è¶…é•¿æ ‡é¢˜æµ‹è¯•å†…å®¹ï¼Œæµ‹è¯•è¶…è¿‡æ˜¾ç¤ºæœ€å¤§èŒƒå›´ä¹‹åŽçš„æ ·å¼',\r\n name: 'è¶…é•¿æ ‡é¢˜'\r\n }\r\n ] as ItemType[],\r\n current: 0,\r\n }\r\n },\n onLoad(){\n uni.showActionSheet({\n title: \"onLoad 调用示例,请手动å–消\",\n itemList:['item1', 'item2'],\n })\n },\r\n methods: {\n //自动化测试例专用\n jest_getWindowInfo() : GetWindowInfoResult {\n return uni.getWindowInfo();\n },\r\n radioChange(e : UniRadioGroupChangeEvent) {\r\n for (let i = 0; i < this.items.length; i++) {\r\n if (this.items[i].value === e.detail.value) {\r\n this.current = i;\r\n break;\r\n }\r\n }\r\n },\r\n itemContentLargeChange: function (e : UniSwitchChangeEvent) {\r\n this.itemContentLarge = e.detail.value\r\n },\r\n itemColorChange: function (e : UniSwitchChangeEvent) {\r\n this.itemColorCustom = e.detail.value\r\n },\r\n itemNumLargeChange: function (e : UniSwitchChangeEvent) {\r\n this.itemNumLargeSelect = e.detail.value\r\n },\r\n actionSheetTap() {\r\n\r\n let itemInfo = ['item1', 'item2', 'item3', 'item4']\r\n\r\n if (this.itemContentLarge) {\r\n itemInfo = ['ä¸¤ä¸ªé»„é¹‚é¸£ç¿ æŸ³ï¼Œä¸€è¡Œç™½é¹ä¸Šé’天。窗å«è¥¿å²åƒç§‹é›ªï¼Œé—¨æ³Šä¸œå´ä¸‡é‡Œèˆ¹', '水光潋滟晴方好,山色空蒙雨亦奇。 欲把西湖比西å,淡妆浓抹总相宜', '']\r\n }\n\n if (this.itemNumLargeSelect) {\r\n // 大é‡é€‰é¡¹æµ‹è¯•,ä¸èƒ½è¶…过6ä¸ªå…ƒç´ https://uniapp.dcloud.net.cn/api/ui/prompt.html#showactionsheet\r\n itemInfo = []\n for (var i = 1; i <= 10; i++) {\r\n itemInfo.push('ä¸¤ä¸ªé»„é¹‚é¸£ç¿ æŸ³ï¼Œä¸€è¡Œç™½é¹ä¸Šé’天');\r\n }\r\n }\r\n\r\n const that = this\r\n if (this.itemColorCustom) {\r\n uni.showActionSheet({\r\n title: this.items[this.current].value,\r\n itemList: itemInfo,\r\n itemColor: \"#ff00ff\",\r\n success: (e) => {\r\n console.log(e.tapIndex);\r\n uni.showToast({\r\n title: \"点击了第\" + e.tapIndex + \"个选项\",\r\n icon: \"none\"\r\n })\r\n },\r\n fail: (e) => {\n if(this.showErrorToast){\n uni.showToast({\n title: e.errMsg,\n icon: \"none\"\n })\n }\r\n console.log(e);\r\n }\r\n })\r\n } else {\r\n uni.showActionSheet({\r\n title: this.items[this.current].value,\r\n itemList: itemInfo,\r\n success: (e) => {\r\n console.log(e.tapIndex);\r\n uni.showToast({\r\n title: \"点击了第\" + e.tapIndex + \"个选项\",\r\n icon: \"none\"\r\n })\r\n },\r\n fail: (e) => {\r\n console.log(e);\n if(this.showErrorToast){\n uni.showToast({\n title: e.errMsg,\n icon: \"none\"\n })\n }\n }\r\n })\r\n }\r\n },\r\n }\r\n }\r\n\n```\n:::"},"showLoading":{"name":"## uni.showLoading(options) @showloading","description":"显示 loading æ示框, 需主动调用 uni.hideLoading æ‰èƒ½å…³é—æ示框。","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ShowLoadingOptions](#showloadingoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| title | string | 是 | - | - | æ示的内容,长度与 icon å–值有关。 |\n@| mask | boolean \\| null | å¦ | - | - | 是å¦æ˜¾ç¤ºé€æ˜Žè’™å±‚,防æ¢è§¦æ‘¸ç©¿é€ï¼Œé»˜è®¤ï¼šfalse |\n@| success | (res: ShowLoadingSuccess) => void \\| null | å¦ | - | - | uni.showLoadingæˆåŠŸå›žè°ƒå‡½æ•°å®šä¹‰ |\n@| fail | (res: [IPromptError](#iprompterror-values)) => void \\| null | å¦ | - | - | uni.showLoading失败回调函数定义 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | uni.showLoading完æˆå›žè°ƒå‡½æ•°å®šä¹‰ | \n\n##### IPromptError 的属性值 @iprompterror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1 \\| 1001 | 是 | - | - | 错误ç <br/>- 1\t 撤销<br/>- 1001 请求å‚æ•°éžæ³• |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### showLoading 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showloading)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.prompt.showLoading)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/loading/loading.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/loading/loading\n>Template\n```vue\n<template>\n <view>\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-list\">\n <view class=\"uni-list-cell uni-list-cell-pd\">\n <view class=\"uni-list-cell-db\">是å¦æ˜¾ç¤ºé€æ˜Žè’™å±‚-å±è”½ç‚¹å‡»äº‹ä»¶</view>\n <switch :checked=\"maskSelect\" @change=\"maskChange\" />\n </view>\n <view class=\"uni-padding-wrap\">\n <view class=\"uni-title uni-common-mt\">\n <text class=\"uni-title-text\"> è®¾ç½®æ ‡é¢˜ </text>\n </view>\n </view>\n <view class=\"uni-list uni-common-pl\">\n <radio-group @change=\"radioChange\">\n <radio class=\"uni-list-cell uni-list-cell-pd radio\" v-for=\"(item, index) in items\" :key=\"item.value\"\n :class=\"index < items.length - 1 ? 'uni-list-cell-line' : ''\" :value=\"item.value\"\n :checked=\"index === current\">\n {{ item.name }}\n </radio>\n </radio-group>\n </view>\n </view>\n <view class=\"uni-padding-wrap\">\n <view class=\"uni-btn-v\">\n <button class=\"uni-btn-v\" type=\"primary\" @click=\"showLoading\">显示 loading æ示框</button>\n <button class=\"uni-btn-v\" @click=\"hideLoading\">éšè— loading æ示框</button>\n <text>为方便演示,loading弹出3秒åŽè‡ªåŠ¨å…³é—</text>\n </view>\n </view>\n </view>\n</template>\n\n\n```\n>Script\n```uts\n\n type ItemType = {\n value : string\n name : string\n }\n export default {\n data() {\n return {\n title: 'loading',\n items: [\n {\n value: 'null',\n name: 'æ— æ ‡é¢˜',\n },\n {\n value: '三秒åŽè‡ªåŠ¨å…³é—',\n name: 'æ™®é€šæ ‡é¢˜',\n },\n {\n value: '超长文本内容,测试超出范围-超长文本内容,测试超出范围-三秒åŽè‡ªåŠ¨å…³é—',\n name: 'é•¿æ ‡é¢˜',\n },\n ] as ItemType[],\n current: 0,\n maskSelect: false,\n titleSelect: \"null\"\n }\n },\n onLoad(){\n uni.showLoading({\n \ttitle:'onLoad 调用示例,2秒åŽæ¶ˆå¤±'\n })\n setTimeout(function() {\n uni.hideLoading()\n }, 2000);\n },\n methods: {\n //自动化测试例专用\n jest_getWindowInfo() : GetWindowInfoResult {\n return uni.getWindowInfo();\n },\n\n radioChange(e : UniRadioGroupChangeEvent) {\n const selected = this.items.find((item) : boolean => {\n return item.value == e.detail.value\n })\n if (selected != null) {\n this.titleSelect = selected.value\n }\n },\n maskChange: function (e : UniSwitchChangeEvent) {\n this.maskSelect = e.detail.value\n },\n showLoading: function () {\n\n console.log(this.titleSelect)\n if (this.titleSelect == \"null\") {\n uni.showLoading({\n title: \"\",\n mask: this.maskSelect\n });\n } else {\n uni.showLoading({\n title: this.titleSelect,\n mask: this.maskSelect\n });\n }\n setTimeout(() => {\n this.hideLoading();\n }, 3000);\n },\n hideLoading: function () {\n uni.hideLoading();\n }\n }\n }\n\n```\n:::"},"hideLoading":{"name":"## uni.hideLoading() @hideloading","description":"éšè— loading æ示框。","param":"","returnValue":"","compatibility":"### hideLoading 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/ui/prompt.html#hideloading)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.prompt.hideLoading)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/loading/loading.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/loading/loading\n>Template\n```vue\n<template>\n <view>\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-list\">\n <view class=\"uni-list-cell uni-list-cell-pd\">\n <view class=\"uni-list-cell-db\">是å¦æ˜¾ç¤ºé€æ˜Žè’™å±‚-å±è”½ç‚¹å‡»äº‹ä»¶</view>\n <switch :checked=\"maskSelect\" @change=\"maskChange\" />\n </view>\n <view class=\"uni-padding-wrap\">\n <view class=\"uni-title uni-common-mt\">\n <text class=\"uni-title-text\"> è®¾ç½®æ ‡é¢˜ </text>\n </view>\n </view>\n <view class=\"uni-list uni-common-pl\">\n <radio-group @change=\"radioChange\">\n <radio class=\"uni-list-cell uni-list-cell-pd radio\" v-for=\"(item, index) in items\" :key=\"item.value\"\n :class=\"index < items.length - 1 ? 'uni-list-cell-line' : ''\" :value=\"item.value\"\n :checked=\"index === current\">\n {{ item.name }}\n </radio>\n </radio-group>\n </view>\n </view>\n <view class=\"uni-padding-wrap\">\n <view class=\"uni-btn-v\">\n <button class=\"uni-btn-v\" type=\"primary\" @click=\"showLoading\">显示 loading æ示框</button>\n <button class=\"uni-btn-v\" @click=\"hideLoading\">éšè— loading æ示框</button>\n <text>为方便演示,loading弹出3秒åŽè‡ªåŠ¨å…³é—</text>\n </view>\n </view>\n </view>\n</template>\n\n\n```\n>Script\n```uts\n\n type ItemType = {\n value : string\n name : string\n }\n export default {\n data() {\n return {\n title: 'loading',\n items: [\n {\n value: 'null',\n name: 'æ— æ ‡é¢˜',\n },\n {\n value: '三秒åŽè‡ªåŠ¨å…³é—',\n name: 'æ™®é€šæ ‡é¢˜',\n },\n {\n value: '超长文本内容,测试超出范围-超长文本内容,测试超出范围-三秒åŽè‡ªåŠ¨å…³é—',\n name: 'é•¿æ ‡é¢˜',\n },\n ] as ItemType[],\n current: 0,\n maskSelect: false,\n titleSelect: \"null\"\n }\n },\n onLoad(){\n uni.showLoading({\n \ttitle:'onLoad 调用示例,2秒åŽæ¶ˆå¤±'\n })\n setTimeout(function() {\n uni.hideLoading()\n }, 2000);\n },\n methods: {\n //自动化测试例专用\n jest_getWindowInfo() : GetWindowInfoResult {\n return uni.getWindowInfo();\n },\n\n radioChange(e : UniRadioGroupChangeEvent) {\n const selected = this.items.find((item) : boolean => {\n return item.value == e.detail.value\n })\n if (selected != null) {\n this.titleSelect = selected.value\n }\n },\n maskChange: function (e : UniSwitchChangeEvent) {\n this.maskSelect = e.detail.value\n },\n showLoading: function () {\n\n console.log(this.titleSelect)\n if (this.titleSelect == \"null\") {\n uni.showLoading({\n title: \"\",\n mask: this.maskSelect\n });\n } else {\n uni.showLoading({\n title: this.titleSelect,\n mask: this.maskSelect\n });\n }\n setTimeout(() => {\n this.hideLoading();\n }, 3000);\n },\n hideLoading: function () {\n uni.hideLoading();\n }\n }\n }\n\n```\n:::"},"showModal":{"name":"## uni.showModal(options) @showmodal","description":"显示模æ€å¼¹çª—,å¯ä»¥åªæœ‰ä¸€ä¸ªç¡®å®šæŒ‰é’®ï¼Œä¹Ÿå¯ä»¥åŒæ—¶æœ‰ç¡®å®šå’Œå–消按钮。类似于一个APIæ•´åˆäº† html ä¸ï¼šalertã€confirm。","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ShowModalOptions](#showmodaloptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| title | string \\| null | å¦ | - | - | æç¤ºçš„æ ‡é¢˜ |\n@| content | string \\| null | å¦ | - | - | æ示的内容 |\n@| showCancel | boolean \\| null | å¦ | true<br/>是å¦æ˜¾ç¤ºå–消按钮,默认为 true | - | |\n@| cancelText | string \\| null | å¦ | - | - | å–消按钮的文å—,默认为\"å–消\" |\n@| cancelColor | [string.ColorString](/uts/data-type.md#ide-string) \\| null | å¦ | - | - | å–消按钮的文å—颜色,默认为\"#000000\" |\n@| confirmText | string \\| null | å¦ | - | - | 确定按钮的文å—,默认为\"确定\" |\n@| confirmColor | [string.ColorString](/uts/data-type.md#ide-string) \\| null | å¦ | - | - | 确定按钮的文å—颜色 |\n@| editable | boolean \\| null | å¦ | false<br/>是å¦æ˜¾ç¤ºè¾“入框 | - | |\n@| placeholderText | string \\| null | å¦ | - | - | 显示输入框时的æ示文本 |\n@| success | (res: [ShowModalSuccess](#showmodalsuccess-values)) => void \\| null | å¦ | - | - | uni.showModalæˆåŠŸå›žè°ƒå‡½æ•°å®šä¹‰ |\n@| fail | (res: [IPromptError](#iprompterror-values)) => void \\| null | å¦ | - | - | uni.showModal失败回调函数定义 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | uni.showModal完æˆå›žè°ƒå‡½æ•°å®šä¹‰ | \n\n##### ShowModalSuccess 的属性值 @showmodalsuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| confirm | boolean | 是 | - | - | 为 true 时,表示用户点击了确定按钮 |\n| cancel | boolean | 是 | - | - | 为 true 时,表示用户点击了å–消(用于 Android 系统区分点击蒙层关é—还是点击å–消按钮关é—) |\n| content | string \\| null | å¦ | - | - | editable 为 true 时,用户输入的文本 |\n\n##### IPromptError 的属性值 @iprompterror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1 \\| 1001 | 是 | - | - | 错误ç <br/>- 1\t 撤销<br/>- 1001 请求å‚æ•°éžæ³• |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### showModal 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showmodal)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.prompt.showModal)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/modal/modal.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/modal/modal\n>Template\n```vue\n<template>\n <!-- #ifdef APP -->\n <scroll-view style=\"flex: 1\">\n <!-- #endif -->\n <view>\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-list\">\n <radio-group @change=\"radioChange\">\n <radio class=\"uni-list-cell uni-list-cell-pd\" v-for=\"(item, index) in items\" :key=\"item.value\"\n :class=\"index < items.length - 1 ? 'uni-list-cell-line' : ''\" :value=\"item.value\"\n :checked=\"index === current\">\n {{ item.name }}\n </radio>\n </radio-group>\n </view>\n <view class=\"uni-list\">\n <view class=\"uni-list-cell uni-list-cell-pd\">\n <view class=\"uni-list-cell-db\">是å¦æ˜¾ç¤ºå–消按钮</view>\n <switch :checked=\"showCancelSelect\" @change=\"showCancelChange\" />\n </view>\n <view class=\"uni-list-cell uni-list-cell-pd\">\n <view class=\"uni-list-cell-db\">定制å–消文案</view>\n <switch :checked=\"cancelTextSelect\" @change=\"cancelTextChange\" />\n </view>\n <view class=\"uni-list-cell uni-list-cell-pd\">\n <view class=\"uni-list-cell-db\">定制确认文案</view>\n <switch :checked=\"confirmTextSelect\" @change=\"confirmTextChange\" />\n </view>\n <view class=\"uni-list-cell uni-list-cell-pd\">\n <view class=\"uni-list-cell-db\">是å¦æ˜¾ç¤ºè¾“入框</view>\n <switch :checked=\"editableSelect\" @change=\"editableChange\" />\n </view>\n <view class=\"uni-list-cell uni-list-cell-pd\">\n <view class=\"uni-list-cell-db\">是å¦å®šåˆ¶è¾“å…¥æ示è¯</view>\n <switch :checked=\"placeholderTextSelect\" @change=\"placeholderTextChange\" />\n </view>\n </view>\n <view class=\"uni-padding-wrap uni-common-mt\">\n <view class=\"uni-btn-v\">\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"modalTap\" id=\"btn-modal-show\">\n modal测试\n </button>\n </view>\n <text>{{ exeRet }}</text>\n </view>\n </view>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n\n\n```\n>Script\n```uts\n\n type ItemType = {\n value : string,\n name : string,\n }\n export default {\n data() {\n return {\n title: 'modal',\n showCancelSelect: false,\n cancelTextSelect: false,\n confirmTextSelect: false,\n editableSelect: false,\n placeholderTextSelect: false,\n exeRet: \"\",\n items: [{\n value: 'æ ‡é¢˜',\n name: 'æœ‰æ ‡é¢˜'\n },\n {\n value: '',\n name: 'æ— æ ‡é¢˜'\n },\n {\n value: 'è¶…é•¿æ ‡é¢˜æµ‹è¯•å†…å®¹ï¼Œæµ‹è¯•è¶…è¿‡æ˜¾ç¤ºæœ€å¤§èŒƒå›´ä¹‹åŽçš„æ ·å¼-è¶…é•¿æ ‡é¢˜æµ‹è¯•å†…å®¹ï¼Œæµ‹è¯•è¶…è¿‡æ˜¾ç¤ºæœ€å¤§èŒƒå›´ä¹‹åŽçš„æ ·å¼',\n name: 'è¶…é•¿æ ‡é¢˜'\n }\n ] as ItemType[],\n current: 0\n }\n },\n onLoad() {\n uni.showModal({\n title: \"onLoad 调用示例,请手动å–消\",\n showCancel: false\n })\n },\n methods: {\n //自动化测试例专用\n jest_getWindowInfo() : GetWindowInfoResult {\n return uni.getWindowInfo();\n },\n showCancelChange: function (e : UniSwitchChangeEvent) {\n this.showCancelSelect = e.detail.value\n },\n cancelTextChange: function (e : UniSwitchChangeEvent) {\n this.cancelTextSelect = e.detail.value\n },\n confirmTextChange: function (e : UniSwitchChangeEvent) {\n this.confirmTextSelect = e.detail.value\n },\n editableChange: function (e : UniSwitchChangeEvent) {\n this.editableSelect = e.detail.value\n },\n placeholderTextChange: function (e : UniSwitchChangeEvent) {\n this.placeholderTextSelect = e.detail.value\n },\n radioChange(e : UniRadioGroupChangeEvent) {\n for (let i = 0; i < this.items.length; i++) {\n if (this.items[i].value === e.detail.value) {\n this.current = i;\n break;\n }\n }\n },\n modalTap: function () {\n let cancelTextVal : string\n let cancelColorVal = ''\n if (this.cancelTextSelect) {\n cancelTextVal = \"修改åŽçš„å–消文本\"\n cancelColorVal = \"#ff00ff\"\n } else {\n cancelTextVal = \"å–消\"\n }\n\n let confirmTextVal = '确定'\n let confirmColorVal = ''\n if (this.confirmTextSelect) {\n confirmTextVal = \"修改åŽçš„确定文本\"\n confirmColorVal = \"#00ffff\"\n }\n\n let placeholderTextVal = ''\n let contentVal = \"弹窗内容,告知当å‰çŠ¶æ€ã€ä¿¡æ¯å’Œè§£å†³æ–¹æ³•ï¼Œæè¿°æ–‡å—å°½é‡æŽ§åˆ¶åœ¨ä¸‰è¡Œå†…\"\n if (this.placeholderTextSelect) {\n placeholderTextVal = \"定制æ示信æ¯\"\n contentVal = \"\"\n }\n uni.showModal({\n title: this.items[this.current].value,\n editable: this.editableSelect,\n placeholderText: placeholderTextVal,\n content: contentVal,\n showCancel: this.showCancelSelect,\n cancelText: cancelTextVal,\n cancelColor: cancelColorVal,\n confirmText: confirmTextVal,\n confirmColor: confirmColorVal,\n success: (res) => {\n this.exeRet = JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = JSON.stringify(res)\n }\n })\n }\n }\n }\n\n```\n:::"},"showToast":{"name":"## uni.showToast(options) @showtoast","description":"显示消æ¯æ示框","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ShowToastOptions](#showtoastoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| title | string | 是 | - | - | æ示的内容,长度与 icon å–值有关。 |\n@| icon | \"success\" \\| \"error\" \\| \"fail\" \\| \"exception\" \\| \"loading\" \\| \"none\" | å¦ | - | - | icon值说明 success: 显示æˆåŠŸå›¾æ ‡ï¼Œerror: æ˜¾ç¤ºé”™è¯¯å›¾æ ‡ï¼› fail: æ˜¾ç¤ºé”™è¯¯å›¾æ ‡ï¼Œæ¤æ—¶titleæ–‡æœ¬æ— é•¿åº¦æ˜¾ç¤ºï¼› exception: æ˜¾ç¤ºå¼‚å¸¸å›¾æ ‡ï¼Œæ¤æ—¶titleæ–‡æœ¬æ— é•¿åº¦æ˜¾ç¤ºï¼› loading: æ˜¾ç¤ºåŠ è½½å›¾æ ‡ï¼›none: ä¸æ˜¾ç¤ºå›¾æ ‡ã€‚ |\n@| image | [string.ImageURIString](/uts/data-type.md#ide-string) \\| null | å¦ | - | - | è‡ªå®šä¹‰å›¾æ ‡çš„æœ¬åœ°è·¯å¾„ï¼ˆapp端暂ä¸æ”¯æŒgif) |\n@| mask | boolean \\| null | å¦ | - | - | 是å¦æ˜¾ç¤ºé€æ˜Žè’™å±‚,防æ¢è§¦æ‘¸ç©¿é€ï¼Œé»˜è®¤ï¼šfalse |\n@| duration | number \\| null | å¦ | - | - | æ示的延迟时间,å•ä½æ¯«ç§’,默认:1500 |\n@| position | \"top\" \\| \"center\" \\| \"bottom\" | å¦ | - | - | position值说明(仅App生效) top: 居上显示; center: å±…ä¸æ˜¾ç¤ºï¼›bottom: 居底显示 |\n@| success | (res: ShowToastSuccess) => void \\| null | å¦ | - | - | uni.showToastæˆåŠŸå›žè°ƒå‡½æ•°å®šä¹‰ |\n@| fail | (res: [IPromptError](#iprompterror-values)) => void \\| null | å¦ | - | - | uni.showToast失败回调函数定义 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | uni.showToast完æˆå›žè°ƒå‡½æ•°å®šä¹‰ | \n\n##### IPromptError 的属性值 @iprompterror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1 \\| 1001 | 是 | - | - | 错误ç <br/>- 1\t 撤销<br/>- 1001 请求å‚æ•°éžæ³• |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### showToast 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showtoast)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.prompt.showToast)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/toast/toast.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/toast/toast\n>Template\n```vue\n<template>\n <view>\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-padding-wrap\">\n <view class=\"uni-btn-v\">\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"toast1Tap\" id=\"btn-toast-default\" >点击弹出默认toast</button>\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"toastTapIconError\" id=\"btn-toast-errorIcon\">点击弹出设置iconçš„toast</button>\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"toast2Tap\" id=\"btn-toast-duration\">点击弹出设置durationçš„toast</button>\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"toast3Tap\" id=\"btn-toast-loading\">点击弹出显示loadingçš„toast</button>\n <!-- #ifndef MP-ALIPAY -->\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"toast4Tap\">点击弹出显示自定义图片的toast</button>\n <!-- #endif -->\n <!-- #ifdef APP -->\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"toast5Tap\" id=\"btn-toast-postion-bottom\">ç‚¹å‡»æ˜¾ç¤ºæ— å›¾æ ‡çš„å±…åº•toast</button>\n <!-- #endif -->\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"hideToast\" id=\"btn-toast-hide\">点击éšè—toast</button>\n </view>\n <text>{{exeRet}}</text>\n </view>\n </view>\n</template>\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n title: 'toast',\n exeRet: ''\n }\n },\n onLoad() {\n uni.showToast({\n title: 'onLoad 调用示例,2秒åŽæ¶ˆå¤±'\n })\n setTimeout(function () {\n uni.hideToast()\n }, 2000);\n },\n methods: {\n //自动化测试例专用\n jest_getWindowInfo() : GetWindowInfoResult {\n return uni.getWindowInfo();\n },\n toast1Tap: function () {\n uni.showToast({\n title: \"默认\",\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n toastTapIconError: function () {\n uni.showToast({\n title: \"默认\",\n icon: 'error',\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n toast2Tap: function () {\n uni.showToast({\n title: \"duration 3000\",\n duration: 3000,\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n toast3Tap: function () {\n uni.showToast({\n title: \"loading\",\n icon: \"loading\",\n duration: 5000,\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n toast4Tap: function () {\n uni.showToast({\n title: \"logo\",\n image: \"/static/uni.png\",\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n // #ifdef APP\n toast5Tap: function () {\n uni.showToast({\n title: \"显示一段轻æ示\",\n position: 'bottom',\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n // #endif\n hideToast: function () {\n uni.hideToast()\n }\n }\n }\n\n```\n:::"},"hideToast":{"name":"## uni.hideToast() @hidetoast","description":"éšè—消æ¯æ示框。","param":"","returnValue":"","compatibility":"### hideToast 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/ui/prompt.html#hidetoast)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.prompt.hideToast)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/toast/toast.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/toast/toast\n>Template\n```vue\n<template>\n <view>\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-padding-wrap\">\n <view class=\"uni-btn-v\">\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"toast1Tap\" id=\"btn-toast-default\" >点击弹出默认toast</button>\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"toastTapIconError\" id=\"btn-toast-errorIcon\">点击弹出设置iconçš„toast</button>\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"toast2Tap\" id=\"btn-toast-duration\">点击弹出设置durationçš„toast</button>\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"toast3Tap\" id=\"btn-toast-loading\">点击弹出显示loadingçš„toast</button>\n <!-- #ifndef MP-ALIPAY -->\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"toast4Tap\">点击弹出显示自定义图片的toast</button>\n <!-- #endif -->\n <!-- #ifdef APP -->\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"toast5Tap\" id=\"btn-toast-postion-bottom\">ç‚¹å‡»æ˜¾ç¤ºæ— å›¾æ ‡çš„å±…åº•toast</button>\n <!-- #endif -->\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"hideToast\" id=\"btn-toast-hide\">点击éšè—toast</button>\n </view>\n <text>{{exeRet}}</text>\n </view>\n </view>\n</template>\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n title: 'toast',\n exeRet: ''\n }\n },\n onLoad() {\n uni.showToast({\n title: 'onLoad 调用示例,2秒åŽæ¶ˆå¤±'\n })\n setTimeout(function () {\n uni.hideToast()\n }, 2000);\n },\n methods: {\n //自动化测试例专用\n jest_getWindowInfo() : GetWindowInfoResult {\n return uni.getWindowInfo();\n },\n toast1Tap: function () {\n uni.showToast({\n title: \"默认\",\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n toastTapIconError: function () {\n uni.showToast({\n title: \"默认\",\n icon: 'error',\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n toast2Tap: function () {\n uni.showToast({\n title: \"duration 3000\",\n duration: 3000,\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n toast3Tap: function () {\n uni.showToast({\n title: \"loading\",\n icon: \"loading\",\n duration: 5000,\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n toast4Tap: function () {\n uni.showToast({\n title: \"logo\",\n image: \"/static/uni.png\",\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n // #ifdef APP\n toast5Tap: function () {\n uni.showToast({\n title: \"显示一段轻æ示\",\n position: 'bottom',\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n // #endif\n hideToast: function () {\n uni.hideToast()\n }\n }\n }\n\n```\n:::"},"loadFontFace":{"name":"## uni.loadFontFace(options) @loadfontface","description":"动æ€åŠ 载网络å—体<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [LoadFontFaceOptions](#loadfontfaceoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| global | boolean | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"x\"]]}' /> | 是å¦å…¨å±€ç”Ÿæ•ˆã€‚微信å°ç¨‹åº '2.10.0'起支æŒå…¨å±€ç”Ÿæ•ˆï¼Œéœ€åœ¨ app.vue ä¸è°ƒç”¨ã€‚ |\n@| family | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.10\"]]}' /> | 定义的å—体å称 |\n@| source | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.10\"]]}' /> | å—体资æºçš„地å€, App-Android å¹³å°ä¸æ”¯æŒ woffã€woff2 æ ¼å¼å—体文件 |\n@| desc | **LoadFontFaceOptionDesc** | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"x\",\"4.10\"]]}' /> | å¯é€‰çš„å—体æ述符 |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| style | string \\| null | å¦ | - | - | |\n@@| weight | string \\| null | å¦ | - | - | |\n@@| variant | string \\| null | å¦ | - | - | |\n@| success | (result: AsyncApiSuccessResult) => void | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.10\"]]}' /> | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (error: [LoadFontFaceFail](#loadfontfacefail-values)) => void | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.10\"]]}' /> | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: [AsyncApiResult](#asyncapiresult-values)) => void | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.10\"]]}' /> | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### LoadFontFaceFail 的属性值 @loadfontfacefail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 4 \\| 99 \\| 101 \\| 100001 \\| 100002 \\| 200001 \\| 300001 \\| 300002 | 是 | - | - | 错误ç <br/>- 4: 框架内部异常<br/>- 99: page is not ready<br/>- 101: å‚数错误<br/>- 100001: family is null<br/>- 100002: source is null<br/>- 200001: local font not found<br/>- 300001: same source task is loading<br/>- 300002: download fail |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### loadFontFace 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | √ | 4.10 |\n","tutorial":"\n### å‚è§\n- [loadFontFace](https://doc.dcloud.net.cn/uni-app-x/api/load-font-face.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.load-font-face)\n"},"load-font-face":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/load-font-face/load-font-face.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/load-font-face/load-font-face\n>Template\n```vue\n<template>\n <page-head title=\"loadFontFace\"></page-head>\n <view class=\"uni-padding-wrap\">\n <text class=\"font-size-20\">å…¨å±€åŠ è½½å—体:</text>\n <text class=\"font-size-20 line-height-40\" style=\"font-family: UniFontFamily\">font-family: uni.ttf</text>\n <view style=\"flex-direction: row;\">\n <text class=\"font-size-20\" style=\"font-family: UniFontFamily;\">{{\n uniIcon1\n }}</text>\n <text style=\"margin-left:5px;margin-right: 20px;line-height:22px;\">\\ue100</text>\n <text class=\"font-size-20\" style=\"font-family: UniFontFamily;\">{{\n uniIcon2\n }}</text>\n <text style=\"margin-left:5px;line-height:22px;\">\\ue101</text>\n </view>\n <text class=\"uni-common-mt font-size-20\">éžå…¨å±€åŠ è½½å—体:</text>\n <text class=\"font-size-20 line-height-40\" style=\"font-family: AlimamaDaoLiTiTTF\">font-family: 阿里妈妈刀隶体-ttf\n (网络å—体下载åŽç”Ÿæ•ˆ)</text>\n <text class=\"font-size-20 line-height-40\" style=\"font-family: AlimamaDaoLiTiOTF\">font-family:\n 阿里妈妈刀隶体-otf</text>\n <text class=\"item\" style=\"font-family: AlimamaDaoLiTiWOFF\">font-family: 阿里妈妈刀隶体-woff</text>\n <text class=\"item\" style=\"font-family: AlimamaDaoLiTiWOFF2\">font-family: 阿里妈妈刀隶体-woff2</text>\n <button class=\"uni-btn\" @click=\"navigateToChild\">跳转å页é¢æµ‹è¯•å—体生效范围</button>\n </view>\n</template>\n\n\n<style>\n .font-size-20 {\n font-size: 20px;\n }\n\n .line-height-40 {\n line-height: 40px;\n }\n</style>\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n uniIcon1: '\\ue100',\n uniIcon2: '\\ue101',\n }\n },\n onLoad() {\n uni.loadFontFace({\n global: true,\n family: 'UniFontFamily',\n source: \"url('/static/font/uni.ttf')\",\n success() {\n console.log('global loadFontFace uni.ttf success')\n },\n fail(error) {\n console.warn('global loadFontFace uni.ttf fail', error.errMsg)\n },\n })\n uni.loadFontFace({\n family: 'AlimamaDaoLiTiTTF',\n source:\n \"url('https://qiniu-web-assets.dcloud.net.cn/uni-app-x/static/font/AlimamaDaoLiTi.ttf')\",\n success() {\n console.log('loadFontFace Remote AlimamaDaoLiTi.ttf success')\n },\n fail(error) {\n console.warn('loadFontFace Remote AlimamaDaoLiTi.ttf fail', error.errMsg)\n },\n })\n uni.loadFontFace({\n family: 'AlimamaDaoLiTiOTF',\n source: \"url('/static/font/AlimamaDaoLiTi.otf')\",\n success() {\n console.log('loadFontFace AlimamaDaoLiTi.otf success')\n },\n fail(error) {\n console.warn('loadFontFace AlimamaDaoLiTi.otf fail', error.errMsg)\n },\n })\n uni.loadFontFace({\n family: 'AlimamaDaoLiTiWOFF',\n source: \"url('/static/font/AlimamaDaoLiTi.woff')\",\n success() {\n console.log('loadFontFace AlimamaDaoLiTi.woff success')\n },\n fail(error) {\n console.warn('loadFontFace AlimamaDaoLiTi.woff fail', error.errMsg)\n },\n })\n uni.loadFontFace({\n family: 'AlimamaDaoLiTiWOFF2',\n source: \"url('/static/font/AlimamaDaoLiTi.woff2')\",\n success() {\n console.log('loadFontFace AlimamaDaoLiTi.woff2 success')\n },\n fail(error) {\n console.warn('loadFontFace AlimamaDaoLiTi.woff2 fail', error.errMsg)\n },\n })\n },\n methods: {\n navigateToChild() {\n uni.navigateTo({\n url: '/pages/API/load-font-face/load-font-face-child',\n })\n },\n },\n }\n\n```\n:::"},"rpx2px":{"name":"## uni.rpx2px(number) @rpx2px","description":"å°†rpxå•ä½å€¼è½¬æ¢æˆpx","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| number | number | 是 | - | - | | \n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| number |\n \n","compatibility":"### rpx2px 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.02 | 4.02 | 4.11 |\n","tutorial":"\n### å‚è§\n- [rpx2px](https://doc.dcloud.net.cn/uni-app-x/api/rpx2px.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.rpx2px)\n","example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/rpx2px/rpx2px.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/rpx2px/rpx2px\n>Template\n```vue\n<template>\n <!-- #ifdef APP -->\n <scroll-view class=\"page-scroll-view\">\n <!-- #endif -->\n <view class=\"page\">\n <page-head :title=\"title\"></page-head>\n <view>\n <view class=\"item\">\n <text class=\"item-k\">输入:</text>\n <text class=\"item-v\">{{rpxValue}}rpx</text>\n </view>\n <view class=\"item\">\n <text class=\"item-k\">返回:</text>\n <text class=\"item-v\">{{pxValue}}px</text>\n </view>\n </view>\n <view>\n <button class=\"convert\" type=\"primary\" @click=\"rpx2px\">转æ¢</button>\n </view>\n </view>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n\n<style>\n .page {\n padding: 15px;\n }\n\n .item {\n flex-direction: row;\n }\n\n .item-k {\n width: 72px;\n line-height: 2;\n }\n\n .item-v {\n font-weight: bold;\n line-height: 2;\n }\n</style>\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n title: 'rpx2px',\n rpxValue: 750,\n pxValue: 0,\n result: false\n }\n },\n methods: {\n rpx2px: function () {\n this.pxValue = uni.rpx2px(this.rpxValue);\n\n // ä»…é™è‡ªåŠ¨åŒ–测试\n const windowInfo = uni.getWindowInfo();\n if (windowInfo.windowWidth == this.pxValue) {\n this.result = true\n }\n }\n }\n }\n\n```\n:::"},"setAppTheme":{"name":"## uni.setAppTheme(options) @setapptheme","description":"设置应用主题","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [SetAppThemeOptions](#setappthemeoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| theme | \"light\" \\| \"dark\" \\| \"auto\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | 主题 |\n@| success | (result: [SetAppThemeSuccessResult](#setappthemesuccessresult-values)) => void | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [IAppThemeFail](#iappthemefail-values)) => void | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SetAppThemeSuccessResult 的属性值 @setappthemesuccessresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| theme | string | 是 | - | - | - |\n\n##### IAppThemeFail 的属性值 @iappthemefail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 702001 \\| 2002000 | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | 错误ç <br/>- 702001 å‚数错误<br/>- 2002000 未知错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### setAppTheme 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.18 | 4.18 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.theme-change.setAppTheme)\n"},"onOsThemeChange":{"name":"## uni.onOsThemeChange(callback) @onosthemechange","description":"å¼€å¯ç›‘å¬ç³»ç»Ÿä¸»é¢˜å˜åŒ–","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (res: [OsThemeChangeResult](#osthemechangeresult-values)) => void | 是 | - | - | | \n\n#### OsThemeChangeResult 的属性值 @osthemechangeresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| osTheme | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | 系统主题 |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| number |\n \n","compatibility":"### onOsThemeChange 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.18 | 4.18 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.theme-change.onOsThemeChange)\n"},"offOsThemeChange":{"name":"## uni.offOsThemeChange(id) @offosthemechange","description":"å–消监å¬ç³»ç»Ÿä¸»é¢˜å˜åŒ–","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| id | number | 是 | - | - | | \n","returnValue":"","compatibility":"### offOsThemeChange 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.18 | 4.18 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.theme-change.offOsThemeChange)\n"},"onAppThemeChange":{"name":"## uni.onAppThemeChange(callback) @onappthemechange","description":"å¼€å¯ç›‘å¬åº”用主题å˜åŒ–","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (res: [AppThemeChangeResult](#appthemechangeresult-values)) => void | 是 | - | - | | \n\n#### AppThemeChangeResult 的属性值 @appthemechangeresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| appTheme | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | 应用主题 |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| number |\n \n","compatibility":"### onAppThemeChange 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.18 | 4.18 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.theme-change.onAppThemeChange)\n"},"offAppThemeChange":{"name":"## uni.offAppThemeChange(id) @offappthemechange","description":"å–消监å¬åº”用主题å˜åŒ–","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| id | number | 是 | - | - | | \n","returnValue":"","compatibility":"### offAppThemeChange 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.18 | 4.18 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.theme-change.offAppThemeChange)\n"},"theme-change":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/theme-change/theme-change.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\n <view class=\"uni-padding-wrap\">\n <view class=\"uni-common-mt item-box\">\n <text>osTheme:</text>\n <text id=\"theme\">{{ osTheme }}</text>\n </view>\n <view class=\"uni-common-mt item-box\">\n <text>应用当å‰ä¸»é¢˜:</text>\n <text id=\"theme\">{{ appTheme }}</text>\n </view>\n\n <view>\n <view class=\"uni-title uni-common-mt\">\n <text class=\"uni-title-text\"> 修改appTheme主题(æ¤å¤„仅为演示API,本应用并未完整适é…暗黑模å¼ï¼‰ </text>\n </view>\n </view>\n <view class=\"uni-list uni-common-pl\">\n <radio-group @change=\"radioChange\" class=\"radio-group\">\n <radio class=\"uni-list-cell uni-list-cell-pd radio\" v-for=\"(item, index) in items\" :key=\"item\"\n :class=\"index < items.length - 1 ? 'uni-list-cell-line' : ''\" :value=\"item\"\n :checked=\"index === current\">\n {{ item }}\n </radio>\n </radio-group>\n </view>\n\n </view>\n</template>\n\n<script>\n export default {\n data() {\n return {\n osThemeChangeId: 0,\n appThemeChangeId: 0,\n osTheme: \"light\" as string,\n appTheme: \"light\" as string,\n current: 0,\n items: [\n \"light\",\n \"dark\",\n \"auto\"\n ] as string[]\n }\n },\n methods: {\n bindOsThemeChange(): number {\n //注册osThemeå˜åŒ–监å¬\n return uni.onOsThemeChange((res: OsThemeChangeResult)=> {\n this.osTheme = res.osTheme\n })\n },\n bindAppThemeChange(): number {\n //注册appThemeå˜åŒ–监å¬\n return uni.onAppThemeChange((res: AppThemeChangeResult) => {\n this.appTheme = res.appTheme\n })\n },\n radioChange(e : UniRadioGroupChangeEvent) {\n const theme = e.detail.value\n this.setAppTheme(theme)\n uni.showToast({\n icon: 'none',\n title: '当å‰é€‰ä¸:'+theme,\n })\n },\n setAppTheme(value: string) {\n uni.setAppTheme({\n theme: value,\n success: function() {\n console.log(\"设置appTheme为\", value, \"æˆåŠŸ\")\n },\n fail: function(e: IAppThemeFail) {\n console.log(\"设置appTheme为\", value, \"失败,åŽŸå› :\", e.errMsg)\n }\n })\n }\n },\n onReady() {\n uni.getSystemInfo({\n success: (res:GetSystemInfoResult) => {\n this.osTheme = res.osTheme!\n this.appTheme = res.appTheme == \"auto\" ? res.osTheme! : res.appTheme!\n this.current = this.items.indexOf(res.appTheme!)\n }\n })\n this.osThemeChangeId = this.bindOsThemeChange()\n this.appThemeChangeId = this.bindAppThemeChange()\n },\n onUnload() {\n //注销监å¬\n uni.offAppThemeChange(this.appThemeChangeId)\n uni.offOsThemeChange(this.osThemeChangeId)\n uni.showToast({\n \"position\":\"bottom\",\n \"title\":\"å·²åœæ¢ç›‘å¬ä¸»é¢˜åˆ‡æ¢\"\n })\n }\n }\n</script>\n\n<style>\n .item-box {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n }\n .uni-list-cell {\n justify-content: flex-start;\n }\n</style>\n\n```"},"request":{"name":"## uni.request(param) @request","description":"å‘起网络请求。","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| param | [RequestOptions\\<T>](#requestoptions-values) | 是 | - | - | 网络请求å‚æ•° |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| url | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¼€å‘者æœåŠ¡å™¨æŽ¥å£åœ°å€<br/> |\n@| data | any \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 请求的å‚æ•° UTSJSONObject\\|string类型 |\n@| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设置请求的 header,header ä¸ä¸èƒ½è®¾ç½® Referer |\n@| method | \"GET\" \\| \"POST\" \\| \"PUT\" \\| \"PATCH\" \\| \"DELETE\" \\| \"HEAD\" \\| \"OPTIONS\" | å¦ | \"GET\" | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 请求方法<br/>- GET GET方法请求一个指定资æºçš„表示形å¼ï¼Œä½¿ç”¨ GET 的请求应该åªè¢«ç”¨äºŽèŽ·å–æ•°æ®ã€‚<br/>- POST POST方法用于将实体æ交到指定的资æºï¼Œé€šå¸¸å¯¼è‡´åœ¨æœåŠ¡å™¨ä¸Šçš„状æ€å˜åŒ–或副作用。<br/>- PUT PUT方法用有效载è·è¯·æ±‚替æ¢ç›®æ ‡èµ„æºçš„所有当å‰è¡¨ç¤ºã€‚<br/>- PATCH PATCH方法用于对资æºåº”用部分修改。<br/>- DELETE DELETEæ–¹æ³•åˆ é™¤æŒ‡å®šçš„èµ„æºã€‚<br/>- HEAD HEAD方法请求一个与GET请求的å“应相åŒçš„å“应,但没有å“应体。 <br/>- OPTIONS OPTIONS 方法用于æè¿°ç›®æ ‡èµ„æºçš„通信选项。 |\n@| timeout | number \\| null | å¦ | 60000 | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 超时时间,å•ä½ ms |\n@| withCredentials | boolean \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"x\",\"x\"]]}' /> | 跨域请求时是å¦æºå¸¦å‡è¯ï¼ˆcookies)<br/> |\n@| success | (option: [RequestSuccess\\<T>](#requestsuccess-values)) => void \\| null | å¦ | null | - | 网络请求æˆåŠŸå›žè°ƒã€‚ |\n@| fail | (option: [RequestFail](#requestfail-values)) => void \\| null | å¦ | null | - | 网络请求失败回调。 |\n@| complete | (option: any) => void \\| null | å¦ | null | - | 网络请求完æˆå›žè°ƒï¼ŒæˆåŠŸæˆ–者失败都会调用。 | \n\n##### RequestSuccess\\<T> 的属性值 @requestsuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| data | T \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¼€å‘者æœåŠ¡å™¨è¿”å›žçš„æ•°æ® |\n| statusCode | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¼€å‘者æœåŠ¡å™¨è¿”回的 HTTP 状æ€ç |\n| header | any | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¼€å‘者æœåŠ¡å™¨è¿”回的 HTTP Response Header |\n| cookies | Array\\<string\\> | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | å¼€å‘者æœåŠ¡å™¨è¿”回的 cookiesï¼Œæ ¼å¼ä¸ºå—符串数组 |\n\n##### RequestFail 的属性值 @requestfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 5 \\| 1000 \\| 100001 \\| 100002 \\| 600003 \\| 600009 \\| 602001 | 是 | - | - | 错误ç <br/>- 5 接å£è¶…æ—¶<br/>- 1000 æœåŠ¡ç«¯ç³»ç»Ÿé”™è¯¯<br/>- 100001 jsonæ•°æ®è§£æžé”™è¯¯<br/>- 100002 错误信æ¯json解æžå¤±è´¥<br/>- 600003 网络ä¸æ–<br/>- 600009 URLæ ¼å¼ä¸åˆæ³•<br/>- 602001 request系统错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [RequestTask](#requesttask-values) |\n\n#### RequestTask 的方法 @requesttask-values \n\n#### abort() @abort\nä¸æ–网络请求。\n\n\n##### abort 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n\n\n##### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/request.html#request)\n \n","compatibility":"### request 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/request.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.request)\n","example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/request/request.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/request/request\n>Template\n```vue\n<template>\r\n <view style=\"flex: 1;\">\r\n <view class=\"uni-padding-wrap uni-common-mt\">\r\n <view class=\"uni-common-mt\" style=\"border-width: 2px;border-style: solid; border-radius: 4px;\">\r\n <textarea :value=\"res\" class=\"uni-textarea\" style=\"width: 100%;\"></textarea>\r\n </view>\r\n <view>\r\n <text>åœ°å€ : {{ host + url}}</text>\r\n <text>è¯·æ±‚æ–¹å¼ : {{method}}</text>\r\n </view>\r\n <view class=\"uni-btn-v uni-common-mt\">\r\n <button type=\"primary\" @click=\"sendRequest\">å‘起请求</button>\r\n </view>\r\n </view>\r\n <scroll-view style=\"flex: 1;\" show-scrollbar=\"true\">\r\n <view style=\"padding: 20px;\">\r\n <text>设置请求方å¼</text>\r\n <view class=\"uni-common-pb\"></view>\r\n <view style=\"flex-direction: row;flex-wrap: wrap;\">\r\n <button style=\"padding: 5px; margin-right: 10px;\" type=\"primary\" size=\"mini\"\r\n @click=\"changeMethod('GET')\">GET</button>\r\n <button style=\"padding: 5px; margin-right: 10px; \" type=\"primary\" size=\"mini\"\r\n @click=\"changeMethod('POST')\">POST</button>\r\n <button style=\"padding: 5px; margin-right: 10px; \" type=\"primary\" size=\"mini\"\r\n @click=\"changeMethod('PUT')\">PUT</button>\r\n <button style=\"padding: 5px; margin-right: 10px;\" type=\"primary\" size=\"mini\"\r\n @click=\"changeMethod('DELETE')\">DELETE</button>\r\n <button style=\"padding: 5px; margin-right: 10px; \" type=\"primary\" size=\"mini\"\r\n @click=\"changeMethod('PATCH')\">PATCH</button>\r\n <button style=\"padding: 5px;margin-right: 10px;\" type=\"primary\" size=\"mini\"\r\n @click=\"changeMethod('OPTIONS')\">OPTIONS</button>\r\n <button style=\"padding: 5px;\" type=\"primary\" size=\"mini\" @click=\"changeMethod('HEAD')\">HEAD</button>\r\n </view>\r\n </view>\r\n <view style=\"padding: 20px;\">\r\n <text>请求返回错误ç 的接å£ï¼ˆé»˜è®¤ä¸ºGET)</text>\r\n <view class=\"uni-common-pb\"></view>\r\n <view style=\"flex-direction: row;flex-wrap: wrap;\">\r\n <button style=\"padding: 5px;\" type=\"primary\" size=\"mini\" v-for=\"(item, index) in errorCodeUrls\" :key=\"index\"\r\n @click=\"changeUrl(item)\">{{item}}</button>\r\n </view>\r\n </view>\r\n <view style=\"padding: 20px;\">\r\n <text>请求ä¸åŒheader的接å£ï¼ˆé»˜è®¤ä¸ºGET)</text>\r\n <view class=\"uni-common-pb\"></view>\r\n <view style=\"flex-direction: row;flex-wrap: wrap;\">\r\n <button style=\"padding: 5px;\" type=\"primary\" size=\"mini\" v-for=\"(item, index) in headerUrls\" :key=\"index\"\r\n @click=\"changeUrl(item)\">{{item}}</button>\r\n </view>\r\n </view>\r\n <view style=\"padding: 20px;\">\r\n <text>请求ä¸åŒcontent-type的接å£ï¼ˆé»˜è®¤ä¸ºGET)</text>\r\n <view class=\"uni-common-pb\"></view>\r\n <view style=\"flex-direction: row;flex-wrap: wrap;\">\r\n <button style=\"padding: 5px;\" type=\"primary\" size=\"mini\" v-for=\"(item, index) in contentTypeUrls\" :key=\"index\"\r\n @click=\"changeUrl(item)\">{{item}}</button>\r\n </view>\r\n </view>\r\n\r\n <view style=\"padding: 20px;\">\r\n <text>POST请求(有body)</text>\r\n <view class=\"uni-common-pb\"></view>\r\n <view style=\"flex-direction: row;flex-wrap: wrap;\">\r\n <button style=\"padding: 5px;\" type=\"primary\" size=\"mini\" v-for=\"(item, index) in postUrls\" :key=\"index\"\r\n @click=\"changeUrlFromPost(item)\">{{item}}</button>\r\n </view>\r\n </view>\r\n </scroll-view>\r\n </view>\r\n</template>\r\n\r\n\n```\n>Script\n```uts\n\n // #ifdef APP\n import {\n testInovkeRequest,\n CommonOptions\n } from '@/uni_modules/test-invoke-network-api'\n // #endif\n\n class GETDataType {\n data: UTSJSONObject | null = null\n }\n\r\n const duration = 2000\r\n const methodMap = {\r\n \"GET\": \"/api/http/method/get\",\r\n \"POST\": \"/api/http/method/post\",\r\n \"PUT\": \"/api/http/method/put\",\r\n \"DELETE\": \"/api/http/method/delete\",\r\n \"PATCH\": \"/api/http/method/patch\",\r\n \"OPTIONS\": \"/api/http/method/options\",\r\n \"HEAD\": \"/api/http/method/head\"\r\n }\r\n\r\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'request',\r\n res: '',\r\n task: null as RequestTask | null,\r\n host: \"https://request.dcloud.net.cn\",\r\n url: \"/api/http/method/get\",\r\n method: \"GET\" as RequestMethod | null,\r\n data: null as any | null,\r\n header: null as UTSJSONObject | null,\r\n errorCodeUrls: [\r\n \"/api/http/statusCode/200\",\r\n \"/api/http/statusCode/204\",\r\n \"/api/http/statusCode/301\",\r\n \"/api/http/statusCode/302\",\r\n \"/api/http/statusCode/307\",\r\n \"/api/http/statusCode/400\",\r\n \"/api/http/statusCode/401\",\r\n \"/api/http/statusCode/403\",\r\n \"/api/http/statusCode/404\",\r\n \"/api/http/statusCode/405\",\r\n \"/api/http/statusCode/500\",\r\n \"/api/http/statusCode/502\",\r\n \"/api/http/statusCode/503\",\r\n \"/api/http/statusCode/504\",\r\n ],\r\n headerUrls: [\r\n \"/api/http/header/ua\",\r\n \"/api/http/header/referer\",\r\n \"/api/http/header/requestCookie\",\r\n \"/api/http/header/setCookie\",\r\n \"/api/http/header/deleteCookie\"\r\n ],\r\n contentTypeUrls: [\r\n \"/api/http/contentType/text/plain\",\r\n \"/api/http/contentType/text/html\",\r\n \"/api/http/contentType/text/xml\",\r\n \"/api/http/contentType/image/gif\",\r\n \"/api/http/contentType/image/jpeg\",\r\n \"/api/http/contentType/image/png\",\r\n \"/api/http/contentType/application/json\",\r\n \"/api/http/contentType/application/octetStream\",\r\n ],\r\n postUrls: [\r\n \"/api/http/contentType/json\",\r\n \"/api/http/contentType/xWwwFormUrlencoded\",\r\n ],\r\n //自动化测试例专用\r\n jest_result: false\r\n }\r\n },\r\n onLoad() {\r\n },\r\n onUnload() {\r\n uni.hideLoading();\r\n this.task?.abort();\r\n },\r\n methods: {\r\n changeMethod(e : RequestMethod) {\r\n this.method = e;\r\n this.url = methodMap[e] as string;\r\n this.data = null;\r\n this.header = null;\r\n },\r\n changeUrl(e : string) {\r\n this.method = \"GET\";\r\n this.url = e;\r\n this.data = null;\r\n this.header = null;\r\n },\r\n changeUrlFromPost(e : string) {\r\n this.method = \"POST\";\r\n this.url = e;\r\n switch (e) {\r\n case \"/api/http/contentType/json\":\r\n this.header = {\r\n \"Content-Type\": \"application/json\"\r\n };\r\n this.data = {\r\n \"hello\": \"world\"\r\n };\r\n break;\r\n case \"/api/http/contentType/xWwwFormUrlencoded\":\r\n this.header = {\r\n \"Content-Type\": \"application/x-www-form-urlencoded\"\r\n };\r\n this.data = \"hello=world\";\r\n break;\r\n }\r\n },\r\n sendRequest() {\r\n uni.showLoading({\r\n title: \"请求ä¸...\"\r\n })\r\n this.task = uni.request({\r\n url: this.host + this.url,\r\n // dataType: \"json\",\r\n // responseType: \"json\",\r\n method: this.method,\r\n data: this.data,\r\n header: this.header,\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: (res) => {\r\n console.log('request success', JSON.stringify(res.data))\r\n console.log('request success header is :', JSON.stringify(res.header))\r\n uni.showToast({\r\n title: '请求æˆåŠŸ',\r\n icon: 'success',\r\n mask: true,\r\n duration: duration\r\n });\r\n this.res = '请求结果 : ' + JSON.stringify(res);\r\n },\r\n fail: (err) => {\r\n console.log('request fail', err);\r\n uni.showModal({\r\n content: err.errMsg,\r\n showCancel: false\r\n });\r\n },\r\n complete: () => {\r\n uni.hideLoading()\r\n },\r\n });\r\n },\r\n //自动化测试例专用\r\n jest_request() {\r\n uni.request({\r\n url: this.host + this.url,\r\n // dataType: \"json\",\r\n // responseType: \"json\",\r\n method: this.method,\r\n data: this.data,\r\n header: this.header,\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: () => {\r\n this.jest_result = true;\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\r\n jest_set_cookie() {\r\n uni.request({\r\n url: this.host + \"/api/http/header/setCookie\",\r\n method: \"GET\",\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: () => {\r\n this.jest_cookie_request(true)\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\r\n jest_delete_cookie() {\r\n uni.request({\r\n url: this.host + \"/api/http/header/deleteCookie\",\r\n method: \"GET\",\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: () => {\r\n this.jest_cookie_request(false)\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\r\n jest_cookie_request(needCookie : boolean) {\r\n uni.request({\r\n url: this.host + \"/api/http/header/requestCookie\",\r\n method: \"GET\",\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: (res) => {\n const requestCookie = (res.data as UTSJSONObject).getJSON(\"data\")?.getAny(\"requestCookie\")\r\n console.log(\"requestCookie \", requestCookie);\r\n if (requestCookie instanceof Array) {\r\n this.jest_result = needCookie ? requestCookie.length > 0 : requestCookie.length == 0\r\n } else {\r\n this.jest_result = needCookie ? (requestCookie as UTSJSONObject).toMap().size > 0 : (requestCookie as UTSJSONObject).toMap().size == 0\r\n }\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\r\n jest_timeout_null() {\r\n uni.request({\r\n url: this.host + (methodMap['GET'] as string),\r\n method: \"GET\",\r\n timeout: null,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: () => {\n this.jest_result = true;\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\n jest_get_with_data() {\n uni.request({\n url: \"https://unidemo.dcloud.net.cn/api/banner/36kr\",\n method: \"GET\",\n data:{\n column: 'id,post_id,title,author_name,cover,published_at' //需è¦çš„å—段å\n },\n timeout: 6000,\n sslVerify: false,\n withCredentials: false,\n firstIpv4: false,\n success: () => {\n this.jest_result = true;\n },\n fail: () => {\n this.jest_result = false;\n },\n });\n },\n jest_get_with_generics() {\n uni.request<GETDataType>({\n url: this.host + (methodMap['GET'] as string),\n method: \"GET\",\n timeout: null,\n sslVerify: false,\n withCredentials: false,\n firstIpv4: false,\n success: (res: RequestSuccess<GETDataType>) => {\n console.log(\"success :\", res.data?.data);\n this.jest_result = true;\n },\n fail: () => {\n this.jest_result = false;\n },\n });\n },\n jest_get_array() {\n uni.request<UTSJSONObject[]>({\n url: 'https://unidemo.dcloud.net.cn/api/news?column=title,author_name,cover,published_at',\n method: \"GET\",\n success: (res : RequestSuccess<UTSJSONObject[]>) => {\n console.log(res)\n if (res.statusCode == 200 && Array.isArray(res.data)) {\n this.jest_result = true\n } else {\n this.jest_result = false\n }\n },\n fail: () => {\n this.jest_result = false\n }\n });\n },\n jest_uts_module_invoked(){\n // #ifdef APP\n testInovkeRequest({\n success:(res: any)=>{\n console.log(\"success :\", res);\n this.jest_result = true\n },\n fail:(err: any)=>{\n console.log(\"fail :\", err);\n this.jest_result = false\n }\n } as CommonOptions)\n // #endif\n }\r\n }\r\n }\r\n\n```\n:::"},"uploadFile":{"name":"## uni.uploadFile(options) @uploadfile","description":"将本地资æºä¸Šä¼ 到开å‘者æœåŠ¡å™¨ã€‚","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [UploadFileOptions](#uploadfileoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| url | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¼€å‘者æœåŠ¡å™¨ url |\n@| filePath | string \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | è¦ä¸Šä¼ 文件资æºçš„路径, 支æŒuni.env |\n@| name | string \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 文件对应的 key , å¼€å‘者在æœåŠ¡å™¨ç«¯é€šè¿‡è¿™ä¸ª key å¯ä»¥èŽ·å–到文件二进制内容 |\n@| files | Array\\<**UploadFileOptionFiles**\\> \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 需è¦ä¸Šä¼ 的文件列表。 |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| name | string \\| null | å¦ | \"file\" | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | multipart æ交时,表å•çš„项目å,默认为 file,如果 name ä¸å¡«æˆ–填的值相åŒï¼Œå¯èƒ½å¯¼è‡´æœåŠ¡ç«¯è¯»å–文件时åªèƒ½è¯»å–到一个文件。 |\n@@| uri | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | è¦ä¸Šä¼ 文件资æºçš„路径 |\n@@| file | any \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | è¦ä¸Šä¼ 的文件对象 |\n@| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | HTTP 请求 Header, header ä¸ä¸èƒ½è®¾ç½® Referer |\n@| formData | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | HTTP 请求ä¸å…¶ä»–é¢å¤–çš„ form data |\n@| timeout | number \\| null | å¦ | 120000 | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 超时时间,å•ä½ ms |\n@| success | (result: [UploadFileSuccess](#uploadfilesuccess-values)) => void \\| null | å¦ | null | - | æˆåŠŸè¿”回的回调函数 |\n@| fail | (result: [UploadFileFail](#uploadfilefail-values)) => void \\| null | å¦ | null | - | 失败的回调函数 |\n@| complete | (result: any) => void \\| null | å¦ | null | - | 结æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### UploadFileSuccess 的属性值 @uploadfilesuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| data | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¼€å‘者æœåŠ¡å™¨è¿”å›žçš„æ•°æ® |\n| statusCode | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¼€å‘者æœåŠ¡å™¨è¿”回的 HTTP 状æ€ç |\n\n##### UploadFileFail 的属性值 @uploadfilefail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 5 \\| 1000 \\| 100001 \\| 100002 \\| 600003 \\| 600009 \\| 602001 | 是 | - | - | 错误ç <br/>- 5 接å£è¶…æ—¶<br/>- 1000 æœåŠ¡ç«¯ç³»ç»Ÿé”™è¯¯<br/>- 100001 jsonæ•°æ®è§£æžé”™è¯¯<br/>- 100002 错误信æ¯json解æžå¤±è´¥<br/>- 600003 网络ä¸æ–<br/>- 600009 URLæ ¼å¼ä¸åˆæ³•<br/>- 602001 request系统错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [UploadTask](#uploadtask-values) |\n\n#### UploadTask 的方法 @uploadtask-values \n\n#### abort() @abort\nä¸æ–ä¸Šä¼ ä»»åŠ¡ã€‚\n\n\n##### abort 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n\n\n##### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/network-file.html#uploadfile)\n\n#### onProgressUpdate(callback) @onprogressupdate\n监å¬ä¸Šä¼ 进度å˜åŒ–。\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [OnProgressUpdateResult](#onprogressupdateresult-values)) => void | 是 | - | - | | \n\n##### OnProgressUpdateResult 的属性值 @onprogressupdateresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| progress | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | ä¸Šä¼ è¿›åº¦ç™¾åˆ†æ¯” |\n| totalBytesSent | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å·²ç»ä¸Šä¼ çš„æ•°æ®é•¿åº¦ï¼Œå•ä½ Bytes |\n| totalBytesExpectedToSend | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 预期需è¦ä¸Šä¼ çš„æ•°æ®æ€»é•¿åº¦ï¼Œå•ä½ Bytes |\n\n\n##### onProgressUpdate 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n\n\n##### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/network-file.html#uploadfile)\n \n","compatibility":"### uploadFile 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/network-file.html#uploadfile)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.upload-file)\n"},"upload-file":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/upload-file/upload-file.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/upload-file/upload-file\n>Template\n```vue\n<template>\r\n <!-- #ifdef APP -->\r\n <scroll-view class=\"page-scroll-view\">\r\n <!-- #endif -->\r\n <view>\r\n <page-head :title=\"title\"></page-head>\r\n <view class=\"uni-padding-wrap uni-common-mt\">\r\n <view class=\"demo\">\r\n <image v-if=\"imageSrc\" :src=\"imageSrc\" class=\"image\" mode=\"widthFix\"></image>\r\n <text v-else class=\"uni-hello-addfile\" @click=\"chooseImage\">+ 选择图片</text>\r\n </view>\r\n </view>\r\n </view>\r\n <!-- #ifdef APP -->\r\n </scroll-view>\r\n <!-- #endif -->\r\n</template>\r\n\r\n\r\n<style>\r\n .image {\r\n width: 100%;\r\n }\r\n\r\n .demo {\r\n background: #fff;\r\n padding: 25px;\r\n justify-content: center;\r\n align-items: center;\r\n }\r\n\r\n .uni-hello-addfile {\r\n text-align: center;\r\n background: #fff;\r\n padding: 25px;\r\n margin-top: 10px;\r\n font-size: 19px;\r\n color: #808080;\r\n }\r\n</style>\r\n\n```\n>Script\n```uts\n\n // #ifdef APP\n import {\n testInovkeUploadFile,\n CommonOptions\n } from '@/uni_modules/test-invoke-network-api'\n // #endif\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'uploadFile',\r\n imageSrc: '',\r\n task: null as UploadTask | null,\r\n //自动化测试例专用\r\n jest_result: false,\r\n }\r\n },\r\n onLoad() {\r\n },\r\n onUnload() {\r\n this.imageSrc = '';\r\n uni.hideLoading();\r\n this.task?.abort();\r\n },\r\n methods: {\r\n chooseImage: function () {\r\n uni.chooseImage({\r\n count: 1,\r\n sizeType: ['compressed'],\r\n sourceType: ['album'],\r\n success: (res) => {\r\n console.log('chooseImage success, temp path is', res.tempFilePaths[0])\r\n var imageSrc = res.tempFilePaths[0]\r\n uni.showLoading({\r\n title: 'ä¸Šä¼ ä¸'\r\n })\r\n this.task = uni.uploadFile({\r\n url: 'https://unidemo.dcloud.net.cn/upload', //仅为示例,éžçœŸå®žçš„接å£åœ°å€\r\n filePath: imageSrc,\r\n name: 'file',\r\n formData: {\r\n 'user': 'test'\r\n },\r\n success: (res) => {\r\n console.log('uploadImage success, res is:', res)\r\n uni.hideLoading();\r\n uni.showToast({\r\n title: 'ä¸Šä¼ æˆåŠŸ',\r\n icon: 'success',\r\n duration: 1000\r\n })\r\n this.imageSrc = imageSrc\r\n },\r\n fail: (err) => {\r\n console.log('uploadImage fail', err);\r\n uni.hideLoading();\r\n uni.showModal({\r\n content: err.errMsg,\r\n showCancel: false\r\n });\r\n },\r\n });\r\n },\r\n fail: (err) => {\r\n console.log('chooseImage fail', err)\r\n }\r\n })\r\n },\r\n //自动化测试例专用\r\n jest_uploadFile() {\r\n const imageSrc = \"/static/uni.png\";\r\n this.task = uni.uploadFile({\r\n url: 'https://unidemo.dcloud.net.cn/upload', //仅为示例,éžçœŸå®žçš„接å£åœ°å€\r\n filePath: imageSrc,\r\n name: 'file',\r\n formData: {\r\n 'user': 'test'\r\n },\r\n success: () => {\r\n this.jest_result = true;\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n })\r\n },\r\n jest_set_cookie() {\r\n uni.request({\r\n url: \"https://request.dcloud.net.cn/api/http/header/setCookie\",\r\n method: \"GET\",\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: () => {\r\n this.jest_cookie_upload(true)\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\r\n\r\n jest_delete_cookie() {\r\n uni.request({\r\n url: \"https://request.dcloud.net.cn/api/http/header/deleteCookie\",\r\n method: \"GET\",\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: () => {\r\n this.jest_cookie_upload(false)\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\r\n jest_cookie_upload(needCookie : boolean) {\r\n const imageSrc = \"/static/uni.png\";\r\n this.task = uni.uploadFile({\r\n url: 'https://request.dcloud.net.cn/api/http/header/upload',\r\n filePath: imageSrc,\r\n name: 'file',\r\n success: (res : UploadFileSuccess) => {\r\n const data = JSON.parseObject(res.data)\r\n const errCode = data?.getNumber(\"errCode\")\r\n if (errCode != null && errCode == 1000) {\r\n this.jest_result = needCookie ? false : true;\r\n } else {\r\n this.jest_result = needCookie ? true : false;\r\n }\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n })\r\n },\r\n jest_files_upload() {\r\n const imageSrc = \"/static/uni.png\";\r\n this.task = uni.uploadFile({\r\n url: 'https://unidemo.dcloud.net.cn/upload',\r\n files: [\r\n {\r\n name: \"file1\",\r\n uri: imageSrc\r\n } as UploadFileOptionFiles,\r\n {\r\n name: \"file2\",\r\n uri: imageSrc\r\n } as UploadFileOptionFiles\r\n ],\r\n success: (res : UploadFileSuccess) => {\r\n if (res.statusCode == 200) {\r\n this.jest_result = true;\r\n }\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n })\r\n },\n jest_uts_module_invoked(){\n // #ifdef APP\n testInovkeUploadFile({\n success:(res: any)=>{\n console.log(\"success :\", res);\n this.jest_result = true\n },\n fail:(err: any)=>{\n console.log(\"fail :\", err);\n this.jest_result = false\n }\n } as CommonOptions)\n // #endif\n }\r\n }\r\n }\r\n\n```\n:::"},"downloadFile":{"name":"## uni.downloadFile(options) @downloadfile","description":"下载文件资æºåˆ°æœ¬åœ°ï¼Œå®¢æˆ·ç«¯ç›´æŽ¥å‘起一个 HTTP GET 请求,返回文件的本地临时路径。","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [DownloadFileOptions](#downloadfileoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| url | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 下载资æºçš„ url |\n@| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | HTTP 请求 Header,header ä¸ä¸èƒ½è®¾ç½® Referer |\n@| filePath | string \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 指定文件下载路径<br/>支æŒç›¸å¯¹è·¯å¾„与ç»å¯¹è·¯å¾„,例:<br/>`/imgs/pic.png`ã€`/storage/emulated/0/Android/data/io.dcloud.HBuilder/apps/HBuilder/temp/imgs/pic.png`<br/>并且支æŒæŒ‡å®šä¸‹è½½ç›®å½•ï¼Œä¾‹ï¼š<br/>`/imgs/`<br/>支æŒuni.envçš„å¹³å°å…¼å®¹æ€§ï¼šAndroid自3.9开始支æŒuni.env,iOS自4.13开始支æŒuni.env |\n@| timeout | number \\| null | å¦ | 120000 | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 超时时间,å•ä½ ms |\n@| success | (result: [DownloadFileSuccess](#downloadfilesuccess-values)) => void \\| null | å¦ | null | - | 下载æˆåŠŸåŽä»¥ tempFilePath çš„å½¢å¼ä¼ 给页é¢ï¼Œres = {tempFilePath: '文件的临时路径'} |\n@| fail | (result: [DownloadFileFail](#downloadfilefail-values)) => void \\| null | å¦ | null | - | 失败的回调函数 |\n@| complete | (result: any) => void \\| null | å¦ | null | - | 结æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### DownloadFileSuccess 的属性值 @downloadfilesuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| tempFilePath | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 临时文件路径,下载åŽçš„文件会å˜å‚¨åˆ°ä¸€ä¸ªä¸´æ—¶æ–‡ä»¶ |\n| statusCode | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¼€å‘者æœåŠ¡å™¨è¿”回的 HTTP 状æ€ç |\n\n##### DownloadFileFail 的属性值 @downloadfilefail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 5 \\| 1000 \\| 100001 \\| 100002 \\| 600003 \\| 600009 \\| 602001 | 是 | - | - | 错误ç <br/>- 5 接å£è¶…æ—¶<br/>- 1000 æœåŠ¡ç«¯ç³»ç»Ÿé”™è¯¯<br/>- 100001 jsonæ•°æ®è§£æžé”™è¯¯<br/>- 100002 错误信æ¯json解æžå¤±è´¥<br/>- 600003 网络ä¸æ–<br/>- 600009 URLæ ¼å¼ä¸åˆæ³•<br/>- 602001 request系统错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [DownloadTask](#downloadtask-values) |\n\n#### DownloadTask 的方法 @downloadtask-values \n\n#### abort() @abort\nä¸æ–下载任务。\n\n\n##### abort 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n\n\n##### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/network-file.html#downloadfile)\n\n#### onProgressUpdate(callback) @onprogressupdate\n监å¬ä¸‹è½½è¿›åº¦å˜åŒ–。\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [OnProgressDownloadResult](#onprogressdownloadresult-values)) => void | 是 | - | - | | \n\n##### OnProgressDownloadResult 的属性值 @onprogressdownloadresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| progress | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 下载进度百分比 |\n| totalBytesWritten | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å·²ç»ä¸‹è½½çš„æ•°æ®é•¿åº¦ï¼Œå•ä½ Bytes |\n| totalBytesExpectedToWrite | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 预期需è¦ä¸‹è½½çš„æ•°æ®æ€»é•¿åº¦ï¼Œå•ä½ Bytes |\n\n\n##### onProgressUpdate 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n\n\n##### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/network-file.html#downloadfile)\n \n","compatibility":"### downloadFile 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/network-file.html#downloadfile)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.download-file)\n"},"download-file":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/download-file/download-file.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/download-file/download-file\n>Template\n```vue\n<template>\r\n <!-- #ifdef APP -->\r\n <scroll-view style=\"flex: 1\">\r\n <!-- #endif -->\r\n <view>\r\n <page-head :title=\"title\"></page-head>\r\n <view>\r\n <view v-if=\"imageSrc\">\r\n <image class=\"img\" :src=\"imageSrc\" mode=\"aspectFit\" />\r\n </view>\r\n <view v-else style=\"margin: 10px;\">\r\n <text class=\"uni-hello-text\">点击按钮下载æœåŠ¡ç«¯ç¤ºä¾‹å›¾ç‰‡ï¼ˆä¸‹è½½ç½‘络文件到本地临时目录)</text>\r\n <button type=\"primary\" @tap=\"downloadImage\">下载</button>\r\n </view>\r\n </view>\r\n </view>\r\n <!-- #ifdef APP -->\r\n </scroll-view>\r\n <!-- #endif -->\r\n</template>\r\n\r\n\r\n<style>\r\n .img {\r\n margin: 0 auto;\r\n }\r\n</style>\n\n```\n>Script\n```uts\n\n\n // #ifdef APP\n import {\n testInovkeDownloadFile,\n CommonOptions\n } from '@/uni_modules/test-invoke-network-api'\n // #endif\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'downloadFile',\r\n imageSrc: '',\r\n task: null as DownloadTask | null,\r\n //自动化测试例专用\r\n jest_result: false\r\n }\r\n },\r\n onLoad() {\r\n },\r\n onUnload() {\r\n // this.imageSrc = '';\r\n uni.hideLoading();\r\n this.task?.abort();\r\n },\r\n methods: {\r\n downloadImage: function () {\r\n uni.showLoading({\r\n title: '下载ä¸'\r\n })\r\n var self = this\r\n this.task = uni.downloadFile({\r\n url: \"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni-app.png\",\r\n success: (res) => {\r\n console.log('downloadFile success, res is', res.tempFilePath)\r\n self.imageSrc = res.tempFilePath;\r\n uni.hideLoading();\r\n },\r\n fail: (err) => {\r\n console.log('downloadFile fail, err is:', err)\r\n uni.hideLoading();\r\n }\r\n });\r\n this.task?.onProgressUpdate((update) => {\r\n console.log(\"progress : \", update.progress);\r\n })\r\n },\r\n //自动化测试例专用\r\n jest_downloadFile() {\r\n uni.downloadFile({\r\n url: \"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni-app.png\",\r\n success: () => {\r\n this.jest_result = true\r\n },\r\n fail: () => {\r\n this.jest_result = false\r\n }\r\n });\r\n },\n\n jest_downloadFile_with_uni_env() {\n uni.downloadFile({\n url: \"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni-app.png\",\n filePath: `${uni.env.CACHE_PATH}/a/b/`,\n success: () => {\n this.jest_result = true\n },\n fail: () => {\n this.jest_result = false\n }\n });\n },\n\n jest_set_cookie(){\n uni.request({\n url: \"https://request.dcloud.net.cn/api/http/header/setCookie\",\n method: \"GET\",\n timeout: 6000,\n sslVerify: false,\n withCredentials: true,\n firstIpv4: false,\n success: () => {\n this.jest_cookie_download(true)\n },\n fail: () => {\n this.jest_result = false;\n },\n });\n },\n\n jest_delete_cookie(){\n uni.request({\n url: \"https://request.dcloud.net.cn/api/http/header/deleteCookie\",\n method: \"GET\",\n timeout: 6000,\n sslVerify: false,\n withCredentials: true,\n firstIpv4: false,\n success: () => {\n this.jest_cookie_download(false)\n },\n fail: () => {\n this.jest_result = false;\n },\n });\n },\n jest_cookie_download(needCookie: boolean){\n uni.downloadFile({\n url: \"https://request.dcloud.net.cn/api/http/header/download\",\n success: () => {\n this.jest_result = needCookie ? true : false;\n },\n fail: () => {\n this.jest_result = needCookie ? false : true;\n }\n });\n },\n jest_uts_module_invoked(){\n // #ifdef APP\n testInovkeDownloadFile({\n success:(res: any)=>{\n console.log(\"success :\", res);\n this.jest_result = true\n },\n fail:(err: any)=>{\n console.log(\"fail :\", err);\n this.jest_result = false\n }\n } as CommonOptions)\n // #endif\n },\n jest_special_characters_download(){\n uni.downloadFile({\n url: \"https://web-ext-storage.dcloud.net.cn/hello-uni-app-x/1789834995055525889-ä½ å¥½%23ä½ å¥½.png\",\n success: (res: DownloadFileSuccess) => {\n this.jest_result = true;\n console.log(\"res :\", res);\n },\n fail: () => {\n this.jest_result = false;\n }\n });\n }\r\n }\r\n }\r\n\n```\n:::"},"getNetworkType":{"name":"## uni.getNetworkType(options) @getnetworktype","description":"获å–网络类型","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [GetNetworkTypeOptions](#getnetworktypeoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (result: [GetNetworkTypeSuccess](#getnetworktypesuccess-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### GetNetworkTypeSuccess 的属性值 @getnetworktypesuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| networkType | string | 是 | - | - | 网络类型 |\n","returnValue":"","compatibility":"### getNetworkType 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/system/network?id=getnetworktype)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.get-network-type)\n"},"get-network-type":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-network-type/get-network-type.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-network-type/get-network-type\n>Template\n```vue\n<template>\r\n <page-head :title=\"title\"></page-head>\r\n <view class=\"uni-padding-wrap uni-common-mt\">\r\n <view style=\"background:#FFFFFF; padding:20px;\">\r\n <view class=\"uni-center\">网络状æ€</view>\r\n <view v-if=\"hasNetworkType == false\">\r\n <view class=\"uni-center uni-common-mt\">未获å–</view>\r\n <view class=\"uni-center uni-common-mt\">请点击下é¢æŒ‰é’®èŽ·å–网络状æ€</view>\r\n </view>\r\n <view v-if=\"hasNetworkType == true\">\r\n <view class=\"uni-center uni-common-mt\">{{networkType}}</view>\r\n </view>\r\n </view>\r\n <view class=\"uni-btn-v uni-common-mt\">\r\n <button type=\"primary\" @tap=\"getNetworkType\">获å–设备网络状æ€</button>\r\n <button class=\"uni-common-mt\" @tap=\"clear\">清空</button>\r\n </view>\r\n </view>\r\n</template>\r\n\r\n\r\n<style>\r\n\r\n</style>\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'getNetworkType',\r\n hasNetworkType: false,\r\n networkType: '',\r\n connectedWifi: '',\r\n //自动化测试例专用\r\n jest_result: false,\r\n }\r\n },\r\n onLoad() {\r\n },\r\n onUnload: function () {\r\n this.networkType = '';\r\n this.hasNetworkType = false;\r\n },\r\n methods: {\r\n getNetworkType: function () {\r\n uni.getNetworkType({\r\n success: (res) => {\r\n console.log(res)\r\n this.hasNetworkType = true;\r\n this.networkType = res.networkType\r\n },\r\n fail: () => {\r\n uni.showModal({\r\n content: '获å–失败ï¼',\r\n showCancel: false\r\n })\r\n }\r\n })\r\n },\r\n clear: function () {\r\n this.hasNetworkType = false;\r\n this.networkType = '';\r\n this.connectedWifi = '';\r\n },\r\n //自动化测试例专用\r\n jest_getNetworkType() {\r\n uni.getNetworkType({\r\n success: () => {\r\n this.jest_result = true;\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n }\r\n })\r\n }\r\n }\r\n }\r\n\n```\n:::"},"connectSocket":{"name":"## connectSocket(options) @connectsocket","description":"创建一个 WebSocket 连接。","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ConnectSocketOptions](#connectsocketoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| url | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | å¼€å‘者æœåŠ¡å™¨æŽ¥å£åœ°å€ |\n@| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 如果属性åå˜åœ¨ï¼Œä¸”类型为UTSJSONObject返回对应的结果,ä¸å˜åœ¨è¿”回null |\n@| protocols | Array\\<string\\> \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | åå议数组 |\n@| success | (result: [ConnectSocketSuccess](#connectsocketsuccess-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [ConnectSocketFail](#connectsocketfail-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### ConnectSocketSuccess 的属性值 @connectsocketsuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n\n##### ConnectSocketFail 的属性值 @connectsocketfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | 错误ç <br/>- 600009 URLæ ¼å¼ä¸åˆæ³• |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [SocketTask](#sockettask-values) |\n\n#### SocketTask 的方法 @sockettask-values \n\n#### send(options) @send\n通过 WebSocket 连接å‘é€æ•°æ®\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [SendSocketMessageOptions](#sendsocketmessageoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| data | any | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 需è¦å‘é€çš„内容 |\n@| success | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [SendSocketMessageFail](#sendsocketmessagefail-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SendSocketMessageFail 的属性值 @sendsocketmessagefail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 10001 \\| 10002 \\| 602001 | 是 | - | - | 错误ç <br/>- 10001 å‘é€æ•°æ®è¶…é™ï¼Œå‘é€é˜Ÿåˆ—ä¸èƒ½è¶…过16M大å°ã€‚<br/>- 10002 websocket未连接<br/>- 602001 websocket系统错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n\n##### send 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n\n\n##### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-send)\n\n#### close(options) @close\nå…³é— WebSocket 连接\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **CloseSocketOptions** | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| code | number \\| null | å¦ | 1000 | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 一个数å—值表示关é—连接的状æ€å·ï¼Œè¡¨ç¤ºè¿žæŽ¥è¢«å…³é—çš„åŽŸå› ã€‚å¦‚æžœè¿™ä¸ªå‚数没有被指定,默认的å–值是1000 (表示æ£å¸¸è¿žæŽ¥å…³é—) |\n@| reason | string \\| null | å¦ | \"\" | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 一个å¯è¯»çš„å—符串,表示连接被关é—çš„åŽŸå› ã€‚è¿™ä¸ªå—符串必须是ä¸é•¿äºŽ123å—节的UTF-8 文本(ä¸æ˜¯å—符) |\n@| success | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### close 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n\n\n##### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-close)\n\n#### onOpen(callback) @onopen\nç›‘å¬ WebSocket 连接打开事件\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | **OnSocketOpenCallbackResult** | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| header | any | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 连接æˆåŠŸçš„ HTTP å“应 Header | \n\n\n##### onOpen 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n\n\n##### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onopen)\n\n#### onClose(callback) @onclose\nç›‘å¬ WebSocket 连接关é—事件\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: any) => void | 是 | - | - | | \n\n\n##### onClose 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n\n\n##### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onclose)\n\n#### onError(callback) @onerror\nç›‘å¬ WebSocket 错误\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 是 | - | - | | \n\n\n##### onError 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n\n\n##### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onerror)\n\n#### onMessage(callback) @onmessage\nç›‘å¬ WebSocket 接å—到æœåŠ¡å™¨çš„消æ¯äº‹ä»¶\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [OnSocketMessageCallbackResult](#onsocketmessagecallbackresult-values)) => void | 是 | - | - | | \n\n##### OnSocketMessageCallbackResult 的属性值 @onsocketmessagecallbackresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| data | any | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | æœåŠ¡å™¨è¿”å›žçš„æ¶ˆæ¯ |\n\n\n##### onMessage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n\n\n##### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onmessage)\n \n","compatibility":"### connectSocket 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/websocket.html#connectsocket)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.connectSocket)\n"},"onSocketOpen":{"name":"## onSocketOpen(options) @onsocketopen","description":"监å¬WebSocket连接打开事件。","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | (result: [OnSocketOpenCallbackResult](#onsocketopencallbackresult-values)) => void | 是 | - | - | | \n","returnValue":"","compatibility":"### onSocketOpen 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketopen)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.onSocketOpen)\n"},"onSocketError":{"name":"## onSocketError(callback) @onsocketerror","description":"下载文件资æºåˆ°æœ¬åœ°ï¼Œå®¢æˆ·ç«¯ç›´æŽ¥å‘起一个 HTTP GET 请求,返回文件的本地临时路径。","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [OnSocketErrorCallbackResult](#onsocketerrorcallbackresult-values)) => void | 是 | - | - | | \n\n#### OnSocketErrorCallbackResult 的属性值 @onsocketerrorcallbackresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | é”™è¯¯ä¿¡æ¯ |\n","returnValue":"","compatibility":"### onSocketError 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketerror)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.onSocketError)\n"},"sendSocketMessage":{"name":"## sendSocketMessage(options) @sendsocketmessage","description":"通过 WebSocket 连接å‘é€æ•°æ®ï¼Œéœ€è¦å…ˆ uni.connectSocket,并在 uni.onSocketOpen 回调之åŽæ‰èƒ½å‘é€ã€‚","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [SendSocketMessageOptions](#sendsocketmessageoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| data | any | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 需è¦å‘é€çš„内容 |\n@| success | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [SendSocketMessageFail](#sendsocketmessagefail-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SendSocketMessageFail 的属性值 @sendsocketmessagefail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 10001 \\| 10002 \\| 602001 | 是 | - | - | 错误ç <br/>- 10001 å‘é€æ•°æ®è¶…é™ï¼Œå‘é€é˜Ÿåˆ—ä¸èƒ½è¶…过16M大å°ã€‚<br/>- 10002 websocket未连接<br/>- 602001 websocket系统错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### sendSocketMessage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/websocket.html#sendsocketmessage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.sendSocketMessage)\n"},"onSocketMessage":{"name":"## onSocketMessage(callback) @onsocketmessage","description":"监å¬WebSocket接å—到æœåŠ¡å™¨çš„消æ¯äº‹ä»¶ã€‚","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [OnSocketMessageCallbackResult](#onsocketmessagecallbackresult-values)) => void | 是 | - | - | | \n\n#### OnSocketMessageCallbackResult 的属性值 @onsocketmessagecallbackresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| data | any | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | æœåŠ¡å™¨è¿”å›žçš„æ¶ˆæ¯ |\n","returnValue":"","compatibility":"### onSocketMessage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketmessage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.onSocketMessage)\n"},"closeSocket":{"name":"## closeSocket(options) @closesocket","description":"å…³é— WebSocket 连接。","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **CloseSocketOptions** | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| code | number \\| null | å¦ | 1000 | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 一个数å—值表示关é—连接的状æ€å·ï¼Œè¡¨ç¤ºè¿žæŽ¥è¢«å…³é—çš„åŽŸå› ã€‚å¦‚æžœè¿™ä¸ªå‚数没有被指定,默认的å–值是1000 (表示æ£å¸¸è¿žæŽ¥å…³é—) |\n@| reason | string \\| null | å¦ | \"\" | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 一个å¯è¯»çš„å—符串,表示连接被关é—çš„åŽŸå› ã€‚è¿™ä¸ªå—符串必须是ä¸é•¿äºŽ123å—节的UTF-8 文本(ä¸æ˜¯å—符) |\n@| success | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n","returnValue":"","compatibility":"### closeSocket 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/websocket.html#closesocket)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.closeSocket)\n"},"onSocketClose":{"name":"## onSocketClose(callback) @onsocketclose","description":"监å¬WebSocketå…³é—。","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [OnSocketCloseCallbackResult](#onsocketclosecallbackresult-values)) => void | 是 | - | - | | \n\n#### OnSocketCloseCallbackResult 的属性值 @onsocketclosecallbackresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| code | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 一个数å—值表示关é—连接的状æ€å·ï¼Œè¡¨ç¤ºè¿žæŽ¥è¢«å…³é—çš„åŽŸå› ã€‚ |\n| reason | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 一个å¯è¯»çš„å—符串,表示连接被关é—çš„åŽŸå› ã€‚\t |\n","returnValue":"","compatibility":"### onSocketClose 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketclose)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.onSocketClose)\n"},"websocket-global":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/websocket-global/websocket-global.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/websocket-global/websocket-global\n>Template\n```vue\n<template>\r\n <page-head title=\"websocket通讯示例\"></page-head>\r\n <view class=\"uni-padding-wrap\">\r\n <view class=\"uni-btn-v\">\r\n <text class=\"websocket-msg\">{{ showMsg }}</text>\r\n <button class=\"uni-btn-v\" type=\"primary\" @click=\"connect\">\r\n 连接websocketæœåŠ¡\r\n </button>\r\n <button class=\"uni-btn-v\" v-show=\"connected\" type=\"primary\" @click=\"send\">\r\n å‘é€ä¸€æ¡æ¶ˆæ¯\r\n </button>\r\n <button class=\"uni-btn-v\" type=\"primary\" @click=\"close\">\r\n æ–å¼€websocketæœåŠ¡\r\n </button>\r\n <text class=\"websocket-tips\">å‘é€æ¶ˆæ¯åŽä¼šæ”¶åˆ°ä¸€æ¡æœåŠ¡å™¨è¿”回的消æ¯ï¼ˆä¸Žå‘é€çš„消æ¯å†…容一致)</text>\r\n </view>\r\n </view>\r\n</template>\r\n\r\n\r\n\r\n<style>\r\n .uni-btn-v {\r\n padding: 5px 0;\r\n }\r\n\r\n .uni-btn-v {\r\n margin: 10px 0;\r\n }\r\n\r\n .websocket-msg {\r\n padding: 40px 0px;\r\n text-align: center;\r\n font-size: 14px;\r\n line-height: 40px;\r\n color: #666666;\r\n }\r\n\r\n .websocket-tips {\r\n padding: 40px 0px;\r\n text-align: center;\r\n font-size: 14px;\r\n line-height: 24px;\r\n color: #666666;\r\n }\r\n</style>\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n connected: false,\r\n connecting: false,\r\n msg: '',\r\n roomId: '',\r\n platform: '',\r\n }\r\n },\r\n computed: {\r\n showMsg() : string {\r\n if (this.connected) {\r\n if (this.msg.length > 0) {\r\n return '收到消æ¯ï¼š' + this.msg\r\n } else {\r\n return 'ç‰å¾…接收消æ¯'\r\n }\r\n } else {\r\n return '尚未连接'\r\n }\r\n },\r\n },\r\n onLoad() {\r\n this.platform = uni.getSystemInfoSync().platform\r\n },\r\n onUnload() {\r\n uni.closeSocket({\r\n code: 1000,\r\n reason: 'close reason from client',\r\n success: (res : any) => {\r\n console.log('uni.closeSocket success', res)\r\n },\r\n fail: (err : any) => {\r\n console.log('uni.closeSocket fail', err)\r\n },\r\n } as CloseSocketOptions)\r\n uni.hideLoading()\r\n },\r\n methods: {\r\n connect() {\r\n if (this.connected || this.connecting) {\r\n uni.showModal({\r\n content: 'æ£åœ¨è¿žæŽ¥æˆ–者已ç»è¿žæŽ¥ï¼Œè¯·å‹¿é‡å¤è¿žæŽ¥',\r\n showCancel: false,\r\n })\r\n return\r\n }\r\n this.connecting = true\r\n uni.showLoading({\r\n title: '连接ä¸...',\r\n })\r\n uni.connectSocket({\r\n url: 'ws://websocket.dcloud.net.cn',\r\n header: null,\r\n protocols: null,\r\n success: (res : any) => {\r\n // 这里是接å£è°ƒç”¨æˆåŠŸçš„回调,ä¸æ˜¯è¿žæŽ¥æˆåŠŸçš„回调,请注æ„\r\n console.log('uni.connectSocket success', res)\r\n },\r\n fail: (err : any) => {\r\n // 这里是接å£è°ƒç”¨å¤±è´¥çš„回调,ä¸æ˜¯è¿žæŽ¥å¤±è´¥çš„回调,请注æ„\r\n console.log('uni.connectSocket fail', err)\r\n },\r\n })\r\n uni.onSocketOpen((res) => {\r\n this.connecting = false\r\n this.connected = true\r\n uni.hideLoading()\r\n\r\n uni.showToast({\r\n icon: 'none',\r\n title: '连接æˆåŠŸ',\r\n })\r\n console.log('onOpen', res)\r\n })\r\n uni.onSocketError((err) => {\r\n this.connecting = false\r\n this.connected = false\r\n uni.hideLoading()\r\n\r\n uni.showModal({\r\n content: '连接失败,å¯èƒ½æ˜¯websocketæœåŠ¡ä¸å¯ç”¨ï¼Œè¯·ç¨åŽå†è¯•',\r\n showCancel: false,\r\n })\r\n console.log('onError', err)\r\n })\r\n uni.onSocketMessage((res) => {\r\n this.msg = res.data as string\r\n console.log('onMessage', res)\r\n })\r\n uni.onSocketClose((res) => {\r\n this.connected = false\r\n this.msg = ''\r\n console.log('onClose', res)\r\n })\r\n },\r\n send() {\r\n uni.sendSocketMessage({\r\n data:\r\n 'from ' +\r\n this.platform +\r\n ' : ' +\r\n parseInt((Math.random() * 10000).toString()).toString(),\r\n success: (res : any) => {\r\n console.log(res)\r\n },\r\n fail: (err : any) => {\r\n console.log(err)\r\n },\r\n } as SendSocketMessageOptions)\r\n },\r\n close() {\r\n uni.closeSocket({\r\n code: 1000,\r\n reason: 'close reason from client',\r\n success: (res : any) => {\r\n console.log('uni.closeSocket success', res)\r\n },\r\n fail: (err : any) => {\r\n console.log('uni.closeSocket fail', err)\r\n },\r\n } as CloseSocketOptions)\r\n },\r\n },\r\n }\r\n\n```\n:::"},"getSystemInfo":{"name":"## uni.getSystemInfo(options) @getsysteminfo","description":"异æ¥èŽ·å–系统信æ¯","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [GetSystemInfoOptions](#getsysteminfooptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (result: [GetSystemInfoResult](#getsysteminforesult-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### GetSystemInfoResult 的属性值 @getsysteminforesult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| SDKVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | 客户端基础库版本<br/> |\n| appId | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | `manifest.json` ä¸åº”用appid。<br/> |\n| appLanguage | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 应用设置的è¯è¨€ã€‚<br/> |\n| appName | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | `manifest.json` ä¸åº”用å称。<br/> |\n| appVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | `manifest.json` ä¸åº”用版本å称。<br/> |\n| appVersionCode | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | `manifest.json` ä¸åº”用版本åå·ã€‚<br/> |\n| ~~brand~~ | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | 手机å“牌。 **已废弃,仅为了å‘下兼容ä¿ç•™** |\n| browserName | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æµè§ˆå™¨å称。`App` 端是系统 webview çš„åå—,比如 wkwebviewã€chrome。å°ç¨‹åºç«¯ä¸ºç©º<br/> |\n| browserVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æµè§ˆå™¨ç‰ˆæœ¬ã€webview 版本。<br/> |\n| deviceId | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备 ID<br/> |\n| deviceBrand | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备å“牌。如:`apple`ã€`huawei`。<br/> |\n| deviceModel | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备型å·<br/> |\n| deviceType | \"phone\" \\| \"pad\" \\| \"tv\" \\| \"watch\" \\| \"pc\" \\| \"undefined\" \\| \"car\" \\| \"vr\" \\| \"appliance\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备类型。<br/> |\n| devicePixelRatio | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备åƒç´ 比<br/> |\n| deviceOrientation | \"portrait\" \\| \"landscape\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备方å‘。 |\n| ~~language~~ | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 程åºè®¾ç½®çš„è¯è¨€ **已废弃,仅为了å‘下兼容ä¿ç•™** |\n| ~~model~~ | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æ‰‹æœºåž‹å· **已废弃,仅为了å‘下兼容ä¿ç•™** |\n| osName | \"ios\" \\| \"android\" \\| \"macos\" \\| \"windows\" \\| \"linux\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 系统å称\t<br/> |\n| osVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æ“作系统版本。如 ios 版本,andriod 版本<br/> |\n| osLanguage | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æ“作系统è¯è¨€<br/> |\n| osTheme | \"light\" \\| \"dark\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"√\",\"4.11\"]]}' /> | æ“作系统主题<br/> |\n| ~~pixelRatio~~ | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备åƒç´ 比 **已废弃,仅为了å‘下兼容ä¿ç•™** |\n| ~~platform~~ | \"ios\" \\| \"android\" \\| \"mac\" \\| \"windows\" \\| \"linux\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å®¢æˆ·ç«¯å¹³å° **已废弃,仅为了å‘下兼容ä¿ç•™** |\n| screenWidth | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å±å¹•å®½åº¦ï¼Œå•ä½ä¸ºpx<br/> |\n| screenHeight | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å±å¹•é«˜åº¦ï¼Œå•ä½ä¸ºpx<br/> |\n| statusBarHeight | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 状æ€æ 的高度,å•ä½ä¸ºpx<br/> |\n| ~~system~~ | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æ“作系统版本 **已废弃,仅为了å‘下兼容ä¿ç•™** |\n| safeArea | **SafeArea** | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 在竖å±æ£æ–¹å‘下的安全区域<br/> |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| left | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域左上角横åæ ‡ï¼Œå•ä½ä¸ºpx<br/> |\n@| right | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域å³ä¸‹è§’横åæ ‡ï¼Œå•ä½ä¸ºpx<br/> |\n@| top | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域左上角纵åæ ‡ï¼Œå•ä½ä¸ºpx<br/> |\n@| bottom | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域å³ä¸‹è§’纵åæ ‡ï¼Œå•ä½ä¸ºpx<br/> |\n@| width | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域的宽度,å•ä½ä¸ºpx<br/> |\n@| height | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域的高度,å•ä½ä¸ºpx<br/> |\n| safeAreaInsets | **SafeAreaInsets** | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 在竖å±æ£æ–¹å‘下的安全区域æ’å…¥ä½ç½®<br/> |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| left | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域左侧æ’å…¥ä½ç½®ï¼ˆè·ç¦»å·¦è¾¹è¾¹ç•Œè·ç¦»ï¼‰ï¼Œå•ä½ä¸ºpx<br/> |\n@| right | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域å³ä¾§æ’å…¥ä½ç½®ï¼ˆè·ç¦»å³è¾¹è¾¹ç•Œè·ç¦»ï¼‰ï¼Œå•ä½ä¸ºpx<br/> |\n@| top | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区顶部æ’å…¥ä½ç½®ï¼ˆè·ç¦»é¡¶éƒ¨è¾¹ç•Œè·ç¦»ï¼‰ï¼Œå•ä½ä¸ºpx<br/> |\n@| bottom | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域底部æ’å…¥ä½ç½®ï¼ˆè·ç¦»åº•éƒ¨è¾¹ç•Œè·ç¦»ï¼‰ï¼Œå•ä½ä¸ºpx<br/> |\n| ua | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | ç”¨æˆ·æ ‡è¯†ã€‚å°ç¨‹åºç«¯ä¸ºç©º<br/> |\n| ~~uniCompileVersion~~ | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | uni 编译器版本。 **已废弃,仅为了å‘下兼容ä¿ç•™** |\n| uniCompilerVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.18\",\"3.9\",\"4.11\"]]}' /> | uni 编译器版本。<br/> |\n| uniPlatform | \"app\" \\| \"web\" \\| \"mp-weixin\" \\| \"mp-alipay\" \\| \"mp-baidu\" \\| \"mp-toutiao\" \\| \"mp-lark\" \\| \"mp-qq\" \\| \"mp-kuaishou\" \\| \"mp-jd\" \\| \"mp-360\" \\| \"quickapp-webview\" \\| \"quickapp-webview-union\" \\| \"quickapp-webview-huawei\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | uni-app è¿è¡Œå¹³å°ï¼Œä¸Žæ¡ä»¶ç¼–译平å°ç›¸åŒã€‚<br/> |\n| uniRuntimeVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | uni è¿è¡Œæ—¶ç‰ˆæœ¬ã€‚<br/> |\n| ~~uniCompileVersionCode~~ | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | uni 编译器版本å·ã€‚ **已废弃,仅为了å‘下兼容ä¿ç•™** |\n| uniCompilerVersionCode | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.18\",\"3.9\",\"4.11\"]]}' /> | uni 编译器版本å·ã€‚<br/> |\n| uniRuntimeVersionCode | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | uni è¿è¡Œæ—¶ç‰ˆæœ¬å·ã€‚<br/> |\n| ~~version~~ | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 引擎版本å·ã€‚ **已废弃,仅为了å‘下兼容ä¿ç•™** |\n| romName | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | rom å称。Android 部分机型获å–ä¸åˆ°å€¼ã€‚iOS æ’为 `ios`<br/> |\n| romVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | rom 版本å·ã€‚Android 部分机型获å–ä¸åˆ°å€¼ã€‚iOS 为æ“作系统版本å·ï¼ˆåŒ `osVersion`)。<br/> |\n| windowWidth | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¯ä½¿ç”¨çª—å£å®½åº¦ï¼Œå•ä½ä¸ºpx<br/> |\n| windowHeight | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¯ä½¿ç”¨çª—å£é«˜åº¦ï¼Œå•ä½ä¸ºpx<br/> |\n| windowTop | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 内容区域è·ç¦»é¡¶éƒ¨çš„è·ç¦»ï¼ˆåŒCSSå˜é‡ `--window-top`),å•ä½ä¸ºpx<br/> |\n| windowBottom | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 内容区域è·ç¦»åº•éƒ¨çš„è·ç¦»ï¼ˆåŒCSSå˜é‡ `--window-bottom`),å•ä½ä¸ºpx<br/> |\n| osAndroidAPILevel | number \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"√\",\"x\"]]}' /> | Android 系统API库的版本。<br/> |\n| appTheme | \"light\" \\| \"dark\" \\| \"auto\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | 当å‰App的主题<br/> |\n","returnValue":"","compatibility":"### getSystemInfo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/system/info?id=getsysteminfo)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-system-info.getSystemInfo)\n"},"getSystemInfoSync":{"name":"## uni.getSystemInfoSync() @getsysteminfosync","description":"åŒæ¥èŽ·å–系统信æ¯","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| **GetSystemInfoResult** |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| SDKVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | 客户端基础库版本<br/> |\n@| appId | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | `manifest.json` ä¸åº”用appid。<br/> |\n@| appLanguage | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 应用设置的è¯è¨€ã€‚<br/> |\n@| appName | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | `manifest.json` ä¸åº”用å称。<br/> |\n@| appVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | `manifest.json` ä¸åº”用版本å称。<br/> |\n@| appVersionCode | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | `manifest.json` ä¸åº”用版本åå·ã€‚<br/> |\n@| ~~brand~~ | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | 手机å“牌。 **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| browserName | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æµè§ˆå™¨å称。`App` 端是系统 webview çš„åå—,比如 wkwebviewã€chrome。å°ç¨‹åºç«¯ä¸ºç©º<br/> |\n@| browserVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æµè§ˆå™¨ç‰ˆæœ¬ã€webview 版本。<br/> |\n@| deviceId | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备 ID<br/> |\n@| deviceBrand | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备å“牌。如:`apple`ã€`huawei`。<br/> |\n@| deviceModel | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备型å·<br/> |\n@| deviceType | \"phone\" \\| \"pad\" \\| \"tv\" \\| \"watch\" \\| \"pc\" \\| \"null\" \\| \"car\" \\| \"vr\" \\| \"appliance\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备类型。<br/> |\n@| devicePixelRatio | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备åƒç´ 比<br/> |\n@| deviceOrientation | \"portrait\" \\| \"landscape\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备方å‘。 |\n@| ~~language~~ | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 程åºè®¾ç½®çš„è¯è¨€ **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| ~~model~~ | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æ‰‹æœºåž‹å· **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| osName | \"ios\" \\| \"android\" \\| \"macos\" \\| \"windows\" \\| \"linux\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 系统å称\t<br/> |\n@| osVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æ“作系统版本。如 ios 版本,andriod 版本<br/> |\n@| osLanguage | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æ“作系统è¯è¨€<br/> |\n@| osTheme | \"light\" \\| \"dark\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"√\",\"4.11\"]]}' /> | æ“作系统主题<br/> |\n@| ~~pixelRatio~~ | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备åƒç´ 比 **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| ~~platform~~ | \"ios\" \\| \"android\" \\| \"mac\" \\| \"windows\" \\| \"linux\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å®¢æˆ·ç«¯å¹³å° **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| screenWidth | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å±å¹•å®½åº¦ï¼Œå•ä½ä¸ºpx<br/> |\n@| screenHeight | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å±å¹•é«˜åº¦ï¼Œå•ä½ä¸ºpx<br/> |\n@| statusBarHeight | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 状æ€æ 的高度,å•ä½ä¸ºpx<br/> |\n@| ~~system~~ | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æ“作系统版本 **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| safeArea | **SafeArea** | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 在竖å±æ£æ–¹å‘下的安全区域<br/> |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| left | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域左上角横åæ ‡ï¼Œå•ä½ä¸ºpx<br/> |\n@@| right | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域å³ä¸‹è§’横åæ ‡ï¼Œå•ä½ä¸ºpx<br/> |\n@@| top | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域左上角纵åæ ‡ï¼Œå•ä½ä¸ºpx<br/> |\n@@| bottom | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域å³ä¸‹è§’纵åæ ‡ï¼Œå•ä½ä¸ºpx<br/> |\n@@| width | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域的宽度,å•ä½ä¸ºpx<br/> |\n@@| height | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域的高度,å•ä½ä¸ºpx<br/> |\n@| safeAreaInsets | **SafeAreaInsets** | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 在竖å±æ£æ–¹å‘下的安全区域æ’å…¥ä½ç½®<br/> |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| left | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域左侧æ’å…¥ä½ç½®ï¼ˆè·ç¦»å·¦è¾¹è¾¹ç•Œè·ç¦»ï¼‰ï¼Œå•ä½ä¸ºpx<br/> |\n@@| right | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域å³ä¾§æ’å…¥ä½ç½®ï¼ˆè·ç¦»å³è¾¹è¾¹ç•Œè·ç¦»ï¼‰ï¼Œå•ä½ä¸ºpx<br/> |\n@@| top | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区顶部æ’å…¥ä½ç½®ï¼ˆè·ç¦»é¡¶éƒ¨è¾¹ç•Œè·ç¦»ï¼‰ï¼Œå•ä½ä¸ºpx<br/> |\n@@| bottom | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域底部æ’å…¥ä½ç½®ï¼ˆè·ç¦»åº•éƒ¨è¾¹ç•Œè·ç¦»ï¼‰ï¼Œå•ä½ä¸ºpx<br/> |\n@| ua | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | ç”¨æˆ·æ ‡è¯†ã€‚å°ç¨‹åºç«¯ä¸ºç©º<br/> |\n@| ~~uniCompileVersion~~ | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | uni 编译器版本。 **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| uniCompilerVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.18\",\"3.9\",\"4.11\"]]}' /> | uni 编译器版本。<br/> |\n@| uniPlatform | \"app\" \\| \"web\" \\| \"mp-weixin\" \\| \"mp-alipay\" \\| \"mp-baidu\" \\| \"mp-toutiao\" \\| \"mp-lark\" \\| \"mp-qq\" \\| \"mp-kuaishou\" \\| \"mp-jd\" \\| \"mp-360\" \\| \"quickapp-webview\" \\| \"quickapp-webview-union\" \\| \"quickapp-webview-huawei\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | uni-app è¿è¡Œå¹³å°ï¼Œä¸Žæ¡ä»¶ç¼–译平å°ç›¸åŒã€‚<br/> |\n@| uniRuntimeVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | uni è¿è¡Œæ—¶ç‰ˆæœ¬ã€‚<br/> |\n@| ~~uniCompileVersionCode~~ | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | uni 编译器版本å·ã€‚ **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| uniCompilerVersionCode | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.18\",\"3.9\",\"4.11\"]]}' /> | uni 编译器版本å·ã€‚<br/> |\n@| uniRuntimeVersionCode | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | uni è¿è¡Œæ—¶ç‰ˆæœ¬å·ã€‚<br/> |\n@| ~~version~~ | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 引擎版本å·ã€‚ **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| romName | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | rom å称。Android 部分机型获å–ä¸åˆ°å€¼ã€‚iOS æ’为 `ios`<br/> |\n@| romVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | rom 版本å·ã€‚Android 部分机型获å–ä¸åˆ°å€¼ã€‚iOS 为æ“作系统版本å·ï¼ˆåŒ `osVersion`)。<br/> |\n@| windowWidth | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¯ä½¿ç”¨çª—å£å®½åº¦ï¼Œå•ä½ä¸ºpx<br/> |\n@| windowHeight | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¯ä½¿ç”¨çª—å£é«˜åº¦ï¼Œå•ä½ä¸ºpx<br/> |\n@| windowTop | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 内容区域è·ç¦»é¡¶éƒ¨çš„è·ç¦»ï¼ˆåŒCSSå˜é‡ `--window-top`),å•ä½ä¸ºpx<br/> |\n@| windowBottom | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 内容区域è·ç¦»åº•éƒ¨çš„è·ç¦»ï¼ˆåŒCSSå˜é‡ `--window-bottom`),å•ä½ä¸ºpx<br/> |\n@| osAndroidAPILevel | number \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"√\",\"x\"]]}' /> | Android 系统API库的版本。<br/> |\n@| appTheme | \"light\" \\| \"dark\" \\| \"auto\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | 当å‰App的主题<br/> | \n","compatibility":"### getSystemInfoSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/system/info?id=getsysteminfosync)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-system-info.getSystemInfoSync)\n"},"get-system-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-system-info/get-system-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-system-info/get-system-info\n>Template\n```vue\n<template>\r\n <!-- #ifdef APP -->\r\n <scroll-view style=\"flex: 1\">\r\n <!-- #endif -->\r\n <view>\r\n <page-head :title=\"title\"></page-head>\r\n <view class=\"uni-common-mt\">\r\n <view class=\"uni-list\">\r\n <view class=\"uni-list-cell\" v-for=\"(item, _) in items\" style=\"align-items: center\">\r\n <view class=\"uni-pd\">\r\n <view class=\"uni-label\" style=\"width: 180px\">{{\r\n item.label\r\n }}</view>\r\n </view>\r\n <view class=\"uni-list-cell-db\">\r\n <text style=\"width: 100%;\">{{ item.value == '' ? '未获å–' : item.value }}</text>\r\n </view>\r\n </view>\r\n </view>\r\n <view class=\"uni-padding-wrap\">\r\n <view class=\"uni-btn-v\">\r\n <button type=\"primary\" @tap=\"getSystemInfoSync\">\r\n åŒæ¥èŽ·å–设备系统信æ¯\r\n </button>\r\n <button type=\"primary\" @tap=\"getSystemInfo\" style=\"margin-top: 20px;\">\r\n 异æ¥èŽ·å–设备系统信æ¯\r\n </button>\r\n </view>\r\n </view>\r\n </view>\r\n </view>\r\n <!-- #ifdef APP -->\r\n </scroll-view>\r\n <!-- #endif -->\r\n</template>\r\n\r\n\r\n<style>\r\n .uni-pd {\r\n padding-left: 15px;\r\n }\r\n</style>\n\n```\n>Script\n```uts\n\r\n type Item = {\r\n label : string,\r\n value : string,\r\n }\r\n export default {\r\n data() {\r\n return {\r\n title: 'getSystemInfo',\r\n items: [] as Item[],\r\n }\r\n },\r\n onUnload: function () {\r\n },\r\n methods: {\r\n getSystemInfo: function () {\r\n uni.getSystemInfo({\r\n success: (res) => {\r\n this.items = [] as Item[];\n const res_str = JSON.stringify(res);\n const res_obj = JSON.parseObject(res_str);\n const res_map = res_obj!.toMap();\n let keys = [] as string[]\n res_map.forEach((_, key) => {\n keys.push(key);\n });\n keys.sort().forEach( key => {\n const value = res[key];\n if(value != null){\n const item = {\n \tlabel: key,\n \tvalue: \"\" + ((typeof value == \"object\")? JSON.stringify(value) : value)\n } as Item;\n this.items.push(item);\n }\n });\r\n },\r\n })\r\n },\r\n getSystemInfoSync: function () {\r\n this.items = [] as Item[];\r\n const res = uni.getSystemInfoSync()\n const res_str = JSON.stringify(res);\n const res_obj = JSON.parseObject(res_str);\n const res_map = res_obj!.toMap();\n let keys = [] as string[]\n res_map.forEach((_, key) => {\n keys.push(key);\n });\n keys.sort().forEach( key => {\n const value = res[key];\n if(value != null){\n const item = {\n \tlabel: key,\n \tvalue: \"\" + ((typeof value == \"object\")? JSON.stringify(value) : value)\n } as Item;\n this.items.push(item);\n }\n });\r\n },\r\n //自动化测试例专用\r\n jest_getSystemInfo() : GetSystemInfoResult {\r\n return uni.getSystemInfoSync();\r\n },\r\n }\r\n }\r\n\n```\n:::"},"getDeviceInfo":{"name":"## uni.getDeviceInfo(options?) @getdeviceinfo","description":"获å–设备信æ¯","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **GetDeviceInfoOptions** | å¦ | 包å«æ‰€æœ‰å—段的过滤对象 | - | \\[options=包å«æ‰€æœ‰å—段的过滤对象]过滤的å—段对象, ä¸ä¼ å‚数默认为获å–全部å—段。 |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filter | Array\\<string\\> | 是 | - | - | 过滤å—段的å—符串数组,å‡å¦‚è¦èŽ·å–指定å—æ®µï¼Œä¼ å…¥æ¤æ•°ç»„。 | \n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| **GetDeviceInfoResult** |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| ~~brand~~ | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | 设备å“牌 **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| deviceBrand | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | 设备å“牌<br/> |\n@| deviceId | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备 id 。由 uni-app 框架生æˆå¹¶å˜å‚¨ï¼Œæ¸…空 Storage 会导致改å˜<br/> |\n@| ~~model~~ | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备型å·\t **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| deviceModel | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备型å·\t<br/> |\n@| deviceType | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备类型phoneã€padã€pc\t<br/> |\n@| deviceOrientation | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | è®¾å¤‡æ–¹å‘ ç«–å± portraitã€æ¨ªå± landscape\t<br/> |\n@| devicePixelRatio | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备åƒç´ 比\t<br/> |\n@| system | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æ“作系统åŠç‰ˆæœ¬\t<br/> |\n@| platform | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 客户端平å°\t<br/> |\n@| isRoot | boolean | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | 是å¦root。iOS 为是å¦è¶Šç‹±<br/> |\n@| isSimulator | boolean | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | 是å¦æ˜¯æ¨¡æ‹Ÿå™¨<br/> |\n@| isUSBDebugging | boolean | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"√\",\"x\"]]}' /> | adb是å¦å¼€å¯<br/> |\n@| osName | \"ios\" \\| \"android\" \\| \"macos\" \\| \"windows\" \\| \"linux\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.18\",\"4.18\",\"4.18\"]]}' /> | 系统å称\t<br/> |\n@| osVersion | string \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.18\",\"4.18\",\"4.18\"]]}' /> | æ“作系统版本。如 ios 版本,andriod 版本<br/> |\n@| osLanguage | string \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | æ“作系统è¯è¨€<br/> |\n@| osTheme | \"light\" \\| \"dark\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | æ“作系统主题<br/> |\n@| osAndroidAPILevel | number \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"x\"]]}' /> | Android 系统API库的版本。<br/> |\n@| romName | string \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | rom å称。Android 部分机型获å–ä¸åˆ°å€¼ã€‚iOS æ’为 `ios`<br/> |\n@| romVersion | string \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | rom 版本å·ã€‚Android 部分机型获å–ä¸åˆ°å€¼ã€‚iOS 为æ“作系统版本å·ï¼ˆåŒ `osVersion`)。<br/> | \n","compatibility":"### getDeviceInfo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/getDeviceInfo.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-device-info)\n"},"get-device-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-device-info/get-device-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-device-info/get-device-info\n>Template\n```vue\n<template>\r\n <!-- #ifdef APP -->\r\n <scroll-view class=\"page-scroll-view\">\r\n <!-- #endif -->\r\n <view>\r\n <page-head :title=\"title\"></page-head>\r\n <view class=\"uni-common-mt\">\r\n <view class=\"uni-list\">\r\n <view class=\"uni-list\">\r\n <view class=\"uni-list-cell\" v-for=\"(item, _) in items\" style=\"align-items: center\">\r\n <view class=\"uni-pd\">\r\n <view class=\"uni-label\" style=\"width: 180px\">{{\r\n item.label\r\n }}</view>\r\n </view>\r\n <view class=\"uni-list-cell-db\">\r\n <text style=\"width: 100%;\">{{ item.value == '' ? '未获å–' : item.value }}</text>\r\n </view>\r\n </view>\r\n </view>\r\n </view>\r\n <view class=\"uni-padding-wrap\">\r\n <view class=\"uni-btn-v\">\r\n <button type=\"primary\" @tap=\"getDeviceInfo\">获å–设备信æ¯</button>\r\n </view>\r\n </view>\r\n </view>\r\n </view>\r\n <!-- #ifdef APP -->\r\n </scroll-view>\r\n <!-- #endif -->\r\n</template>\r\n\r\n\r\n<style>\r\n .uni-pd {\r\n padding-left: 15px;\r\n }\r\n</style>\n\n```\n>Script\n```uts\n\r\n import { setDevicePixelRatio } from '@/store/index.uts'\r\n\r\n type Item = {\r\n label : string,\r\n value : string,\r\n }\r\n export default {\r\n data() {\r\n return {\r\n title: 'getDeviceInfo',\r\n items: [] as Item[],\r\n }\r\n },\r\n onUnload: function () {\r\n },\r\n methods: {\r\n getDeviceInfo: function () {\r\n const res = uni.getDeviceInfo();\r\n // 获å–åƒç´ 比, 供截图对比使用\r\n setDevicePixelRatio(res.devicePixelRatio !== null ? parseFloat(res.devicePixelRatio!) : 1)\r\n this.items = [] as Item[];\n\n const res_str = JSON.stringify(res);\n const res_obj = JSON.parseObject(res_str);\n const res_map = res_obj!.toMap();\n let keys = [] as string[]\n res_map.forEach((_, key) => {\n keys.push(key);\n });\n keys.sort().forEach( key => {\n const value = res[key];\n if(value != null){\n const item = {\n \tlabel: key,\n \tvalue: \"\" + ((typeof value == \"object\")? JSON.stringify(value) : value)\n } as Item;\n this.items.push(item);\n }\n });\r\n }\r\n }\r\n }\r\n\n```\n:::"},"getWindowInfo":{"name":"## uni.getWindowInfo() @getwindowinfo","description":"åŒæ¥èŽ·å–窗å£ä¿¡æ¯","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| **GetWindowInfoResult** |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| pixelRatio | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备åƒç´ 比<br/> |\n@| screenWidth | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å±å¹•å®½åº¦ï¼Œå•ä½ä¸ºpx<br/> |\n@| screenHeight | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å±å¹•é«˜åº¦ï¼Œå•ä½ä¸ºpx<br/> |\n@| windowWidth | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¯ä½¿ç”¨çª—å£å®½åº¦ï¼Œå•ä½ä¸ºpx<br/> |\n@| windowHeight | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | å¯ä½¿ç”¨çª—å£é«˜åº¦ï¼Œå•ä½ä¸ºpx<br/> |\n@| statusBarHeight | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 状æ€æ 的高度,å•ä½ä¸ºpx<br/> |\n@| windowTop | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 内容区域è·ç¦»é¡¶éƒ¨çš„è·ç¦»ï¼ˆåŒCSSå˜é‡ `--window-top`),å•ä½ä¸ºpx<br/> |\n@| windowBottom | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 内容区域è·ç¦»åº•éƒ¨çš„è·ç¦»ï¼ˆåŒCSSå˜é‡ `--window-bottom`),å•ä½ä¸ºpx<br/> |\n@| safeArea | **SafeArea** | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域在å±å¹•ä¸çš„ä½ç½®ä¿¡æ¯<br/> |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| left | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域左上角横åæ ‡ï¼Œå•ä½ä¸ºpx<br/> |\n@@| right | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域å³ä¸‹è§’横åæ ‡ï¼Œå•ä½ä¸ºpx<br/> |\n@@| top | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域左上角纵åæ ‡ï¼Œå•ä½ä¸ºpx<br/> |\n@@| bottom | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域å³ä¸‹è§’纵åæ ‡ï¼Œå•ä½ä¸ºpx<br/> |\n@@| width | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域的宽度,å•ä½ä¸ºpx<br/> |\n@@| height | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域的高度,å•ä½ä¸ºpx<br/> |\n@| safeAreaInsets | **SafeAreaInsets** | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域æ’å…¥ä½ç½®ï¼ˆä¸Žå±å¹•è¾¹ç•Œçš„è·ç¦»ï¼‰ä¿¡æ¯<br/> |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| left | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域左侧æ’å…¥ä½ç½®ï¼ˆè·ç¦»å·¦è¾¹è¾¹ç•Œè·ç¦»ï¼‰ï¼Œå•ä½ä¸ºpx<br/> |\n@@| right | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域å³ä¾§æ’å…¥ä½ç½®ï¼ˆè·ç¦»å³è¾¹è¾¹ç•Œè·ç¦»ï¼‰ï¼Œå•ä½ä¸ºpx<br/> |\n@@| top | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区顶部æ’å…¥ä½ç½®ï¼ˆè·ç¦»é¡¶éƒ¨è¾¹ç•Œè·ç¦»ï¼‰ï¼Œå•ä½ä¸ºpx<br/> |\n@@| bottom | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域底部æ’å…¥ä½ç½®ï¼ˆè·ç¦»åº•éƒ¨è¾¹ç•Œè·ç¦»ï¼‰ï¼Œå•ä½ä¸ºpx<br/> |\n@| screenTop | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 窗å£ä¸Šè¾¹ç¼˜çš„ y 值,å•ä½ä¸ºpx<br/> | \n","compatibility":"### getWindowInfo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/system/getWindowInfo.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-window-info)\n"},"get-window-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-window-info/get-window-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-window-info/get-window-info\n>Template\n```vue\n<template>\r\n <page-head :title=\"title\"></page-head>\r\n <view class=\"uni-common-mt\">\r\n <view class=\"uni-list\">\r\n <view class=\"uni-list-cell\" v-for=\"(item, _) in items\" style=\"align-items: center\">\r\n <view class=\"uni-pd\">\r\n <view class=\"uni-label\" style=\"width: 180px\">{{ item.label }}</view>\r\n </view>\r\n <view class=\"uni-list-cell-db\">\r\n <text style=\"width: 100%;\">{{ item.value == '' ? '未获å–' : item.value }}</text>\r\n </view>\r\n </view>\r\n </view>\r\n <view class=\"uni-padding-wrap\">\r\n <view class=\"uni-btn-v\">\r\n <button type=\"primary\" @tap=\"getWindowInfo\">获å–窗å£ä¿¡æ¯</button>\r\n </view>\r\n </view>\r\n </view>\r\n</template>\r\n\r\n\r\n<style>\r\n .uni-pd {\r\n padding-left: 15px;\r\n }\r\n</style>\n\n```\n>Script\n```uts\n\r\n import { setStatusBarHeight, setSafeArea } from '@/store/index.uts'\r\n // #ifdef APP-ANDROID\r\n import type { SafeArea } from '@/store/index.uts'\r\n // #endif\r\n\r\n type Item = {\r\n label : string,\r\n value : string,\r\n }\r\n export default {\r\n data() {\r\n return {\r\n title: 'getWindowInfo',\r\n items: [] as Item[],\r\n }\r\n },\r\n onUnload: function () {\r\n },\r\n onReady() {\r\n this.getWindowInfo()\r\n },\r\n methods: {\r\n getWindowInfo: function () {\r\n const res = uni.getWindowInfo();\r\n // 获å–状æ€æ 高度, 供截图对比使用\r\n setStatusBarHeight(res.statusBarHeight);\r\n // 获å–安全区信æ¯,供截图使用\r\n // #ifdef APP-ANDROID\r\n setSafeArea({\r\n top: res.safeArea.top,\r\n left: res.safeArea.left,\r\n right: res.safeArea.right,\r\n bottom: res.safeArea.bottom,\r\n width: res.safeArea.width,\r\n height: res.safeArea.height,\r\n } as SafeArea);\r\n // #endif\r\n // #ifdef APP-IOS\r\n setSafeArea({\r\n top: res.safeArea.top,\r\n left: res.safeArea.left,\r\n right: res.safeArea.right,\r\n bottom: res.safeArea.bottom,\r\n width: res.safeArea.width,\r\n height: res.safeArea.height,\r\n });\r\n // #endif\r\n this.items = [] as Item[];\r\n\r\n const res_str = JSON.stringify(res);\r\n const res_obj = JSON.parseObject(res_str);\r\n const res_map = res_obj!.toMap();\r\n let keys = [] as string[]\r\n res_map.forEach((_, key) => {\r\n keys.push(key);\r\n });\r\n keys.sort().forEach(key => {\r\n const value = res[key];\r\n if (value != null) {\r\n const item = {\r\n label: key,\r\n value: \"\" + ((typeof value == \"object\") ? JSON.stringify(value) : value)\r\n } as Item;\r\n this.items.push(item);\r\n }\r\n });\r\n },\r\n //自动化测试例专用\r\n jest_getWindowInfo() : GetWindowInfoResult {\r\n return uni.getWindowInfo();\r\n },\r\n }\r\n }\r\n\n```\n:::"},"getAppBaseInfo":{"name":"## uni.getAppBaseInfo(options?) @getappbaseinfo","description":"获å–app基本信æ¯","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **GetAppBaseInfoOptions** | å¦ | 包å«æ‰€æœ‰å—段的过滤对象 | - | \\[options=包å«æ‰€æœ‰å—段的过滤对象] 过滤的å—段对象, ä¸ä¼ å‚数默认为获å–全部å—段。 |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filter | Array\\<string\\> | 是 | - | - | 过滤å—段的å—符串数组,å‡å¦‚è¦èŽ·å–指定å—æ®µï¼Œä¼ å…¥æ¤æ•°ç»„。 | \n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| **GetAppBaseInfoResult** |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| appId | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | manifest.json ä¸åº”用appid,å³DCloud appid。\t<br/> |\n@| appName | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | `manifest.json` ä¸åº”用å称。<br/> |\n@| appVersion | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | `manifest.json` ä¸åº”用版本å称。<br/> |\n@| appVersionCode | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | `manifest.json` ä¸åº”用版本åå·ã€‚<br/> |\n@| appLanguage | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 应用设置的è¯è¨€enã€zh-Hansã€zh-Hantã€frã€es\t<br/> |\n@| language | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 应用设置的è¯è¨€\t<br/> |\n@| ~~version~~ | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | 引擎版本å·ã€‚已废弃,仅为了å‘下兼容ä¿ç•™ **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| isUniAppX | boolean | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.18\",\"3.9\",\"4.11\"]]}' /> | 是å¦uni-app x<br/> |\n@| ~~uniCompileVersion~~ | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | uni 编译器版本 **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| uniCompilerVersion | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.18\",\"4.0\",\"4.11\"]]}' /> | uni 编译器版本<br/> |\n@| uniPlatform | \"app\" \\| \"web\" \\| \"mp-weixin\" \\| \"mp-alipay\" \\| \"mp-baidu\" \\| \"mp-toutiao\" \\| \"mp-lark\" \\| \"mp-qq\" \\| \"mp-kuaishou\" \\| \"mp-jd\" \\| \"mp-360\" \\| \"quickapp-webview\" \\| \"quickapp-webview-union\" \\| \"quickapp-webview-huawei\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | uni-app è¿è¡Œå¹³å°ã€‚<br/> |\n@| uniRuntimeVersion | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.18\",\"3.9\",\"4.11\"]]}' /> | uni è¿è¡Œæ—¶ç‰ˆæœ¬<br/> |\n@| ~~uniCompileVersionCode~~ | number | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | uni ç¼–è¯‘å™¨ç‰ˆæœ¬å· **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| uniCompilerVersionCode | number | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.18\",\"4.0\",\"4.11\"]]}' /> | uni 编译器版本å·<br/> |\n@| uniRuntimeVersionCode | number | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | uni è¿è¡Œæ—¶ç‰ˆæœ¬å·<br/> |\n@| packageName | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.97\",\"x\"]]}' /> | Android的包å<br/> |\n@| bundleId | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"x\",\"4.11\"]]}' /> | iOSçš„bundleId<br/> |\n@| signature | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.97\",\"4.11\"]]}' /> | Android: 应用ç¾åè¯ä¹¦çš„SHA1值(全部为å°å†™ï¼Œä¸é—´ä¸åŒ…å«â€œ:â€ï¼‰ã€‚ 为了ä¿è¯åº”用的安全性,请使用自己生æˆçš„è¯ä¹¦ï¼ˆä¸è¦ä½¿ç”¨å…¬å…±æµ‹è¯•è¯ä¹¦ï¼‰ã€‚<br/>iOS: 应用ç¾åè¯ä¹¦ä¸ç»‘定的Bundle ID(AppleID)的md5值(全部为å°å†™ï¼‰ã€‚<br/> |\n@| appTheme | \"light\" \\| \"dark\" \\| \"auto\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | 当å‰App的主题<br/> | \n","compatibility":"### getAppBaseInfo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/getAppBaseInfo.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-app-base-info)\n"},"get-app-base-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-app-base-info/get-app-base-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-app-base-info/get-app-base-info\n>Template\n```vue\n<template>\r\n <page-head :title=\"title\"></page-head>\r\n <view class=\"uni-common-mt\">\r\n <view class=\"uni-list\">\n <view class=\"uni-list-cell\" v-for=\"(item,_) in items\" style=\"align-items: center;\">\n <view class=\"uni-pd\">\n <view class=\"uni-label\" style=\"width:180px;\">{{item.label}}</view>\n </view>\n <view class=\"uni-list-cell-db\">\n <text style=\"width: 100%;\">{{ item.value == '' ? '未获å–' : item.value }}</text>\n </view>\n </view>\r\n </view>\r\n <view class=\"uni-padding-wrap\">\r\n <view class=\"uni-btn-v\">\r\n <button type=\"primary\" @tap=\"getAppBaseInfo\">获å–App基础信æ¯</button>\r\n </view>\r\n </view>\r\n </view>\r\n</template>\r\n\r\n\r\n<style>\r\n\t.uni-pd {\r\n\t\tpadding-left: 15px;\r\n\t}\r\n</style>\r\n\n```\n>Script\n```uts\n\n\ttype Item = {\n\t\tlabel : string,\n\t\tvalue : string,\n\t}\n\texport default {\r\n\t\tdata() {\r\n\t\t\treturn {\r\n\t\t\t\ttitle: 'getAppBaseInfo',\n\t\t\t\titems: [] as Item[],\r\n\t\t\t}\r\n\t\t},\r\n\t\tonUnload:function(){\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\tgetAppBaseInfo: function () {\n\t\t\t\tconst res = uni.getAppBaseInfo();\n const res_str = JSON.stringify(res);\n const res_obj = JSON.parseObject(res_str);\n const res_map = res_obj!.toMap();\n let keys = [] as string[]\n res_map.forEach((_, key) => {\n keys.push(key);\n });\n\n this.items = [] as Item[];\n keys.sort().forEach( key => {\n const value = res[key];\n if(value != null){\n const item = {\n \tlabel: key,\n \tvalue: \"\" + ((typeof value == \"object\")? JSON.stringify(value) : value)\n } as Item;\n this.items.push(item);\n }\n });\n\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\n```\n:::"},"getAppAuthorizeSetting":{"name":"## uni.getAppAuthorizeSetting() @getappauthorizesetting","description":"èŽ·å– APP 授æƒè®¾ç½®ã€‚","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| **GetAppAuthorizeSettingResult** |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| albumAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"x\",\"4.11\"]]}' /> | å…许 App 使用相册的开关(仅 iOS 支æŒï¼‰<br/>- authorized: å·²ç»èŽ·å¾—授æƒï¼Œæ— 需å†æ¬¡è¯·æ±‚授æƒ<br/>- denied: 请求授æƒè¢«æ‹’ç»ï¼Œæ— 法å†æ¬¡è¯·æ±‚授æƒï¼›ï¼ˆæ¤æƒ…况需è¦å¼•å¯¼ç”¨æˆ·æ‰“开系统设置,在设置页ä¸æ‰“å¼€æƒé™ï¼‰<br/>- not determined: 尚未请求授æƒï¼Œä¼šåœ¨App下一次调用系统相应æƒé™æ—¶è¯·æ±‚;(仅 iOS 会出现。æ¤ç§æƒ…况下引导用户打开系统设置,ä¸å±•ç¤ºå¼€å…³ï¼‰<br/>- config error: 当å‰åº”用没有é…置相册æƒé™æè¿° |\n@| bluetoothAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"x\",\"4.11\"]]}' /> | å…许 App 使用è“牙的开关(仅 iOS 支æŒï¼‰<br/>- authorized: å·²ç»èŽ·å¾—授æƒï¼Œæ— 需å†æ¬¡è¯·æ±‚授æƒ<br/>- denied: 请求授æƒè¢«æ‹’ç»ï¼Œæ— 法å†æ¬¡è¯·æ±‚授æƒï¼›ï¼ˆæ¤æƒ…况需è¦å¼•å¯¼ç”¨æˆ·æ‰“开系统设置,在设置页ä¸æ‰“å¼€æƒé™ï¼‰<br/>- not determined: 尚未请求授æƒï¼Œä¼šåœ¨App下一次调用系统相应æƒé™æ—¶è¯·æ±‚;(仅 iOS 会出现。æ¤ç§æƒ…况下引导用户打开系统设置,ä¸å±•ç¤ºå¼€å…³ï¼‰<br/>- config error: Androidå¹³å°æ²¡æœ‰è¯¥å€¼ï¼›iOSå¹³å°ï¼šå½“å‰åº”用没有é…ç½®è“牙æƒé™æè¿° |\n@| cameraAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | å…许 App 使用摄åƒå¤´çš„开关<br/>- authorized: å·²ç»èŽ·å¾—授æƒï¼Œæ— 需å†æ¬¡è¯·æ±‚授æƒ<br/>- denied: 请求授æƒè¢«æ‹’ç»ï¼Œæ— 法å†æ¬¡è¯·æ±‚授æƒï¼›ï¼ˆæ¤æƒ…况需è¦å¼•å¯¼ç”¨æˆ·æ‰“开系统设置,在设置页ä¸æ‰“å¼€æƒé™ï¼‰<br/>- not determined: 尚未请求授æƒï¼Œä¼šåœ¨App下一次调用系统相应æƒé™æ—¶è¯·æ±‚;(仅 iOS 会出现。æ¤ç§æƒ…况下引导用户打开系统设置,ä¸å±•ç¤ºå¼€å…³ï¼‰<br/>- config error: Androidå¹³å°ï¼šè¡¨ç¤ºæ²¡æœ‰é…ç½® `android.permission.CAMERA` æƒé™ï¼Œ[æƒé™é…置详情](https://uniapp.dcloud.net.cn/tutorial/app-nativeresource-android.html#permissions)ï¼›iOSå¹³å°ï¼šå½“å‰åº”用没有é…置相机æƒé™æè¿° |\n@| locationAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | å…许 App 使用定ä½çš„开关<br/>- authorized: å·²ç»èŽ·å¾—授æƒï¼Œæ— 需å†æ¬¡è¯·æ±‚授æƒ<br/>- denied: 请求授æƒè¢«æ‹’ç»ï¼Œæ— 法å†æ¬¡è¯·æ±‚授æƒï¼›ï¼ˆæ¤æƒ…况需è¦å¼•å¯¼ç”¨æˆ·æ‰“开系统设置,在设置页ä¸æ‰“å¼€æƒé™ï¼‰<br/>- not determined: 尚未请求授æƒï¼Œä¼šåœ¨App下一次调用系统相应æƒé™æ—¶è¯·æ±‚;(仅 iOS 会出现。æ¤ç§æƒ…况下引导用户打开系统设置,ä¸å±•ç¤ºå¼€å…³ï¼‰<br/>- config error: Androidå¹³å°ï¼šè¡¨ç¤ºæ²¡æœ‰é…ç½® `android.permission.ACCESS_COARSE_LOCATION` æƒé™ï¼Œ[æƒé™é…置详情](https://uniapp.dcloud.net.cn/tutorial/app-nativeresource-android.html#permissions)ï¼›iOSå¹³å°ï¼šå½“å‰åº”用没有é…置定ä½æƒé™æè¿° |\n@| locationAccuracy | \"reduced\" \\| \"full\" \\| \"unsupported\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 定ä½å‡†ç¡®åº¦ã€‚<br/>- reduced: 模糊定ä½<br/>- full: 精准定ä½<br/>- unsupported: ä¸æ”¯æŒï¼ˆåŒ…括用户拒ç»å®šä½æƒé™å’Œæ²¡æœ‰åŒ…å«å®šä½æƒé™æ述) |\n@| locationReducedAccuracy | boolean \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"x\",\"4.11\"]]}' /> | 定ä½å‡†ç¡®åº¦ï¼ˆæŽ¨è使用 locationAccuracy 属性)。true 表示模糊定ä½ï¼Œfalse 表示精确定ä½ï¼ˆä»… iOS 支æŒï¼‰ |\n@| microphoneAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | å…许 App 使用麦克风的开关<br/>- authorized: å·²ç»èŽ·å¾—授æƒï¼Œæ— 需å†æ¬¡è¯·æ±‚授æƒ<br/>- denied: 请求授æƒè¢«æ‹’ç»ï¼Œæ— 法å†æ¬¡è¯·æ±‚授æƒï¼›ï¼ˆæ¤æƒ…况需è¦å¼•å¯¼ç”¨æˆ·æ‰“开系统设置,在设置页ä¸æ‰“å¼€æƒé™ï¼‰<br/>- not determined: 尚未请求授æƒï¼Œä¼šåœ¨App下一次调用系统相应æƒé™æ—¶è¯·æ±‚;(仅 iOS 会出现。æ¤ç§æƒ…况下引导用户打开系统设置,ä¸å±•ç¤ºå¼€å…³ï¼‰<br/>- config error: Androidå¹³å°ï¼šè¡¨ç¤ºæ²¡æœ‰é…ç½® `android.permission.RECORD_AUDIO` æƒé™ï¼Œ[æƒé™é…置详情](https://uniapp.dcloud.net.cn/tutorial/app-nativeresource-android.html#permissions)ï¼›iOSå¹³å°ï¼šå½“å‰åº”用没有é…置麦克风æƒé™æè¿° |\n@| notificationAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | å…许 App 通知的开关<br/>- authorized: å·²ç»èŽ·å¾—授æƒï¼Œæ— 需å†æ¬¡è¯·æ±‚授æƒ<br/>- denied: 请求授æƒè¢«æ‹’ç»ï¼Œæ— 法å†æ¬¡è¯·æ±‚授æƒï¼›ï¼ˆæ¤æƒ…况需è¦å¼•å¯¼ç”¨æˆ·æ‰“开系统设置,在设置页ä¸æ‰“å¼€æƒé™ï¼‰<br/>- not determined: 尚未请求授æƒï¼Œä¼šåœ¨App下一次调用系统相应æƒé™æ—¶è¯·æ±‚;(仅 iOS 会出现。æ¤ç§æƒ…况下引导用户打开系统设置,ä¸å±•ç¤ºå¼€å…³ï¼‰<br/>- config error: Androidå¹³å°æ²¡æœ‰è¯¥å€¼ï¼›iOSå¹³å°ï¼šæ²¡æœ‰åŒ…å«æŽ¨é€æƒé™æè¿° |\n@| notificationAlertAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"x\",\"4.11\"]]}' /> | å…许 App 通知带有æ醒的开关(仅 iOS 支æŒï¼‰<br/>- authorized: å·²ç»èŽ·å¾—授æƒï¼Œæ— 需å†æ¬¡è¯·æ±‚授æƒ<br/>- denied: 请求授æƒè¢«æ‹’ç»ï¼Œæ— 法å†æ¬¡è¯·æ±‚授æƒï¼›ï¼ˆæ¤æƒ…况需è¦å¼•å¯¼ç”¨æˆ·æ‰“开系统设置,在设置页ä¸æ‰“å¼€æƒé™ï¼‰<br/>- not determined: 尚未请求授æƒï¼Œä¼šåœ¨App下一次调用系统相应æƒé™æ—¶è¯·æ±‚;(仅 iOS 会出现。æ¤ç§æƒ…况下引导用户打开系统设置,ä¸å±•ç¤ºå¼€å…³ï¼‰<br/>- config error: 当å‰åº”用没有é…置推é€æƒé™æè¿° |\n@| notificationBadgeAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"x\",\"4.11\"]]}' /> | å…许 App é€šçŸ¥å¸¦æœ‰æ ‡è®°çš„å¼€å…³ï¼ˆä»… iOS 支æŒï¼‰<br/>- authorized: å·²ç»èŽ·å¾—授æƒï¼Œæ— 需å†æ¬¡è¯·æ±‚授æƒ<br/>- denied: 请求授æƒè¢«æ‹’ç»ï¼Œæ— 法å†æ¬¡è¯·æ±‚授æƒï¼›ï¼ˆæ¤æƒ…况需è¦å¼•å¯¼ç”¨æˆ·æ‰“开系统设置,在设置页ä¸æ‰“å¼€æƒé™ï¼‰<br/>- not determined: 尚未请求授æƒï¼Œä¼šåœ¨App下一次调用系统相应æƒé™æ—¶è¯·æ±‚;(仅 iOS 会出现。æ¤ç§æƒ…况下引导用户打开系统设置,ä¸å±•ç¤ºå¼€å…³ï¼‰<br/>- config error: 当å‰åº”用没有é…置推é€æƒé™æè¿° |\n@| notificationSoundAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"x\",\"4.11\"]]}' /> | å…许 App 通知带有声音的开关(仅 iOS 支æŒï¼‰<br/>- authorized: å·²ç»èŽ·å¾—授æƒï¼Œæ— 需å†æ¬¡è¯·æ±‚授æƒ<br/>- denied: 请求授æƒè¢«æ‹’ç»ï¼Œæ— 法å†æ¬¡è¯·æ±‚授æƒï¼›ï¼ˆæ¤æƒ…况需è¦å¼•å¯¼ç”¨æˆ·æ‰“开系统设置,在设置页ä¸æ‰“å¼€æƒé™ï¼‰<br/>- not determined: 尚未请求授æƒï¼Œä¼šåœ¨App下一次调用系统相应æƒé™æ—¶è¯·æ±‚;(仅 iOS 会出现。æ¤ç§æƒ…况下引导用户打开系统设置,ä¸å±•ç¤ºå¼€å…³ï¼‰<br/>- config error: 当å‰åº”用没有é…置推é€æƒé™æè¿° | \n","compatibility":"### getAppAuthorizeSetting 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/system/getappauthorizesetting)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-app-authorize-setting)\n"},"get-app-authorize-setting":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-app-authorize-setting/get-app-authorize-setting.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\r\n <page-head :title=\"title\"></page-head>\r\n <view class=\"uni-common-mt\">\r\n <view class=\"uni-list\">\n <!-- #ifdef APP-IOS -->\n <view class=\"uni-list-cell\">\n <view class=\"uni-pd\">\n <view class=\"uni-label\" style=\"width:180px;\">是å¦æŽˆæƒä½¿ç”¨ç›¸å†Œ</view>\n </view>\n <view class=\"uni-list-cell-db\">\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"albumAuthorized\" />\n </view>\n </view>\n <view class=\"uni-list-cell\">\n <view class=\"uni-pd\">\n <view class=\"uni-label\" style=\"width:180px;\">是å¦æŽˆæƒä½¿ç”¨è“牙</view>\n </view>\n <view class=\"uni-list-cell-db\">\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"bluetoothAuthorized\" />\n </view>\n </view>\n <!-- #endif -->\r\n <view class=\"uni-list-cell\">\r\n <view class=\"uni-pd\">\r\n <view class=\"uni-label\" style=\"width:180px;\">是å¦æŽˆæƒä½¿ç”¨æ‘„åƒå¤´</view>\r\n </view>\r\n <view class=\"uni-list-cell-db\">\r\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"cameraAuthorized\" />\r\n </view>\r\n </view>\r\n <view class=\"uni-list-cell\">\r\n <view class=\"uni-pd\">\r\n <view class=\"uni-label\" style=\"width:180px;\">是å¦æŽˆæƒä½¿ç”¨å®šä½</view>\r\n </view>\r\n <view class=\"uni-list-cell-db\">\r\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"locationAuthorized\" />\r\n </view>\r\n </view>\r\n <view class=\"uni-list-cell\">\r\n <view class=\"uni-pd\">\r\n <view class=\"uni-label\" style=\"width:180px;\">定ä½å‡†ç¡®åº¦</view>\r\n </view>\r\n <view class=\"uni-list-cell-db\">\r\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"locationAccuracy\" />\r\n </view>\r\n </view>\r\n <view class=\"uni-list-cell\">\r\n <view class=\"uni-pd\">\r\n <view class=\"uni-label\" style=\"width:180px;\">是å¦æŽˆæƒä½¿ç”¨éº¦å…‹é£Ž</view>\r\n </view>\r\n <view class=\"uni-list-cell-db\">\r\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"microphoneAuthorized\" />\r\n </view>\r\n </view>\n\r\n <view class=\"uni-list-cell\">\r\n <view class=\"uni-pd\">\r\n <view class=\"uni-label\" style=\"width:180px;\">是å¦æŽˆæƒé€šçŸ¥</view>\r\n </view>\r\n <view class=\"uni-list-cell-db\">\r\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"notificationAuthorized\" />\r\n </view>\r\n </view>\n<!-- #ifdef APP-IOS -->\n <view class=\"uni-list-cell\">\n <view class=\"uni-pd\">\n <view class=\"uni-label\" style=\"width:180px;\">是å¦å…许通知带有æ醒</view>\n </view>\n <view class=\"uni-list-cell-db\">\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"notificationAlertAuthorized\" />\n </view>\n </view>\n\n <view class=\"uni-list-cell\">\n <view class=\"uni-pd\">\n <view class=\"uni-label\" style=\"width:180px;\">是å¦å…è®¸é€šçŸ¥å¸¦æœ‰æ ‡è®°</view>\n </view>\n <view class=\"uni-list-cell-db\">\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"notificationBadgeAuthorized\" />\n </view>\n </view>\n <view class=\"uni-list-cell\">\n <view class=\"uni-pd\">\n <view class=\"uni-label\" style=\"width:180px;\">是å¦å…许通知带有声音</view>\n </view>\n <view class=\"uni-list-cell-db\">\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"notificationSoundAuthorized\" />\n </view>\n </view>\n<!-- #endif -->\r\n </view>\r\n <view class=\"uni-padding-wrap\">\r\n <view class=\"uni-btn-v\">\r\n <button type=\"primary\" @tap=\"getAppAuthorizeSetting\">获å–App授æƒè®¾ç½®</button>\r\n </view>\r\n </view>\r\n </view>\r\n</template>\r\n<script>\r\n export default {\r\n data() {\r\n return {\r\n title: 'getAppAuthorizeSetting',\r\n cameraAuthorized: \"\",\n albumAuthorized: \"\",\r\n locationAuthorized: \"\",\r\n locationAccuracy: \"\",\r\n microphoneAuthorized: \"\",\n bluetoothAuthorized: \"\",\r\n notificationAuthorized: \"\",\n notificationAlertAuthorized: \"\",\n notificationBadgeAuthorized: \"\",\n notificationSoundAuthorized: \"\"\r\n }\r\n },\r\n onUnload: function () {\r\n },\r\n methods: {\r\n getAppAuthorizeSetting: function () {\r\n const res = uni.getAppAuthorizeSetting();\r\n this.cameraAuthorized = res.cameraAuthorized;\r\n this.locationAuthorized = res.locationAuthorized;\r\n this.locationAccuracy = res.locationAccuracy ?? \"unsupported\";\r\n this.microphoneAuthorized = res.microphoneAuthorized;\r\n this.notificationAuthorized = res.notificationAuthorized;\n // #ifdef APP-IOS\n this.notificationAlertAuthorized = res.notificationAlertAuthorized;\n this.notificationBadgeAuthorized = res.notificationBadgeAuthorized;\n this.notificationSoundAuthorized = res.notificationSoundAuthorized;\n this.bluetoothAuthorized = res.bluetoothAuthorized;\n this.albumAuthorized = res.albumAuthorized;\n // #endif\n\r\n }\r\n }\r\n }\r\n</script>\r\n\r\n<style>\r\n .uni-pd {\r\n padding-left: 15px;\r\n }\r\n</style>\n\n```"},"getSystemSetting":{"name":"## uni.getSystemSetting() @getsystemsetting","description":"获å–系统设置","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| **GetSystemSettingResult** |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| bluetoothEnabled | boolean | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | è“牙是å¦å¼€å¯<br/> |\n@| bluetoothError | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | è“牙的报错信æ¯<br/> |\n@| locationEnabled | boolean | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | ä½ç½®æ˜¯å¦å¼€å¯<br/> |\n@| wifiEnabled | boolean | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | wifi是å¦å¼€å¯<br/> |\n@| wifiError | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"x\"]]}' /> | wifi的报错信æ¯<br/> |\n@| deviceOrientation | \"portrait\" \\| \"landscape\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 设备方å‘<br/> | \n","compatibility":"### getSystemSetting 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/getsystemsetting.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-system-setting)\n"},"get-system-setting":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-system-setting/get-system-setting.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\r\n <page-head :title=\"title\"></page-head>\r\n <view class=\"uni-common-mt\">\r\n <view class=\"uni-list\">\r\n <view class=\"uni-list-cell\">\r\n <view class=\"uni-pd\">\r\n <view class=\"uni-label\" style=\"width:180px;\">è“牙的系统开关</view>\r\n </view>\r\n <view class=\"uni-list-cell-db\">\r\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"bluetoothEnabled\" />\r\n </view>\r\n </view>\r\n <view class=\"uni-list-cell\">\r\n <view class=\"uni-pd\">\r\n <view class=\"uni-label\" style=\"width:180px;\">地ç†ä½ç½®çš„系统开关</view>\r\n </view>\r\n <view class=\"uni-list-cell-db\">\r\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"locationEnabled\" />\r\n </view>\r\n </view>\r\n <view class=\"uni-list-cell\">\r\n <view class=\"uni-pd\">\r\n <view class=\"uni-label\" style=\"width:180px;\">Wi-Fi 的系统开关</view>\r\n </view>\r\n <view class=\"uni-list-cell-db\">\r\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"wifiEnabled\" />\r\n </view>\r\n </view>\r\n <view class=\"uni-list-cell\">\r\n <view class=\"uni-pd\">\r\n <view class=\"uni-label\" style=\"width:180px;\">设备方å‘</view>\r\n </view>\r\n <view class=\"uni-list-cell-db\">\r\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"deviceOrientation\" />\r\n </view>\r\n </view>\r\n </view>\r\n <view class=\"uni-padding-wrap\">\r\n <view class=\"uni-btn-v\">\r\n <button type=\"primary\" @tap=\"getSystemSetting\">获å–系统设置</button>\r\n </view>\r\n </view>\r\n </view>\r\n</template>\n\r\n<script>\r\n export default {\r\n data() {\r\n return {\r\n title: 'getSystemSetting',\r\n bluetoothEnabled: \"\",\r\n locationEnabled: \"\",\r\n wifiEnabled: \"\",\r\n deviceOrientation: \"\"\r\n }\r\n },\r\n onUnload: function () {\r\n },\r\n methods: {\r\n getSystemSetting: function () {\r\n const res = uni.getSystemSetting();\r\n this.bluetoothEnabled = (res.bluetoothEnabled ?? false) ? \"å¼€å¯\" : \"å…³é—\";\r\n this.locationEnabled = res.locationEnabled ? \"å¼€å¯\" : \"å…³é—\";\r\n this.wifiEnabled = (res.wifiEnabled ?? false) ? \"å¼€å¯\" : \"å…³é—\";\r\n this.deviceOrientation = res.deviceOrientation\n\n if(res.bluetoothError != null){\n this.bluetoothEnabled = \"æ— è“牙æƒé™\"\n }\n\n if(res.wifiError != null){\n this.wifiEnabled = \"æ— WiFiæƒé™\"\n }\n }\r\n }\r\n }\r\n</script>\r\n\r\n<style>\r\n .uni-pd {\r\n padding-left: 15px;\r\n }\r\n</style>\n\n```"},"installApk":{"name":"## uni.installApk(options) @installapk","description":"安装apk","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [InstallApkOptions](#installapkoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | string | 是 | - | - | apkæ–‡ä»¶åœ°å€ |\n@| success | (res: [InstallApkSuccess](#installapksuccess-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (err: [InstallApkFail](#installapkfail-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### InstallApkSuccess 的属性值 @installapksuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | 安装æˆåŠŸæ¶ˆæ¯ |\n\n##### InstallApkFail 的属性值 @installapkfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | 错误ç <br/>- 1300002 找ä¸åˆ°æ–‡ä»¶ |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### installApk 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.94 | x |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.install-apk)\n"},"install-apk":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/install-apk/install-apk.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\r\n <!-- #ifdef APP -->\r\n <scroll-view style=\"flex: 1\">\r\n <!-- #endif -->\r\n <view>\r\n <page-head :title=\"title\"></page-head>\r\n <view class=\"uni-common-mt\">\r\n <view class=\"uni-padding-wrap\">\r\n <view class=\"uni-btn-v\">\r\n <button type=\"primary\" @tap=\"installApk\">\r\n installApk\r\n </button>\r\n </view>\r\n </view>\r\n </view>\r\n </view>\r\n <!-- #ifdef APP -->\r\n </scroll-view>\r\n <!-- #endif -->\r\n</template>\r\n<script>\r\n export default {\r\n data() {\r\n return {\r\n title: 'installApk'\r\n }\r\n },\r\n onUnload: function () {\r\n },\r\n methods: {\r\n installApk: function () {\r\n uni.installApk({\r\n filePath: \"/static/test-apk/test.apk\",\r\n complete(res : any) {\n console.log(res);\r\n }\r\n })\r\n },\r\n }\r\n }\r\n</script>\r\n<style>\r\n</style>\n\n```"},"getPushClientId":{"name":"## uni.getPushClientId(options) @getpushclientid","description":"获å–客户端唯一的推é€æ ‡è¯†","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [GetPushClientIdOptions](#getpushclientidoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (result: [GetPushClientIdSuccess](#getpushclientidsuccess-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### GetPushClientIdSuccess 的属性值 @getpushclientidsuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| cid | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"4.18\"]]}' /> | 个推客户端推é€id,对应uni-id-device表的push_clientid<br/> |\n| errMsg | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"4.18\"]]}' /> | 错误æè¿°<br/> |\n","returnValue":"","compatibility":"### getPushClientId 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.98 | 4.18 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/plugins/push.html#getpushclientid)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.push.uni-push.getPushClientId)\n"},"onPushMessage":{"name":"## uni.onPushMessage(callback) @onpushmessage","description":"å¯åŠ¨ç›‘å¬æŽ¨é€æ¶ˆæ¯äº‹ä»¶","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [OnPushMessageCallbackResult](#onpushmessagecallbackresult-values)) => void | 是 | - | - | | \n\n#### OnPushMessageCallbackResult 的属性值 @onpushmessagecallbackresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| type | \"click\" \\| \"receive\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"4.18\"]]}' /> | 事件类型<br/>- click 从系统推é€æœåŠ¡ç‚¹å‡»æ¶ˆæ¯å¯åŠ¨åº”用事件<br/>- receive 应用从推é€æœåŠ¡å™¨æŽ¥æ”¶åˆ°æŽ¨é€æ¶ˆæ¯äº‹ä»¶ |\n| data | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"4.18\"]]}' /> | 消æ¯å†…容<br/> |\n","returnValue":"","compatibility":"### onPushMessage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.98 | 4.18 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/plugins/push.html#onpushmessage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.push.uni-push.onPushMessage)\n"},"offPushMessage":{"name":"## uni.offPushMessage(callback) @offpushmessage","description":"å…³é—推é€æ¶ˆæ¯ç›‘å¬äº‹ä»¶ï¼ŒiOS端调用会关é—所有监å¬ã€‚","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [OnPushMessageCallbackResult](#onpushmessagecallbackresult-values)) => void | 是 | - | - | | \n\n#### OnPushMessageCallbackResult 的属性值 @onpushmessagecallbackresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| type | \"click\" \\| \"receive\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"4.18\"]]}' /> | 事件类型<br/>- click 从系统推é€æœåŠ¡ç‚¹å‡»æ¶ˆæ¯å¯åŠ¨åº”用事件<br/>- receive 应用从推é€æœåŠ¡å™¨æŽ¥æ”¶åˆ°æŽ¨é€æ¶ˆæ¯äº‹ä»¶ |\n| data | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"4.18\"]]}' /> | 消æ¯å†…容<br/> |\n","returnValue":"","compatibility":"### offPushMessage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.98 | 4.18 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/plugins/push.html#offpushmessage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.push.uni-push.offPushMessage)\n"},"getChannelManager":{"name":"## uni.getChannelManager() @getchannelmanager","description":"获å–é€šçŸ¥æ¸ é“管ç†å™¨ï¼ŒAndroid 8系统以上æ‰å¯ä»¥è®¾ç½®é€šçŸ¥æ¸ é“,Android 8系统以下返回null。","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [ChannelManager](#channelmanager-values) |\n\n#### ChannelManager 的方法 @channelmanager-values \n\n#### setPushChannel(options) @setpushchannel\n设置推é€æ¸ é“<br/>\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **SetPushChannelOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| soundName | string \\| null | å¦ | null | - | æ·»åŠ çš„å£°éŸ³æ–‡ä»¶ï¼Œæ³¨æ„raw目录下必须è¦æœ‰ ,ä¸ä¼ æ¤å—段将使用默认铃音。 |\n@| channelId | string | 是 | - | - | é€šçŸ¥æ¸ é“id |\n@| channelDesc | string | 是 | - | - | é€šçŸ¥æ¸ é“æè¿° |\n@| enableLights | boolean \\| null | å¦ | false | - | 呼å¸ç¯é—ªçƒ |\n@| enableVibration | boolean \\| null | å¦ | false | - | 震动 |\n@| importance | number \\| null | å¦ | 3 | - | 通知的é‡è¦æ€§çº§åˆ«ï¼Œå¯é€‰èŒƒå›´IMPORTANCE_LOW:2ã€IMPORTANCE_DEFAULT:3ã€IMPORTANCE_HIGH:4 。 |\n@| lockscreenVisibility | number \\| null | å¦ | -1000 | - | é”å±å¯è§æ€§ï¼Œå¯é€‰èŒƒå›´VISIBILITY_PRIVATE:0ã€VISIBILITY_PUBLIC:1ã€VISIBILITY_SECRET:-1ã€VISIBILITY_NO_OVERRIDE:-1000。 | \n\n\n##### setPushChannel 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.98 | x |\n\n\n#### getAllChannels() @getallchannels\n获å–当å‰åº”ç”¨æ³¨å†Œçš„æ‰€æœ‰çš„é€šçŸ¥æ¸ é“。<br/>\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| Array\\<string\\> |\n \n\n##### getAllChannels 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.98 | x |\n\n \n","compatibility":"### getChannelManager 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.98 | x |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.push.uni-push.getChannelManager)\n"},"createPushMessage":{"name":"## uni.createPushMessage(options) @createpushmessage","description":"创建本地通知æ 消æ¯","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **CreatePushMessageOptions** | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| cover | boolean \\| null | å¦ | false | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"4.18\"]]}' /> | 是å¦è¦†ç›–上一次æç¤ºçš„æ¶ˆæ¯ |\n@| delay | number \\| null | å¦ | 0 | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"4.18\"]]}' /> | æ示消æ¯å»¶è¿Ÿæ˜¾ç¤ºçš„时间,å•ä½ä¸ºs |\n@| icon | string \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"x\"]]}' /> | 推é€æ¶ˆæ¯çš„å›¾æ ‡ |\n@| sound | string \\| null | å¦ | \"system\" | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"4.18\"]]}' /> | 推é€æ¶ˆæ¯çš„æ示音<br/>- system: 使用系统通知æ示音(默认值)<br/>- none: ä¸ä½¿ç”¨æ示音 |\n@| title | string \\| null | å¦ | Appçš„å称 | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"4.18\"]]}' /> | 推é€æ¶ˆæ¯çš„æ ‡é¢˜ |\n@| content | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"4.18\"]]}' /> | 消æ¯æ˜¾ç¤ºçš„内容,在系统通知ä¸å¿ƒä¸æ˜¾ç¤ºçš„文本内容<br/> |\n@| payload | any \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"4.18\"]]}' /> | 消æ¯æ‰¿è½½çš„æ•°æ®ï¼Œå¯æ ¹æ®ä¸šåŠ¡é€»è¾‘自定义数æ®æ ¼å¼ |\n@| when | number \\| null | å¦ | 当å‰æ—¶é—´ | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"x\"]]}' /> | 消æ¯ä¸Šæ˜¾ç¤ºçš„æ示时间 |\n@| channelId | string \\| null | å¦ | \"DcloudChannelID\" | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"x\"]]}' /> | æ¸ é“id |\n@| category | string \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"x\"]]}' /> | 通知类别 |\n@| success | (result: CreatePushMessageSuccess) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n","returnValue":"","compatibility":"### createPushMessage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.98 | 4.18 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/plugins/push.html#createpushmessage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.push.uni-push.createPushMessage)\n"},"getBatteryInfo":{"name":"## uni.getBatteryInfo(options) @getbatteryinfo","description":"获å–ç”µæ± ç”µé‡ä¿¡æ¯<br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-getbatteryinfo](https://ext.dcloud.net.cn/plugin?name=uni-getbatteryinfo)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [GetBatteryInfoOptions](#getbatteryinfooptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (res: [GetBatteryInfoSuccess](#getbatteryinfosuccess-values)) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ |\n@| fail | (res: UniError) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调 | \n\n##### GetBatteryInfoSuccess 的属性值 @getbatteryinfosuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n| level | number | 是 | - | - | 设备电é‡ï¼ŒèŒƒå›´1 - 100 |\n| isCharging | boolean | 是 | - | - | 是å¦æ£åœ¨å……ç”µä¸ |\n","returnValue":"","compatibility":"### getBatteryInfo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-battery-info.getBatteryInfo)\n"},"getBatteryInfoSync":{"name":"## uni.getBatteryInfoSync() @getbatteryinfosync","description":"获å–ç”µæ± ç”µé‡ä¿¡æ¯<br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-getbatteryinfo](https://ext.dcloud.net.cn/plugin?name=uni-getbatteryinfo)<br/>","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| **GetBatteryInfoResult** |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| level | number | 是 | - | - | 设备电é‡ï¼ŒèŒƒå›´1 - 100 |\n@| isCharging | boolean | 是 | - | - | 是å¦æ£åœ¨å……ç”µä¸ | \n","compatibility":"### getBatteryInfoSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-battery-info.getBatteryInfoSync)\n"},"get-battery-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-battery-info/get-battery-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-battery-info/get-battery-info\n>Template\n```vue\n<template>\n <view>\n <text>当å‰ç”µé‡ï¼š{{level}}%</text>\n <text>是å¦å……电ä¸ï¼š{{isCharging}}</text>\n </view>\n</template>\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n level: 0,\n isCharging: false\n }\n },\n onLoad() {\n try {\n uni.getBatteryInfo({\n success: res => {\n this.level = res.level;\n this.isCharging = res.isCharging;\n }\n });\n } catch (e) {\n console.error((e as Error).message);\n uni.showModal({\n content: (e as Error).message,\n showCancel: false\n });\n }\n }\n }\n\n```\n:::"},"startWifi":{"name":"## uni.startWifi(option) @startwifi","description":"åˆå§‹åŒ–Wi-Fi模å—<br/><br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| option | [WifiOption](#wifioption-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (res: [UniWifiResult](#uniwifiresult-values)) => void | å¦ | - | - | - |\n@| fail | (res: UniError) => void | å¦ | - | - | - |\n@| complete | (res: any) => void | å¦ | - | - | - | \n\n##### UniWifiResult 的属性值 @uniwifiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | - |\n| errMsg | string | 是 | - | - | - |\n| wifi | **UniWifiInfo** \\| null | å¦ | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| SSID | string | 是 | - | - | - |\n@| BSSID | string | å¦ | - | - | - |\n@| secure | boolean | å¦ | - | - | - |\n@| signalStrength | number | å¦ | - | - | - |\n@| frequency | number | å¦ | - | - | - |\n","returnValue":"","compatibility":"### startWifi 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/wifi.html#startwifi)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.startWifi)\n"},"stopWifi":{"name":"## uni.stopWifi(option) @stopwifi","description":"å…³é— Wi-Fi 模å—<br/><br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| option | [WifiOption](#wifioption-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (res: [UniWifiResult](#uniwifiresult-values)) => void | å¦ | - | - | - |\n@| fail | (res: UniError) => void | å¦ | - | - | - |\n@| complete | (res: any) => void | å¦ | - | - | - | \n\n##### UniWifiResult 的属性值 @uniwifiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | - |\n| errMsg | string | 是 | - | - | - |\n| wifi | **UniWifiInfo** \\| null | å¦ | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| SSID | string | 是 | - | - | - |\n@| BSSID | string | å¦ | - | - | - |\n@| secure | boolean | å¦ | - | - | - |\n@| signalStrength | number | å¦ | - | - | - |\n@| frequency | number | å¦ | - | - | - |\n","returnValue":"","compatibility":"### stopWifi 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | x | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/wifi.html#stopwifi)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.stopWifi)\n"},"connectWifi":{"name":"## uni.connectWifi(option) @connectwifi","description":"","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| option | [WifiConnectOption](#wificonnectoption-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| SSID | string | å¦ | - | - | - |\n@| BSSID | string | å¦ | - | - | - |\n@| password | string | å¦ | - | - | - |\n@| maunal | boolean | å¦ | - | - | - |\n@| partialInfo | boolean | å¦ | - | - | - |\n@| success | (res: [UniWifiResult](#uniwifiresult-values)) => void | å¦ | - | - | - |\n@| fail | (res: UniError) => void | å¦ | - | - | - |\n@| complete | (res: any) => void | å¦ | - | - | - | \n\n##### UniWifiResult 的属性值 @uniwifiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | - |\n| errMsg | string | 是 | - | - | - |\n| wifi | **UniWifiInfo** \\| null | å¦ | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| SSID | string | 是 | - | - | - |\n@| BSSID | string | å¦ | - | - | - |\n@| secure | boolean | å¦ | - | - | - |\n@| signalStrength | number | å¦ | - | - | - |\n@| frequency | number | å¦ | - | - | - |\n","returnValue":"","compatibility":"### connectWifi 兼容性 \n| Web | Android 系统版本 | Android | iOS |\n| :- | :- | :- | :- |\n| - | >=4.4 && <10.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/wifi.html#connectWifi)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.connectWifi)\n"},"getWifiList":{"name":"## uni.getWifiList(option) @getwifilist","description":"è¯·æ±‚èŽ·å– Wi-Fi 列表。wifiList æ•°æ®ä¼šåœ¨ onGetWifiList 注册的回调ä¸è¿”回。<br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| option | [WifiOption](#wifioption-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (res: [UniWifiResult](#uniwifiresult-values)) => void | å¦ | - | - | - |\n@| fail | (res: UniError) => void | å¦ | - | - | - |\n@| complete | (res: any) => void | å¦ | - | - | - | \n\n##### UniWifiResult 的属性值 @uniwifiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | - |\n| errMsg | string | 是 | - | - | - |\n| wifi | **UniWifiInfo** \\| null | å¦ | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| SSID | string | 是 | - | - | - |\n@| BSSID | string | å¦ | - | - | - |\n@| secure | boolean | å¦ | - | - | - |\n@| signalStrength | number | å¦ | - | - | - |\n@| frequency | number | å¦ | - | - | - |\n","returnValue":"","compatibility":"### getWifiList 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/wifi.html#getWifiList)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.getWifiList)\n"},"onGetWifiList":{"name":"## uni.onGetWifiList(callback) @ongetwifilist","description":"监å¬èŽ·å–到 Wi-Fi 列表数æ®äº‹ä»¶ã€‚<br/><br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (wifiInfo: any) => void | 是 | - | - | | \n","returnValue":"","compatibility":"### onGetWifiList 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/wifi.html#onGetWifiList)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.onGetWifiList)\n"},"offGetWifiList":{"name":"## uni.offGetWifiList(callback) @offgetwifilist","description":"移除获å–到 Wi-Fi 列表数æ®äº‹ä»¶çš„监å¬å‡½æ•°ã€‚<br/><br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | () => void | 是 | - | - | | \n","returnValue":"","compatibility":"### offGetWifiList 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/wifi.html#offGetWifiList)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.offGetWifiList)\n"},"getConnectedWifi":{"name":"## uni.getConnectedWifi(option) @getconnectedwifi","description":"获å–已连接的 Wi-Fi ä¿¡æ¯<br/><br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| option | [GetConnectedWifiOptions](#getconnectedwifioptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| partialInfo | boolean | å¦ | - | - | - |\n@| success | (res: [UniWifiResult](#uniwifiresult-values)) => void | å¦ | - | - | - |\n@| fail | (res: UniError) => void | å¦ | - | - | - |\n@| complete | (res: any) => void | å¦ | - | - | - | \n\n##### UniWifiResult 的属性值 @uniwifiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | - |\n| errMsg | string | 是 | - | - | - |\n| wifi | **UniWifiInfo** \\| null | å¦ | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| SSID | string | 是 | - | - | - |\n@| BSSID | string | å¦ | - | - | - |\n@| secure | boolean | å¦ | - | - | - |\n@| signalStrength | number | å¦ | - | - | - |\n@| frequency | number | å¦ | - | - | - |\n","returnValue":"","compatibility":"### getConnectedWifi 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/wifi.html#getConnectedWifi)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.getConnectedWifi)\n"},"onWifiConnected":{"name":"## uni.onWifiConnected(callback) @onwificonnected","description":"监å¬è¿žæŽ¥ä¸Š Wi-Fi 的事件<br/><br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (wifiInfo: [UniWifiResult](#uniwifiresult-values)) => void | 是 | - | - | | \n\n#### UniWifiResult 的属性值 @uniwifiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | - |\n| errMsg | string | 是 | - | - | - |\n| wifi | **UniWifiInfo** \\| null | å¦ | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| SSID | string | 是 | - | - | - |\n@| BSSID | string | å¦ | - | - | - |\n@| secure | boolean | å¦ | - | - | - |\n@| signalStrength | number | å¦ | - | - | - |\n@| frequency | number | å¦ | - | - | - |\n","returnValue":"","compatibility":"### onWifiConnected 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/wifi.html#onWifiConnected)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.onWifiConnected)\n"},"onWifiConnectedWithPartialInfo":{"name":"## uni.onWifiConnectedWithPartialInfo(callback) @onwificonnectedwithpartialinfo","description":"监å¬è¿žæŽ¥ä¸Š Wi-Fi 的事件。<br/><br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (wifiInfo: [UniWifiInfoWithPartialInfo](#uniwifiinfowithpartialinfo-values)) => void | 是 | - | - | | \n\n#### UniWifiInfoWithPartialInfo 的属性值 @uniwifiinfowithpartialinfo-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| SSID | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### onWifiConnectedWithPartialInfo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/wifi.html#onWifiConnectedWithPartialInfo)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.onWifiConnectedWithPartialInfo)\n"},"offWifiConnected":{"name":"## uni.offWifiConnected(callback?) @offwificonnected","description":"移除连接上 Wi-Fi 的事件的监å¬å‡½æ•°ã€‚<br/><br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | () => void \\| null | å¦ | - | - | | \n","returnValue":"","compatibility":"### offWifiConnected 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/wifi.html#offWifiConnected)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.offWifiConnected)\n"},"onMemoryWarning":{"name":"## uni.onMemoryWarning(callback) @onmemorywarning","description":"å¼€å¯ç›‘å¬å†…å˜è¦å‘Š<br/><br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-memorywarning](https://ext.dcloud.net.cn/plugin?name=uni-memorywarning)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (res: [MemoryWarningCallbackResult](#memorywarningcallbackresult-values)) => void | 是 | - | - | | \n\n#### MemoryWarningCallbackResult 的属性值 @memorywarningcallbackresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| level | number | 是 | - | - | 内å˜è¦å‘Šç‰çº§(仅安å“å¹³å°æœ‰æ•ˆï¼ŒiOS始终是0) |\n","returnValue":"","compatibility":"### onMemoryWarning 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/memory.html#onmemorywarning)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.memory.onMemoryWarning)\n"},"offMemoryWarning":{"name":"## uni.offMemoryWarning(callback?) @offmemorywarning","description":"å–消监å¬å†…å˜ä¸è¶³å‘Šè¦äº‹ä»¶<br/><br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-memorywarning](https://ext.dcloud.net.cn/plugin?name=uni-memorywarning)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (res: [MemoryWarningCallbackResult](#memorywarningcallbackresult-values)) => void \\| null | å¦ | - | - | | \n\n#### MemoryWarningCallbackResult 的属性值 @memorywarningcallbackresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| level | number | 是 | - | - | 内å˜è¦å‘Šç‰çº§(仅安å“å¹³å°æœ‰æ•ˆï¼ŒiOS始终是0) |\n","returnValue":"","compatibility":"### offMemoryWarning 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/memory.html#offmemorywarning)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.memory.offMemoryWarning)\n"},"onUserCaptureScreen":{"name":"## uni.onUserCaptureScreen(callback?) @onusercapturescreen","description":"å¼€å¯æˆªå±ç›‘å¬<br/><br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-usercapturescreen](https://ext.dcloud.net.cn/plugin?name=uni-usercapturescreen)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (res: [OnUserCaptureScreenCallbackResult](#onusercapturescreencallbackresult-values)) => void \\| null | å¦ | - | - | | \n\n#### OnUserCaptureScreenCallbackResult 的属性值 @onusercapturescreencallbackresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| path | string | å¦ | - | - | 截å±æ–‡ä»¶è·¯å¾„(仅Android返回) |\n","returnValue":"","compatibility":"### onUserCaptureScreen 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/capture-screen.html#onusercapturescreen)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.captureScreen.onUserCaptureScreen)\n"},"offUserCaptureScreen":{"name":"## uni.offUserCaptureScreen(callback?) @offusercapturescreen","description":"å…³é—截å±ç›‘å¬<br/><br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-usercapturescreen](https://ext.dcloud.net.cn/plugin?name=uni-usercapturescreen)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (res: [OnUserCaptureScreenCallbackResult](#onusercapturescreencallbackresult-values)) => void \\| null | å¦ | - | - | | \n\n#### OnUserCaptureScreenCallbackResult 的属性值 @onusercapturescreencallbackresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| path | string | å¦ | - | - | 截å±æ–‡ä»¶è·¯å¾„(仅Android返回) |\n","returnValue":"","compatibility":"### offUserCaptureScreen 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/capture-screen.html#offusercapturescreen)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.captureScreen.offUserCaptureScreen)\n"},"createRequestPermissionListener":{"name":"## uni.createRequestPermissionListener() @createrequestpermissionlistener","description":"创建一个监å¬æƒé™ç”³è¯·çš„对象。","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [RequestPermissionListener](#requestpermissionlistener-values) |\n\n#### RequestPermissionListener 的方法 @requestpermissionlistener-values \n\n#### onRequest(callback) @onrequest\n监å¬ç”³è¯·ç³»ç»Ÿæƒé™\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (permissions: Array\\<string\\>) => void | 是 | - | - | 申请系统æƒé™å›žè°ƒï¼Œpermissions为触å‘æƒé™ç”³è¯·çš„所有æƒé™ | \n\n\n##### onRequest 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### onConfirm(callback) @onconfirm\n监å¬å¼¹å‡ºç³»ç»Ÿæƒé™æŽˆæƒæ¡†\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (permissions: Array\\<string\\>) => void | 是 | - | - | 弹出系统æƒé™æŽˆæƒæ¡†å›žè°ƒï¼Œpermissions为触å‘弹出æƒé™æŽˆæƒæ¡†çš„所有æƒé™ | \n\n\n##### onConfirm 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### onComplete(callback) @oncomplete\n监å¬æƒé™ç”³è¯·å®Œæˆ\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (permissions: Array\\<string\\>) => void | 是 | - | - | æƒé™ç”³è¯·å®Œæˆå›žè°ƒï¼Œpermissions为申请完æˆçš„所有æƒé™ | \n\n\n##### onComplete 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### stop() @stop\nå–消所有监å¬\n\n\n##### stop 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n \n","compatibility":"### createRequestPermissionListener 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 4.0 | - |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.createRequestPermissionListener)\n","example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/create-request-permission-listener/create-request-permission-listener.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\n <!-- #ifdef APP -->\n <scroll-view style=\"flex:1\">\n <!-- #endif -->\n <page-head title=\"æƒé™ç”³è¯·ç›‘å¬\"></page-head>\n <view class=\"permission-alert\" id=\"permission-alert\" :style=\"{'transform':isPermissionAlertShow ? 'translateY(0)':'translateY(-110px)'}\">\n <text style=\"font-size: 20px;margin-bottom: 10px;margin-top: 5px;\">访问日历æƒé™ç”³è¯·è¯´æ˜Žï¼š</text>\n <text style=\"color: darkgray;\">uni-app xæ£åœ¨ç”³è¯·è®¿é—®æ—¥åŽ†æƒé™ç”¨äºŽæ¼”示,å…许或拒ç»å‡ä¸ä¼šèŽ·å–任何éšç§ä¿¡æ¯ã€‚</text>\n </view>\n <button type=\"primary\" style=\"margin: 10px;\" @click=\"requestPermission\">点击申请日历æƒé™</button>\n\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n<script>\n export default {\n data() {\n return {\n isPermissionAlertShow: false,\n permissionAlert: null as UniElement | null,\n timeoutId: -1,\n permissionListener: null as RequestPermissionListener | null\n }\n },\n\n onReady() {\n this.watchPermissionRRequest()\n },\n onUnload() {\n this.permissionListener?.stop()\n this.permissionListener = null\n clearTimeout(this.timeoutId)\n },\n methods: {\n watchPermissionRRequest() {\n this.permissionListener = uni.createRequestPermissionListener()\n this.permissionListener!.onConfirm((_) => {\n // TODO ç›®å‰onConfirm监å¬å®žçŽ°çš„在时间上ä¸å¤Ÿç²¾ç¡®ï¼Œæš‚时需è¦å»¶è¿Ÿå¼¹æ¡†ï¼ŒåŽç»ä¿®å¤\n // TODO 这里的弹框仅为演示,实际开å‘ä¸ç›‘å¬æƒé™ç”³è¯·çš„代ç 应该在app.uvueä¸ï¼Œå¼¹æ¡†åº”全局处ç†ï¼Œå¯å‚考https://gitcode.net/dcloud/uni-api/-/tree/master/uni_modules/uni-prompt/utssdk/app-android 代ç 自行å°è£…一个uts的全局弹框\n this.timeoutId = setTimeout(() => {\n this.isPermissionAlertShow = true\n }, 100)\n })\n this.permissionListener!.onComplete((_) => {\n clearTimeout(this.timeoutId)\n this.isPermissionAlertShow = false\n })\n },\n requestPermission() {\n // #ifdef APP-ANDROID\n if (UTSAndroid.checkSystemPermissionGranted(UTSAndroid.getUniActivity()!, [\"android.permission.READ_CALENDAR\"])) {\n uni.showToast({\n title: \"æƒé™å·²ç»åŒæ„了,ä¸éœ€è¦å†ç”³è¯·\",\n position: \"bottom\"\n })\n return\n }\n UTSAndroid.requestSystemPermission(UTSAndroid.getUniActivity()!, [\"android.permission.READ_CALENDAR\"], (_ : boolean, p : string[]) => {\n console.log(p)\n }, (_ : boolean, p : string[]) => {\n uni.showToast({\n title: \"æƒé™è¢«æ‹’ç»äº†\",\n position: \"bottom\"\n })\n console.log(p)\n })\n // #endif\n }\n }\n }\n</script>\n\n<style>\n .permission-alert {\n width: 90%;\n height: 100px;\n margin: 10px 5%;\n position: absolute;\n top: 0px;\n z-index: 3;\n border-radius: 5px;\n transition-property: transform;\n transition-duration: 200ms;\n background-color: white;\n padding: 10px;\n }\n</style>\n\n```"},"chooseImage":{"name":"## uni.chooseImage(options) @chooseimage","description":"从本地相册选择图片或使用相机æ‹ç…§","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ChooseImageOptions](#chooseimageoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| count | number \\| null | å¦ | 9 | - | 最多å¯ä»¥é€‰æ‹©çš„å›¾ç‰‡å¼ æ•°ï¼Œapp端ä¸é™åˆ¶ï¼Œå¾®ä¿¡å°ç¨‹åºæœ€å¤šå¯æ”¯æŒ20个。 |\n@| sourceType | Array\\<string\\> \\| null | å¦ | ['album','camera'\\] | - | album 从相册选图,camera 使用相机,默认二者都有 |\n@| success | (callback: [ChooseImageSuccess](#chooseimagesuccess-values)) => void \\| null | å¦ | - | - | æˆåŠŸåˆ™è¿”回图片的本地文件路径列表 tempFilePaths |\n@| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (callback: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### ChooseImageSuccess 的属性值 @chooseimagesuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errSubject | string | 是 | - | - | 调用APIçš„å称 |\n| errMsg | string | 是 | - | - | æè¿°ä¿¡æ¯ |\n| tempFilePaths | Array\\<string\\> | 是 | - | - | 图片的本地文件路径列表 |\n| tempFiles | any | 是 | - | - | 图片的本地文件列表 |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | - | 错误ç <br/>- 1101001 用户å–消<br/>- 1101002 urls至少包å«ä¸€å¼ 图片地å€<br/>- 1101003 文件ä¸å˜åœ¨<br/>- 1101004 å›¾ç‰‡åŠ è½½å¤±è´¥<br/>- 1101005 未获å–æƒé™<br/>- 1101006 图片或视频ä¿å˜å¤±è´¥<br/>- 1101007 图片è£å‰ªå¤±è´¥<br/>- 1101008 æ‹ç…§æˆ–录åƒå¤±è´¥<br/>- 1101009 图片压缩失败<br/>- 1101010 其他错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### chooseImage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/media/image?id=chooseimage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.choose-image)\n"},"choose-image":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/choose-image/choose-image.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/choose-image/choose-image\n>Template\n```vue\n<template>\n <!-- #ifdef APP -->\n <scroll-view class=\"page-scroll-view\">\n <!-- #endif -->\n <view>\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-common-mt\">\n <view class=\"uni-list\">\n <view class=\"uni-list-cell cell-pd\">\n <view class=\"uni-list-cell-left uni-label\">\n 图片æ¥æº\n </view>\n <view class=\"uni-list-cell-right\" @click=\"chooseImageSource\">\n <text class=\"click-t\">{{sourceType[sourceTypeIndex]}}</text>\n </view>\n </view>\n\n <view class=\"uni-list-cell cell-pd\">\n <view class=\"uni-list-cell-left uni-label\">\n 图片质é‡\n </view>\n <view class=\"uni-list-cell-right\" @click=\"chooseImageType\">\n <text class=\"click-t\">{{sizeType[sizeTypeIndex]}}</text>\n </view>\n </view>\n\n <view class=\"uni-list-cell cell-pd\">\n <view class=\"uni-list-cell-left uni-label\">\n æ•°é‡é™åˆ¶\n </view>\n <view class=\"uni-list-cell-right\">\n <input class=\"click-t\" :value=\"countIndex+1\" type=\"number\" :maxlength=\"1\" @confirm=\"chooseImageCount\" confirm-type=\"done\" />\n </view>\n </view>\n <view class=\"uni-list-cell cell-pd\">\n <view class=\"uni-list-cell-left uni-label\">\n 图åƒè£å‰ª\n </view>\n <view class=\"uni-list-cell-right\">\n <switch :checked=\"isCrop\" @change=\"switchCrop\"></switch>\n </view>\n </view>\n <view ref=\"cropOptionNode\" class=\"crop-option\" :style=\"{'height':isCrop?'200px':'0px','margin-bottom':isCrop?'11px':'0px'}\">\n <view class=\"uni-list-cell cell-pd\">\n <view class=\"uni-list-cell-left item_width\">\n 图片质é‡(%)\n </view>\n <view class=\"uni-list-cell-right\">\n <input :value=\"cropPercent\" @confirm=\"cropPercentConfim\" type=\"number\" maxlength=\"-1\"/>\n </view>\n </view>\n <view class=\"uni-list-cell cell-pd\">\n <view class=\"uni-list-cell-left item_width\">\n è£å‰ªå®½åº¦(px)\n </view>\n <view class=\"uni-list-cell-right\">\n <input :value=\"cropWidth\" @confirm=\"cropWidthConfim\" type=\"number\" maxlength=\"-1\"/>\n </view>\n </view>\n <view class=\"uni-list-cell cell-pd\">\n <view class=\"uni-list-cell-left item_width\">\n è£å‰ªé«˜åº¦(px)\n </view>\n <view class=\"uni-list-cell-right\">\n <input :value=\"cropHeight\" @confirm=\"cropHeightConfim\" type=\"number\" maxlength=\"-1\"/>\n </view>\n </view>\n <view class=\"uni-list-cell cell-pd\">\n <view class=\"uni-list-cell-left item_width\">\n ä¿ç•™åŽŸå®½é«˜\n </view>\n <view class=\"uni-list-cell-right\">\n <switch :checked=\"cropResize\" @change=\"cropResizeChange\"></switch>\n </view>\n </view>\n </view>\n </view>\n\n <view class=\"uni-list list-pd\" style=\"padding: 15px;\">\n <view class=\"uni-flex\" style=\"margin-bottom: 10px;\">\n <view class=\"uni-list-cell-left\">点击å¯é¢„览选好的图片</view>\n <view style=\"margin-left: auto;\">\n <text class=\"click-t\">{{imageList.length}}/{{countIndex+1}}</text>\n </view>\n </view>\n <view class=\"uni-flex\" style=\"flex-wrap: wrap;\">\n <view v-for=\"(image,index) in imageList\" :key=\"index\" class=\"uni-uploader__input-box\" style=\"border: 0;\">\n <image style=\"width: 104px; height: 104px;\" :src=\"image\" :data-src=\"image\" @tap=\"previewImage(index)\">\n </image>\n <image src=\"/static/plus.png\" class=\"image-remove\" @click=\"removeImage(index)\"></image>\n </view>\n <image class=\"uni-uploader__input-box\" @tap=\"chooseImage\" src=\"/static/plus.png\"></image>\n </view>\n </view>\n </view>\n </view>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n\n\n<style>\n .cell-pd {\n padding: 11px 15px;\n }\n\n .click-t {\n color: darkgray;\n }\n\n .list-pd {\n margin-top: 25px;\n }\n\n .uni-uploader__input-box {\n margin: 5px;\n width: 104px;\n height: 104px;\n border: 1px solid #D9D9D9;\n }\n\n .uni-uploader__input {\n position: absolute;\n z-index: 1;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n }\n\n .image-remove {\n transform: rotate(45deg);\n width: 25px;\n height: 25px;\n position: absolute;\n top: 0;\n right: 0;\n border-radius: 13px;\n background-color: rgba(200, 200, 200, 0.8);\n }\n\n .item_width {\n width: 130px;\n }\n\n .crop-option {\n margin-left: 11px;\n margin-right: 11px;\n border-radius: 11px;\n background-color: #eee;\n transition-property: height, margin-bottom;\n transition-duration: 200ms;\n }\n</style>\n\n```\n>Script\n```uts\n\n var sourceTypeArray = [\n ['camera'],\n ['album'],\n ['camera', 'album']\n ]\n var sizeTypeArray = [\n ['compressed'],\n ['original'],\n ['compressed', 'original']\n ]\n export default {\n data() {\n return {\n title: 'chooseImage',\n imageList: [] as Array<string>,\n sourceTypeIndex: 2,\n sourceType: ['æ‹ç…§', '相册', 'æ‹ç…§æˆ–相册'],\n sizeTypeIndex: 2,\n sizeType: ['压缩', '原图', '压缩或原图'],\n countIndex: 8,\n count: [1, 2, 3, 4, 5, 6, 7, 8, 9],\n isCrop: false,\n cropPercent: 80,\n cropWidth: 100,\n cropHeight: 100,\n cropResize: false\n }\n },\n onUnload() {\n this.imageList = [];\n this.sourceTypeIndex = 2\n this.sourceType = ['æ‹ç…§', '相册', 'æ‹ç…§æˆ–相册']\n this.sizeTypeIndex = 2\n this.sizeType = ['压缩', '原图', '压缩或原图']\n this.countIndex = 8\n },\n methods: {\n cropHeightConfim(e : InputConfirmEvent) {\n let value = parseInt(e.detail.value)\n if (value > 0) {\n this.cropHeight = value\n } else {\n uni.showToast({\n position: \"bottom\",\n title: \"è£å‰ªé«˜åº¦éœ€è¦å¤§äºŽ0\"\n })\n }\n },\n cropWidthConfim(e : InputConfirmEvent) {\n let value = parseInt(e.detail.value)\n if (value > 0) {\n this.cropWidth = value\n } else {\n uni.showToast({\n position: \"bottom\",\n title: \"è£å‰ªå®½åº¦éœ€è¦å¤§äºŽ0\"\n })\n }\n },\n cropPercentConfim(e : InputConfirmEvent) {\n let value = parseInt(e.detail.value)\n if (value > 0 && value <= 100) {\n this.cropPercent = value\n } else {\n uni.showToast({\n position: \"bottom\",\n title: \"请输入0~100之间的值\"\n })\n }\n },\n cropResizeChange(e : UniSwitchChangeEvent) {\n this.cropResize = e.detail.value\n },\n switchCrop(e : UniSwitchChangeEvent) {\n this.isCrop = e.detail.value\n },\n removeImage(index : number) {\n this.imageList.splice(index, 1)\n },\n chooseImageSource() {\n uni.showActionSheet({\n itemList: ['æ‹ç…§', '相册', 'æ‹ç…§æˆ–相册'],\n success: (e) => {\n this.sourceTypeIndex = e.tapIndex!\n }\n })\n },\n chooseImageType() {\n uni.showActionSheet({\n itemList: ['压缩', '原图', '压缩或原图'],\n success: (e) => {\n this.sizeTypeIndex = e.tapIndex!\n }\n })\n },\n chooseImageCount(event : InputConfirmEvent) {\n let count = parseInt(event.detail.value) - 1\n if (count < 0) {\n uni.showToast({\n position: \"bottom\",\n title: \"图片数é‡åº”该大于0\"\n })\n return\n }\n this.countIndex = count\n },\n chooseImage: function () {\n // var cropOption:ChooseImageCropOptions|null = this.isCrop ? null : new ChooseImageCropOptions( )\n if (this.imageList.length >= 9) {\n uni.showToast({\n position: \"bottom\",\n title: \"å·²ç»æœ‰9å¼ å›¾ç‰‡äº†ï¼Œè¯·åˆ é™¤éƒ¨åˆ†å›¾ç‰‡ä¹‹åŽé‡æ–°é€‰æ‹©\"\n })\n return\n }\n uni.chooseImage({\n sourceType: sourceTypeArray[this.sourceTypeIndex],\n sizeType: sizeTypeArray[this.sizeTypeIndex],\n crop: this.isCrop ? { \"quality\": this.cropPercent, \"width\": this.cropWidth, \"height\": this.cropHeight, \"resize\": this.cropResize } as ChooseImageCropOptions : null,\n count: this.imageList.length + this.count[this.countIndex] > 9 ? 9 - this.imageList.length : this.count[this.countIndex],\n success: (res) => {\n this.imageList = this.imageList.concat(res.tempFilePaths);\n },\n fail: (err) => {\n console.log(\"err: \", JSON.stringify(err));\n }\n })\n },\n previewImage: function (index : number) {\n uni.previewImage({\n current: index,\n urls: this.imageList\n })\n }\n }\n }\n\n```\n:::"},"previewImage":{"name":"## uni.previewImage(options) @previewimage","description":"预览图片","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [PreviewImageOptions](#previewimageoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| current | any \\| null | å¦ | - | - | current 为当å‰æ˜¾ç¤ºå›¾ç‰‡çš„链接/索引值,ä¸å¡«æˆ–å¡«å†™çš„å€¼æ— æ•ˆåˆ™ä¸º urls çš„ç¬¬ä¸€å¼ ã€‚APPå¹³å°ä»…支æŒç´¢å¼•å€¼ã€‚ |\n@| urls | Array\\<[string.ImageURIString](/uts/data-type.md#ide-string)\\> | 是 | - | - | 需è¦é¢„览的图片链接列表 |\n@| indicator | string \\| null | å¦ | - | - | å›¾ç‰‡æŒ‡ç¤ºå™¨æ ·å¼<br/>- default: 底部圆点指示器<br/>- number: 顶部数å—指示器<br/>- none: ä¸æ˜¾ç¤ºæŒ‡ç¤ºå™¨ |\n@| loop | boolean \\| null | å¦ | - | - | 是å¦å¯å¾ªçŽ¯é¢„览 |\n@| success | (callback: [PreviewImageSuccess](#previewimagesuccess-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (callback: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### PreviewImageSuccess 的属性值 @previewimagesuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errSubject | string | 是 | - | - | 调用APIçš„å称 |\n| errMsg | string | 是 | - | - | æè¿°ä¿¡æ¯ |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | - | 错误ç <br/>- 1101001 用户å–消<br/>- 1101002 urls至少包å«ä¸€å¼ 图片地å€<br/>- 1101003 文件ä¸å˜åœ¨<br/>- 1101004 å›¾ç‰‡åŠ è½½å¤±è´¥<br/>- 1101005 未获å–æƒé™<br/>- 1101006 图片或视频ä¿å˜å¤±è´¥<br/>- 1101007 图片è£å‰ªå¤±è´¥<br/>- 1101008 æ‹ç…§æˆ–录åƒå¤±è´¥<br/>- 1101009 图片压缩失败<br/>- 1101010 其他错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### previewImage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/media/image?id=previewimage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.preview-image.previewImage)\n"},"closePreviewImage":{"name":"## uni.closePreviewImage(options) @closepreviewimage","description":"å…³é—图片预览","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ClosePreviewImageOptions](#closepreviewimageoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (callback: [ClosePreviewImageSuccess](#closepreviewimagesuccess-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (callback: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### ClosePreviewImageSuccess 的属性值 @closepreviewimagesuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | é”™è¯¯ä¿¡æ¯ |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | - | 错误ç <br/>- 1101001 用户å–消<br/>- 1101002 urls至少包å«ä¸€å¼ 图片地å€<br/>- 1101003 文件ä¸å˜åœ¨<br/>- 1101004 å›¾ç‰‡åŠ è½½å¤±è´¥<br/>- 1101005 未获å–æƒé™<br/>- 1101006 图片或视频ä¿å˜å¤±è´¥<br/>- 1101007 图片è£å‰ªå¤±è´¥<br/>- 1101008 æ‹ç…§æˆ–录åƒå¤±è´¥<br/>- 1101009 图片压缩失败<br/>- 1101010 其他错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### closePreviewImage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/media/image?id=closepreviewimage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.preview-image.closePreviewImage)\n"},"preview-image":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/preview-image/preview-image.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/preview-image/preview-image\n>Template\n```vue\n<template>\n <!-- #ifdef APP -->\n <scroll-view style=\"flex: 1\">\n <!-- #endif -->\n <view style=\"padding-left: 8px; padding-right: 8px\">\n <view>\n <text class=\"text-desc\">å›¾ç‰‡æŒ‡ç¤ºå™¨æ ·å¼</text>\n <radio-group class=\"cell-ct\" style=\"background-color: white\" @change=\"onIndicatorChanged\">\n <view class=\"indicator-it\" v-for=\"(item, index) in indicator\" :key=\"item.value\">\n <radio :checked=\"index == 0\" :value=\"item.value\">{{\n item.name\n }}</radio>\n </view>\n </radio-group>\n </view>\n <view>\n <checkbox-group @change=\"onCheckboxChange\" style=\"margin-top: 16px; margin-bottom: 16px; margin-left: 8px\">\n <checkbox :checked=\"isLoop\" style=\"margin-right: 15px\">循环æ’放</checkbox>\n </checkbox-group>\n </view>\n <view style=\"background-color: white\">\n <text class=\"text-desc\">点击图片开始预览</text>\n <view class=\"cell-ct\" style=\"margin: 8px;\">\n <view class=\"cell cell-choose-image\" v-for=\"(image, index) in imageList\" :key=\"index\">\n <image style=\"width: 100px; height: 100px\" mode=\"aspectFit\" :src=\"image\" @click=\"previewImage(index)\">\n </image>\n </view>\n <image class=\"cell cell-choose-image\" src=\"/static/plus.png\" @click=\"chooseImage\">\n <view></view>\n </image>\n </view>\n </view>\n </view>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n\n\n<style>\n .text-desc {\n margin-top: 16px;\n margin-left: 8px;\n margin-bottom: 16px;\n font-weight: bold;\n }\n\n .cell-ct {\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n }\n\n .cell {\n margin-left: 3px;\n margin-right: 3px;\n width: 100px;\n height: 100px;\n }\n\n .cell-choose-image {\n border-width: 1px;\n border-style: solid;\n border-color: lightgray;\n }\n\n .indicator-it {\n margin: 8px;\n }\n</style>\n\n```\n>Script\n```uts\n\n type ItemType = {\n value : string,\n name : string\n }\n\n export default {\n data() {\n return {\n imageList: [\"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni@2x.png\", \"/static/uni.png\"],\n indicator: [{\n value: \"default\",\n name: \"圆点\"\n }, {\n value: \"number\",\n name: \"æ•°å—\"\n }, {\n value: \"none\",\n name: \"ä¸æ˜¾ç¤º\"\n }] as ItemType[],\n currentIndicator: \"default\",\n isLoop: true\n }\n },\n methods: {\n previewImage(index : number) {\n uni.previewImage({\n urls: this.imageList,\n current: index,\n indicator: this.currentIndicator,\n loop: this.isLoop\n })\n },\n chooseImage() {\n uni.chooseImage({\n sourceType: ['album'],\n success: (e) => {\n this.imageList = this.imageList.concat(e.tempFilePaths)\n },\n fail(_) {\n }\n })\n },\n onIndicatorChanged(e : UniRadioGroupChangeEvent) {\n this.currentIndicator = e.detail.value\n },\n onCheckboxChange(_ : UniCheckboxGroupChangeEvent) {\n this.isLoop = !this.isLoop\n }\n }\n }\n\n```\n:::"},"saveImageToPhotosAlbum":{"name":"## uni.saveImageToPhotosAlbum(options) @saveimagetophotosalbum","description":"ä¿å˜å›¾ç‰‡åˆ°ç³»ç»Ÿç›¸å†Œ","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [SaveImageToPhotosAlbumOptions](#saveimagetophotosalbumoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | [string.ImageURIString](/uts/data-type.md#ide-string) | 是 | - | - | 图片文件路径,å¯ä»¥æ˜¯ä¸´æ—¶æ–‡ä»¶è·¯å¾„也å¯ä»¥æ˜¯æ°¸ä¹…文件路径,ä¸æ”¯æŒç½‘络图片路径 |\n@| success | (callback: [SaveImageToPhotosAlbumSuccess](#saveimagetophotosalbumsuccess-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (callback: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SaveImageToPhotosAlbumSuccess 的属性值 @saveimagetophotosalbumsuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| path | string | 是 | - | - | ä¿å˜åˆ°ç›¸å†Œçš„图片路径 |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | - | 错误ç <br/>- 1101001 用户å–消<br/>- 1101002 urls至少包å«ä¸€å¼ 图片地å€<br/>- 1101003 文件ä¸å˜åœ¨<br/>- 1101004 å›¾ç‰‡åŠ è½½å¤±è´¥<br/>- 1101005 未获å–æƒé™<br/>- 1101006 图片或视频ä¿å˜å¤±è´¥<br/>- 1101007 图片è£å‰ªå¤±è´¥<br/>- 1101008 æ‹ç…§æˆ–录åƒå¤±è´¥<br/>- 1101009 图片压缩失败<br/>- 1101010 其他错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### saveImageToPhotosAlbum 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/media/image?id=saveimagetophotosalbum)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.save-image-to-photos-album)\n"},"save-image-to-photos-album":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/save-image-to-photos-album/save-image-to-photos-album.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\n <!-- #ifdef APP -->\n <scroll-view style=\"flex:1\">\n <!-- #endif -->\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-padding-wrap\">\n <image class=\"image\" src=\"/static/uni.png\"></image>\n <button class=\"margin-top-10\" type=\"primary\" @click=\"saveImage\">将图片ä¿å˜åˆ°æ‰‹æœºç›¸å†Œ</button>\n </view>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n<script>\n export default {\n data() {\n return {\n title: \"saveImageToPhotosAlbum\"\n }\n },\n methods: {\n saveImage() {\n uni.saveImageToPhotosAlbum({\n filePath: \"/static/uni.png\",\n success: (res) => {\n console.log(\"saveImageToPhotosAlbum success\", JSON.stringify(res));\n uni.showToast({\n position: \"center\",\n icon: \"none\",\n title: \"图片ä¿å˜æˆåŠŸï¼Œè¯·åˆ°æ‰‹æœºç›¸å†ŒæŸ¥çœ‹\"\n })\n },\n fail: (err) => {\n uni.showModal({\n title: \"ä¿å˜å›¾ç‰‡åˆ°ç›¸å†Œå¤±è´¥\",\n content: JSON.stringify(err),\n showCancel: false\n });\n }\n })\n }\n }\n }\n</script>\n\n<style>\n .margin-top-10 {\n margin-top: 10px;\n }\n\n .image {\n width: 196px;\n height: 196px;\n align-self: center;\n }\n</style>\n\n```"},"getImageInfo":{"name":"## uni.getImageInfo(options) @getimageinfo","description":"获å–图片信æ¯","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [GetImageInfoOptions](#getimageinfooptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| src | [string.ImageURIString](/uts/data-type.md#ide-string) | 是 | - | - | 图片的路径,å¯ä»¥æ˜¯ç›¸å¯¹è·¯å¾„,临时文件路径,å˜å‚¨æ–‡ä»¶è·¯å¾„,网络图片路径 |\n@| success | (callback: [GetImageInfoSuccess](#getimageinfosuccess-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (callback: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### GetImageInfoSuccess 的属性值 @getimageinfosuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| width | number | 是 | - | - | 图片宽度,å•ä½px |\n| height | number | 是 | - | - | 图片高度,å•ä½px |\n| path | string | 是 | - | - | 返回图片的本地路径 |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | - | 错误ç <br/>- 1101001 用户å–消<br/>- 1101002 urls至少包å«ä¸€å¼ 图片地å€<br/>- 1101003 文件ä¸å˜åœ¨<br/>- 1101004 å›¾ç‰‡åŠ è½½å¤±è´¥<br/>- 1101005 未获å–æƒé™<br/>- 1101006 图片或视频ä¿å˜å¤±è´¥<br/>- 1101007 图片è£å‰ªå¤±è´¥<br/>- 1101008 æ‹ç…§æˆ–录åƒå¤±è´¥<br/>- 1101009 图片压缩失败<br/>- 1101010 其他错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### getImageInfo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 4.18 | - |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/media/image?id=getimageinfo)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.get-image-info)\n"},"get-image-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-image-info/get-image-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-image-info/get-image-info\n>Template\n```vue\n<template>\n <!-- #ifdef APP -->\n <scroll-view style=\"flex:1\">\n <!-- #endif -->\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-padding-wrap\">\n <view class=\"uni-title\">\n <text class=\"uni-subtitle-text\">获å–本地相对路径图片信æ¯</text>\n </view>\n <image class=\"image\" :src=\"relativeImagePath\" mode=\"aspectFit\"></image>\n <text class=\"margin-top-10\">{{absoluteImageInfo}}</text>\n <view class=\"uni-title\">\n <text class=\"uni-subtitle-text\">获å–网络路径图片信æ¯</text>\n </view>\n <image class=\"image\" :src=\"remoteImagePath\" mode=\"aspectFit\"></image>\n <text class=\"margin-top-10\">{{remoteImageInfo}}</text>\n <view class=\"uni-title\">\n <text class=\"uni-subtitle-text\">获å–本地ç»å¯¹è·¯å¾„图片信æ¯</text>\n </view>\n <image class=\"image\" :src=\"absoluteImagePath\" mode=\"aspectFit\"></image>\n <text class=\"margin-top-10\">{{relativeImageInfo}}</text>\n <view class=\"uni-btn-v\">\n <button type=\"primary\" @click=\"chooseImage\">æ‹æ‘„照片或从相册ä¸é€‰æ‹©ç…§ç‰‡</button>\n </view>\n </view>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n\n\n<style>\n .image {\n align-self: center;\n }\n\n .margin-top-10 {\n margin-top: 10px;\n }\n</style>\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n title: \"getImageInfo\",\n relativeImagePath: \"/static/test-image/logo.png\",\n relativeImageInfo: \"\",\n absoluteImagePath: \"\",\n absoluteImageInfo: \"\",\n remoteImagePath: \"https://qiniu-web-assets.dcloud.net.cn/uni-app-x/static/img/building.jpg\",\n remoteImageInfo: \"\",\n }\n },\n methods: {\n chooseImage() {\n uni.chooseImage({\n count: 1,\n success: (res) => {\n this.absoluteImagePath = res.tempFilePaths[0];\n uni.getImageInfo({\n src: res.tempFilePaths[0],\n success: (_res) => {\n console.log(\"getImageInfo success\", JSON.stringify(res));\n this.relativeImageInfo = `图片宽度: ${_res.width}\\n图片高度: ${_res.height}\\n图片路径: ${_res.path}\\n图片方å‘: ${_res.orientation}\\nå›¾ç‰‡æ ¼å¼: ${_res.type}`;\n },\n fail: (err) => {\n uni.showModal({\n title: \"获å–图片信æ¯å¤±è´¥\",\n content: JSON.stringify(err),\n showCancel: false\n });\n }\n });\n }\n });\n }\n },\n onReady() {\n uni.getImageInfo({\n src: this.relativeImagePath,\n success: (res) => {\n console.log(\"getImageInfo success\", JSON.stringify(res));\n this.absoluteImageInfo = `图片宽度: ${res.width}\\n图片高度: ${res.height}\\n图片路径: ${res.path}\\n图片方å‘: ${res.orientation}\\nå›¾ç‰‡æ ¼å¼: ${res.type}`;\n },\n fail: (err) => {\n uni.showModal({\n title: \"获å–图片信æ¯å¤±è´¥\",\n content: JSON.stringify(err),\n showCancel: false\n });\n }\n });\n uni.getImageInfo({\n src: this.remoteImagePath,\n success: (res) => {\n console.log(\"getImageInfo success\", JSON.stringify(res));\n this.remoteImageInfo = `图片宽度: ${res.width}\\n图片高度: ${res.height}\\n图片路径: ${res.path}\\n图片方å‘: ${res.orientation}\\nå›¾ç‰‡æ ¼å¼: ${res.type}`;\n },\n fail: (err) => {\n uni.showModal({\n title: \"获å–图片信æ¯å¤±è´¥\",\n content: JSON.stringify(err),\n showCancel: false\n });\n }\n });\n }\n }\n\n```\n:::"},"compressImage":{"name":"## uni.compressImage(options) @compressimage","description":"压缩图片","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [CompressImageOptions](#compressimageoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| src | [string.ImageURIString](/uts/data-type.md#ide-string) | 是 | - | - | 图片路径,图片的路径,å¯ä»¥æ˜¯ç›¸å¯¹è·¯å¾„ã€ä¸´æ—¶æ–‡ä»¶è·¯å¾„ã€å˜å‚¨æ–‡ä»¶è·¯å¾„ |\n@| quality | number \\| null | å¦ | - | - | 压缩质é‡ï¼ŒèŒƒå›´0~100,数值越å°ï¼Œè´¨é‡è¶Šä½Žï¼ŒåŽ‹ç¼©çŽ‡è¶Šé«˜ï¼ˆä»…对jpg有效) |\n@| rotate | number \\| null | å¦ | - | - | 旋转度数,范围0~360 |\n@| ~~width~~ | string \\| null | å¦ | - | - | 缩放图片的宽度 **已废弃** |\n@| ~~height~~ | string \\| null | å¦ | - | - | 缩放图片的高度 **已废弃** |\n@| compressedHeight | number \\| null | å¦ | - | - | 压缩åŽå›¾ç‰‡çš„高度,å•ä½ä¸ºpx,若ä¸å¡«å†™åˆ™é»˜è®¤ä»¥compressedWidth为准ç‰æ¯”缩放 |\n@| compressedWidth | number \\| null | å¦ | - | - | 压缩åŽå›¾ç‰‡çš„宽度,å•ä½ä¸ºpx,若ä¸å¡«å†™åˆ™é»˜è®¤ä»¥compressedHeight为准ç‰æ¯”缩放。 |\n@| success | (callback: [CompressImageSuccess](#compressimagesuccess-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (callback: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### CompressImageSuccess 的属性值 @compressimagesuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| tempFilePath | string | 是 | - | - | 压缩åŽå›¾ç‰‡çš„临时文件路径 |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | - | 错误ç <br/>- 1101001 用户å–消<br/>- 1101002 urls至少包å«ä¸€å¼ 图片地å€<br/>- 1101003 文件ä¸å˜åœ¨<br/>- 1101004 å›¾ç‰‡åŠ è½½å¤±è´¥<br/>- 1101005 未获å–æƒé™<br/>- 1101006 图片或视频ä¿å˜å¤±è´¥<br/>- 1101007 图片è£å‰ªå¤±è´¥<br/>- 1101008 æ‹ç…§æˆ–录åƒå¤±è´¥<br/>- 1101009 图片压缩失败<br/>- 1101010 其他错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### compressImage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 4.18 | - |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/media/image?id=compressimage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.compress-image)\n"},"compress-image":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/compress-image/compress-image.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\n <!-- #ifdef APP -->\n <scroll-view style=\"flex:1\">\n <!-- #endif -->\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-padding-wrap\">\n <view class=\"image-container\">\n <image class=\"image\" :src=\"beforeCompressPath\" mode=\"aspectFit\"></image>\n <image class=\"image\" :src=\"afterCompressPath\" mode=\"aspectFit\"></image>\n </view>\n <view class=\"uni-title\">\n <text class=\"uni-subtitle-text\">压缩å‰å›¾ç‰‡ä¿¡æ¯</text>\n </view>\n <text>{{beforeCompressImageInfo}}</text>\n <view class=\"uni-title\">\n <text class=\"uni-subtitle-text\">压缩åŽå›¾ç‰‡ä¿¡æ¯</text>\n </view>\n <text>{{afterCompressImageInfo}}</text>\n <view class=\"uni-btn-v\">\n <button type=\"primary\" @click=\"chooseImage\">从相册ä¸é€‰å–待压缩的图片</button>\n </view>\n <view class=\"uni-btn-v\">\n <button type=\"primary\" @click=\"compressImage\">压缩图片</button>\n </view>\n </view>\n <input-data defaultValue=\"80\" title=\"压缩质é‡ï¼ŒèŒƒå›´0~100,数值越å°ï¼Œè´¨é‡è¶Šä½Žï¼ŒåŽ‹ç¼©çŽ‡è¶Šé«˜ï¼ˆä»…对jpg有效)\" type=\"number\"\n @confirm=\"onQualityConfirm\"></input-data>\n <input-data title=\"压缩åŽå›¾ç‰‡çš„宽度,å•ä½px\" type=\"string\" @confirm=\"onCompressedWidthConfirm\"></input-data>\n <input-data title=\"压缩åŽå›¾ç‰‡çš„高度,å•ä½px\" type=\"string\" @confirm=\"onCompressedHeightConfirm\"></input-data>\n <input-data defaultValue=\"auto\" title=\"压缩åŽå›¾ç‰‡çš„宽度,支æŒpxã€%ã€auto\" type=\"string\" @confirm=\"onWidthConfirm\"></input-data>\n <input-data defaultValue=\"auto\" title=\"压缩åŽå›¾ç‰‡çš„高度,支æŒpxã€%ã€auto\" type=\"string\" @confirm=\"onHeightConfirm\"></input-data>\n <input-data defaultValue=\"0\" title=\"旋转度数,范围0~360\" type=\"number\" @confirm=\"onRotateConfirm\"></input-data>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n<script>\n // #ifdef APP-ANDROID\n import FileInputStream from 'java.io.FileInputStream';\n // #endif\n export default {\n data() {\n return {\n title: \"compressImage\",\n beforeCompressImageInfo: \"\",\n afterCompressImageInfo: \"\",\n beforeCompressPath: \"\",\n afterCompressPath: \"\",\n quality: 80,\n compressedWidth: null as number | null,\n compressedHeight: null as number | null,\n width: \"auto\",\n height: \"auto\",\n rotate: 0\n }\n },\n methods: {\n compressImage() {\n if (this.beforeCompressPath == \"\") {\n uni.showToast({\n title: \"请先选择图片\",\n icon: \"error\"\n });\n return;\n }\n uni.showLoading({\n title: \"图片压缩ä¸\"\n });\n uni.compressImage({\n src: this.beforeCompressPath,\n quality: this.quality,\n compressedWidth: this.compressedWidth,\n compressedHeight: this.compressedHeight,\n width: this.width,\n height: this.height,\n rotate: this.rotate,\n success: (res) => {\n console.log(\"compressImage success\", JSON.stringify(res));\n this.afterCompressPath = res.tempFilePath;\n uni.showToast({\n title: \"压缩æˆåŠŸ\",\n icon: null\n });\n uni.getImageInfo({\n src: res.tempFilePath,\n success: (_res) => {\n this.afterCompressImageInfo = `图片宽度: ${_res.width}\\n图片高度: ${_res.height}\\n`;\n // #ifdef APP-ANDROID\n const size = new FileInputStream(res.tempFilePath.substring(\"file://\".length)).available() / 1024;\n this.afterCompressImageInfo = this.afterCompressImageInfo.concat(`图片大å°: ${size}KB`);\n // #endif\n }\n });\n },\n fail: (err) => {\n uni.showModal({\n title: \"压缩图片失败\",\n content: JSON.stringify(err),\n showCancel: false\n });\n },\n complete: (_) => {\n uni.hideLoading();\n }\n })\n },\n chooseImage() {\n uni.chooseImage({\n count: 1,\n sizeType: [\"original\"],\n sourceType: [\"album\"],\n success: (res) => {\n this.beforeCompressPath = res.tempFilePaths[0];\n uni.getImageInfo({\n src: res.tempFilePaths[0],\n success: (_res) => {\n this.beforeCompressImageInfo = `图片宽度: ${_res.width}\\n图片高度: ${_res.height}\\n`;\n // #ifdef APP-ANDROID\n const size = new FileInputStream(res.tempFilePaths[0].substring(\"file://\".length)).available() / 1024;\n this.beforeCompressImageInfo = this.beforeCompressImageInfo.concat(`图片大å°: ${size}KB`);\n // #endif\n }\n });\n }\n });\n },\n onQualityConfirm(value : number) {\n this.quality = value;\n },\n onCompressedWidthConfirm(value : string) {\n this.compressedWidth = parseInt(value);\n },\n onCompressedHeightConfirm(value : string) {\n this.compressedHeight = parseInt(value);\n },\n onWidthConfirm(value : string) {\n this.width = value;\n },\n onHeightConfirm(value : string) {\n this.height = value;\n },\n onRotateConfirm(value : number) {\n this.rotate = value;\n }\n }\n }\n</script>\n\n<style>\n .image {\n flex: 1;\n }\n\n .image-container {\n flex-direction: row;\n }\n</style>\n\n```"},"chooseVideo":{"name":"## uni.chooseVideo(options) @choosevideo","description":"æ‹æ‘„视频或从手机相册ä¸é€‰è§†é¢‘,返回视频的临时文件路径。","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ChooseVideoOptions](#choosevideooptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| sourceType | Array\\<string\\> \\| null | å¦ | - | - | album 从相册选视频,camera 使用相机æ‹æ‘„,默认为:['album', 'camera'\\] |\n@| success | (callback: [ChooseVideoSuccess](#choosevideosuccess-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸï¼Œè¿”回视频文件的临时文件路径,详è§è¿”回å‚数说明 |\n@| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (callback: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### ChooseVideoSuccess 的属性值 @choosevideosuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| tempFilePath | string | 是 | - | - | 选定视频的临时文件路径 |\n| duration | number | 是 | - | - | 选定视频的时间长度 |\n| size | number | 是 | - | - | 选定视频的数æ®é‡å¤§å° |\n| height | number | 是 | - | - | 返回选定视频的长 |\n| width | number | 是 | - | - | 返回选定视频的宽 |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | - | 错误ç <br/>- 1101001 用户å–消<br/>- 1101002 urls至少包å«ä¸€å¼ 图片地å€<br/>- 1101003 文件ä¸å˜åœ¨<br/>- 1101004 å›¾ç‰‡åŠ è½½å¤±è´¥<br/>- 1101005 未获å–æƒé™<br/>- 1101006 图片或视频ä¿å˜å¤±è´¥<br/>- 1101007 图片è£å‰ªå¤±è´¥<br/>- 1101008 æ‹ç…§æˆ–录åƒå¤±è´¥<br/>- 1101009 图片压缩失败<br/>- 1101010 其他错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### chooseVideo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 4.18 | 4.18 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/media/video?id=choosevideo)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.choose-video)\n"},"choose-video":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/choose-video/choose-video.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/choose-video/choose-video\n>Template\n```vue\n<template>\n <!-- #ifdef APP -->\n <scroll-view style=\"flex:1\">\n <!-- #endif -->\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-padding-wrap\">\n <video class=\"video\" :src=\"src\" :controls=\"true\"></video>\n <view class=\"uni-title\">\n <text class=\"uni-subtitle-text\">视频信æ¯</text>\n </view>\n <text>{{videoInfo}}</text>\n <view class=\"uni-btn-v\">\n <button type=\"primary\" @click=\"chooseVideo\">选å–视频</button>\n </view>\n <enum-data title=\"视频æ¥æº\" :items=\"sourceTypeItemTypes\" @change=\"onSourceTypeChange\"></enum-data>\n <enum-data title=\"æ‘„åƒå¤´\" :items=\"cameraItemTypes\" @change=\"onCameraChange\"></enum-data>\n </view>\n <input-data title=\"最长æ‹æ‘„时间,å•ä½ç§’\" defaultValue=\"60\" type=\"number\" @confirm=\"onMaxDurationConfirm\"></input-data>\n <!-- #ifdef APP -->\n <view class=\"uni-padding-wrap\">\n <boolean-data title=\"是å¦åŽ‹ç¼©\" :defaultValue=\"true\" @change=\"onCompressedChange\"></boolean-data>\n </view>\n <!-- #endif -->\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n\n\n<style>\n .video {\n align-self: center;\n width: 300px;\n height: 225px;\n }\n</style>\n\n```\n>Script\n```uts\n\n import { ItemType } from '@/components/enum-data/enum-data';\n export default {\n data() {\n return {\n title: \"chooseVideo\",\n src: \"\",\n sourceTypeItemTypes: [{ \"value\": 0, \"name\": \"从相册ä¸é€‰æ‹©è§†é¢‘\" }, { \"value\": 1, \"name\": \"æ‹æ‘„视频\" }, { \"value\": 2, \"name\": \"从相册ä¸é€‰æ‹©è§†é¢‘或æ‹æ‘„视频\" }] as ItemType[],\n sourceTypeItems: [[\"album\"], [\"camera\"], [\"album\", \"camera\"]],\n cameraItemTypes: [{ \"value\": 0, \"name\": \"åŽç½®æ‘„åƒå¤´\" }, { \"value\": 1, \"name\": \"å‰ç½®æ‘„åƒå¤´\" }] as ItemType[],\n cameraItems: [\"back\", \"front\"],\n sourceType: [\"album\", \"camera\"],\n compressed: true,\n maxDuration: 60,\n camera: \"back\",\n videoInfo: \"\"\n }\n },\n methods: {\n chooseVideo() {\n uni.chooseVideo({\n sourceType: this.sourceType,\n // #ifdef APP\n compressed: this.compressed,\n // #endif\n maxDuration: this.maxDuration,\n camera: this.camera,\n success: (res) => {\n console.log(\"chooseVideo success\", JSON.stringify(res));\n this.src = res.tempFilePath;\n this.videoInfo = `视频长度: ${res.duration}s\\n视频大å°: ${Math.ceil(res.size / 1024)}KB\\n视频宽度: ${res.width}\\n视频高度: ${res.height}\\n`;\n },\n fail: (err) => {\n uni.showModal({\n title: \"选择视频失败\",\n content: JSON.stringify(err),\n showCancel: false\n });\n }\n });\n },\n onSourceTypeChange(value : number) {\n this.sourceType = this.sourceTypeItems[value];\n },\n onCompressedChange(value : boolean) {\n this.compressed = value;\n },\n onMaxDurationConfirm(value : number) {\n this.maxDuration = value;\n },\n onCameraChange(value : number) {\n this.camera = this.cameraItems[value];\n }\n }\n }\n\n```\n:::"},"saveVideoToPhotosAlbum":{"name":"## uni.saveVideoToPhotosAlbum(options) @savevideotophotosalbum","description":"ä¿å˜è§†é¢‘到系统相册","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [SaveVideoToPhotosAlbumOptions](#savevideotophotosalbumoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | [string.VideoURIString](/uts/data-type.md#ide-string) | 是 | - | - | 视频文件路径,å¯ä»¥æ˜¯ä¸´æ—¶æ–‡ä»¶è·¯å¾„也å¯ä»¥æ˜¯æ°¸ä¹…文件路径 |\n@| success | (callback: SaveVideoToPhotosAlbumSuccess) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (callback: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### IMediaError 的属性值 @imediaerror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | - | 错误ç <br/>- 1101001 用户å–消<br/>- 1101002 urls至少包å«ä¸€å¼ 图片地å€<br/>- 1101003 文件ä¸å˜åœ¨<br/>- 1101004 å›¾ç‰‡åŠ è½½å¤±è´¥<br/>- 1101005 未获å–æƒé™<br/>- 1101006 图片或视频ä¿å˜å¤±è´¥<br/>- 1101007 图片è£å‰ªå¤±è´¥<br/>- 1101008 æ‹ç…§æˆ–录åƒå¤±è´¥<br/>- 1101009 图片压缩失败<br/>- 1101010 其他错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### saveVideoToPhotosAlbum 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.18 | 4.18 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/media/video?id=savevideotophotosalbum)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.save-video-to-photos-album)\n"},"save-video-to-photos-album":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/save-video-to-photos-album/save-video-to-photos-album.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\n <!-- #ifdef APP -->\n <scroll-view style=\"flex:1\">\n <!-- #endif -->\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-padding-wrap\">\n <video class=\"video\" :src=\"src\" :controls=\"true\"></video>\n <button type=\"primary\" class=\"margin-top-10\" @click=\"saveVideo\">将视频ä¿å˜åˆ°æ‰‹æœºç›¸å†Œ</button>\n </view>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n<script>\n export default {\n data() {\n return {\n title: 'saveVideoToPhotosAlbum',\n src: ''\n }\n },\n methods: {\n saveVideo() {\n uni.saveVideoToPhotosAlbum({\n filePath: this.src,\n success: (_) => {\n console.log(\"saveVideoToPhotosAlbum success\");\n uni.showToast({\n position: \"center\",\n icon: \"none\",\n title: \"视频ä¿å˜æˆåŠŸï¼Œè¯·åˆ°æ‰‹æœºç›¸å†ŒæŸ¥çœ‹\"\n });\n },\n fail: (err) => {\n uni.showModal({\n title: \"ä¿å˜è§†é¢‘到相册失败\",\n content: JSON.stringify(err),\n showCancel: false\n });\n }\n });\n }\n },\n onReady() {\n uni.showLoading({\n title: '视频下载ä¸'\n });\n uni.downloadFile({\n url: 'https://qiniu-web-assets.dcloud.net.cn/uni-app-x/static/video/swiper-vertical-video/uts.mp4',\n success: (res) => {\n console.log(\"download video success\", res.tempFilePath);\n this.src = res.tempFilePath;\n uni.hideLoading();\n }\n });\n }\n }\n</script>\n\n<style>\n .video {\n align-self: center;\n }\n\n .margin-top-10 {\n margin-top: 10px;\n }\n</style>\n\n```"},"getVideoInfo":{"name":"## uni.getVideoInfo(options) @getvideoinfo","description":"获å–视频详细信æ¯","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [GetVideoInfoOptions](#getvideoinfooptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| src | [string.VideoURIString](/uts/data-type.md#ide-string) | 是 | - | - | 视频文件路径,å¯ä»¥æ˜¯ä¸´æ—¶æ–‡ä»¶è·¯å¾„也å¯ä»¥æ˜¯æ°¸ä¹…文件路径 |\n@| success | (callback: [GetVideoInfoSuccess](#getvideoinfosuccess-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (callback: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### GetVideoInfoSuccess 的属性值 @getvideoinfosuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| duration | number | 是 | - | - | 视频长度 |\n| size | number | 是 | - | - | 视频大å°ï¼Œå•ä½ kB |\n| height | number | 是 | - | - | 视频的长,å•ä½ px |\n| width | number | 是 | - | - | 视频的宽,å•ä½ px |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | - | 错误ç <br/>- 1101001 用户å–消<br/>- 1101002 urls至少包å«ä¸€å¼ 图片地å€<br/>- 1101003 文件ä¸å˜åœ¨<br/>- 1101004 å›¾ç‰‡åŠ è½½å¤±è´¥<br/>- 1101005 未获å–æƒé™<br/>- 1101006 图片或视频ä¿å˜å¤±è´¥<br/>- 1101007 图片è£å‰ªå¤±è´¥<br/>- 1101008 æ‹ç…§æˆ–录åƒå¤±è´¥<br/>- 1101009 图片压缩失败<br/>- 1101010 其他错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### getVideoInfo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 4.18 | - |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/media/video?id=getvideoinfo)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.get-video-info)\n"},"get-video-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-video-info/get-video-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-video-info/get-video-info\n>Template\n```vue\n<template>\n <!-- #ifdef APP -->\n <scroll-view style=\"flex:1\">\n <!-- #endif -->\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-padding-wrap\">\n <view class=\"uni-title\">\n <text class=\"uni-subtitle-text\">获å–本地ç»å¯¹è·¯å¾„视频信æ¯</text>\n </view>\n <video class=\"video\" :src=\"absoluteVideoPath\" :controls=\"true\"></video>\n <text class=\"margin-top-10\">{{absoluteVideoInfo}}</text>\n <view class=\"uni-btn-v\">\n <button type=\"primary\" @click=\"chooseVideo\">æ‹æ‘„视频或从相册ä¸é€‰æ‹©è§†é¢‘</button>\n </view>\n </view>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n\n\n<style>\n .video {\n align-self: center;\n }\n\n .margin-top-10 {\n margin-top: 10px;\n }\n</style>\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n title: \"getVideoInfo\",\n absoluteVideoPath: \"\",\n absoluteVideoInfo: \"\",\n }\n },\n methods: {\n chooseVideo() {\n uni.chooseVideo({\n compressed: false,\n success: (res) => {\n this.absoluteVideoPath = res.tempFilePath;\n uni.getVideoInfo({\n src: res.tempFilePath,\n success: (_res) => {\n console.log(\"getVideoInfo success\", JSON.stringify(res));\n this.absoluteVideoInfo = `视频画é¢æ–¹å‘: ${_res.orientation}\\nè§†é¢‘æ ¼å¼: ${_res.type}\\n视频长度: ${_res.duration}s\\n视频大å°: ${_res.size}KB\\n视频宽度: ${_res.width}\\n视频高度: ${_res.height}\\n视频帧率: ${_res.fps}fps\\n视频ç 率: ${_res.bitrate}kbps`;\n },\n fail: (err) => {\n uni.showModal({\n title: \"获å–视频信æ¯å¤±è´¥\",\n content: JSON.stringify(err),\n showCancel: false\n });\n }\n });\n }\n });\n }\n }\n }\n\n```\n:::"},"compressVideo":{"name":"## uni.compressVideo(options) @compressvideo","description":"压缩视频","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [CompressVideoOptions](#compressvideooptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| src | [string.VideoURIString](/uts/data-type.md#ide-string) | 是 | - | - | 视频文件路径,å¯ä»¥æ˜¯ä¸´æ—¶æ–‡ä»¶è·¯å¾„也å¯ä»¥æ˜¯æ°¸ä¹…文件路径 |\n@| quality | string \\| null | å¦ | - | - | 压缩质é‡<br/>- low: 低<br/>- medium: ä¸<br/>- high: 高 |\n@| resolution | number \\| null | å¦ | - | - | 相对于原视频的分辨率比例,å–值范围(0, 1\\] |\n@| success | (callback: [CompressVideoSuccess](#compressvideosuccess-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (callback: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### CompressVideoSuccess 的属性值 @compressvideosuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| tempFilePath | string | 是 | - | - | 压缩åŽçš„ä¸´æ—¶æ–‡ä»¶åœ°å€ |\n| size | number | 是 | - | - | 压缩åŽçš„大å°ï¼Œå•ä½ kB |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | - | 错误ç <br/>- 1101001 用户å–消<br/>- 1101002 urls至少包å«ä¸€å¼ 图片地å€<br/>- 1101003 文件ä¸å˜åœ¨<br/>- 1101004 å›¾ç‰‡åŠ è½½å¤±è´¥<br/>- 1101005 未获å–æƒé™<br/>- 1101006 图片或视频ä¿å˜å¤±è´¥<br/>- 1101007 图片è£å‰ªå¤±è´¥<br/>- 1101008 æ‹ç…§æˆ–录åƒå¤±è´¥<br/>- 1101009 图片压缩失败<br/>- 1101010 其他错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### compressVideo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 4.18 | - |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/media/video?id=compressvideo)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.compress-video)\n"},"compress-video":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/compress-video/compress-video.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\n <!-- #ifdef APP -->\n <scroll-view style=\"flex:1\">\n <!-- #endif -->\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-padding-wrap\">\n <video class=\"video\" :src=\"beforeCompressPath\" :controls=\"true\"></video>\n <view class=\"uni-title\">\n <text class=\"uni-subtitle-text\">压缩å‰è§†é¢‘ä¿¡æ¯</text>\n </view>\n <text>{{beforeCompressVideoInfo}}</text>\n <video class=\"video\" :src=\"afterCompressPath\" :controls=\"true\"></video>\n <view class=\"uni-title\">\n <text class=\"uni-subtitle-text\">压缩åŽè§†é¢‘ä¿¡æ¯</text>\n </view>\n <text>{{afterCompressVideoInfo}}</text>\n <view class=\"uni-btn-v\">\n <button type=\"primary\" @click=\"chooseVideo\">从相册ä¸é€‰å–待压缩的视频</button>\n </view>\n <view class=\"uni-btn-v\">\n <button type=\"primary\" @click=\"compressVideo\">压缩视频</button>\n </view>\n <enum-data title=\"压缩质é‡\" :items=\"qualityItemTypes\" @change=\"onQualityChange\"></enum-data>\n <view class=\"uni-common-mt\">\n <text class=\"uni-title uni-title-text\">相对于原视频的分辨率比例,å–值范围(0, 1]</text>\n <slider :min=\"0.1\" :max=\"1\" :step=\"0.1\" :show-value=\"true\" @change=\"onResolutionChange\"></slider>\n </view>\n </view>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n<script>\n import { ItemType } from '@/components/enum-data/enum-data';\n export default {\n data() {\n return {\n title: \"compressVideo\",\n beforeCompressVideoInfo: \"\",\n afterCompressVideoInfo: \"\",\n beforeCompressPath: \"\",\n afterCompressPath: \"\",\n quality: null as string | null,\n bitrate: null as number | null,\n fps: null as number | null,\n resolution: null as number | null,\n qualityItemTypes: [{ \"value\": 0, \"name\": \"low(低)\" }, { \"value\": 1, \"name\": \"medium(ä¸)\" }, { \"value\": 2, \"name\": \"high(高)\" }] as ItemType[],\n qualityItems: [\"low\", \"medium\", \"high\"]\n }\n },\n methods: {\n compressVideo() {\n if (this.beforeCompressPath == \"\") {\n uni.showToast({\n title: \"请先选择视频\",\n icon: \"error\"\n });\n return;\n }\n uni.showLoading({\n title: \"视频压缩ä¸\"\n });\n uni.compressVideo({\n src: this.beforeCompressPath,\n quality: this.quality,\n resolution: this.resolution,\n success: (res) => {\n console.log(\"compressVideo success\", JSON.stringify(res));\n this.afterCompressPath = res.tempFilePath;\n uni.showToast({\n title: \"压缩æˆåŠŸ\",\n icon: null\n });\n uni.getVideoInfo({\n src: res.tempFilePath,\n success: (_res) => {\n this.afterCompressVideoInfo = `视频画é¢æ–¹å‘: ${_res.orientation}\\nè§†é¢‘æ ¼å¼: ${_res.type}\\n视频长度: ${_res.duration}s\\n视频大å°: ${_res.size}KB\\n视频宽度: ${_res.width}\\n视频高度: ${_res.height}\\n视频帧率: ${_res.fps}fps\\n视频ç 率: ${_res.bitrate}kbps`;\n }\n });\n },\n fail: (err) => {\n uni.showModal({\n title: \"压缩视频失败\",\n content: JSON.stringify(err),\n showCancel: false\n });\n },\n complete: (_) => {\n uni.hideLoading();\n }\n });\n },\n chooseVideo() {\n uni.chooseVideo({\n sourceType: [\"album\"],\n compressed: false,\n success: (res) => {\n this.beforeCompressPath = res.tempFilePath;\n uni.getVideoInfo({\n src: res.tempFilePath,\n success: (_res) => {\n this.beforeCompressVideoInfo = `视频画é¢æ–¹å‘: ${_res.orientation}\\nè§†é¢‘æ ¼å¼: ${_res.type}\\n视频长度: ${_res.duration}s\\n视频大å°: ${_res.size}KB\\n视频宽度: ${_res.width}\\n视频高度: ${_res.height}\\n视频帧率: ${_res.fps}fps\\n视频ç 率: ${_res.bitrate}kbps`;\n }\n });\n }\n });\n },\n onQualityChange(value : number) {\n this.quality = this.qualityItems[value];\n },\n onResolutionChange(event : UniSliderChangeEvent) {\n this.resolution = event.detail.value;\n }\n }\n }\n</script>\n\n<style>\n .video {\n align-self: center;\n }\n\n .image-container {\n flex-direction: row;\n }\n</style>\n\n```"},"getLocation":{"name":"## uni.getLocation(options) @getlocation","description":"获å–当å‰çš„地ç†ä½ç½®ã€é€Ÿåº¦","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [GetLocationOptions](#getlocationoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| type | \"wgs84\" \\| \"gcj02\" | å¦ | wgs84 | - | 默认为 wgs84 返回 gps åæ ‡ï¼Œgcj02 返回å¯ç”¨äºŽuni.openLocationçš„åæ ‡ï¼Œweb端需é…ç½®å®šä½ SDK ä¿¡æ¯æ‰å¯æ”¯æŒ gcj02 |\n@| altitude | boolean \\| null | å¦ | false | - | ä¼ å…¥ true 会返回高度信æ¯ï¼Œç”±äºŽèŽ·å–高度需è¦è¾ƒé«˜ç²¾ç¡®åº¦ï¼Œä¼šå‡æ…¢æŽ¥å£è¿”回速度 |\n@| geocode | boolean \\| null | å¦ | false | - | ä¼ å…¥ true 会解æžåœ°å€ |\n@| highAccuracyExpireTime | number \\| null | å¦ | 3000 | - | 高精度定ä½è¶…时时间(ms),指定时间内返回最高精度,该值3000ms以上高精度定ä½æ‰æœ‰æ•ˆæžœ |\n@| isHighAccuracy | boolean \\| null | å¦ | false | - | å¼€å¯é«˜ç²¾åº¦å®šä½ |\n@| success | (result: [GetLocationSuccess](#getlocationsuccess-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [IGetLocationFail](#igetlocationfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### GetLocationSuccess 的属性值 @getlocationsuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| latitude | number | 是 | 0 | - | 纬度,浮点数,范围为-90~90,负数表示å—纬 |\n| longitude | number | 是 | 0 | - | ç»åº¦ï¼ŒèŒƒå›´ä¸º-180~180ï¼Œè´Ÿæ•°è¡¨ç¤ºè¥¿ç» |\n| speed | number | 是 | 0 | - | 速度,浮点数,å•ä½m/s |\n| accuracy | number | 是 | - | - | ä½ç½®çš„精确度 |\n| altitude | number | 是 | 0 | - | 高度,å•ä½ m |\n| verticalAccuracy | number | 是 | 0 | - | 垂直精度,å•ä½ m(Android æ— æ³•èŽ·å–,返回 0) |\n| horizontalAccuracy | number | 是 | 0 | - | 水平精度,å•ä½ m |\n| address | any \\| null | å¦ | null | - | 地å€ä¿¡æ¯ |\n\n##### IGetLocationFail 的属性值 @igetlocationfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1505004 \\| 1505005 \\| 1505021 \\| 1505022 \\| 1505023 \\| 1505024 \\| 1505025 \\| 1505026 | 是 | - | - | 错误ç <br/>- 1505004 缺失æƒé™<br/>- 1505005 缺失高精度æƒé™æŽˆæƒï¼ˆiOS特有)<br/>- 1505021 超时<br/>- 1505022 ä¸æ”¯æŒçš„定ä½ç±»åž‹<br/>- 1505023 ä¸æ”¯æŒé€†åœ°ç†ç¼–ç <br/>- 1505024 没有找到具体的定ä½å¼•æ“Žï¼Œè¯·å®šä½å¼€å…³æ˜¯å¦å·²æ‰“å¼€<br/>- 1505025 逆地ç†ç¼–ç æ•èŽ·å¤±è´¥<br/>- 1505026 æ•èŽ·å®šä½å¤±è´¥ |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### getLocation 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/location/location?id=getlocation)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.location.get-location)\n"},"get-location":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-location/get-location.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-location/get-location\n>Template\n```vue\n<template>\n <page-head :title=\"title\"></page-head>\n <view style=\"padding: 4px;\">\n <text class=\"hello-text\">\n 定ä½åŠŸèƒ½é»˜è®¤è°ƒç”¨æ“作系统定ä½API实现。\\n\n éƒ¨åˆ†æ‰‹æœºå› gms兼容ä¸å¥½å¯èƒ½å¯¼è‡´æ— 法定ä½ã€‚\\n\n gcjå›½æ ‡ã€é€†åœ°ç†ä¿¡æ¯ç‰åŠŸèƒ½éœ€ä¸‰æ–¹sdk定ä½ã€‚如果需è¦ç±»ä¼¼èƒ½åŠ›å¯ä»¥ä¸‹è½½è…¾è®¯å®šä½æ’件,打包自定义基座。å‚考示例:</text>\n <u-link :href=\"'https://ext.dcloud.net.cn/plugin?id=14569'\" :text=\"'https://ext.dcloud.net.cn/plugin?id=14569'\" :inWhiteList=\"true\"></u-link>\n </view>\n\n <view class=\"uni-padding-wrap uni-common-mt\">\n <view class=\"uni-list\">\n <radio-group @change=\"radioChange\">\n <radio class=\"uni-list-cell uni-list-cell-pd\" v-for=\"(item, index) in items\" :key=\"item.value\"\n :class=\"index < items.length - 1 ? 'uni-list-cell-line': ''\" :value=\"item.value\"\n :checked=\"index === current\">\n {{item.name}}\n </radio>\n </radio-group>\n </view>\n <view class=\"uni-list-cell uni-list-cell-pd\">\n <view class=\"uni-list-cell-db\">高度信æ¯</view>\n <switch :checked=\"altitudeSelect\" @change=\"altitudeChange\" />\n </view>\n <view class=\"uni-list-cell uni-list-cell-pd\">\n <view class=\"uni-list-cell-db\">å¼€å¯é«˜ç²¾åº¦å®šä½</view>\n <switch :checked=\"isHighAccuracySelect\" @change=\"highAccuracySelectChange\" />\n </view>\n <view class=\"uni-list-cell uni-list-cell-pd\">\n <view class=\"uni-list-cell-db\">是å¦è§£æžåœ°å€ä¿¡æ¯</view>\n <switch :checked=\"geocodeSelect\" @change=\"geocodeChange\" />\n </view>\n <text>{{exeRet}}</text>\n <view class=\"uni-btn-v\">\n <button class=\"uni-btn\" type=\"default\" @tap=\"getLocationTap\">获å–定ä½</button>\n </view>\n </view>\n</template>\n\n\n```\n>Script\n```uts\n\n type ItemType = {\n value : 'wgs84' | 'gcj02',\n name : string,\n }\n export default {\n data() {\n return {\n title: 'get-location',\n altitudeSelect: false,\n isHighAccuracySelect: false,\n geocodeSelect: false,\n exeRet: '',\n items: [\n {\n value: 'wgs84',\n name: 'wgs84'\n },\n {\n value: 'gcj02',\n name: 'gcj02'\n }\n ] as ItemType[],\n current: 0,\n }\n },\n methods: {\n altitudeChange: function (e : UniSwitchChangeEvent) {\n this.altitudeSelect = e.detail.value\n },\n geocodeChange: function (e : UniSwitchChangeEvent) {\n this.geocodeSelect = e.detail.value\n },\n highAccuracySelectChange: function (e : UniSwitchChangeEvent) {\n this.isHighAccuracySelect = e.detail.value\n },\n radioChange(e : UniRadioGroupChangeEvent) {\n for (let i = 0; i < this.items.length; i++) {\n if (this.items[i].value === e.detail.value) {\n this.current = i;\n break;\n }\n }\n },\n getLocationTap: function () {\n uni.showLoading({\n title: '定ä½ä¸'\n })\n uni.getLocation(({\n type: this.items[this.current].value,\n altitude: this.altitudeSelect,\n isHighAccuracy: this.isHighAccuracySelect,\n geocode: this.geocodeSelect,\n success: (res : any) => {\n uni.hideLoading()\n console.log(res);\n this.exeRet = JSON.stringify(res)\n },\n fail: (res : any) => {\n uni.hideLoading()\n console.log(res);\n this.exeRet = JSON.stringify(res)\n },\n complete: (res : any) => {\n uni.hideLoading()\n console.log(res);\n this.exeRet = JSON.stringify(res)\n }\n }));\n\n\n }\n\n }\n }\n\n```\n:::"},"getStorageInfo":{"name":"## uni.getStorageInfo(options) @getstorageinfo","description":"uni.getStorageInfo函数定义<br/>异æ¥èŽ·å–å½“å‰ storage 的相关信æ¯ã€‚<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [GetStorageInfoOptions](#getstorageinfooptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (res: [GetStorageInfoSuccess](#getstorageinfosuccess-values)) => void \\| null | å¦ | - | - | uni.getStorageInfoæˆåŠŸå›žè°ƒå‡½æ•°å®šä¹‰ |\n@| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | å¦ | - | - | uni.getStorageInfo失败回调函数定义 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | uni.getStorageInfo完æˆå›žè°ƒå‡½æ•°å®šä¹‰ | \n\n##### GetStorageInfoSuccess 的属性值 @getstorageinfosuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| keys | Array\\<string\\> | 是 | - | - | å½“å‰ storage ä¸æ‰€æœ‰çš„ key |\n| currentSize | number | 是 | - | - | 当å‰å 用的空间大å°, å•ä½ï¼škb |\n| limitSize | number | 是 | - | - | é™åˆ¶çš„空间大å°, å•ä½ï¼škb |\n","returnValue":"","compatibility":"### getStorageInfo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/storage/storage.html#getstorageinfo)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.getStorageInfo)\n"},"getStorageInfoSync":{"name":"## uni.getStorageInfoSync() @getstorageinfosync","description":"uni.getStorageInfoSync函数定义<br/>åŒæ¥èŽ·å–å½“å‰ storage 的相关信æ¯ã€‚<br/><br/>","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| **GetStorageInfoSuccess** |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| keys | Array\\<string\\> | 是 | - | - | å½“å‰ storage ä¸æ‰€æœ‰çš„ key |\n@| currentSize | number | 是 | - | - | 当å‰å 用的空间大å°, å•ä½ï¼škb |\n@| limitSize | number | 是 | - | - | é™åˆ¶çš„空间大å°, å•ä½ï¼škb | \n","compatibility":"### getStorageInfoSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/storage/storage.html#getstorageinfosync)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.getStorageInfoSync)\n"},"getStorage":{"name":"## uni.getStorage(options) @getstorage","description":"uni.getStorage函数定义<br/>从本地å˜å‚¨ä¸å¼‚æ¥èŽ·å–指定 key 对应的内容。<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [GetStorageOptions](#getstorageoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| key | string | 是 | - | - | 本地å˜å‚¨ä¸çš„指定的 key |\n@| success | (res: [GetStorageSuccess](#getstoragesuccess-values)) => void \\| null | å¦ | - | - | uni.getStorageæˆåŠŸå›žè°ƒå‡½æ•°å®šä¹‰ |\n@| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | å¦ | - | - | uni.getStorage失败回调函数定义 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | uni.getStorage完æˆå›žè°ƒå‡½æ•°å®šä¹‰ | \n\n##### GetStorageSuccess 的属性值 @getstoragesuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| data | any \\| null | å¦ | - | - | key 对应的内容 |\n","returnValue":"","compatibility":"### getStorage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/storage/storage.html#getstorage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.getStorage)\n"},"getStorageSync":{"name":"## uni.getStorageSync(key) @getstoragesync","description":"uni.getStorageSync函数定义<br/>从本地å˜å‚¨ä¸åŒæ¥èŽ·å–指定 key 对应的内容。<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| key | string | 是 | - | - | 本地å˜å‚¨ä¸çš„指定的 key | \n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| any \\| null | å¦ |\n \n","compatibility":"### getStorageSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/storage/storage.html#getstoragesync)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.getStorageSync)\n"},"setStorage":{"name":"## uni.setStorage(options) @setstorage","description":"uni.setStorage函数定义<br/>将数æ®å˜å‚¨åœ¨æœ¬åœ°storageå˜å‚¨ä¸æŒ‡å®šçš„ key ä¸ï¼Œä¼šè¦†ç›–掉原æ¥è¯¥ key 对应的内容,这是一个异æ¥æŽ¥å£ã€‚ <br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **SetStorageOptions** | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| key | string | 是 | - | - | 本地å˜å‚¨ä¸çš„指定的 key |\n@| data | any | 是 | - | - | 需è¦å˜å‚¨çš„内容,åªæ”¯æŒèƒ½é€šè¿‡ JSON.stringify åºåˆ—化的对象 |\n@| success | (res: SetStorageSuccess) => void \\| null | å¦ | - | - | uni.setStorageæˆåŠŸå›žè°ƒå‡½æ•°å®šä¹‰ |\n@| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | å¦ | - | - | uni.setStorage失败回调函数定义 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | uni.setStorage完æˆå›žè°ƒå‡½æ•°å®šä¹‰ | \n","returnValue":"","compatibility":"### setStorage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/storage/storage.html#setstorage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.setStorage)\n"},"setStorageSync":{"name":"## uni.setStorageSync(key, data) @setstoragesync","description":"uni.setStorageSync函数定义<br/>å°† data å˜å‚¨åœ¨æœ¬åœ°storageå˜å‚¨ä¸æŒ‡å®šçš„ key ä¸ï¼Œä¼šè¦†ç›–掉原æ¥è¯¥ key 对应的内容,这是一个åŒæ¥æŽ¥å£ã€‚<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| key | string | 是 | - | - | 本地storageå˜å‚¨ä¸çš„指定的 key |\n| data | any | 是 | - | - | 需è¦å˜å‚¨çš„内容,åªæ”¯æŒèƒ½é€šè¿‡ JSON.stringify åºåˆ—化的对象 | \n","returnValue":"","compatibility":"### setStorageSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/storage/storage.html#setstoragesync)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.setStorageSync)\n"},"removeStorage":{"name":"## uni.removeStorage(options) @removestorage","description":"uni.removeStorage函数定义<br/>从本地å˜å‚¨ä¸å¼‚æ¥ç§»é™¤æŒ‡å®š key。<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **RemoveStorageOptions** | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| key | string | 是 | - | - | 本地å˜å‚¨ä¸çš„指定的 key |\n@| success | (res: RemoveStorageSuccess) => void \\| null | å¦ | - | - | uni.removeStorageæˆåŠŸå›žè°ƒå‡½æ•°å®šä¹‰ |\n@| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | å¦ | - | - | uni.removeStorage失败回调函数定义 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | uni.removeStorage完æˆå›žè°ƒå‡½æ•°å®šä¹‰ | \n","returnValue":"","compatibility":"### removeStorage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](hhttps://uniapp.dcloud.net.cn/api/storage/storage.html#removestorage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.removeStorage)\n"},"removeStorageSync":{"name":"## uni.removeStorageSync(key) @removestoragesync","description":"uni.removeStorageSync函数定义<br/>从本地å˜å‚¨ä¸åŒæ¥ç§»é™¤æŒ‡å®š key。<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| key | string | 是 | - | - | 本地å˜å‚¨ä¸çš„指定的 key | \n","returnValue":"","compatibility":"### removeStorageSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/storage/storage.html#removestoragesync)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.removeStorageSync)\n"},"clearStorage":{"name":"## uni.clearStorage(option?) @clearstorage","description":"uni.clearStorage函数定义<br/>清除本地数æ®å˜å‚¨ã€‚<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| option | **ClearStorageOptions** \\| null | å¦ | - | - | uni.removeStorageå‚数定义 |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (res: ClearStorageSuccess) => void \\| null | å¦ | - | - | uni.clearStorage æˆåŠŸå›žè°ƒå‡½æ•°å®šä¹‰ |\n@| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | å¦ | - | - | uni.clearStorage 失败回调函数定义 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | uni.clearStorage 完æˆå›žè°ƒå‡½æ•°å®šä¹‰ | \n","returnValue":"","compatibility":"### clearStorage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/storage/storage.html#clearstorage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.clearStorage)\n"},"clearStorageSync":{"name":"## uni.clearStorageSync() @clearstoragesync","description":"uni.clearStorageSync函数定义<br/>清除本地数æ®å˜å‚¨ã€‚<br/>","param":"","returnValue":"","compatibility":"### clearStorageSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/storage/storage.html#clearstoragesync)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.clearStorageSync)\n"},"storage":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/storage/storage.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/storage/storage\n>Template\n```vue\n<template>\n <!-- #ifdef APP -->\n <scroll-view class=\"page-scroll-view\">\n <!-- #endif -->\n <view>\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-common-mt\">\n <view class=\"uni-list\">\n <view class=\"uni-list-cell uni-list-cell-line\">\n <view class=\"uni-list-cell-left\">\n <view class=\"uni-label\">key</view>\n </view>\n <view class=\"uni-list-cell-db\">\n <input class=\"uni-input\" type=\"text\" placeholder=\"请输入key\" name=\"key\" :value=\"key\" maxlength=\"-1\" @input=\"keyChange\" />\n </view>\n </view>\n <view class=\"uni-list-cell\">\n <view class=\"uni-list-cell-left\">\n <view class=\"uni-label\">value</view>\n </view>\n <view class=\"uni-list-cell-db\">\n <input class=\"uni-input\" type=\"text\" placeholder=\"请输入value\" name=\"data\"\n :value=\"typeof data === 'string' ? data : JSON.stringify(data)\" maxlength=\"-1\" @input=\"dataChange\" />\n </view>\n </view>\n </view>\n <view class=\"uni-padding-wrap\">\n <view class=\"uni-btn-v\">\n <button class=\"uni-btn btn-getStorageInfoASync\" type=\"primary\" @tap=\"getStorageInfo\">\n 获å–å˜å‚¨æ¦‚è¿°ä¿¡æ¯-异æ¥\n </button>\n <button class=\"uni-btn btn-getStorageInfoSync\" @tap=\"getStorageInfoSync\">\n 获å–å˜å‚¨æ¦‚è¿°ä¿¡æ¯-åŒæ¥\n </button>\n </view>\n <text>{{ storageInfo }}</text>\n <view class=\"uni-flex uni-row\">\n <button type=\"default\" style=\"width:50%\" @tap=\"strMock\">\n å¡«å……å—符串\n </button>\n <button type=\"default\" style=\"width:50%\" @tap=\"complexMock\">\n å¡«å……å¤æ‚对象\n </button>\n </view>\n <view class=\"uni-flex uni-row\">\n <button type=\"default\" style=\"width:50%\" @tap=\"numberMock\">\n å¡«å……æ•´åž‹\n </button>\n <button type=\"default\" style=\"width:50%\" @tap=\"floatMock\">\n 填充浮点型\n </button>\n </view>\n <view class=\"uni-flex uni-row\">\n <button type=\"default\" style=\"width:50%\" @tap=\"jsonLikeMock\">\n å¡«å……jsonå—符串\n </button>\n <button type=\"default\" style=\"width:50%\" @tap=\"longLikeMock\">\n å¡«å……æ•´æ•°å—符串\n </button>\n </view>\n <view class=\"uni-flex uni-row\">\n <button type=\"default\" style=\"width:50%\" @tap=\"floatLikeMock\">\n 填充浮点å—符串\n </button>\n <button type=\"default\" style=\"width:50%\" @tap=\"negativeLikeMock\">\n å¡«å……è´Ÿæ•°å—符串\n </button>\n </view>\n </view>\n <view class=\"uni-padding-wrap\">\n <view class=\"uni-btn-v\">\n <button type=\"primary\" class=\"uni-btn btn-setstorageAsync\" @tap=\"setStorage\">\n å˜å‚¨æ•°æ®-异æ¥\n </button>\n <button class=\"uni-btn btn-getstorageAsync\" @tap=\"getStorage\">读å–æ•°æ®-异æ¥</button>\n <button class=\"uni-btn btn-removeStorageInfoASync\" @tap=\"removeStorage\">移除数æ®-异æ¥</button>\n <button class=\"uni-btn btn-clearStorageInfoASync\" @tap=\"clearStorage\">清ç†æ•°æ®-异æ¥</button>\n </view>\n\n <view class=\"uni-btn-v\">\n <button type=\"primary\" class=\"uni-btn btn-setstorageSync\" @tap=\"setStorageSync\">\n å˜å‚¨æ•°æ®-åŒæ¥\n </button>\n <button class=\"uni-btn btn-getstorageSync\" @tap=\"getStorageSync\">读å–æ•°æ®-åŒæ¥</button>\n <button class=\"uni-btn btn-removeStorageInfoSync\" @tap=\"removeStorageSync\">\n 移除数æ®-åŒæ¥\n </button>\n <button class=\"uni-btn btn-clearStorageInfoSync\" @tap=\"clearStorageSync\">\n 清ç†æ•°æ®-åŒæ¥\n </button>\n </view>\n </view>\n </view>\n </view>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n\n\n<style>\n</style>\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n title: 'get/set/clearStorage',\n key: '',\n data: '' as any,\n apiGetData: '' as any | null,\n storageInfo: '',\n }\n },\n methods: {\n getStorageInfo() {\n uni.getStorageInfo({\n success: (res) => {\n this.apiGetData = res\n this.storageInfo = JSON.stringify(res)\n },\n })\n },\n getStorageInfoSync() {\n try {\n const res = uni.getStorageInfoSync()\n this.apiGetData = res\n this.storageInfo = JSON.stringify(res)\n } catch (e) {\n // error\n console.log(e)\n }\n },\n jsonLikeMock() {\n this.key = 'key_' + Math.random()\n this.data = JSON.stringify({\n name: \"james\",\n age: 12,\n from: \"american\"\n });\n\n },\n longLikeMock() {\n this.key = 'key_' + Math.random()\n this.data = \"1234567890\"\n },\n floatLikeMock() {\n this.key = 'key_' + Math.random()\n this.data = \"321456.1234567890\"\n },\n negativeLikeMock() {\n this.key = 'key_' + Math.random()\n this.data = \"-321456\"\n },\n strMock() {\n this.key = 'key_' + Math.random()\n this.data = '测试å—符串数æ®ï¼Œé•¿åº¦ä¸º16个å—符'\n },\n complexMock() {\n this.key = 'key_' + Math.random()\n let jsonObj = {\n name: 'å¼ ä¸‰',\n age: 12,\n classMate: [\n {\n id: 1001,\n name: 'æŽå››',\n },\n {\n id: 1002,\n name: 'jack ma',\n },\n ],\n }\n this.data = jsonObj\n },\n numberMock() {\n this.key = 'key_' + Math.random()\n this.data = 10011\n },\n floatMock() {\n this.key = 'key_' + Math.random()\n this.data = 3.1415926535893384626\n },\n\n keyChange: function (e : InputEvent) {\n this.key = e.detail.value\n },\n dataChange: function (e : InputEvent) {\n this.data = e.detail.value\n },\n getStorage: function () {\n var key = this.key\n if (key.length == 0) {\n uni.showModal({\n title: '读å–æ•°æ®å¤±è´¥',\n content: 'key ä¸èƒ½ä¸ºç©º',\n showCancel: false,\n })\n } else {\n let that = this\n uni.getStorage({\n key: key,\n success: (res) => {\n\n that.apiGetData = res.data\n let desc : string = typeof this.apiGetData\n if (\"object\" == desc) {\n desc = desc + \": \" + JSON.stringify(this.apiGetData)\n } else {\n desc = desc + \": \" + this.apiGetData\n }\n\n uni.showModal({\n title: '读å–æ•°æ®æˆåŠŸ',\n content: desc,\n showCancel: false,\n })\n },\n fail: () => {\n uni.showModal({\n title: '读å–æ•°æ®å¤±è´¥',\n content: '找ä¸åˆ° key 对应的数æ®',\n showCancel: false,\n })\n },\n })\n }\n },\n getStorageSync: function () {\n var key = this.key\n if (key.length == 0) {\n uni.showModal({\n title: '读å–æ•°æ®å¤±è´¥',\n content: 'key ä¸èƒ½ä¸ºç©º',\n showCancel: false,\n })\n } else {\n this.apiGetData = uni.getStorageSync(key)\n\n let desc : string = typeof this.apiGetData\n if (\"object\" == desc) {\n desc = desc + \": \" + JSON.stringify(this.apiGetData)\n } else {\n desc = desc + \": \" + this.apiGetData\n }\n\n uni.showModal({\n title: '读å–æ•°æ®æˆåŠŸ',\n content: desc,\n showCancel: false,\n })\n }\n },\n setStorage: function () {\n var key = this.key\n var data = this.data\n if (key.length == 0) {\n uni.showModal({\n title: 'ä¿å˜æ•°æ®å¤±è´¥',\n content: 'key ä¸èƒ½ä¸ºç©º',\n showCancel: false,\n })\n } else {\n uni.setStorage({\n key: key,\n data: data,\n success: () => {\n uni.showModal({\n title: 'å˜å‚¨æ•°æ®æˆåŠŸ',\n showCancel: false,\n })\n },\n fail: () => {\n uni.showModal({\n title: '储å˜æ•°æ®å¤±è´¥!',\n showCancel: false,\n })\n },\n })\n }\n },\n setStorageSync: function () {\n var key = this.key\n var data = this.data\n if (key.length == 0) {\n uni.showModal({\n title: 'ä¿å˜æ•°æ®å¤±è´¥',\n content: 'key ä¸èƒ½ä¸ºç©º',\n showCancel: false,\n })\n } else {\n uni.setStorageSync(key, data)\n uni.showModal({\n title: 'å˜å‚¨æ•°æ®æˆåŠŸ',\n showCancel: false,\n })\n }\n },\n removeStorage: function () {\n uni.removeStorage({\n key: this.key,\n success: () => {\n uni.showModal({\n title: '移除数æ®æˆåŠŸ',\n showCancel: false,\n })\n },\n fail: () => {\n uni.showModal({\n title: '移除数æ®å¤±è´¥',\n showCancel: false,\n })\n },\n })\n },\n removeStorageSync: function () {\n uni.removeStorageSync(this.key)\n uni.showModal({\n title: '移除数æ®æˆåŠŸ',\n showCancel: false,\n })\n },\n clearStorage: function () {\n this.key = ''\n this.data = ''\n uni.clearStorage({\n success: function (_) {\n uni.showModal({\n title: '清除数æ®æˆåŠŸ',\n showCancel: false,\n })\n },\n fail: function (_) {\n uni.showModal({\n title: '清除数æ®å¤±è´¥',\n showCancel: false,\n })\n },\n })\n },\n clearStorageSync: function () {\n this.key = ''\n this.data = ''\n uni.clearStorageSync()\n uni.showModal({\n title: '清除数æ®æˆåŠŸ',\n content: ' ',\n showCancel: false,\n })\n },\n },\n }\n\n```\n:::"},"getFileSystemManager":{"name":"## uni.getFileSystemManager() @getfilesystemmanager","description":"获å–文件管ç†å™¨","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [FileSystemManager](#filesystemmanager-values) |\n\n#### FileSystemManager 的方法 @filesystemmanager-values \n\n#### readFile(options) @readfile\n读å–本地文件内容\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ReadFileOptions](#readfileoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| encoding | \"base64\" \\| \"utf-8\" | 是 | - | - | base64 / utf-8 |\n@| filePath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | 文件路径,支æŒç›¸å¯¹åœ°å€å’Œç»å¯¹åœ°å€ï¼Œapp-androidå¹³å°æ”¯æŒä»£ç 包文件目录 |\n@| success | (res: [ReadFileSuccessResult](#readfilesuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 通用的错误返回结果回调 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 通用的结æŸè¿”回结果回调 | \n\n##### ReadFileSuccessResult 的属性值 @readfilesuccessresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| data | string | 是 | - | - | - |\n\n##### IFileSystemManagerFail 的属性值 @ifilesystemmanagerfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1200002 \\| 1300002 \\| 1300013 \\| 1300021 \\| 1300022 \\| 1300066 \\| 1301003 \\| 1301005 \\| 1300201 \\| 1300202 \\| 1301111 \\| 1302003 \\| 1300009 | 是 | - | - | 错误ç <br/>- 1200002 ç±»åž‹é”™è¯¯ã€‚ä»…æ”¯æŒ base64 / utf-8<br/>- 1300002 未找到文件<br/>- 1300013 æ— æƒé™<br/>- 1300021 是目录<br/>- 1300022 å‚æ•°æ— æ•ˆ<br/>- 1300066 目录éžç©º<br/>- 1301003 对目录的éžæ³•æ“作<br/>- 1301005 文件已å˜åœ¨<br/>- 1300201 系统错误<br/>- 1300202 超出文件å˜å‚¨é™åˆ¶çš„最大尺寸<br/>- 1301111 brotli解压失败<br/>- 1302003 æ ‡å¿—æ— æ•ˆ<br/>- 1300009 文件æ述符错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n\n##### readFile 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n\n\n#### readFileSync(filePath, encoding?) @readfilesync\nFileSystemManager.readFile çš„åŒæ¥ç‰ˆæœ¬å‚æ•°\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| filePath | string | 是 | - | - | 文件路径,支æŒç›¸å¯¹åœ°å€å’Œç»å¯¹åœ°å€ï¼Œapp-androidå¹³å°æ”¯æŒä»£ç 包文件目录 |\n| encoding | string \\| null | å¦ | - | - | base64 / utf-8 | \n\n##### 返回值 \n\n| 类型 |\n| :- |\n| string |\n \n\n##### readFileSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### writeFile(options) @writefile\n写文件\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [WriteFileOptions](#writefileoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | 文件路径,åªæ”¯æŒç»å¯¹åœ°å€ |\n@| encoding | \"ascii\" \\| \"base64\" \\| \"utf-8\" | 是 | - | - | 指定写入文件的å—符编ç <br/>支æŒ:ascii base64 utf-8 |\n@| data | string | 是 | - | - | 写入的文本内容 |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 通用的æ£ç¡®è¿”回结果回调 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### FileManagerSuccessResult 的属性值 @filemanagersuccessresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n\n\n##### writeFile 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n\n\n#### writeFileSync(filePath, data, encoding) @writefilesync\nFileSystemManager.writeFile çš„åŒæ¥ç‰ˆæœ¬\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| filePath | string | 是 | - | - | 文件路径,åªæ”¯æŒç»å¯¹åœ°å€ |\n| data | string | 是 | - | - | 写入的文本内容 |\n| encoding | string | 是 | - | - | 指定写入文件的å—符编ç ,支æŒ:ascii base64 utf-8 | \n\n\n##### writeFileSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### unlink(options) @unlink\nåˆ é™¤æ–‡ä»¶\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **UnLinkOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | 文件路径,åªæ”¯æŒç»å¯¹åœ°å€ |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### unlink 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n\n\n#### unlinkSync(filePath) @unlinksync\nFileSystemManager.unlink çš„åŒæ¥ç‰ˆæœ¬\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| filePath | string | 是 | - | - | 文件路径,åªæ”¯æŒç»å¯¹åœ°å€ | \n\n\n##### unlinkSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### mkdir(options) @mkdir\n创建目录\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MkDirOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| dirPath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | 创建的目录路径 (本地路径) |\n@| recursive | boolean | 是 | - | - | 是å¦åœ¨é€’归创建该目录的上级目录åŽå†åˆ›å»ºè¯¥ç›®å½•ã€‚如果对应的上级目录已ç»å˜åœ¨ï¼Œåˆ™ä¸åˆ›å»ºè¯¥ä¸Šçº§ç›®å½•ã€‚如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,å†åœ¨ a 目录下创建 b 目录,以æ¤ç±»æŽ¨ç›´è‡³åˆ›å»º a/b/c 目录下的 d 目录。 |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### mkdir 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n\n\n#### mkdirSync(dirPath, recursive) @mkdirsync\nFileSystemManager.mkdir çš„åŒæ¥ç‰ˆæœ¬\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| dirPath | string | 是 | - | - | 创建的目录路径 (本地路径) |\n| recursive | boolean | 是 | - | - | 是å¦åœ¨é€’归创建该目录的上级目录åŽå†åˆ›å»ºè¯¥ç›®å½•ã€‚如果对应的上级目录已ç»å˜åœ¨ï¼Œåˆ™ä¸åˆ›å»ºè¯¥ä¸Šçº§ç›®å½•ã€‚如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,å†åœ¨ a 目录下创建 b 目录,以æ¤ç±»æŽ¨ç›´è‡³åˆ›å»º a/b/c 目录下的 d 目录。 | \n\n\n##### mkdirSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### rmdir(options) @rmdir\nåˆ é™¤ç›®å½•\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **RmDirOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| dirPath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | è¦åˆ 除的目录路径 (本地路径) |\n@| recursive | boolean | 是 | - | - | 是å¦é€’å½’åˆ é™¤ç›®å½•ã€‚å¦‚æžœä¸º trueï¼Œåˆ™åˆ é™¤è¯¥ç›®å½•å’Œè¯¥ç›®å½•ä¸‹çš„æ‰€æœ‰å目录以åŠæ–‡ä»¶ã€‚ |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### rmdir 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n\n\n#### rmdirSync(dirPath, recursive) @rmdirsync\nFileSystemManager.rmdir çš„åŒæ¥ç‰ˆæœ¬\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| dirPath | string | 是 | - | - | è¦åˆ 除的目录路径 (本地路径) |\n| recursive | boolean | 是 | - | - | 是å¦é€’å½’åˆ é™¤ç›®å½•ã€‚å¦‚æžœä¸º trueï¼Œåˆ™åˆ é™¤è¯¥ç›®å½•å’Œè¯¥ç›®å½•ä¸‹çš„æ‰€æœ‰å目录以åŠæ–‡ä»¶ã€‚ | \n\n\n##### rmdirSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### readdir(options) @readdir\n读å–目录内文件列表\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ReadDirOptions](#readdiroptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| dirPath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | è¦è¯»å–的目录路径 (本地路径) |\n@| success | (res: [ReadDirSuccessResult](#readdirsuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### ReadDirSuccessResult 的属性值 @readdirsuccessresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| files | Array\\<string\\> | 是 | - | - | - |\n\n\n##### readdir 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n\n\n#### readdirSync(dirPath) @readdirsync\nFileSystemManager.readdir çš„åŒæ¥ç‰ˆæœ¬\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| dirPath | string | 是 | - | - | è¦è¯»å–的目录路径 (本地路径) | \n\n##### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Array\\<string\\> \\| null | å¦ |\n \n\n##### readdirSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### access(options) @access\n判æ–文件/目录是å¦å˜åœ¨\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **AccessOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| path | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | è¦åˆ 除的目录路径 (本地路径) |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### access 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n\n\n#### accessSync(path) @accesssync\nFileSystemManager.access çš„åŒæ¥ç‰ˆæœ¬\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| path | string | 是 | - | - | è¦åˆ 除的目录路径 (本地路径) | \n\n\n##### accessSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### rename(options) @rename\né‡å‘½å文件。å¯ä»¥æŠŠæ–‡ä»¶ä»Ž oldPath 移动到 newPath\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **RenameOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| oldPath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | æºæ–‡ä»¶è·¯å¾„,支æŒæœ¬åœ°è·¯å¾„ |\n@| newPath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | 新文件路径,支æŒæœ¬åœ°è·¯å¾„ |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### rename 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n\n\n#### renameSync(oldPath, newPath) @renamesync\nFileSystemManager.rename çš„åŒæ¥ç‰ˆæœ¬\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| oldPath | string | 是 | - | - | æºæ–‡ä»¶è·¯å¾„,支æŒæœ¬åœ°è·¯å¾„ |\n| newPath | string | 是 | - | - | 新文件路径,支æŒæœ¬åœ°è·¯å¾„ | \n\n\n##### renameSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### copyFile(options) @copyfile\nå¤åˆ¶æ–‡ä»¶\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **CopyFileOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| srcPath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | æºæ–‡ä»¶è·¯å¾„,支æŒæœ¬åœ°è·¯å¾„ |\n@| destPath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | 新文件路径,支æŒæœ¬åœ°è·¯å¾„ |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### copyFile 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n\n\n#### copyFileSync(srcPath, destPath) @copyfilesync\nFileSystemManager.copyFile çš„åŒæ¥ç‰ˆæœ¬\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| srcPath | string | 是 | - | - | æºæ–‡ä»¶è·¯å¾„,支æŒæœ¬åœ°è·¯å¾„ |\n| destPath | string | 是 | - | - | 新文件路径,支æŒæœ¬åœ°è·¯å¾„ | \n\n\n##### copyFileSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### getFileInfo(options) @getfileinfo\n获å–该本地临时文件 或 本地缓å˜æ–‡ä»¶ ä¿¡æ¯\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [GetFileInfoOptions](#getfileinfooptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | è¦è¯»å–的文件路径 (本地路径) |\n@| digestAlgorithm | \"md5\" \\| \"sha1\" | 是 | - | - | md5 / sha1 |\n@| success | (res: [GetFileInfoSuccessResult](#getfileinfosuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### GetFileInfoSuccessResult 的属性值 @getfileinfosuccessresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| digest | string | 是 | - | - | - |\n| size | number | 是 | - | - | - |\n| errMsg | string | 是 | - | - | - |\n\n\n##### getFileInfo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n\n\n#### stat(options) @stat\n获å–文件 Stats 对象\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [StatOptions](#statoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| path | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | 文件/目录路径 (本地路径) |\n@| recursive | boolean | 是 | - | - | 是å¦é€’归获å–目录下的æ¯ä¸ªæ–‡ä»¶çš„ Stats ä¿¡æ¯ |\n@| success | (res: [StatSuccessResult](#statsuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### StatSuccessResult 的属性值 @statsuccessresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n| stats | Array\\<[FileStats](#filestats-values)\\> | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| path | string | 是 | - | - | - |\n@| stats | [Stats](#stats-values) | 是 | - | - | - |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| mode | number | 是 | - | - | 文件的类型和å˜å–çš„æƒé™ï¼Œå¯¹åº” POSIX stat.st_mode<br/>注æ„androidä¸ï¼Œæ–‡ä»¶ç±»åž‹åªåŒ…å«æ˜¯å¦æ˜¯ç›®å½•ä¸Žæ–‡ä»¶ï¼Œ<br/>å¦å¤–在androidä¸è¿™é‡Œçš„æƒé™æŒ‡çš„是当å‰è¿›ç¨‹å¯¹æ–‡ä»¶æˆ–者文件夹是å¦æœ‰è¯»ï¼Œå†™ï¼Œæ‰§è¡Œçš„æƒé™ï¼Œ<br/>这里没有与 POSIX stat.st_mode对应的组,其他人ç‰ç›¸å…³æƒé™çš„æ•°æ®è¿”回,åªæœ‰æ‰€æœ‰è€…的相关æƒé™ |\n@@| size | number | 是 | - | - | 文件大å°ï¼Œå•ä½ï¼šB,对应 POSIX stat.st_size |\n@@| lastAccessedTime | number | 是 | - | - | 文件最近一次被å˜å–或被执行的时间,UNIX 时间戳,对应 POSIX stat.st_atime<br/>注æ„:androidä¸ç”±äºŽç³»ç»Ÿé™åˆ¶æ— 法获å–è¯¥æ•°æ® |\n@@| lastModifiedTime | number | 是 | - | - | 文件最åŽä¸€æ¬¡è¢«ä¿®æ”¹çš„时间,UNIX 时间戳,对应 POSIX stat.st_mtime |\n\n##### Stats 的方法 @stats-values \n\n##### isDirectory() @isdirectory\n判æ–当å‰æ–‡ä»¶æ˜¯å¦ä¸€ä¸ªç›®å½•\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| boolean |\n \n\n###### isDirectory 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n##### isFile() @isfile\n判æ–当å‰æ–‡ä»¶æ˜¯å¦ä¸€ä¸ªæ™®é€šæ–‡ä»¶\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| boolean |\n \n\n###### isFile 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n\n##### stat 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n\n\n#### statSync(path, recursive) @statsync\nFileSystemManager.stat çš„åŒæ¥ç‰ˆæœ¬\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| path | string | 是 | - | - | 文件/目录路径 (本地路径) |\n| recursive | boolean | 是 | - | - | 是å¦é€’归获å–目录下的æ¯ä¸ªæ–‡ä»¶çš„ Stats ä¿¡æ¯ | \n\n##### 返回值 \n\n| 类型 |\n| :- |\n| Array\\<[FileStats](#filestats-values)\\> |\n \n\n##### statSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### appendFile(options) @appendfile\nåœ¨æ–‡ä»¶ç»“å°¾è¿½åŠ å†…å®¹\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **AppendFileOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | è¦è¿½åŠ 内容的文件路径 (本地路径) |\n@| encoding | \"ascii\" \\| \"base64\" \\| \"utf-8\" | 是 | - | - | 指定写入文件的å—符编ç <br/>支æŒ:ascii base64 utf-8 |\n@| data | string | 是 | - | - | è¦è¿½åŠ 的文本 |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### appendFile 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### appendFileSync(filePath, data, encoding) @appendfilesync\nFileSystemManager.appendFile çš„åŒæ¥ç‰ˆæœ¬\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| filePath | string | 是 | - | - | è¦è¿½åŠ 内容的文件路径 (本地路径) |\n| data | string | 是 | - | - | è¦è¿½åŠ 的文本 |\n| encoding | string | 是 | - | - | 指定写入文件的å—符编ç 支æŒ:ascii base64 utf-8 | \n\n\n##### appendFileSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### saveFile(options) @savefile\nä¿å˜ä¸´æ—¶æ–‡ä»¶åˆ°æœ¬åœ°ã€‚æ¤æŽ¥å£ä¼šç§»åŠ¨ä¸´æ—¶æ–‡ä»¶ï¼Œå› æ¤è°ƒç”¨æˆåŠŸåŽï¼ŒtempFilePath å°†ä¸å¯ç”¨ã€‚\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [SaveFileOptions](#savefileoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| tempFilePath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | 临时å˜å‚¨æ–‡ä»¶è·¯å¾„ (本地路径) |\n@| filePath | [string.URIString](/uts/data-type.md#ide-string) \\| null | å¦ | - | - | è¦å˜å‚¨çš„文件路径 (本地路径) |\n@| success | (res: [SaveFileSuccessResult](#savefilesuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SaveFileSuccessResult 的属性值 @savefilesuccessresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| savedFilePath | string | 是 | - | - | å˜å‚¨åŽçš„文件路径 (本地路径) |\n\n\n##### saveFile 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### saveFileSync(tempFilePath, filePath?) @savefilesync\nFileSystemManager.saveFile çš„åŒæ¥ç‰ˆæœ¬\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| tempFilePath | string | 是 | - | - | 临时å˜å‚¨æ–‡ä»¶è·¯å¾„ (本地路径) |\n| filePath | string \\| null | å¦ | - | - | è¦å˜å‚¨çš„文件路径 (本地路径) | \n\n##### 返回值 \n\n| 类型 |\n| :- |\n| string |\n \n\n##### saveFileSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### removeSavedFile(options) @removesavedfile\nåˆ é™¤è¯¥å°ç¨‹åºä¸‹å·²ä¿å˜çš„本地缓å˜æ–‡ä»¶\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **RemoveSavedFileOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | 需è¦åˆ 除的文件路径 (本地路径) |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### removeSavedFile 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### unzip(options) @unzip\n解压文件\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **UnzipFileOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| zipFilePath | string | 是 | - | - | æºæ–‡ä»¶è·¯å¾„,支æŒæœ¬åœ°è·¯å¾„, åªå¯ä»¥æ˜¯ zip 压缩文件 |\n@| targetPath | string | 是 | - | - | ç›®æ ‡ç›®å½•è·¯å¾„, 支æŒæœ¬åœ°è·¯å¾„ |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### unzip 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### getSavedFileList(options) @getsavedfilelist\n获å–该已ä¿å˜çš„本地缓å˜æ–‡ä»¶åˆ—表\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [GetSavedFileListOptions](#getsavedfilelistoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (res: [GetSavedFileListResult](#getsavedfilelistresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### GetSavedFileListResult 的属性值 @getsavedfilelistresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| fileList | Array\\<string\\> | 是 | - | - | - |\n\n\n##### getSavedFileList 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### truncate(options) @truncate\n对文件内容进行截æ–æ“作\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **TruncateFileOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | è¦æˆªæ–的文件路径 (本地路径) |\n@| length | number | 是 | - | - | 截æ–ä½ç½®ï¼Œé»˜è®¤0。如果 length å°äºŽæ–‡ä»¶é•¿åº¦ï¼ˆå—节),则åªæœ‰å‰é¢ length 个å—节会ä¿ç•™åœ¨æ–‡ä»¶ä¸ï¼Œå…¶ä½™å†…å®¹ä¼šè¢«åˆ é™¤ï¼›<br/>如果 length 大于文件长度,ä¸åšå¤„ç† |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### truncate 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### truncateSync(filePath, length?) @truncatesync\n对文件内容进行截æ–æ“作 (truncate çš„åŒæ¥ç‰ˆæœ¬)\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| filePath | string | 是 | - | - | è¦æˆªæ–的文件路径 (本地路径) |\n| length | number | å¦ | - | - | 截æ–ä½ç½®ï¼Œé»˜è®¤0。如果 length å°äºŽæ–‡ä»¶é•¿åº¦ï¼ˆå—节),则åªæœ‰å‰é¢ length 个å—节会ä¿ç•™åœ¨æ–‡ä»¶ä¸ï¼Œå…¶ä½™å†…å®¹ä¼šè¢«åˆ é™¤ï¼›å¦‚æžœ length 大于文件长度,ä¸åšå¤„ç† | \n\n\n##### truncateSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### readCompressedFile(options) @readcompressedfile\n读å–指定压缩类型的本地文件内容\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ReadCompressedFileOptions](#readcompressedfileoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | è¦è¯»å–的文件的路径 (本地用户文件或代ç 包文件),app-androidå¹³å°æ”¯æŒä»£ç 包文件目录 |\n@| compressionAlgorithm | string | 是 | - | - | 文件压缩类型,目å‰ä»…æ”¯æŒ 'br'。 |\n@| success | (res: [ReadCompressedFileResult](#readcompressedfileresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### ReadCompressedFileResult 的属性值 @readcompressedfileresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| data | string | 是 | - | - | - |\n\n\n##### readCompressedFile 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### readCompressedFileSync(filePath, compressionAlgorithm) @readcompressedfilesync\nåŒæ¥è¯»å–指定压缩类型的本地文件内容\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| filePath | string | 是 | - | - | è¦è¯»å–的文件的路径 (本地用户文件或代ç 包文件),app-androidå¹³å°æ”¯æŒä»£ç 包文件目录 |\n| compressionAlgorithm | string | 是 | - | - | 文件压缩类型,目å‰ä»…æ”¯æŒ 'br'。 | \n\n##### 返回值 \n\n| 类型 |\n| :- |\n| string |\n \n\n##### readCompressedFileSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### open(options) @open\n打开文件,返回文件æ述符\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [OpenFileOptions](#openfileoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | è¦è¿½åŠ 内容的文件路径 (本地路径) |\n@| flag | \"a\" \\| \"ax\" \\| \"a+\" \\| \"ax+\" \\| \"r\" \\| \"r+\" \\| \"w\" \\| \"wx\" \\| \"w+\" \\| \"wx\" \\| \"wx+\" | 是 | - | - | æ–‡ä»¶ç³»ç»Ÿæ ‡å¿—ï¼Œé»˜è®¤å€¼: 'r' |\n@| success | (res: [OpenFileSuccessResult](#openfilesuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### OpenFileSuccessResult 的属性值 @openfilesuccessresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| fd | string | 是 | - | - | - |\n\n\n##### open 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### openSync(options) @opensync\nåŒæ¥æ‰“开文件,返回文件æ述符\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **OpenFileSyncOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | è¦è¿½åŠ 内容的文件路径 (本地路径) |\n@| flag | \"a\" \\| \"ax\" \\| \"a+\" \\| \"ax+\" \\| \"r\" \\| \"r+\" \\| \"w\" \\| \"wx\" \\| \"w+\" \\| \"wx\" \\| \"wx+\" | 是 | - | - | æ–‡ä»¶ç³»ç»Ÿæ ‡å¿—ï¼Œé»˜è®¤å€¼: 'r' | \n\n##### 返回值 \n\n| 类型 |\n| :- |\n| string |\n \n\n##### openSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### write(options) @write\n写入文件\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [WriteOptions](#writeoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| fd | string | 是 | - | - | 文件æ述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接å£èŽ·å¾— |\n@| data | string | 是 | - | - | 写入的内容 |\n@| encoding | \"ascii\" \\| \"base64\" \\| \"utf-8\" | 是 | - | - | 指定写入文件的å—符编ç <br/>支æŒ:ascii base64 utf-8 |\n@| success | (res: [WriteResult](#writeresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### WriteResult 的属性值 @writeresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| bytesWritten | number | 是 | - | - | 实际被写入到文件ä¸çš„å—节数(注æ„,被写入的å—节数ä¸ä¸€å®šä¸Žè¢«å†™å…¥çš„å—符串å—符数相åŒï¼‰ |\n\n\n##### write 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### writeSync(options) @writesync\nåŒæ¥å†™å…¥æ–‡ä»¶\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **WriteSyncOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| fd | string | 是 | - | - | 文件æ述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接å£èŽ·å¾— |\n@| data | string | 是 | - | - | 写入的内容 |\n@| encoding | \"ascii\" \\| \"base64\" \\| \"utf-8\" | 是 | - | - | 指定写入文件的å—符编ç <br/>支æŒ:ascii base64 utf-8 | \n\n##### 返回值 \n\n| 类型 |\n| :- |\n| [WriteResult](#writeresult-values) |\n \n\n##### writeSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### close(options) @close\nå…³é—文件\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **CloseOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| fd | string | 是 | - | - | 需è¦è¢«å…³é—的文件æ述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接å£èŽ·å¾— |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### close 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### closeSync(options) @closesync\nåŒæ¥å…³é—文件\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **CloseSyncOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| fd | string | 是 | - | - | 需è¦è¢«å…³é—的文件æ述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接å£èŽ·å¾— | \n\n\n##### closeSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### fstat(options) @fstat\n获å–文件的状æ€ä¿¡æ¯\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [FStatOptions](#fstatoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| fd | string | 是 | - | - | 文件æ述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接å£èŽ·å¾— |\n@| success | (res: [FStatSuccessResult](#fstatsuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### FStatSuccessResult 的属性值 @fstatsuccessresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| stats | [Stats](#stats-values) | 是 | - | - | Stats 对象,包å«äº†æ–‡ä»¶çš„状æ€ä¿¡æ¯ |\n\n\n##### fstat 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### fstatSync(options) @fstatsync\nåŒæ¥èŽ·å–文件的状æ€ä¿¡æ¯\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **FStatSyncOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| fd | string | 是 | - | - | 文件æ述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接å£èŽ·å¾— | \n\n##### 返回值 \n\n| 类型 |\n| :- |\n| [Stats](#stats-values) |\n \n\n##### fstatSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### ftruncate(options) @ftruncate\n对文件内容进行截æ–æ“作\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **FTruncateFileOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| fd | string | 是 | - | - | 文件æ述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接å£èŽ·å¾— |\n@| length | number | 是 | - | - | 截æ–ä½ç½®ï¼Œé»˜è®¤0。如果 length å°äºŽæ–‡ä»¶é•¿åº¦ï¼ˆå—节),则åªæœ‰å‰é¢ length 个å—节会ä¿ç•™åœ¨æ–‡ä»¶ä¸ï¼Œå…¶ä½™å†…å®¹ä¼šè¢«åˆ é™¤ï¼›<br/>如果 length 大于文件长度,ä¸åšå¤„ç† |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### ftruncate 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### ftruncateSync(options) @ftruncatesync\nåŒæ¥å¯¹æ–‡ä»¶å†…容进行截æ–æ“作\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **FTruncateFileSyncOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| fd | string | 是 | - | - | 文件æ述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接å£èŽ·å¾— |\n@| length | number | 是 | - | - | 截æ–ä½ç½®ï¼Œé»˜è®¤0。如果 length å°äºŽæ–‡ä»¶é•¿åº¦ï¼ˆå—节),则åªæœ‰å‰é¢ length 个å—节会ä¿ç•™åœ¨æ–‡ä»¶ä¸ï¼Œå…¶ä½™å†…å®¹ä¼šè¢«åˆ é™¤ï¼›<br/>如果 length 大于文件长度,ä¸åšå¤„ç† | \n\n\n##### ftruncateSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### readZipEntry(options) @readzipentry\n读å–压缩包内的文件\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ReadZipEntryOptions](#readzipentryoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | è¦è¯»å–的压缩包的路径 (本地路径),app-androidå¹³å°æ”¯æŒä»£ç 包文件目录 |\n@| encoding | \"ascii\" \\| \"base64\" \\| \"utf-8\" | 是 | - | - | 统一指定读å–文件的å—符编ç ,åªåœ¨ entries 值为\"all\"时有效。<br/>如果 entries 值为\"all\"且ä¸ä¼ encoding,则以 string æ ¼å¼è¯»å–文件的内容 |\n@| entries | Array\\<**EntryItem**\\> \\| null | å¦ | - | - | è¦è¯»å–的压缩包内的文件列表(当ä¸ä¼ 入时表示读å–压缩包内所有文件) |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| path | string | 是 | - | - | 压缩包内文件路径 |\n@@| encoding | \"ascii\" \\| \"base64\" \\| \"base64\" | 是 | - | - | 指定写入文件的å—符编ç <br/>支æŒ:ascii base64 utf-8 |\n@| success | (res: [EntriesResult](#entriesresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### EntriesResult 的属性值 @entriesresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| result | Map\\<string, ZipFileItem> | 是 | - | - | 文件路径 |\n\n\n##### readZipEntry 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n \n","compatibility":"### getFileSystemManager 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.file.filemanager.getFileSystemManager)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-file-system-manager/get-file-system-manager.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\n <!-- #ifdef APP -->\n <text>显示简易æ“作日志,详细日志需真机è¿è¡ŒæŸ¥çœ‹</text><button size=\"mini\" @click=\"log=''\">清空日志</button>\n <text style=\"margin: 2px; padding: 2px; border: 1px solid #000000;\">{{ log }}</text>\n <scroll-view style=\"flex: 1;\">\n <!-- #endif -->\n <button class=\"btnstyle\" type=\"primary\" @tap=\"statFileInfoTest\"\n id=\"btn-stat-file\">递归获å–目录filesçš„Stats对象{{statFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"mkdirTest\" id=\"btn-mkdir\">创建文件夹{{mkdirFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"writeFileTest\" id=\"btn-write-file\">覆盖写入文件{{writeFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"readDirTest\" id=\"btn-read-dir\">读å–文件夹{{readDir}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"readFileTest\" id=\"btn-read-file\">读å–文件{{readFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"copyFileTest\"\n id=\"btn-copy-file\">å¤åˆ¶æ–‡ä»¶{{copyFromFile}}到{{copyToFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"renameFileTest\"\n id=\"btn-rename-file\">é‡å‘½å文件{{renameFromFile}}到{{renameToFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"accessFileTest\" id=\"btn-access-file\">判æ–文件{{accessFile}}是å¦å˜åœ¨</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"getFileInfoTest\"\n id=\"btn-get-file-info\">获å–文件信æ¯{{getFileInfoFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"unlinkTest\" id=\"btn-unlink-file\">åˆ é™¤æ–‡ä»¶{{unlinkFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"copyStaticToFilesTest\"\n id=\"btn-copyStatic-file\">从static目录å¤åˆ¶æ–‡ä»¶åˆ°a目录</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"unlinkAllFileTest\"\n id=\"btn-clear-file\">åˆ é™¤æ–‡ä»¶å¤¹{{rmDirFile}}下的所有文件</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"rmdirTest\" id=\"btn-remove-dir\">åˆ é™¤æ–‡ä»¶å¤¹{{rmDirFile}}</button>\n\n\n <!-- #ifdef APP-ANDROID -->\n <button class=\"btnstyle\" type=\"primary\" @tap=\"statFileInfoSyncTest\"\n id=\"btn-stat-file-sync\">åŒæ¥é€’归获å–目录filesçš„Stats对象{{statFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"appendFileTest\" id=\"btn-append-file\">在文件{{readFile}}ç»“å°¾è¿½åŠ å†…å®¹</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"appendFileSyncTest\"\n id=\"btn-append-file-sync\">åŒæ¥åœ¨æ–‡ä»¶{{readFile}}ç»“å°¾è¿½åŠ å†…å®¹</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"writeFileSyncTest\"\n id=\"btn-write-file-sync\">åŒæ¥è¦†ç›–写入文件{{writeFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"readFileSyncTest\" id=\"btn-read-file-sync\">åŒæ¥è¯»å–文件{{readFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"unlinkSyncTest\"\n id=\"btn-unlink-file-sync\">åŒæ¥åˆ 除文件{{unlinkFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"mkdirSyncTest\" id=\"btn-mkdir-sync\">åŒæ¥åˆ›å»ºæ–‡ä»¶å¤¹{{mkdirFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"rmdirSyncTest\" id=\"btn-remove-dir-sync\">åŒæ¥åˆ 除文件夹{{rmDirFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"readDirSyncTest\" id=\"btn-read-dir-sync\">åŒæ¥è¯»å–文件夹{{readDir}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"accessFileSyncTest\"\n id=\"btn-access-file-sync\">åŒæ¥åˆ¤æ–文件{{accessFile}}是å¦å˜åœ¨</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"renameFileSync\"\n id=\"btn-rename-file-sync\">åŒæ¥é‡å‘½å文件{{renameFromFile}}到{{renameToFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"copyFileSyncTest\"\n id=\"btn-copy-file-sync\">åŒæ¥å¤åˆ¶æ–‡ä»¶{{copyFromFile}}到{{copyToFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"saveFileTest\" id=\"btn-save-file\">ä¿å˜ä¸´æ—¶æ–‡ä»¶åˆ°æœ¬åœ°</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"saveFileSyncTest\" id=\"btn-save-file-sync\">åŒæ¥ä¿å˜ä¸´æ—¶æ–‡ä»¶åˆ°æœ¬åœ°</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"removeSavedFileTest\" id=\"btn-remove-saved-file\">åˆ é™¤å·²ä¿å˜çš„本地文件</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"unzipFileTest\" id=\"btn-unzip-file-sync\">解压文件</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"getSavedFileListTest\"\n id=\"btn-getsaved-filelist\">获å–该已ä¿å˜çš„本地缓å˜æ–‡ä»¶åˆ—表</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"truncateFileTest\"\n id=\"btn-truncate-file\">对文件{{writeFile}}内容进行截æ–æ“作</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"truncateFileSyncTest\"\n id=\"btn-truncate-file-sync\">åŒæ¥å¯¹æ–‡ä»¶{{writeFile}}内容进行截æ–æ“作</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"readCompressedFileTest\"\n id=\"btn-compressed-file\">读å–指定压缩类型的本地文件内容</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"readCompressedFileSyncTest\"\n id=\"btn-compressed-file-sync\">åŒæ¥è¯»å–指定压缩类型的本地文件内容</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"openFileTest\" id=\"btn-open-file\">打开文件{{readFile}},返回æ述符</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"openFileSyncTest('r')\"\n id=\"btn-open-file-sync\">åŒæ¥æ‰“开文件{{readFile}},返回æ述符</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"closeTest\" id=\"btn-close-file\">通过文件æ述符关é—文件{{readFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"closeSyncTest\"\n id=\"btn-close-file-sync\">通过文件æ述符åŒæ¥å…³é—文件{{readFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"writeTest\" id=\"btn-write\">通过文件æ述符写入文件{{readFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"writeSyncTest\" id=\"btn-write-sync\">åŒæ¥é€šè¿‡æ–‡ä»¶æ述符写入文件{{readFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"fstatTest\" id=\"btn-fstat-file\">通过文件æ述符获å–{{statFile}}的状æ€ä¿¡æ¯</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"fstatSyncTest\"\n id=\"btn-fstat-file-sync\">åŒæ¥é€šè¿‡æ–‡ä»¶æ述符获å–{{statFile}}的状æ€ä¿¡æ¯</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"ftruncateFileTest\"\n id=\"btn-ftruncate-file\">通过文件æ述符对文件{{writeFile}}内容进行截æ–</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"ftruncateFileSyncTest\"\n id=\"btn-ftruncate-file-sync\">åŒæ¥é€šè¿‡æ–‡ä»¶æ述符对文件{{writeFile}}内容进行截æ–</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"readZipEntry\" id=\"btn-readzip-entry\">读å–压缩包内的文件</button>\n <view style=\"height: 4px;\"></view>\n <!-- #endif -->\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n<script>\n export default {\n\n data() {\n return {\n log: \"\",\n /**\n * 自动化测试需è¦å…³é—log\n */\n logAble: true,\n fileListSuccess: [] as string[],\n fileListComplete: [] as string[],\n accessFileRet: '',\n lastFailError: new UniError(\"uni-file-manager\", 1300000, \"mock error\"),\n lastCompleteError: new UniError(\"uni-file-manager\", 1300000, \"mock error\"),\n readDir: 'a',\n readFileRet: \"\",\n writeFileContent: \"ä¸æ–‡ en.\\r\\n\\tæ¢è¡Œ\",\n appendFileContent: \"append content\",\n getFileInfoAlgorithm: \"md5\",\n getFileInfoSize: -1,\n getFileInfoDigest: \"\",\n unlinkFile: 'a/1.txt',\n accessFile: 'a/1.txt',\n writeFile: 'a/1.txt',\n writeData: 'insert data哈哈哈',\n brFile: 'a/1.txt.br',\n temFile: 'a/1.txt',\n copyFromFile: 'a/1.txt',\n copyToFile: 'a/2.txt',\n renameFromFile: 'a/2.txt',\n renameToFile: 'a/3.txt',\n getFileInfoFile: 'a/1.txt',\n statFile: '',\n rmDirFile: 'a',\n mkdirFile: 'a',\n readFile: 'a/1.txt',\n recursiveVal: true,\n done: false,\n writeFileEncoding: \"utf-8\",\n readFileEncoding: \"utf-8\",\n statsRet: [] as Array<FileStats>,\n unzipFile: 'zip/1.zip',\n targetZip: \"unzip\",\n renameFileRet: '',\n saveFileRet: '',\n removeSavedFileRet: '',\n fd: '',\n closeFileRet: '',\n bytesWritten: 0,\n fstat: null as Stats | null,\n ftruncateRet: '',\n readZipFile: 'to.zip',\n getSavedFileListRet: '',\n /**\n * 待测试的全局环境å˜é‡\n */\n basePath: uni.env.USER_DATA_PATH,\n copyToBasePath: uni.env.USER_DATA_PATH,\n globalTempPath: uni.env.CACHE_PATH,\n globalRootPath: uni.env.SANDBOX_PATH,\n globalUserDataPath: uni.env.USER_DATA_PATH\n }\n },\n onLoad() {\n },\n\n methods: {\n statFileInfoTest: function (_ : any) {\n const fileManager = uni.getFileSystemManager()\n fileManager.stat({\n // path: `${this.basePath}${this.statFile}`, //USER_DATA_PATH\n path: `${this.globalTempPath}${this.statFile}`, //CACHE_PATH\n recursive: this.recursiveVal,\n success: (res : StatSuccessResult) => {\n if (this.logAble) {\n this.log += 'statFileInfoTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('statFileInfoTest success', res)\n this.statsRet = res.stats\n console.log('this.statsRet', this.statsRet)\n },\n fail: (res:IUniError ) => {\n if (this.logAble) {\n this.log += 'statFileInfoTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('statFileInfoTest fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n },\n complete: (res : any) => {\n console.log(\"statFileInfoTest complete\", res)\n this.done = true\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n }\n } as StatOptions)\n },\n\n getFileInfoTest: function () {\n const fileManager = uni.getFileSystemManager()\n\n fileManager.getFileInfo({\n filePath: `${this.basePath}${this.getFileInfoFile}`,\n digestAlgorithm: this.getFileInfoAlgorithm,\n success: (res : GetFileInfoSuccessResult) => {\n if (this.logAble) {\n this.log += 'getFileInfoTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n this.getFileInfoSize = res.size\n this.getFileInfoDigest = res.digest\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'getFileInfoTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n },\n complete: (res : any) => {\n console.log(\"complete\", res)\n this.done = true\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n }\n } as GetFileInfoOptions)\n },\n\n copyFileTest: function () {\n const fileManager = uni.getFileSystemManager()\n\n fileManager.copyFile({\n srcPath: `${this.basePath}${this.copyFromFile}`,\n destPath: `${this.copyToBasePath}${this.copyToFile}`,\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'copyFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'copyFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n },\n complete: (res : any) => {\n console.log(\"complete\", res)\n this.done = true\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n }\n } as CopyFileOptions)\n },\n\n renameFileTest: function () {\n const fileManager = uni.getFileSystemManager()\n\n fileManager.rename({\n oldPath: `${this.basePath}${this.renameFromFile}`,\n newPath: `${this.basePath}${this.renameToFile}`,\n success: (res) => {\n if (this.logAble) {\n this.log += 'renameFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'renameFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n },\n complete: (res : any) => {\n this.done = true\n console.log(\"complete\", res)\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n }\n } as RenameOptions)\n },\n\n readDirTest: function () {\n const fileManager = uni.getFileSystemManager()\n fileManager.readdir({\n dirPath: `${this.basePath}${this.readDir}`,\n success: (res : ReadDirSuccessResult) => {\n if (this.logAble) {\n this.log += 'readDirTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log(\"success\", res)\n this.fileListSuccess = res.files\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'readDirTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n },\n complete: (res : any) => {\n console.log(\"complete\", res)\n this.done = true\n if (res instanceof UniError) {\n this.lastCompleteError = res\n } else {\n this.fileListComplete = (res as ReadDirSuccessResult).files\n }\n }\n } as ReadDirOptions)\n },\n\n writeFileTest: function (_ : any) {\n const fileManager = uni.getFileSystemManager()\n\n fileManager.writeFile({\n filePath: `${this.basePath}${this.writeFile}`,\n data: this.writeFileContent,\n encoding: this.writeFileEncoding,\n success: (res) => {\n if (this.logAble) {\n this.log += 'writeFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'writeFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail')\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n },\n complete: (res : any) => {\n this.done = true\n console.log(\"complete\")\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n\n }\n } as WriteFileOptions)\n },\n\n readFileTest: function () {\n const fileManager = uni.getFileSystemManager()\n\n fileManager.readFile({\n filePath: `${this.basePath}${this.readFile}`,\n encoding: this.readFileEncoding,\n success: (res : ReadFileSuccessResult) => {\n if (this.logAble) {\n this.log += 'readFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n this.readFileRet = res.data\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'readFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n },\n complete: (res : any) => {\n console.log(\"complete\", res)\n this.done = true\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n }\n } as ReadFileOptions)\n },\n\n rmdirTest: function () {\n const fileManager = uni.getFileSystemManager()\n fileManager.rmdir({\n dirPath: `${this.basePath}${this.rmDirFile}`,\n recursive: this.recursiveVal,\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'rmdirTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'rmdirTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n },\n complete: (res : any) => {\n console.log(\"complete\", res)\n this.done = true\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n }\n } as RmDirOptions)\n },\n\n mkdirTest: function () {\n // 准备测试数æ®\n const fileManager = uni.getFileSystemManager()\n\n fileManager.mkdir({\n dirPath: `${this.basePath}${this.mkdirFile}`,\n recursive: this.recursiveVal,\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'mkdirTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'mkdirTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (res : any) => {\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n this.done = true\n console.log(\"complete\", res)\n }\n } as MkDirOptions)\n\n },\n accessFileTest: function () {\n this.accessFileRet = ''\n const fileManager = uni.getFileSystemManager()\n fileManager.access({\n path: `${this.basePath}${this.accessFile}`,\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'accessFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n this.accessFileRet = res.errMsg\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'accessFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (res : any) => {\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n console.log(\"complete\", res)\n this.done = true\n }\n } as AccessOptions)\n\n },\n unlinkTest: function () {\n const fileManager = uni.getFileSystemManager()\n\n fileManager.unlink({\n filePath: `${this.basePath}${this.unlinkFile}`,\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'unlinkTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'unlinkTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (res : any) => {\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n console.log(\"complete\", res)\n this.done = true\n }\n } as UnLinkOptions)\n },\n unlinkAllFileTest: function () {\n const fileManager = uni.getFileSystemManager()\n fileManager.readdir({\n dirPath: `${this.basePath}${this.rmDirFile}`,\n success: (res : ReadDirSuccessResult) => {\n console.log(\"success to readdir\", res)\n res.files.forEach(element => {\n console.log(element)\n let filePath : string\n if (this.rmDirFile.length <= 0) {\n filePath = `${this.basePath}${element}`\n } else {\n filePath = `${this.basePath}${this.rmDirFile}/${element}`\n }\n fileManager.unlink({\n filePath: filePath,\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'unlinkAllFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success unlink', res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'unlinkAllFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail unlink', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (res : any) => {\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n console.log(\"complete unlink\", res)\n this.done = true\n }\n } as UnLinkOptions)\n });\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'unlinkAllFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail to readdir', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (res : any) => {\n console.log(\"complete readdir\", res)\n this.done = true\n if (res instanceof UniError) {\n this.lastCompleteError = res\n } else {\n this.fileListComplete = (res as ReadDirSuccessResult).files\n }\n }\n } as ReadDirOptions)\n },\n copyStaticToFilesTest: function () {\n const fileManager = uni.getFileSystemManager()\n\n fileManager.copyFile({\n srcPath: \"/static/list-mock/mock.json\",\n destPath: `${this.copyToBasePath}/a/mock.json`,\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'copyFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'copyFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (res : any) => {\n console.log(\"complete\", res)\n this.done = true\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n }\n } as CopyFileOptions)\n },\n //start\n appendFileTest: function (_ : any) {\n const fileManager = uni.getFileSystemManager()\n fileManager.appendFile({\n filePath: `${this.basePath}${this.writeFile}`,\n data: this.appendFileContent,\n encoding: this.writeFileEncoding,\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'appendFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'appendFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail')\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (res : any) => {\n this.done = true\n console.log(\"complete\")\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n\n }\n } as AppendFileOptions)\n },\n writeFileSyncTest: function (_ : any) {\n try {\n const fileManager = uni.getFileSystemManager()\n fileManager.writeFileSync(`${this.basePath}${this.writeFile}`, this.writeFileContent, this.writeFileEncoding)\n if (this.logAble) {\n this.log += 'writeFileSyncTest success:' + '\\n\\n'\n }\n this.done = true\n } catch (e) {\n if (this.logAble) {\n this.log += 'writeFileSyncTest fail:' + e + '\\n\\n'\n }\n this.done = true\n }\n\n },\n readFileSyncTest: function () {\n try {\n const fileManager = uni.getFileSystemManager()\n let data = fileManager.readFileSync(\n `${this.basePath}${this.readFile}`,\n this.readFileEncoding)\n if (this.logAble) {\n this.log += 'readFileSyncTest result:' + data + '\\n\\n'\n }\n this.done = true\n this.readFileRet = data\n } catch (e) {\n if (this.logAble) {\n this.log += 'readFileSyncTest fail:' + e + '\\n\\n'\n }\n this.done = true\n }\n\n },\n unlinkSyncTest: function () {\n try {\n const fileManager = uni.getFileSystemManager()\n fileManager.unlinkSync(\n `${this.basePath}${this.unlinkFile}`)\n this.done = true\n } catch (e) {\n if (this.logAble) {\n this.log += 'unlinkSyncTest fail:' + e + '\\n\\n'\n }\n this.done = true\n }\n },\n mkdirSyncTest: function () {\n // 准备测试数æ®\n try {\n const fileManager = uni.getFileSystemManager()\n fileManager.mkdirSync(`${this.basePath}${this.mkdirFile}`, this.recursiveVal)\n this.done = true\n } catch (e) {\n this.done = true\n if (this.logAble) {\n this.log += 'mkdirSyncTest fail:' + e + '\\n\\n'\n }\n }\n\n },\n rmdirSyncTest: function () {\n try {\n const fileManager = uni.getFileSystemManager()\n fileManager.rmdirSync(\n `${this.basePath}${this.rmDirFile}`,\n this.recursiveVal)\n this.done = true\n } catch (e) {\n if (this.logAble) {\n this.log += 'rmdirSyncTest fail:' + e + '\\n\\n'\n }\n this.done = true\n }\n },\n readDirSyncTest: function () {\n try {\n const fileManager = uni.getFileSystemManager()\n let res = fileManager.readdirSync(\n `${this.basePath}${this.readDir}`)\n if (this.logAble) {\n this.log += 'readDirTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n if (res != null) {\n this.fileListSuccess = res\n }\n this.done = true\n } catch (e) {\n if (this.logAble) {\n this.log += 'rmdirSyncTest fail:' + e + '\\n\\n'\n }\n this.done = true\n }\n },\n accessFileSyncTest: function () {\n this.accessFileRet = ''\n const fileManager = uni.getFileSystemManager()\n try {\n fileManager.accessSync(`${this.basePath}${this.accessFile}`)\n this.done = true\n this.accessFileRet = 'access:ok'\n } catch (e) {\n if (this.logAble) {\n this.log += 'rmdirSyncTest fail:' + e + '\\n\\n'\n }\n this.done = true\n }\n },\n renameFileSync: function () {\n const fileManager = uni.getFileSystemManager()\n try {\n fileManager.renameSync(`${this.basePath}${this.renameFromFile}`,\n `${this.basePath}${this.renameToFile}`)\n this.done = true\n this.renameFileRet = \"rename:ok\"\n\n } catch (e) {\n if (this.logAble) {\n this.log += 'rmdirSyncTest fail:' + e + '\\n\\n'\n }\n console.log('renameSync:' + e)\n this.done = true\n }\n },\n copyFileSyncTest: function () {\n const fileManager = uni.getFileSystemManager()\n try {\n fileManager.copyFileSync(\n `${this.basePath}${this.copyFromFile}`,\n `${this.copyToBasePath}${this.copyToFile}`)\n this.done = true\n } catch (e) {\n if (this.logAble) {\n this.log += 'rmdirSyncTest fail:' + e + '\\n\\n'\n }\n this.done = true\n }\n },\n appendFileSyncTest: function (_ : any) {\n const fileManager = uni.getFileSystemManager()\n try {\n fileManager.appendFileSync(\n `${this.basePath}${this.writeFile}`,\n this.appendFileContent,\n this.writeFileEncoding)\n this.done = true\n } catch (e) {\n if (this.logAble) {\n this.log += 'rmdirSyncTest fail:' + e + '\\n\\n'\n }\n this.done = true\n }\n },\n saveFileTest: function (_ : any) {\n const fileManager = uni.getFileSystemManager()\n fileManager.saveFile({\n tempFilePath: `${this.globalTempPath}${this.temFile}`,\n // filePath:`${this.basePath}local/`,\n success: (res : SaveFileSuccessResult) => {\n if (this.logAble) {\n this.log += 'saveFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n this.saveFileRet = res.savedFilePath\n this.done = true\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'saveFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('saveFileTest fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n this.done = true\n },\n complete: (_) => {\n this.done = true\n }\n } as SaveFileOptions)\n },\n saveFileSyncTest: function (_ : any) {\n const fileManager = uni.getFileSystemManager()\n try {\n fileManager.saveFileSync(\n `${this.globalTempPath}${this.temFile}`, `${this.basePath}/`)\n // filePath:`${this.basePath}local/`,)\n this.done = true\n\n //todo åŽé¢æ‰“å¼€\n // this.saveFileRet=res\n } catch (e) {\n console.log('saveFileSyncTest:' + e)\n this.done = true\n }\n },\n unzipFileTest: function (_ : any) {\n const fileManager = uni.getFileSystemManager()\n try {\n fileManager.mkdirSync(`${this.basePath}${this.targetZip}`, true)\n } catch (e) {\n console.error(e)\n }\n fileManager.unzip({\n zipFilePath: '/static/filemanager/to.zip',\n targetPath: `${this.basePath}${this.targetZip}`,\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'unzipFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'unzipFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (_) => {\n this.done = true\n }\n } as UnzipFileOptions)\n },\n\n getSavedFileListTest: function () {\n const fileManager = uni.getFileSystemManager()\n fileManager.getSavedFileList({\n success: (res : GetSavedFileListResult) => {\n if (this.logAble) {\n this.log += 'getSavedFileListTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log(\"getSavedFileListTest success\", res)\n this.fileListSuccess = res.fileList\n this.getSavedFileListRet = \"getSavedFileList:ok\"\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'getSavedFileListTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('getSavedFileListTest fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n this.getSavedFileListRet = JSON.stringify(res)\n },\n complete: (res : any) => {\n console.log(\"complete\", res)\n this.done = true\n if (res instanceof UniError) {\n this.lastCompleteError = res\n } else {\n this.fileListComplete = (res as GetSavedFileListResult).fileList\n }\n }\n } as GetSavedFileListOptions)\n },\n truncateFileTest() {\n const fileManager = uni.getFileSystemManager()\n fileManager.truncate({\n filePath: `${this.basePath}${this.writeFile}`,\n length: 7,\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'truncateFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log(\"success\", res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'truncateFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (res : any) => {\n console.log(\"complete\", res)\n this.done = true\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n }\n } as TruncateFileOptions)\n },\n truncateFileSyncTest() {\n const fileManager = uni.getFileSystemManager()\n try {\n fileManager.truncateSync(\n `${this.basePath}${this.writeFile}`,\n 4)\n this.done = true\n } catch (e) {\n console.log(e)\n this.done = true\n }\n },\n readCompressedFileTest() {\n const fileManager = uni.getFileSystemManager()\n fileManager.readCompressedFile({\n filePath: '/static/filemanager/1.txt.br',\n compressionAlgorithm: \"br\",\n success: (res : ReadCompressedFileResult) => {\n if (this.logAble) {\n this.log += 'readCompressedFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log(\"success\", res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'readCompressedFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (_) => {\n this.done = true\n }\n } as ReadCompressedFileOptions)\n },\n readCompressedFileSyncTest() {\n console.log('readCompressedFileSyncTest')\n const fileManager = uni.getFileSystemManager()\n try {\n let data = fileManager.readCompressedFileSync(\n '/static/filemanager/1.txt.br',\n \"br\")\n if (this.logAble) {\n this.log += data\n }\n this.done = true\n } catch (e) {\n if (this.logAble) {\n this.log += 'readCompressedFileSyncTest fail:' + e + '\\n\\n'\n }\n this.done = true\n }\n\n },\n removeSavedFileTest() {\n console.log(\"removeSavedFileTest enter\")\n const fileManager = uni.getFileSystemManager()\n fileManager.removeSavedFile({\n filePath: `${this.basePath}${this.writeFile}`,\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'removeSavedFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n this.removeSavedFileRet = res.errMsg\n console.log(\"removeSavedFileTest success\", res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'removeSavedFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('removeSavedFileTest fail', res)\n },\n complete: (_) => {\n this.done = true\n }\n } as RemoveSavedFileOptions)\n },\n\n statFileInfoSyncTest: function (_ : any) {\n const fileManager = uni.getFileSystemManager()\n try {\n let res = fileManager.statSync(\n // path: `${this.basePath}${this.statFile}`, //USER_DATA_PATH\n `${this.globalTempPath}${this.statFile}`, //CACHE_PATH\n this.recursiveVal)\n if (this.logAble) {\n this.log += 'statFileInfoSyncTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n this.statsRet = res\n this.done = true\n } catch (e) {\n if (this.logAble) {\n this.log += 'statFileInfoSyncTest fail:' + e + '\\n\\n'\n }\n this.done = true\n }\n\n },\n openFileTest() {\n const fileManager = uni.getFileSystemManager()\n fileManager.open({\n filePath: `${this.basePath}${this.readFile}`,\n flag: \"a\",\n success: (res : OpenFileSuccessResult) => {\n if (this.logAble) {\n this.log += 'openFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log(\"success\", res)\n this.fd = res.fd\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'openFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (_) => {\n this.done = true\n }\n } as OpenFileOptions)\n },\n openFileSyncTest(param : string) : string {\n const fileManager = uni.getFileSystemManager()\n try {\n let fd = fileManager.openSync({\n filePath: `${this.basePath}${this.readFile}`,\n flag: param,\n } as OpenFileSyncOptions)\n if (this.logAble) {\n this.log += 'openFileSyncTest success:' + fd + '\\n\\n'\n }\n this.done = true\n this.fd = fd\n return fd\n } catch (e) {\n if (this.logAble) {\n this.log += 'openFileSyncTest fail:' + JSON.stringify(e) + '\\n\\n'\n }\n console.log('fail', e)\n this.done = true\n }\n return \"\"\n },\n closeSyncTest() {\n console.log('closeSyncTest')\n const fileManager = uni.getFileSystemManager()\n try {\n console.log('closeSync')\n fileManager.closeSync({\n fd: this.openFileSyncTest('r')\n } as CloseSyncOptions)\n if (this.logAble) {\n this.log += 'closeSyncTest success:' + '\\n\\n'\n }\n this.done = true\n this.closeFileRet = \"close:ok\"\n } catch (e) {\n if (this.logAble) {\n this.log += 'closeSyncTest fail:' + JSON.stringify(e) + '\\n\\n'\n }\n console.log('fail', e)\n this.done = true\n }\n },\n closeTest() {\n const fileManager = uni.getFileSystemManager()\n fileManager.close({\n fd: this.openFileSyncTest('r'),\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'closeTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n this.closeFileRet = res.errMsg\n console.log(\"success\", res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'closeTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (_) => {\n this.done = true\n }\n\n } as CloseOptions)\n },\n writeTest() {\n const fileManager = uni.getFileSystemManager()\n try {\n fileManager.mkdirSync(`${this.basePath}${this.mkdirFile}`, true)\n } catch (e) {\n console.error(e)\n }\n\n fileManager.write({\n fd: this.openFileSyncTest('w+'),\n data: this.writeData,\n encoding: \"utf-8\",\n success: (res : WriteResult) => {\n if (this.logAble) {\n this.log += 'writeTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log(\"success\", res)\n this.bytesWritten = res.bytesWritten\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'writeTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (_) => {\n this.done = true\n }\n\n } as WriteOptions)\n },\n writeSyncTest() {\n const fileManager = uni.getFileSystemManager()\n try {\n fileManager.mkdirSync(`${this.basePath}${this.mkdirFile}`, true)\n } catch (e) {\n console.error(e)\n }\n fileManager.open({\n filePath: `${this.basePath}${this.readFile}`,\n flag: \"r+\",\n success: (res : OpenFileSuccessResult) => {\n console.log(\"success\", res)\n if (res.fd.length <= 0) {\n this.done = true\n return\n }\n try {\n let ret = fileManager.writeSync({\n fd: res.fd,\n data: this.writeData,\n encoding: \"utf-8\"\n } as WriteSyncOptions)\n if (this.logAble) {\n this.log += 'writeSyncTest success:' + JSON.stringify(ret) + '\\n\\n'\n }\n console.log(\"success\", ret)\n this.done = true\n this.bytesWritten = ret.bytesWritten\n } catch (e) {\n if (this.logAble) {\n this.log += 'writeSyncTest fail:' + JSON.stringify(e) + '\\n\\n'\n }\n console.log('fail', e)\n this.done = true\n }\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'openFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n this.done = true\n }\n } as OpenFileOptions)\n\n },\n fstatTest() {\n const fileManager = uni.getFileSystemManager()\n fileManager.fstat({\n fd: this.openFileSyncTest('r'),\n success: (res : FStatSuccessResult) => {\n if (this.logAble) {\n this.log += 'fstatTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log(\"success\", res)\n this.fstat = res.stats\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'fstatTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (_) => {\n this.done = true\n }\n\n } as FStatOptions)\n },\n fstatSyncTest() {\n const fileManager = uni.getFileSystemManager()\n try {\n let stat =\n fileManager.fstatSync({\n fd: this.openFileSyncTest('r'),\n } as FStatSyncOptions)\n if (this.logAble) {\n this.log += 'fstatSyncTest success:' + JSON.stringify(stat) + '\\n\\n'\n }\n this.done = true\n this.fstat = stat\n } catch (e) {\n if (this.logAble) {\n this.log += 'fstatSyncTest fail:' + JSON.stringify(e) + '\\n\\n'\n }\n this.done = true\n }\n },\n ftruncateFileTest() {\n const fileManager = uni.getFileSystemManager()\n fileManager.ftruncate({\n fd: this.openFileSyncTest('r+'),\n length: 6,\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'ftruncateFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n this.ftruncateRet = res.errMsg\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'ftruncateFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (res : any) => {\n console.log(\"complete\", res)\n this.done = true\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n }\n } as FTruncateFileOptions)\n },\n ftruncateFileSyncTest() {\n const fileManager = uni.getFileSystemManager()\n try {\n fileManager.ftruncateSync({\n fd: this.openFileSyncTest('r+'),\n length: 4\n } as FTruncateFileSyncOptions)\n if (this.logAble) {\n this.log += 'ftruncateFileSyncTest success:' + '\\n\\n'\n }\n this.done = true\n this.ftruncateRet = 'ftruncate:ok'\n } catch (e) {\n if (this.logAble) {\n this.log += 'ftruncateFileSyncTest fail:' + JSON.stringify(e) + '\\n\\n'\n }\n this.done = true\n }\n },\n readZipEntry() {\n const fileManager = uni.getFileSystemManager()\n fileManager.readZipEntry({\n filePath: '/static/filemanager/to.zip',\n encoding: 'utf-8',\n success: (res : EntriesResult) => {\n if (this.logAble) {\n this.log += 'readZipEntry success:size=' + res.result.size + '\\n\\n'\n }\n console.log(\"success\", res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'readZipEntry fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n }\n } as ReadZipEntryOptions)\n },\n\n },\n\n }\n</script>\n\n<style>\n .btnstyle {\n margin: 4px;\n }\n</style>\n\n```"},"getUniverifyManager":{"name":"## uni.getUniverifyManager() @getuniverifymanager","description":"获å–一键登录管ç†å¯¹è±¡","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [UniverifyManager](#univerifymanager-values) |\n\n#### UniverifyManager 的方法 @univerifymanager-values \n\n#### preLogin(options) @prelogin\n预登录\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [PreLoginOptions](#preloginoptions-values) | 是 | - | - | 预登录å‚æ•° |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | () => void | å¦ | - | - | - |\n@| fail | (err: [PreLoginFail](#preloginfail-values)) => void | å¦ | - | - | - |\n@| complete | (res: any) => void | å¦ | - | - | - | \n\n##### PreLoginFail 的属性值 @preloginfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1000 \\| 1001 \\| 1002 \\| 1004 \\| 4001 \\| 30004 \\| 30005 \\| 30006 | 是 | - | - | 1000 当å‰åº”用appid尚未开通uni一键登录<br/>1001 应用所有者账å·ä¿¡æ¯å¼‚常,请检查账å·ä¸€é”®ç™»å½•æœåŠ¡æ˜¯å¦æ£å¸¸<br/>1002 应用所有者账å·ä¿¡æ¯å¼‚常,请检查账å·ä½™é¢æ˜¯å¦å……足<br/>1004 uni一键登录应用ä¸å˜åœ¨<br/>4001 å‚数异常<br/>30004 其他错误<br/>30005 预登录失败<br/>30006 一键登录失败 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n\n##### preLogin 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.99 | 4.18 |\n\n\n#### login(options) @login\n登录\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [LoginOptions](#loginoptions-values) | 是 | - | - | 登录å‚æ•° |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| univerifyStyle | **UniverifyStyle** | å¦ | - | - | ç™»å½•é¡µæ ·å¼ |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| fullScreen | boolean | å¦ | - | - | 是å¦å…¨å± |\n@@| logoPath | string | å¦ | - | - | logo路径 |\n@@| backgroundColor | string | å¦ | - | - | 登录页背景色 |\n@@| loginBtnText | string | å¦ | - | - | ç™»å½•æŒ‰é’®æ–‡å— |\n@| success | (res: [LoginSuccess](#loginsuccess-values)) => void | å¦ | - | - | - |\n@| fail | (err: [LoginFail](#loginfail-values)) => void | å¦ | - | - | - |\n@| complete | (res: any) => void | å¦ | - | - | - | \n\n##### LoginSuccess 的属性值 @loginsuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| openId | string | 是 | - | - | 登录授æƒå”¯ä¸€æ ‡è¯† |\n| accessToken | string | 是 | - | - | token |\n\n##### LoginFail 的属性值 @loginfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1000 \\| 1001 \\| 1002 \\| 1004 \\| 4001 \\| 30004 \\| 30005 \\| 30006 | 是 | - | - | 1000 当å‰åº”用appid尚未开通uni一键登录<br/>1001 应用所有者账å·ä¿¡æ¯å¼‚常,请检查账å·ä¸€é”®ç™»å½•æœåŠ¡æ˜¯å¦æ£å¸¸<br/>1002 应用所有者账å·ä¿¡æ¯å¼‚常,请检查账å·ä½™é¢æ˜¯å¦å……足<br/>1004 uni一键登录应用ä¸å˜åœ¨<br/>4001 å‚数异常<br/>30004 其他错误<br/>30005 预登录失败<br/>30006 一键登录失败 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n\n##### login 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.99 | 4.18 |\n\n\n#### close() @close\nå…³é—登录页\n\n\n##### close 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.99 | 4.18 |\n\n\n#### isPreLoginValid() @ispreloginvalid\n预登录是å¦æœ‰æ•ˆ\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| boolean |\n \n\n##### isPreLoginValid 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.99 | 4.18 |\n\n \n","compatibility":"### getUniverifyManager 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.99 | 4.18 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/univerify.html#univerifymanager)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.login_verify.univerify.getUniverifyManager)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-univerify-manager/get-univerify-manager.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\n <view>\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-padding-wrap uni-common-mt\">\n <view class=\"uni-btn-v uni-common-mt\">\n <button type=\"primary\" @click=\"verify(false)\">一键登录(åŠå±ï¼‰</button>\n </view>\n <view class=\"uni-btn-v uni-common-mt\">\n <button type=\"primary\" @click=\"verify(true)\">一键登录(全å±ï¼‰</button>\n </view>\n </view>\n </view>\n</template>\n\n<script>\n export default {\n data() {\n return {\n title: '一键登录',\n univerifyManager: null as UniverifyManager | null\n }\n },\n onLoad() {\n this.univerifyManager = uni.getUniverifyManager();\n // 预登录\n this.univerifyManager?.preLogin({\n success: () => {\n console.log(\"pre login success\");\n },\n fail: (err : PreLoginFail) => {\n console.error(\"pre login fail => \" + JSON.stringify(err));\n uni.showModal({\n title: '预登录失败',\n content: JSON.parseObject(err.cause?.cause?.message ?? \"\")?.getString(\"errorDesc\") ?? err.errMsg,\n showCancel: false\n });\n }\n } as PreLoginOptions);\n },\n methods: {\n verify(fullScreen : boolean) {\n // æ ¡éªŒé¢„ç™»å½•æ˜¯å¦æœ‰æ•ˆ\n const isPreLoginValid = this.univerifyManager?.isPreLoginValid() ?? false;\n if (isPreLoginValid) {\n // 预登录有效,执行登录\n this.login(fullScreen);\n } else {\n // é¢„ç™»å½•æ— æ•ˆï¼Œæ‰§è¡Œé¢„ç™»å½•\n this.univerifyManager?.preLogin({\n success: () => {\n console.log(\"pre login success\");\n this.login(fullScreen);\n },\n fail: (err : PreLoginFail) => {\n console.error(\"pre login fail => \" + JSON.stringify(err));\n uni.showModal({\n title: '预登录失败',\n content: JSON.parseObject(err.cause?.cause?.message ?? \"\")?.getString(\"errorDesc\") ?? err.errMsg,\n showCancel: false\n });\n }\n } as PreLoginOptions);\n }\n },\n login(fullScreen : boolean) {\n this.univerifyManager?.login({\n // ç™»å½•é¡µæ ·å¼\n univerifyStyle: {\n fullScreen: fullScreen,\n backgroundColor: \"#FFFFFF\",\n loginBtnText: \"一键登录\",\n logoPath: \"/static/logo.png\"\n } as UniverifyStyle,\n success: (res : LoginSuccess) => {\n console.log(\"login success => \" + JSON.stringify(res));\n // 云函数å–å·\n uniCloud.callFunction({\n name: 'univerify',\n data: {\n access_token: res.accessToken, // 客户端一键登录接å£è¿”回的access_token\n openid: res.openId // 客户端一键登录接å£è¿”回的openid\n }\n }).then(res => {\n // å…³é—登录页\n this.univerifyManager?.close();\n setTimeout(() => {\n uni.showModal({\n title: 'å–å·æˆåŠŸ',\n content: res.result.getJSON(\"res\")?.getString(\"phoneNumber\"),\n showCancel: false\n });\n }, 100);\n }).catch(err => {\n console.error(JSON.stringify(err));\n // å…³é—登录页\n this.univerifyManager?.close();\n setTimeout(() => {\n uni.showModal({\n title: 'å–å·å¤±è´¥',\n content: (err as Error).message,\n showCancel: false\n });\n }, 100);\n });\n },\n fail: (err : LoginFail) => {\n console.error(\"login fail => \" + err);\n uni.showModal({\n title: '登录失败',\n content: JSON.parseObject(err.cause?.cause?.message ?? \"\")?.getString(\"errorDesc\") ?? err.errMsg,\n showCancel: false\n });\n }\n } as LoginOptions);\n }\n }\n }\n</script>\n\n<style>\n\n</style>\n\n```"},"getFacialRecognitionMetaInfo":{"name":"## uni.getFacialRecognitionMetaInfo() @getfacialrecognitionmetainfo","description":"获å–阿里云实人认è¯meta info","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| string |\n \n","compatibility":"### getFacialRecognitionMetaInfo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.login_verify.facial-recognition-verify.getFacialRecognitionMetaInfo)\n"},"startFacialRecognitionVerify":{"name":"## uni.startFacialRecognitionVerify(faceStyle) @startfacialrecognitionverify","description":"å¯åŠ¨äººè„¸è¯†åˆ«","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| faceStyle | [StartFacialRecognitionVerifyOptions](#startfacialrecognitionverifyoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| certifyId | string | 是 | - | - | certifyId 调用实人认è¯çš„id |\n@| progressBarColor | string \\| null | å¦ | - | - | 活体检测页é¢çš„进度æ¡é¢œè‰²ã€‚ |\n@| screenOrientation | \"land\" \\| \"port\" | å¦ | \"port\" | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 认è¯æ—¶å±å¹•æ–¹å‘<br/>- land 横å±<br/>- port ç«–å± |\n@| success | (res: [StartFacialRecognitionVerifySuccess](#startfacialrecognitionverifysuccess-values)) => void \\| null | å¦ | - | - | æˆåŠŸå›žè°ƒ |\n@| fail | (res: [IFacialRecognitionVerifyError](#ifacialrecognitionverifyerror-values)) => void \\| null | å¦ | - | - | 失败回调 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 完æˆå›žè°ƒ | \n\n##### StartFacialRecognitionVerifySuccess 的属性值 @startfacialrecognitionverifysuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | 错误ç |\n| errSubject | string | 是 | - | - | 调用APIçš„å称 |\n| errMsg | string | 是 | - | - | é”™è¯¯çš„è¯¦ç»†ä¿¡æ¯ |\n| cause | **SourceError** | å¦ | - | - | 错误æ¥æº |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| subject | string \\| null | å¦ | - | - | æºé”™è¯¯æ¨¡å—å称 |\n@| message | string | 是 | - | - | æºé”™è¯¯æè¿°ä¿¡æ¯ |\n@| code | number | 是 | - | - | æºé”™è¯¯çš„错误ç |\n@| name | string | 是 | - | - | - |\n@| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | |\n\n##### IFacialRecognitionVerifyError 的属性值 @ifacialrecognitionverifyerror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 10010 \\| 10012 \\| 10011 \\| 10013 \\| 10020 \\| 10001 \\| 10002 | 是 | - | - | 错误ç <br/>- 10001 certifyId ä¸èƒ½ä¸ºç©º<br/>- 10002 \"当å‰è®¾å¤‡ä¸æ”¯æŒ\"<br/>- 10010 刷脸异常<br/>- 10012 网络异常<br/>- 10011 验è¯ä¸æ–<br/>- 10013 刷脸验è¯å¤±è´¥<br/>- 10020 设备设置时间异常 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### startFacialRecognitionVerify 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.login_verify.facial-recognition-verify.startFacialRecognitionVerify)\n"},"facial-recognition-verify":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/facial-recognition-verify/facial-recognition-verify.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\n <!-- #ifdef APP -->\n <scroll-view class=\"page-scroll-view\">\n <!-- #endif -->\n <view>\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-padding-wrap uni-common-mt\">\n <view class=\"uni-btn-v uni-common-mt\">\n <input class=\"uni-input\" type=\"text\" v-model=\"realName\" name=\"real-name\"\n placeholder=\"姓å\" maxlength=\"-1\"/>\n </view>\n <view class=\"uni-btn-v uni-common-mt\">\n <input class=\"uni-input\" type=\"text\" v-model=\"idCard\" name=\"id-card\"\n placeholder=\"身份è¯å·\" maxlength=\"-1\"/>\n </view>\n <view class=\"uni-btn-v uni-common-mt\">\n <button type=\"primary\" @click=\"facialRecognition\">开始人脸识别</button>\n </view>\n </view>\n </view>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n<script>\n export default {\n data() {\n return {\n title: '实人认è¯',\n realName: '',\n idCard: ''\n }\n },\n onReady() {\n },\n methods: {\n facialRecognition() {\n const realName = this.realName.trim()\n const idCard = this.idCard.trim()\n if (realName == '' || idCard == '') {\n uni.showModal({\n title: '错误',\n content: '姓å和身份è¯å·ä¸å¯ä¸ºç©º',\n showCancel: false\n })\n return\n }\n const testFacialCo = uniCloud.importObject('facial-recognition-co')\n let metaInfo = uni.getFacialRecognitionMetaInfo();\n testFacialCo.getCertifyId({\n realName,\n idCard,\n metaInfo\n })\n .then((res : UTSJSONObject) : Promise<string> => {\n const certifyId = res['certifyId'] as string\n return new Promise((\n resolve : (res : string) => void,\n reject : (err : Error) => void\n ) => {\n uni.startFacialRecognitionVerify({\n certifyId,\n success() {\n resolve(certifyId)\n },\n fail(err) {\n reject(new Error(err.errMsg))\n }\n })\n })\n })\n .then((certifyId : string) : Promise<UTSJSONObject> => {\n return testFacialCo.getAuthResult(certifyId)\n })\n .then((res : UTSJSONObject) => {\n console.log('res', res)\n })\n .catch((err : any | null) => {\n console.error('error', err)\n })\n }\n }\n }\n</script>\n\n<style>\n</style>\n\n```"},"createRewardedVideoAd":{"name":"## uni.createRewardedVideoAd(option) @createrewardedvideoad","description":"创建激励视频广告对象","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| option | **CreateRewardedVideoAdOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| adpid | string | 是 | - | - | å¹¿å‘Šä½ id |\n@| urlCallback | **UrlCallbackOptions** \\| null | å¦ | - | - | æœåŠ¡å™¨å›žè°ƒé€ä¼ å‚æ•° |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| userId | string \\| null | å¦ | - | - | é€ä¼ 到æœåŠ¡å™¨ç«¯çš„userId |\n@@| extra | string \\| null | å¦ | - | - | é€ä¼ 到æœåŠ¡å™¨ç«¯çš„extra,ä¸æŽ¨è设置过于å¤æ‚çš„å—符串 | \n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [RewardedVideoAd](#rewardedvideoad-values) |\n\n#### RewardedVideoAd 的方法 @rewardedvideoad-values \n\n#### show() @show\nå¹¿å‘ŠåŠ è½½æˆåŠŸä¹‹åŽï¼Œè°ƒç”¨æ¤æ–¹æ³•å±•ç¤ºå¹¿å‘Š\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| Promise\\<any> |\n \n\n##### show 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### load() @load\nåŠ è½½å¹¿å‘Š\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| Promise\\<any> |\n \n\n##### load 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### destroy() @destroy\n销æ¯å¹¿å‘Š\n\n\n##### destroy 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### onLoad(callback) @onload\n绑定广告 load 事件的监å¬å™¨\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: any) => void | 是 | - | - | - | \n\n\n##### onLoad 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### offLoad(callback) @offload\n解除绑定 load 事件的监å¬å™¨\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: any) => void | 是 | - | - | - | \n\n\n##### offLoad 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### onError(callback) @onerror\n绑定 error 事件的监å¬å™¨\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [IUniAdError](#iuniaderror-values)) => void | 是 | - | - | - | \n\n##### IUniAdError 的属性值 @iuniaderror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | 错误ç <br/>- -5001 广告ä½æ ‡è¯†adpidä¸ºç©ºï¼Œè¯·ä¼ å…¥æœ‰æ•ˆçš„adpid<br/>- -5002 æ— æ•ˆçš„å¹¿å‘Šä½æ ‡è¯†adpid,请使用æ£ç¡®çš„adpid<br/>- -5003 广告ä½æœªå¼€é€šå¹¿å‘Šï¼Œè¯·åœ¨å¹¿å‘Šå¹³å°ç”³è¯·å¹¶ç¡®ä¿å·²å®¡æ ¸é€šè¿‡<br/>- -5004 æ— å¹¿å‘Šæ¨¡å—,打包时请é…ç½®è¦ä½¿ç”¨çš„广告模å—<br/>- -5005 å¹¿å‘ŠåŠ è½½å¤±è´¥ï¼Œè¯·ç¨åŽé‡è¯•<br/>- -5006 广告已ç»å±•ç¤ºè¿‡äº†ï¼Œè¯·é‡æ–°åŠ è½½<br/>- -5007 广告ä¸å¯ç”¨æˆ–已过期,请é‡æ–°è¯·æ±‚<br/>- -5008 广告ä¸å¯ç”¨æˆ–已过期,请é‡æ–°è¯·æ±‚<br/>- -5009 广告类型ä¸ç¬¦ï¼Œè¯·æ£€æŸ¥åŽå†è¯•<br/>- -5011 æ‰“åŒ…æˆ–å¼€é€šçš„æ¸ é“,ä¸æ”¯æŒæ¤ç±»åž‹å¹¿å‘Š<br/>- -5013 广告æ’放失败,请é‡æ–°åŠ è½½ |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n\n##### onError 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### offError(callback) @offerror\n解除绑定 error 事件的监å¬å™¨\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [IUniAdError](#iuniaderror-values)) => void | 是 | - | - | - | \n\n\n##### offError 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### onClose(callback) @onclose\n绑定 close 事件的监å¬å™¨\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [VideoAdClose](#videoadclose-values)) => void | 是 | - | - | - | \n\n##### VideoAdClose 的属性值 @videoadclose-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| isEnded | boolean | 是 | - | - | trueæ ‡è¯†å¹¿å‘Šæ’放完毕或者达到å‘放奖励的æ¡ä»¶ |\n\n\n##### onClose 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### offClose(callback) @offclose\n解除绑定 close 事件的监å¬å™¨\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [VideoAdClose](#videoadclose-values)) => void | 是 | - | - | - | \n\n\n##### offClose 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### onAdClicked(callback) @onadclicked\n绑定广告å¯ç‚¹å‡»å±å¹•åŒºåŸŸäº‹ä»¶çš„监å¬å™¨\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: any) => void | 是 | - | - | - | \n\n\n##### onAdClicked 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### onVerify(callback) @onverify\n绑定 verify 事件的监å¬å™¨\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md)) => void | 是 | - | - | - | \n\n\n##### onVerify 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n \n","compatibility":"### createRewardedVideoAd 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 4.0 | - |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ad.createRewardedVideoAd)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/rewarded-video-ad/rewarded-video-ad.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\n <page-head title=\"激励视频广告\"></page-head>\n <button :type=\"btnType\" style=\"margin: 10px;\" :disabled=\"btnDisable\" @click=\"showAd()\">{{btnText}}</button>\n</template>\n\n<script>\n export default {\n data() {\n return {\n btnText: \"\",\n btnType: \"primary\",\n btnDisable: false,\n rewardAd: null as RewardedVideoAd | null,\n isAdLoadSuccess: false\n }\n },\n onReady() {\n this.loadAd()\n },\n methods: {\n loadAd() {\n if (this.btnDisable)\n return\n this.btnDisable = true\n this.btnText = \"æ£åœ¨åŠ 载广告\"\n this.btnType = \"primary\"\n if (this.rewardAd == null) {\n this.rewardAd = uni.createRewardedVideoAd({\n adpid: \"1507000689\" //æ¤å¤„为测试广告ä½ï¼Œå®žé™…å¼€å‘ä¸è¯·åœ¨uni-adåŽå°ç”³è¯·è‡ªå·±çš„广告ä½åŽæ›¿æ¢\n })\n this.rewardAd!.onError((_) => {\n this.btnType = \"warn\"\n this.btnText = \"å¹¿å‘ŠåŠ è½½å¤±è´¥ï¼Œç‚¹å‡»é‡è¯•\"\n this.btnDisable = false\n })\n this.rewardAd!.onLoad((_) => {\n this.btnType = \"primary\"\n this.btnText = \"å¹¿å‘ŠåŠ è½½æˆåŠŸï¼Œç‚¹å‡»è§‚看\"\n this.btnDisable = false\n this.isAdLoadSuccess = true\n })\n this.rewardAd!.onClose((e) => {\n // 测试广告ä½æ— 法通过æœåŠ¡å™¨å›žè°ƒã€‚实际开å‘ä¸ï¼Œä½¿ç”¨è‡ªå·±çš„广告ä½åŽï¼Œéœ€å‚考uni-ad文档编写æœåŠ¡å™¨å›žè°ƒçš„代ç ,在æœåŠ¡ç«¯å‘放奖励\n this.isAdLoadSuccess = false\n uni.showToast({\n title: \"激励视频\" + (e.isEnded ? \"\" : \"未\") + \"æ’放完毕\",\n position: \"bottom\"\n })\n this.loadAd()\n })\n }\n this.rewardAd!.load()\n },\n showAd() {\n if (this.isAdLoadSuccess) {\n this.rewardAd!.show()\n } else {\n this.loadAd()\n }\n }\n }\n }\n</script>\n\n<style>\n\n</style>\n\n```"},"requestPayment":{"name":"## uni.requestPayment(options) @requestpayment","description":"请求支付","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [RequestPaymentOptions](#requestpaymentoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| provider | string | 是 | - | - | 支付æœåŠ¡æ供商,通过 [uni.getProvider](https://doc.dcloud.net.cn/uni-app-x/api/get-provider.html) 获å–,ç›®å‰æ”¯æŒæ”¯ä»˜å®æ”¯ä»˜(alipay),微信支付(wxpay) |\n@| orderInfo | string | 是 | - | - | 订å•æ•°æ® |\n@| success | (result: [RequestPaymentSuccess](#requestpaymentsuccess-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [IRequestPaymentFail](#irequestpaymentfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### RequestPaymentSuccess 的属性值 @requestpaymentsuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| data | any \\| null | å¦ | - | - | |\n\n##### IRequestPaymentFail 的属性值 @irequestpaymentfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 700600 \\| 701100 \\| 701110 \\| 700601 \\| 700602 \\| 700603 \\| 700000 \\| 700604 \\| 700800 \\| 700801 | 是 | - | - | 错误ç <br/>- 700600 æ£åœ¨å¤„ç†ä¸ï¼Œæ”¯ä»˜ç»“果未知(有å¯èƒ½å·²ç»æ”¯ä»˜æˆåŠŸï¼‰ï¼Œè¯·æŸ¥è¯¢å•†å®¶è®¢å•åˆ—表ä¸è®¢å•çš„支付状æ€<br/>- 701100 订å•æ”¯ä»˜å¤±è´¥ã€‚<br/>- 701110 é‡å¤è¯·æ±‚。<br/>- 700601 用户ä¸é€”å–消。<br/>- 700602 网络连接出错。<br/>- 700603 支付结果未知(有å¯èƒ½å·²ç»æ”¯ä»˜æˆåŠŸï¼‰ï¼Œè¯·æŸ¥è¯¢å•†å®¶è®¢å•åˆ—表ä¸è®¢å•çš„支付状æ€ã€‚<br/>- 700000 其它支付错误。<br/>- 700604 微信没有安装。<br/>- 700800 没有é…置对应的URL Scheme。<br/>- 700801 没有é…置对应的universal Link。 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### requestPayment 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.02 | 4.18 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/plugins/payment.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.payment.requestPayment)\n","example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/request-payment/request-payment.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/request-payment/request-payment\n>Template\n```vue\n<template>\r\n\t<page-head title=\"å‘起支付\"></page-head>\r\n\r\n\t<template v-if=\"providerList.length > 0\">\r\n\t\t<button style=\"margin-top: 20px;\" type=\"primary\" v-for=\"(item,index) in providerList\" :key=\"index\"\r\n\t\t\t@click=\"requestPayment(item)\">{{item.name}}支付</button>\r\n\t</template>\r\n</template>\r\n\r\n\r\n\r\n<style>\r\n\r\n</style>\n\n```\n>Script\n```uts\n\r\n\texport type PayItem = { id : string, name : string, provider ?: UniProvider }\r\n\texport default {\r\n\t\tdata() {\r\n\t\t\treturn {\r\n\t\t\t\tbtnText: \"支付å®æ”¯ä»˜\",\r\n\t\t\t\tbtnType: \"primary\",\r\n\t\t\t\torderInfo: \"\",\r\n\t\t\t\terrorCode: 0,\r\n\t\t\t\terrorMsg: \"\",\r\n\t\t\t\tcomplete: false,\r\n\t\t\t\tproviderList: [] as PayItem[]\r\n\t\t\t}\r\n\t\t},\r\n\t\tonLoad: function () {\r\n\t\t\tuni.getProvider({\r\n\t\t\t\tservice: \"payment\",\r\n\t\t\t\tsuccess: (e) => {\r\n\t\t\t\t\tconsole.log(\"payment success:\" + JSON.stringify(e));\r\n\t\t\t\t\tlet array = e.provider as string[]\r\n\t\t\t\t\tarray.forEach((value : string) => {\r\n\t\t\t\t\t\tswitch (value) {\r\n\t\t\t\t\t\t\tcase 'alipay':\r\n\t\t\t\t\t\t\t\tthis.providerList.push({\r\n\t\t\t\t\t\t\t\t\tname: '支付å®',\r\n\t\t\t\t\t\t\t\t\tid: \"alipay\",\r\n\t\t\t\t\t\t\t\t\tprovider: e.providers.find((item) : boolean => {\r\n\t\t\t\t\t\t\t\t\t\treturn item.id == 'alipay'\r\n\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t} as PayItem);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 'wxpay':\r\n\t\t\t\t\t\t\t\tthis.providerList.push({\r\n\t\t\t\t\t\t\t\t\tname: '微信',\r\n\t\t\t\t\t\t\t\t\tid: \"wxpay\",\r\n\t\t\t\t\t\t\t\t\tprovider: e.providers.find((item) : boolean => {\r\n\t\t\t\t\t\t\t\t\t\treturn item.id == 'wxpay'\r\n\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t} as PayItem);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})\r\n\t\t\t\t},\r\n\t\t\t\tfail: (e) => {\r\n\t\t\t\t\tconsole.log(\"获å–支付通é“失败:\", e);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\trequestPayment(e : PayItem) {\r\n\t\t\t\tconst provider = e.id\r\n\t\t\t\tif (provider == \"alipay\") {\r\n\t\t\t\t\tthis.payAli()\r\n\t\t\t\t} else if (provider == \"wxpay\") {\n\r\n\t\t\t\t\tif (e.provider != null && e.provider?.isAppExist==false) {\r\n\t\t\t\t\t\tuni.showToast({\r\n\t\t\t\t\t\t\ttitle: \"微信没有安装\",\n\t\t\t\t\t\t\ticon:'error'\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.payWX()\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tpayAli() {\r\n\t\t\t\tuni.showLoading({\r\n\t\t\t\t\ttitle: \"请求ä¸...\"\r\n\t\t\t\t})\r\n\t\t\t\tuni.request({\r\n\t\t\t\t\turl: 'https://demo.dcloud.net.cn/payment/alipay/?total=0.01',\r\n\t\t\t\t\tmethod: 'GET',\r\n\t\t\t\t\ttimeout: 6000,\r\n\t\t\t\t\tsuccess: (res) => {\r\n\t\t\t\t\t\tthis.orderInfo = JSON.stringify(res.data);\r\n\t\t\t\t\t\tconsole.log(\"====\" + this.orderInfo)\r\n\t\t\t\t\t\tuni.hideLoading()\r\n\t\t\t\t\t\tuni.requestPayment({\r\n\t\t\t\t\t\t\tprovider: \"alipay\",\r\n\t\t\t\t\t\t\torderInfo: res.data as string,\r\n\t\t\t\t\t\t\tfail: (res) => {\r\n\t\t\t\t\t\t\t\tconsole.log(JSON.stringify(res))\r\n\t\t\t\t\t\t\t\tthis.errorCode = res.errCode\r\n\t\t\t\t\t\t\t\tuni.showToast({\r\n\t\t\t\t\t\t\t\t\ticon: 'error',\r\n\t\t\t\t\t\t\t\t\ttitle: 'errorCode:' + this.errorCode\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tsuccess: (res) => {\r\n\t\t\t\t\t\t\t\tconsole.log(JSON.stringify(res))\r\n\t\t\t\t\t\t\t\tuni.showToast({\r\n\t\t\t\t\t\t\t\t\ticon: 'success',\r\n\t\t\t\t\t\t\t\t\ttitle: '支付æˆåŠŸ'\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t},\r\n\t\t\t\t\tfail: (e) => {\r\n\t\t\t\t\t\tconsole.log(e)\r\n\t\t\t\t\t\tuni.hideLoading()\r\n\t\t\t\t\t},\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\tpayWX() {\r\n\t\t\t\tuni.showLoading({\r\n\t\t\t\t\ttitle: \"请求ä¸...\"\r\n\t\t\t\t})\r\n\t\t\t\tlet url = 'https://demo.dcloud.net.cn/payment/wxpayv3.__UNI__uniappx/?total=0.01'\r\n\t\t\t\tconst res = uni.getAppBaseInfo();\n\t\t\t\tlet packageName:string | null\n\n\t\t\t\t// #ifdef APP-ANDROID\n\t\t\t\tpackageName = res.packageName\n\t\t\t\t// #endif\n\n\t\t\t\t// #ifdef APP-IOS\n\t\t\t\tpackageName = res.bundleId\n\t\t\t\t// #endif\n\n\t\t\t\tif (packageName == 'io.dcloud.hellouniappx') {//hello uniappx\n\t\t\t\t url = 'https://demo.dcloud.net.cn/payment/wxpayv3.__UNI__HelloUniAppX/?total=0.01'\n\t\t\t\t}\r\n\t\t\t\tuni.request({\r\n\t\t\t\t\turl: url,\r\n\t\t\t\t\tmethod: 'GET',\r\n\t\t\t\t\ttimeout: 6000,\r\n\t\t\t\t\theader: {\r\n\t\t\t\t\t\t\"Content-Type\": \"application/json\"\r\n\t\t\t\t\t} as UTSJSONObject,\r\n\t\t\t\t\tsuccess: (res) => {\r\n\t\t\t\t\t\tconsole.log(res.data)\r\n\t\t\t\t\t\tuni.hideLoading()\r\n\t\t\t\t\t\tuni.requestPayment({\r\n\t\t\t\t\t\t\tprovider: \"wxpay\",\r\n\t\t\t\t\t\t\torderInfo: JSON.stringify(res.data),\r\n\t\t\t\t\t\t\tfail: (res) => {\r\n\t\t\t\t\t\t\t\tconsole.log(JSON.stringify(res))\r\n\t\t\t\t\t\t\t\tthis.errorCode = res.errCode\r\n\t\t\t\t\t\t\t\tuni.showToast({\r\n\t\t\t\t\t\t\t\t\tduration: 5000,\r\n\t\t\t\t\t\t\t\t\ticon: 'error',\r\n\t\t\t\t\t\t\t\t\ttitle: 'errorCode:' + this.errorCode,\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tsuccess: (res) => {\r\n\t\t\t\t\t\t\t\tconsole.log(JSON.stringify(res))\r\n\t\t\t\t\t\t\t\tuni.showToast({\r\n\t\t\t\t\t\t\t\t\tduration: 5000,\r\n\t\t\t\t\t\t\t\t\ticon: 'success',\r\n\t\t\t\t\t\t\t\t\ttitle: '支付æˆåŠŸ'\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t},\r\n\t\t\t\t\tfail: (res) => {\r\n\t\t\t\t\t\tuni.hideLoading()\r\n\t\t\t\t\t\tconsole.log(res)\r\n\t\t\t\t\t},\r\n\t\t\t\t});\r\n\t\t\t},\r\n\r\n\t\t\t//自动化测试使用\r\n\t\t\tjest_pay() {\r\n\t\t\t\tuni.requestPayment({\r\n\t\t\t\t\tprovider: \"alipay\",\r\n\t\t\t\t\torderInfo: this.orderInfo,\r\n\t\t\t\t\tfail: (res : RequestPaymentFail) => {\r\n\t\t\t\t\t\tthis.errorCode = res.errCode\r\n\t\t\t\t\t\tthis.complete = true\r\n\t\t\t\t\t},\r\n\t\t\t\t\tsuccess: (res : RequestPaymentSuccess) => {\r\n\t\t\t\t\t\tconsole.log(JSON.stringify(res))\r\n\t\t\t\t\t\tthis.complete = true\r\n\t\t\t\t\t}\r\n\t\t\t\t} as RequestPaymentOptions)\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\n```\n:::"},"createWebviewContext":{"name":"## uni.createWebviewContext(webviewId, component?) @createwebviewcontext","description":"创建 web-view 组件的上下文对象,用于æ“作 web-view 的行为。","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| webviewId | [string.WebviewIdString](/uts/data-type.md#ide-string) | 是 | - | - | - |\n| component | ComponentPublicInstance \\| null | å¦ | - | - | | \n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| [WebviewContext](#webviewcontext-values) \\| null | å¦ |\n\n#### WebviewContext 的方法 @webviewcontext-values \n\n#### back() @back\nåŽé€€åˆ° web-view ç»„ä»¶ç½‘é¡µåŠ è½½åŽ†å²çš„上一页,如果ä¸å˜åœ¨ä¸Šä¸€é¡µåˆ™æ²¡æœ‰ä»»ä½•æ•ˆæžœã€‚\n\n\n##### back 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n\n\n#### forward() @forward\nå‰è¿›åˆ° web-view ç»„ä»¶ç½‘é¡µåŠ è½½åŽ†å²çš„下一页,如果ä¸å˜åœ¨ä¸‹ä¸€é¡µåˆ™æ²¡æœ‰ä»»ä½•æ•ˆæžœã€‚\n\n\n##### forward 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n\n\n#### reload() @reload\né‡æ–°åŠ è½½ web-view 组件当å‰é¡µé¢ã€‚\n\n\n##### reload 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n\n\n#### stop() @stop\nåœæ¢åŠ è½½ web-view 组件当å‰ç½‘页,该方法ä¸èƒ½é˜»æ¢å·²ç»åŠ 载的 html 文档,但是能够阻æ¢æœªå®Œæˆçš„图片åŠå»¶è¿ŸåŠ 载的资æºã€‚\n\n\n##### stop 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n\n\n#### evalJS(js) @evaljs\n在网页ä¸æ‰§è¡ŒæŒ‡å®šçš„js脚本,在 uvue 页é¢ä¸å¯é€šè¿‡æ¤æ–¹æ³•å‘ web-view ç»„ä»¶åŠ è½½çš„é¡µé¢å‘é€æ•°æ®\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| js | string | 是 | - | - | - | \n\n\n##### evalJS 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n\n \n","compatibility":"### createWebviewContext 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.component.create-webview-context)\n"},"createVideoContext":{"name":"## uni.createVideoContext(videoId, component?) @createvideocontext","description":"创建并返回 video 上下文 videoContext 对象","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| videoId | [string.VideoIdString](/uts/data-type.md#ide-string) | 是 | - | - | - |\n| component | ComponentPublicInstance \\| null | å¦ | - | - | | \n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| [VideoContext](#videocontext-values) \\| null | å¦ |\n\n#### VideoContext 的方法 @videocontext-values \n\n#### play() @play\næ’放\n\n\n##### play 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n\n\n#### pause() @pause\næš‚åœ\n\n\n##### pause 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n\n\n#### seek(position) @seek\n跳转到指定ä½ç½®\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| position | number | 是 | - | - | 跳转到指定ä½ç½®(秒) | \n\n\n##### seek 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n\n\n#### stop() @stop\nåœæ¢è§†é¢‘\n\n\n##### stop 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n\n\n#### sendDanmu(danmu) @senddanmu\nå‘é€å¼¹å¹•\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| danmu | **Danmu** | 是 | - | - | text, color |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| text | string \\| null | å¦ | - | - | å¼¹å¹•æ–‡å— |\n@| color | string \\| null | å¦ | - | - | 弹幕颜色 |\n@| time | number \\| null | å¦ | - | - | 显示时刻 | \n\n\n##### sendDanmu 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n\n\n#### playbackRate(rate) @playbackrate\n设置å€é€Ÿæ’放\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| rate | number | 是 | - | - | , 支æŒå€çŽ‡ 0.5/0.8/1.0/1.25/1.5 | \n\n\n##### playbackRate 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n\n\n#### requestFullScreen(direction?) @requestfullscreen\n进入全å±\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| direction | **RequestFullScreenOptions** | å¦ | - | - | , 0\\|æ£å¸¸ç«–å‘, 90\\|å±å¹•é€†æ—¶é’ˆ90度, -90\\|å±å¹•é¡ºæ—¶é’ˆ90度 |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| direction | number \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9.0\",\"4.11\"]]}' /> | direction<br/>- 0: æ£å¸¸ç«–å‘<br/>- 90: å±å¹•é€†æ—¶é’ˆ90度<br/>- -90: å±å¹•é¡ºæ—¶é’ˆ90度 | \n\n\n##### requestFullScreen 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n\n\n#### exitFullScreen() @exitfullscreen\n退出全å±\n\n\n##### exitFullScreen 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n\n \n","compatibility":"### createVideoContext 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | √ | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/media/video-context?id=createVideoContext)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.component.create-video-context)\n"},"createMapContext":{"name":"## uni.createMapContext(mapId, currentComponent?) @createmapcontext","description":"创建并返回 map 上下文 mapContext 对象<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| mapId | string | 是 | - | - | - |\n| currentComponent | ComponentPublicInstance | å¦ | - | - | - | \n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [MapContext](#mapcontext-values) |\n\n#### MapContext 的方法 @mapcontext-values \n\n#### getCenterLocation(options) @getcenterlocation\n获å–当å‰åœ°å›¾ä¸å¿ƒçš„ç»çº¬åº¦ï¼Œè¿”回的是 gcj02 åæ ‡ç³»ï¼Œå¯ä»¥ç”¨äºŽ uni.openLocation\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [MapContextGetCenterLocationOptions](#mapcontextgetcenterlocationoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (result: [LocationObject](#locationobject-values)) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 ,res = { longitude: \"ç»åº¦\", latitude: \"纬度\"} |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### LocationObject 的属性值 @locationobject-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| latitude | number | 是 | - | - | 纬度,浮点数,范围为-90~90,负数表示å—纬 |\n| longitude | number | 是 | - | - | ç»åº¦ï¼ŒèŒƒå›´ä¸º-180~180ï¼Œè´Ÿæ•°è¡¨ç¤ºè¥¿ç» |\n\n\n##### getCenterLocation 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### moveToLocation(options) @movetolocation\n将地图ä¸å¿ƒç§»åŠ¨åˆ°å½“å‰å®šä½ç‚¹ï¼Œéœ€è¦é…åˆmap组件的show-location使用\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextMoveToLocationOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| latitude | number | å¦ | - | - | 纬度,浮点数,范围为-90~90,负数表示å—纬 |\n@| longitude | number | å¦ | - | - | ç»åº¦ï¼ŒèŒƒå›´ä¸º-180~180ï¼Œè´Ÿæ•°è¡¨ç¤ºè¥¿ç» |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### moveToLocation 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### translateMarker(options) @translatemarker\n平移marker,带动画\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [MapContextTranslateMarkerOptions](#mapcontexttranslatemarkeroptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| markerId | number | 是 | - | - | 指定marker |\n@| destination | [LocationObject](#locationobject-values) | 是 | - | - | 指定markerç§»åŠ¨åˆ°çš„ç›®æ ‡ç‚¹ |\n@| autoRotate | boolean | å¦ | - | - | 移动过程ä¸æ˜¯å¦è‡ªåŠ¨æ—‹è½¬marker |\n@| rotate | number | å¦ | - | - | marker的旋转角度 |\n@| moveWithRotate | boolean | å¦ | - | - | 平移和旋转åŒæ—¶è¿›è¡Œï¼Œé»˜è®¤å€¼false(仅微信å°ç¨‹åº2.13.0支æŒï¼‰ |\n@| duration | number | å¦ | - | - | 动画æŒç»æ—¶é•¿ï¼Œé»˜è®¤å€¼1000ms,平移与旋转分别计算 |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### MapContextTranslateMarkerOptions 的方法 @mapcontexttranslatemarkeroptions-values \n\n##### animationEnd(result) @animationend\n动画结æŸå›žè°ƒå‡½æ•°\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| result | any | 是 | - | - | - | \n\n\n###### animationEnd 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n\n##### translateMarker 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### includePoints(options) @includepoints\n缩放视野展示所有ç»çº¬åº¦\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextIncludePointsOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| points | Array\\<[LocationObject](#locationobject-values)\\> | 是 | - | - | è¦æ˜¾ç¤ºåœ¨å¯è§†åŒºåŸŸå†…çš„åæ ‡ç‚¹åˆ—è¡¨ï¼Œ[{latitude, longitude}\\] |\n@| padding | Array\\<number\\> | å¦ | - | - | åæ ‡ç‚¹å½¢æˆçš„矩形边缘到地图边缘的è·ç¦»ï¼Œå•ä½åƒç´ ã€‚æ ¼å¼ä¸º\\[上,å³,下,å·¦]安å“上åªèƒ½è¯†åˆ«æ•°ç»„第一项,上下左å³çš„padding一致。开å‘者工具暂ä¸æ”¯æŒpaddingå‚数。 |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### includePoints 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### getRegion(options) @getregion\n获å–当å‰åœ°å›¾çš„视野范围\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [MapContextGetRegionOptions](#mapcontextgetregionoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (result: [MapContextGetRegionResult](#mapcontextgetregionresult-values)) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数,res = {southwest, northeast},西å—角与东北角的ç»çº¬åº¦ |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### MapContextGetRegionResult 的属性值 @mapcontextgetregionresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| southwest | [LocationObject](#locationobject-values) | 是 | - | - | 西å—角的ç»çº¬åº¦ |\n| northeast | [LocationObject](#locationobject-values) | 是 | - | - | 东北角的ç»çº¬åº¦ |\n\n\n##### getRegion 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### getScale(options) @getscale\n获å–当å‰åœ°å›¾çš„缩放级别\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [MapContextGetScaleOptions](#mapcontextgetscaleoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (result: [MapContextGetScaleResult](#mapcontextgetscaleresult-values)) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数,res = {scale} |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### MapContextGetScaleResult 的属性值 @mapcontextgetscaleresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| scale | number | 是 | - | - | 地图缩放级别 |\n\n\n##### getScale 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### addCustomLayer(options) @addcustomlayer\næ·»åŠ ä¸ªæ€§åŒ–å›¾å±‚\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextAddCustomLayerOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| layerId | string | 是 | - | - | 个性化图层id |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### addCustomLayer 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### addGroundOverlay(options) @addgroundoverlay\n创建自定义图片图层,图片会éšç€åœ°å›¾ç¼©æ”¾è€Œç¼©æ”¾\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextAddGroundOverlayOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| id | string | 是 | - | - | 图片图层 id |\n@| src | string | 是 | - | - | 图片路径,支æŒç½‘络图片ã€ä¸´æ—¶è·¯å¾„ã€ä»£ç 包路径 |\n@| bounds | **Bounds** | 是 | - | - | 图片覆盖的ç»çº¬åº¦èŒƒå›´ |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| southwest | [LocationObject](#locationobject-values) | 是 | - | - | 西å—角的ç»çº¬åº¦ |\n@@| northeast | [LocationObject](#locationobject-values) | 是 | - | - | 东北角的ç»çº¬åº¦ |\n@| visible | boolean | å¦ | - | - | 是å¦å¯è§ |\n@| zIndex | number | å¦ | - | - | å›¾å±‚ç»˜åˆ¶é¡ºåº |\n@| opacity | number | å¦ | - | - | 图层é€æ˜Žåº¦ |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### addGroundOverlay 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### addMarkers(options) @addmarkers\næ·»åŠ marker\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextAddMarkersOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| markers | Array\\<any\\> | 是 | - | - | åŒä¼ å…¥ map 组件的 marker 属性 |\n@| clear | boolean | 是 | - | - | 是å¦å…ˆæ¸…空地图上所有 marker |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### addMarkers 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### fromScreenLocation(options) @fromscreenlocation\n获å–å±å¹•ä¸Šçš„点对应的ç»çº¬åº¦ï¼Œåæ ‡åŽŸç‚¹ä¸ºåœ°å›¾å·¦ä¸Šè§’\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextFromScreenLocationOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| x | number | 是 | - | - | x åæ ‡å€¼ |\n@| y | number | 是 | - | - | y åæ ‡å€¼ |\n@| success | (result: [LocationObject](#locationobject-values)) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### fromScreenLocation 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### initMarkerCluster(options) @initmarkercluster\nåˆå§‹åŒ–点èšåˆçš„é…置,未调用时采用默认é…ç½®\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextInitMarkerClusterOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| enableDefaultStyle | boolean | 是 | - | - | å¯ç”¨é»˜è®¤çš„èšåˆæ ·å¼ |\n@| zoomOnClick | boolean | 是 | - | - | 点击已ç»èšåˆçš„æ ‡è®°ç‚¹æ—¶æ˜¯å¦å®žçŽ°èšåˆåˆ†ç¦» |\n@| gridSize | number | 是 | - | - | èšåˆç®—法的å¯èšåˆè·ç¦»ï¼Œå³è·ç¦»å°äºŽè¯¥å€¼çš„点会èšåˆè‡³ä¸€èµ·ï¼Œä»¥åƒç´ 为å•ä½ |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### initMarkerCluster 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### moveAlong(options) @movealong\n沿指定路径移动 marker,用于轨迹回放ç‰åœºæ™¯ã€‚动画完æˆæ—¶è§¦å‘回调事件,若动画进行ä¸ï¼Œå¯¹åŒä¸€ marker å†æ¬¡è°ƒç”¨ moveAlong 方法,å‰ä¸€æ¬¡çš„动画将被打æ–。\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextMoveAlongOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| markerId | number | 是 | - | - | 指定 marker |\n@| path | Array\\<[LocationObject](#locationobject-values)\\> | 是 | - | - | 移动路径的åæ ‡ä¸²ï¼Œåæ ‡ç‚¹æ ¼å¼ {longitude, latitude} |\n@| autoRotate | boolean | å¦ | - | - | æ ¹æ®è·¯å¾„æ–¹å‘è‡ªåŠ¨æ”¹å˜ marker 的旋转角度 |\n@| duration | number | 是 | - | - | 平滑移动的时间 |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### moveAlong 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### openMapApp(options) @openmapapp\n拉起地图APP选择导航。\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextOpenMapAppOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| destination | string | 是 | - | - | 目的地å称 |\n@| latitude | number | 是 | - | - | 目的地纬度 |\n@| longitude | number | 是 | - | - | 目的地ç»åº¦ |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### openMapApp 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### removeCustomLayer(options) @removecustomlayer\n移除个性化图层\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextRemoveCustomLayerOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| layerId | string | 是 | - | - | 个性化图层id |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### removeCustomLayer 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### removeGroundOverlay(options) @removegroundoverlay\n移除自定义图片图层\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextRemoveGroundOverlayOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| id | string | 是 | - | - | 图片图层 id |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### removeGroundOverlay 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### removeMarkers(options) @removemarkers\n移除 marker\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextRemoveMarkersOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| markerIds | Array\\<any\\> | 是 | - | - | è¦è¢«åˆ 除的markerçš„id属性组æˆçš„数组 |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### removeMarkers 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### setCenterOffset(options) @setcenteroffset\n设置地图ä¸å¿ƒç‚¹å移,å‘åŽå‘下为增长,å±å¹•æ¯”例范围(0.25~0.75),默认å移为[0.5, 0.5\\]\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextSetCenterOffsetOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| offset | Array\\<number\\> | 是 | - | - | å移é‡ï¼Œä¸¤ä½æ•°ç»„ |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### setCenterOffset 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### toScreenLocation(options) @toscreenlocation\n获å–ç»çº¬åº¦å¯¹åº”çš„å±å¹•åæ ‡ï¼Œåæ ‡åŽŸç‚¹ä¸ºåœ°å›¾å·¦ä¸Šè§’ã€‚\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextToScreenLocationOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| latitude | number | 是 | - | - | 纬度 |\n@| longitude | number | 是 | - | - | ç»åº¦ |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### toScreenLocation 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### updateGroundOverlay(options) @updategroundoverlay\n更新自定义图片图层。\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextUpdateGroundOverlayOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| id | string | 是 | - | - | 图片图层 id |\n@| src | string | 是 | - | - | 图片路径,支æŒç½‘络图片ã€ä¸´æ—¶è·¯å¾„ã€ä»£ç 包路径 |\n@| bounds | [Bounds](#bounds-values) | 是 | - | - | 图片路径,支æŒç½‘络图片ã€ä¸´æ—¶è·¯å¾„ã€ä»£ç 包路径 |\n@| visible | boolean | å¦ | - | - | 是å¦å¯è§ |\n@| zIndex | number | å¦ | - | - | å›¾å±‚ç»˜åˆ¶é¡ºåº |\n@| opacity | number | å¦ | - | - | 图层é€æ˜Žåº¦ |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### updateGroundOverlay 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### on(event, callback) @on\n监å¬åœ°å›¾äº‹ä»¶ã€‚\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| event | \"markerClusterCreate\" \\| \"markerClusterClick\" | 是 | - | - | - |\n| callback | (args?: Array\\<any\\>) => any | 是 | - | - | - | \n\n\n##### on 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### $getAppMap() @$getappmap\n获å–原生地图对象 plus.maps.Map\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| any |\n \n\n##### $getAppMap 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n \n","compatibility":"### createMapContext 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | x | x |\n","tutorial":"\n### å‚è§\n- [createMapContext](https://doc.dcloud.net.cn/uni-app-x/api/create-map-context.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.component.create-map-context)\n"},"getProvider":{"name":"## uni.getProvider(options) @getprovider","description":"获å–æœåŠ¡ä¾›åº”商","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [GetProviderOptions](#getprovideroptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| service | string | 是 | - | - | æœåŠ¡ç±»åž‹ï¼Œå¯å–值“paymentâ€<br/>- payment: 支付 (Alipayã€Wxpay) |\n@| success | (result: [GetProviderSuccess](#getprovidersuccess-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调 |\n@| fail | (result: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### GetProviderSuccess 的属性值 @getprovidersuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| service | string | 是 | - | - | æœåŠ¡ç±»åž‹<br/>- payment: 支付 |\n| provider | Array\\<string\\> | 是 | - | - | 得到的æœåŠ¡ä¾›åº”商 |\n| providers | Array\\<**UniProvider**\\> | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | 得到的æœåŠ¡ä¾›åº”商æœåŠ¡å¯¹è±¡ |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| id | string | 是 | - | - | æœåŠ¡ä¾›åº”å•†æ ‡è¯† |\n@| description | string | 是 | - | - | æœåŠ¡ä¾›åº”商æè¿° |\n@| isAppExist | boolean | 是 | - | - | 判æ–æœåŠ¡ä¾›åº”商ä¾èµ–çš„App是å¦å®‰è£…(仅支æŒå¾®ä¿¡æ”¯ä»˜ï¼‰ |\n| errMsg | string | 是 | - | - | é”™è¯¯ä¿¡æ¯ |\n","returnValue":"","compatibility":"### getProvider 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.11 | 4.18 |\n","tutorial":"\n### å‚è§\n- [getProvider](https://doc.dcloud.net.cn/uni-app-x/api/get-provider.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.tripartite.get-provider)\n"},"get-provider":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-provider/get-provider.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\r\n <!-- #ifdef APP -->\r\n <scroll-view class=\"page-scroll-view\">\r\n <!-- #endif -->\r\n <view class=\"page\">\r\n <page-head :title=\"title\"></page-head>\r\n <view class=\"service-item\" v-for=\"(item, index) in serviceList\" :key=\"index\">\r\n <text class=\"service-name\">{{item.name}}:</text>\r\n <view class=\"provider-list\">\r\n <text class=\"provider-item\" v-for=\"(item2, index2) in item.provider\" :key=\"index2\">{{item2}}</text>\r\n </view>\r\n </view>\r\n <button class=\"btn-get-provider\" type=\"primary\" @click=\"getProvider\">getProvider</button>\r\n </view>\r\n <!-- #ifdef APP -->\r\n </scroll-view>\r\n <!-- #endif -->\r\n</template>\r\n\r\n<script>\r\n type ProviderItem = {\r\n service : string,\r\n name : string,\r\n provider : string[]\r\n }\r\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'provider',\r\n serviceList: [\r\n { service: \"oauth\", name: \"登陆\", provider: [] },\r\n { service: \"share\", name: \"分享\", provider: [] },\r\n { service: \"payment\", name: \"支付\", provider: [] },\r\n { service: \"push\", name: \"推é€\", provider: [] },\r\n { service: \"location\", name: \"定ä½\", provider: [] }\r\n ] as ProviderItem[]\r\n }\r\n },\r\n methods: {\r\n getProvider() {\r\n this.serviceList.forEach((item : ProviderItem) => {\r\n uni.getProvider({\r\n service: item.service,\r\n success: (e) => {\r\n this.updateProvider(e.service, e.provider);\r\n }\r\n })\r\n })\r\n },\r\n updateProvider(service : string, provider : string[]) {\r\n const item : ProviderItem | null = this.serviceList.find((item : ProviderItem) : boolean => {\r\n return item.service == service\r\n });\r\n if (item != null) {\r\n item.provider = provider\r\n }\r\n }\r\n }\r\n }\r\n</script>\r\n\r\n<style>\r\n .page {\r\n padding: 15px;\r\n }\r\n\r\n .service-item {\r\n margin-top: 10px;\r\n }\r\n\r\n .service-name {\r\n font-weight: bold;\r\n }\r\n\r\n .provider-list {\r\n margin-left: 32px;\r\n }\r\n\r\n .provider-item {\r\n line-height: 1.5;\r\n }\r\n\r\n .btn-get-provider {\r\n margin-top: 30px;\r\n }\r\n</style>\n\n```"},"general_type":{"name":"## 通用类型\n","param":"### GeneralCallbackResult \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | é”™è¯¯ä¿¡æ¯ |\n"}} \ No newline at end of file +{"getApp":{"name":"## getApp() @getapp","description":"`getApp()` 函数用于获å–当å‰åº”用实例,å¯é€šè¿‡åº”用实例调用 App.uvue methods ä¸å®šä¹‰çš„方法。","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| any |\n \n","compatibility":"### getApp 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/tutorial/page.html#getapp)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.global.get-app)\n"},"get-app":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-app/get-app.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-app/get-app\n>Template\n```vue\n<template>\r\n <!-- #ifdef APP -->\r\n <scroll-view style=\"flex: 1; padding-bottom: 20px\">\r\n <!-- #endif -->\r\n <view>\r\n <page-head title=\"getApp\"></page-head>\r\n <view class=\"uni-padding-wrap\">\r\n <button @click=\"getGlobalData\">get globalData</button>\r\n <template v-if=\"originGlobalData.str.length\">\r\n <text class=\"uni-common-mt bold\">åˆå§‹çš„ globalData:</text>\r\n <text class=\"uni-common-mt\">globalData string: {{ originGlobalData.str }}</text>\r\n <text class=\"uni-common-mt\">globalData number: {{ originGlobalData.num }}</text>\r\n <text class=\"uni-common-mt\">globalData boolean: {{ originGlobalData.bool }}</text>\r\n <text class=\"uni-common-mt\">globalData object: {{ originGlobalData.obj }}</text>\r\n <text class=\"uni-common-mt\">globalData null: {{ originGlobalData.null }}</text>\r\n <text class=\"uni-common-mt\">globalData array: {{ originGlobalData.arr }}</text>\r\n <text class=\"uni-common-mt\">globalData Set: {{ originGlobalData.mySet }}</text>\r\n <text class=\"uni-common-mt\">globalData Map: {{ originGlobalData.myMap }}</text>\r\n <text class=\"uni-common-mt\">globalData func 返回值: {{ originGlobalDataFuncRes }}</text>\r\n </template>\r\n <button @click=\"setGlobalData\" class=\"uni-common-mt\">\r\n set globalData\r\n </button>\r\n <template v-if=\"newGlobalData.bool\">\r\n <text class=\"uni-common-mt bold\">æ›´æ–°åŽçš„ globalData:</text>\r\n <text class=\"uni-common-mt\">globalData string: {{ newGlobalData.str }}</text>\r\n <text class=\"uni-common-mt\">globalData number: {{ newGlobalData.num }}</text>\r\n <text class=\"uni-common-mt\">globalData boolean: {{ newGlobalData.bool }}</text>\r\n <text class=\"uni-common-mt\">globalData object: {{ newGlobalData.obj }}</text>\r\n <text class=\"uni-common-mt\">globalData null: {{ newGlobalData.null }}</text>\r\n <text class=\"uni-common-mt\">globalData array: {{ newGlobalData.arr }}</text>\r\n <text class=\"uni-common-mt\">globalData Set: {{ newGlobalData.mySet }}</text>\r\n <text class=\"uni-common-mt\">globalData Map: {{ newGlobalData.myMap }}</text>\r\n <text class=\"uni-common-mt\">globalData func 返回值: {{ newGlobalDataFuncRes }}</text>\r\n </template>\r\n <text class=\"uni-common-mt\">点击按钮调用 App.uvue methods</text>\r\n <text class=\"uni-common-mt\">increasetLifeCycleNum 方法</text>\r\n <button class=\"uni-common-mt\" @click=\"_increasetLifeCycleNum\">\r\n increase lifeCycleNum\r\n </button>\r\n <text class=\"uni-common-mt\">lifeCycleNum: {{ lifeCycleNum }}</text>\r\n </view>\r\n </view>\r\n <!-- #ifdef APP -->\r\n </scroll-view>\r\n <!-- #endif -->\r\n</template>\r\n\r\n\r\n\r\n<style>\r\n .bold {\r\n font-weight: bold;\r\n }\r\n\r\n .hr {\r\n border-bottom: 1px solid #ccc;\r\n }\r\n</style>\n\n```\n>Script\n```uts\n\r\n import { state, setLifeCycleNum } from '@/store/index.uts'\r\n\r\n type MyGlobalData = {\r\n str : string,\r\n num : number,\r\n bool : boolean,\r\n obj : UTSJSONObject,\r\n null : string | null,\r\n arr : number[],\r\n mySet : string[],\r\n myMap : UTSJSONObject,\r\n func : () => string\r\n }\r\n\r\n export default {\r\n data() {\r\n return {\r\n originGlobalData: {\r\n str: '',\r\n num: 0,\r\n bool: false,\r\n obj: {\r\n str: '',\r\n num: 0,\r\n bool: false\r\n } as UTSJSONObject,\r\n null: null,\r\n arr: [] as number[],\r\n mySet: [] as string[],\r\n myMap: {},\r\n func: () : string => ''\r\n } as MyGlobalData,\r\n originGlobalDataFuncRes: '',\r\n newGlobalData: {\r\n str: '',\r\n num: 0,\r\n bool: false,\r\n obj: {\r\n str: '',\r\n num: 0,\r\n bool: false\r\n } as UTSJSONObject,\r\n null: null,\r\n arr: [] as number[],\r\n mySet: [] as string[],\r\n myMap: {},\r\n func: () : string => ''\r\n } as MyGlobalData,\r\n newGlobalDataFuncRes: '',\r\n lifeCycleNum: 0,\r\n }\r\n },\r\n onReady() {\r\n this.lifeCycleNum = state.lifeCycleNum\r\n },\r\n methods: {\r\n getGlobalData() {\r\n const app = getApp()\r\n\r\n this.originGlobalData.str = app.globalData.str\r\n this.originGlobalData.num = app.globalData.num\r\n this.originGlobalData.bool = app.globalData.bool\r\n this.originGlobalData.obj = app.globalData.obj\r\n this.originGlobalData.null = app.globalData.null\r\n this.originGlobalData.arr = app.globalData.arr\r\n app.globalData.mySet.forEach((value : string) => {\r\n this.originGlobalData.mySet.push(value)\r\n })\r\n app.globalData.myMap.forEach((value : any, key : string) => {\r\n this.originGlobalData.myMap[key] = value\r\n })\r\n this.originGlobalData.func = app.globalData.func\r\n this.originGlobalDataFuncRes = this.originGlobalData.func()\r\n },\r\n setGlobalData() {\r\n const app = getApp()\r\n\r\n app.globalData.str = 'new globalData str'\r\n app.globalData.num = 100\r\n app.globalData.bool = true\r\n app.globalData.obj = {\r\n str: 'new globalData obj str',\r\n num: 200,\r\n bool: true\r\n }\r\n app.globalData.null = 'not null'\r\n app.globalData.arr = [1, 2, 3]\r\n app.globalData.mySet = new Set(['a', 'b', 'c'])\r\n app.globalData.myMap = new Map([\r\n ['a', 1],\r\n ['b', 2],\r\n ['c', 3]\r\n ])\r\n app.globalData.func = () : string => {\r\n return 'new globalData func'\r\n }\r\n\r\n this.newGlobalData.str = app.globalData.str\r\n this.newGlobalData.num = app.globalData.num\r\n this.newGlobalData.bool = app.globalData.bool\r\n this.newGlobalData.obj = app.globalData.obj\r\n this.newGlobalData.null = app.globalData.null\r\n this.newGlobalData.arr = app.globalData.arr\r\n app.globalData.mySet.forEach((value : string) => {\r\n this.newGlobalData.mySet.push(value)\r\n })\r\n app.globalData.myMap.forEach((value : any, key : string) => {\r\n this.newGlobalData.myMap[key] = value\r\n })\r\n this.newGlobalData.func = app.globalData.func\r\n this.newGlobalDataFuncRes = this.newGlobalData.func()\r\n },\r\n _increasetLifeCycleNum: function () {\r\n const app = getApp()\r\n app.increasetLifeCycleNum()\r\n this.lifeCycleNum = state.lifeCycleNum\r\n },\r\n // 自动化测试\r\n setLifeCycleNum(num : number) {\r\n setLifeCycleNum(num)\r\n }\r\n },\r\n }\r\n\n```\n:::"},"getCurrentPages":{"name":"## getCurrentPages() @getcurrentpages","description":"`getCurrentPages()` 函数用于获å–当å‰é¡µé¢æ ˆçš„实例,以数组形å¼æŒ‰æ ˆçš„顺åºç»™å‡ºï¼Œæ•°ç»„ä¸çš„å…ƒç´ ä¸ºé¡µé¢å®žä¾‹ï¼Œç¬¬ä¸€ä¸ªå…ƒç´ 为首页,最åŽä¸€ä¸ªå…ƒç´ 为当å‰é¡µé¢ã€‚","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| Array\\<[Page](#page-values)\\> |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| route | string | 是 | - | - | 页é¢çš„è·¯ç”±åœ°å€ |\n@| options | Map\\<string, string \\| null> | 是 | - | - | 页é¢çš„路由å‚æ•°ä¿¡æ¯ï¼Œç›®å‰web端options类型为Object,åŽç»å¯èƒ½ä¼šè°ƒæ•´ |\n#### Page 的方法 @page-values \n\n#### $getPageStyle() @$getpagestyle\n获å–当å‰é¡µé¢æ ·å¼ \\<br/>åŒ…å« pages.json 页é¢ä¸‹çš„ style èŠ‚ç‚¹å±žæ€§å’Œæ ¹èŠ‚ç‚¹ globalStyle 属性\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) |\n \n\n##### $getPageStyle 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.13 | 4.13 | 4.13 |\n\n\n##### å‚è§\n- [$getPageStyle](https://doc.dcloud.net.cn/uni-app-x/api/get-current-pages.html#getPageStyle)\n\n#### $setPageStyle(style) @$setpagestyle\n设置当å‰é¡µé¢æ ·å¼ \\<br/>æ”¯æŒ pages.json 页é¢ä¸‹çš„ style èŠ‚ç‚¹å±žæ€§å’Œæ ¹èŠ‚ç‚¹ globalStyle 属性\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| style | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 是 | - | - | 如果属性åå˜åœ¨ï¼Œä¸”类型为UTSJSONObject返回对应的结果,ä¸å˜åœ¨è¿”回null | \n\n\n##### $setPageStyle 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.13 | 4.13 | 4.13 |\n\n\n##### å‚è§\n- [$setPageStyle](https://doc.dcloud.net.cn/uni-app-x/api/get-current-pages.html#setPageStyle)\n \n","compatibility":"### getCurrentPages 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/tutorial/page.html#getcurrentpages)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.global.get-current-pages)\n"},"get-current-pages":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-current-pages/get-current-pages.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-current-pages/get-current-pages\n>Template\n```vue\n<template>\r\n <!-- #ifdef APP -->\r\n <scroll-view class=\"page-scroll-view\">\r\n <!-- #endif -->\r\n <page-head title=\"getCurrentPages\"></page-head>\r\n <view class=\"uni-padding-wrap\">\r\n <button @click=\"_getCurrentPages\">getCurrentPages</button>\r\n <view v-if=\"pages.length\" style=\"padding: 15px 0px\">\r\n <text>当å‰é¡µé¢æ ˆä¸ {{ pages.length }} 个页é¢ï¼Œåˆ—表如下:</text>\r\n <template v-for=\"(page, index) in pages\" :key=\"page.route\">\r\n <text style=\"margin-top: 5px\">index: {{ index }}, route: {{ page.route }}</text>\r\n </template>\r\n </view>\r\n </view>\r\n\r\n <page-head title=\"currentPageStyle\"></page-head>\r\n <template v-for=\"(item, index) in PageStyleArray\">\r\n <view class=\"page-style-item\" v-if=\"currentPageStyle[item.key]!=null\" :key=\"index\">\r\n <view class=\"item-text\">\r\n <text class=\"item-text-key\">{{item.key}}:</text>\r\n <text class=\"item-text-value\">{{currentPageStyle[item.key]}}</text>\r\n </view>\r\n <view class=\"set-value\" v-if=\"item.type == 'boolean'\">\r\n <switch :checked=\"currentPageStyle.getBoolean(item.key)\"\r\n @change=\"switchChange(item.key, $event as UniSwitchChangeEvent)\">\r\n </switch>\r\n </view>\r\n <view class=\"set-value\" v-else-if=\"item.type == 'number'\">\r\n <slider :value=\"currentPageStyle.getNumber(item.key)\" :show-value=\"true\"\r\n @change=\"sliderChange(item.key, $event as UniSliderChangeEvent)\" />\r\n </view>\r\n <view class=\"set-value\" v-else-if=\"item.type == 'string'\">\r\n <radio-group class=\"radio-set-value\" @change=\"radioChange(item.key, $event as RadioGroupChangeEvent)\">\n <radio class=\"radio-value\" v-for=\"(item2, index2) in item.value\" :key=\"index2\" :value=\"item2\" >{{item2}}</radio>\n </radio-group>\r\n </view>\r\n </view>\r\n </template>\r\n <!-- #ifdef APP -->\r\n </scroll-view>\r\n <!-- #endif -->\r\n</template>\r\n\r\n\r\n\r\n<style>\r\n .page {\r\n flex: 1;\r\n padding: 10px;\r\n }\r\n\r\n .page-style {\r\n margin-top: 15px;\r\n }\r\n\r\n .page-style-item {\r\n padding: 10px;\r\n margin-top: 10px;\r\n background-color: #ffffff;\r\n border-radius: 5px;\r\n }\r\n\r\n .item-text {\r\n flex-direction: row;\r\n }\r\n\r\n .item-text-key {\r\n font-weight: bold;\r\n }\r\n\r\n .item-text-value {\r\n margin-left: 5px;\r\n }\r\n\r\n .set-value {\r\n margin-top: 10px;\r\n }\r\n\r\n .radio-set-value {\r\n flex-direction: row;\r\n }\r\n\r\n .radio-value {\n margin-left: 10px;\n }\r\n</style>\n\n```\n>Script\n```uts\n\r\n import { PageStyleItem, PageStyleArray } from './page-style.uts';\r\n\r\n class Page {\r\n constructor(public route : string) {\r\n }\r\n }\r\n\r\n export default {\r\n data() {\r\n return {\r\n checked: false,\r\n pages: [] as Page[],\r\n PageStyleArray: PageStyleArray as PageStyleItem[],\r\n currentPageStyle: {} as UTSJSONObject,\r\n }\r\n },\r\n computed: {\r\n pageStyleText() : string {\r\n return JSON.stringify(this.currentPageStyle)\r\n }\r\n },\r\n onLoad() {\r\n this.getPageStyle();\r\n },\r\n onPullDownRefresh() {\r\n setTimeout(() => {\r\n uni.stopPullDownRefresh()\r\n }, 2000)\r\n },\r\n methods: {\r\n startPullDownRefresh() {\r\n uni.startPullDownRefresh()\r\n },\r\n _getCurrentPages: function () {\r\n this.pages.length = 0\r\n const pages = getCurrentPages()\r\n this.pages.push(new Page(pages[0].route))\r\n if (this.pages[0].route.includes('/tabBar/')) {\r\n this.checked = true\r\n }\r\n for (let i = 1; i < pages.length; i++) {\r\n this.pages.push(new Page(pages[i].route))\r\n if (pages[i].route.includes('/tabBar/')) {\r\n this.checked = false\r\n }\r\n }\r\n },\r\n /// get-set-page-style\r\n radioChange(key : string, e : RadioGroupChangeEvent) {\r\n this.setStyleValue(key, e.detail.value);\r\n },\r\n sliderChange(key : string, e : UniSliderChangeEvent) {\r\n this.setStyleValue(key, e.detail.value);\r\n },\r\n switchChange(key : string, e : UniSwitchChangeEvent) {\r\n this.setStyleValue(key, e.detail.value);\r\n },\r\n setStyleValue(key : string, value : any) {\r\n const style = {}\r\n style[key] = value\r\n this.setPageStyle(style)\r\n this.getPageStyle()\r\n },\r\n getPageStyle() : UTSJSONObject {\r\n const pages = getCurrentPages();\r\n const currentPage = pages[pages.length - 1];\r\n this.currentPageStyle = currentPage.$getPageStyle()\r\n return this.currentPageStyle;\r\n },\r\n setPageStyle(style : UTSJSONObject) {\r\n console.log('setPageStyle:', style);\r\n const pages = getCurrentPages();\r\n const currentPage = pages[pages.length - 1];\r\n currentPage.$setPageStyle(style);\r\n },\r\n // getCurrentPage(): Page {\r\n // const pages = getCurrentPages();\r\n // const currentPage = pages[pages.length - 1];\r\n // return currentPage;\r\n // }\r\n },\r\n }\r\n\n```\n:::"},"$on":{"name":"## uni.$on(eventName, callback) @$on","description":"监å¬è‡ªå®šä¹‰äº‹ä»¶ã€‚事件å¯ä»¥ç”± uni.$emit 触å‘。回调函数会接收 uni.$emit ä¼ é€’çš„å‚数。<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| eventName | string | 是 | - | - | - |\n| callback | () => void | 是 | - | - | - | \n","returnValue":"","compatibility":"### $on 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [$on](https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#on)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.event-bus.$on)\n"},"$once":{"name":"## uni.$once(eventName, callback) @$once","description":"监å¬ä¸€ä¸ªè‡ªå®šä¹‰äº‹ä»¶ã€‚事件åªè§¦å‘一次,在第一次触å‘之åŽç§»é™¤äº‹ä»¶ç›‘å¬å™¨ã€‚<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| eventName | string | 是 | - | - | - |\n| callback | () => void | 是 | - | - | - | \n","returnValue":"","compatibility":"### $once 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [$once](https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#once)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.event-bus.$once)\n"},"$off":{"name":"## uni.$off(eventName, callback?) @$off","description":"移除自定义事件监å¬å™¨ã€‚如果æ供了事件å和回调,则åªç§»é™¤è¿™ä¸ªå›žè°ƒçš„监å¬å™¨ã€‚<br/>4.13+ 开始支æŒç¬¬äºŒä¸ªå‚数为å¯é€‰ï¼Œå¦‚果仅æ供事件å,则移除该事件的所有监å¬å™¨ã€‚","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| eventName | string | 是 | - | - | - |\n| callback | () => void \\| null | å¦ | - | - | | \n","returnValue":"","compatibility":"### $off 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [$off](https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#off)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.event-bus.$off)\n"},"$emit":{"name":"## uni.$emit(eventName, args?) @$emit","description":"触å‘è‡ªå®šä¹‰äº‹ä»¶ï¼Œé™„åŠ çš„å‚æ•°ä¼šä¼ é€’ç»™äº‹ä»¶ç›‘å¬å™¨ã€‚<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| eventName | string | 是 | - | - | - |\n| args | any \\| null | å¦ | - | - | | \n","returnValue":"","compatibility":"### $emit 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [$emit](https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#emit)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.event-bus.$emit)\n"},"event-bus":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/event-bus/event-bus.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/event-bus/event-bus\n>Template\n```vue\n<template>\r\n <!-- #ifdef APP -->\r\n <scroll-view class=\"page-scroll-view\">\r\n <!-- #endif -->\r\n <view>\r\n <button @click=\"on\">开始监å¬</button>\r\n <button @click=\"once\">监å¬ä¸€æ¬¡</button>\r\n <button @click=\"off\">å–消监å¬</button>\n <!-- <button @click=\"offAll\">å–消全部监å¬</button> -->\r\n <button @click=\"emit\">触å‘监å¬</button>\r\n <button @click=\"clear\">清空消æ¯</button>\r\n <view class=\"box\">\r\n <view>收到的消æ¯ï¼š</view>\r\n <view>\r\n <view v-for=\"(item, index) in log\" :key=\"index\">{{ item }}</view>\r\n </view>\r\n </view>\r\n </view>\r\n <!-- #ifdef APP -->\r\n </scroll-view>\r\n <!-- #endif -->\r\n</template>\r\n\r\n\r\n\r\n<style>\r\n .box {\r\n padding: 10px;\r\n }\r\n</style>\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n log: [] as string[],\r\n }\r\n },\r\n methods: {\r\n fn(res : string) {\r\n this.log.push(res)\r\n },\n fn2(res : string) {\n this.log.push(res)\n },\r\n on() {\r\n uni.$on('test', this.fn)\r\n },\n on2() {\n uni.$on('test', this.fn2)\n },\r\n once() {\r\n uni.$once('test', this.fn)\r\n },\r\n off() {\r\n uni.$off('test', this.fn)\r\n },\n offAll() {\n uni.$off('test')\n },\r\n emit() {\r\n uni.$emit('test', 'msg:' + Date.now())\r\n },\r\n clear() {\r\n this.log.length = 0\r\n },\r\n },\r\n }\r\n\n```\n:::"},"addInterceptor":{"name":"## uni.addInterceptor(name, interceptor) @addinterceptor","description":"æ·»åŠ æ‹¦æˆªå™¨","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| name | string | 是 | - | - | 需è¦æ‹¦æˆªçš„ API å称 |\n| interceptor | Interceptor | 是 | - | - | 拦截器 | \n","returnValue":"","compatibility":"### addInterceptor 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.97 | 4.11 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.interceptor.addInterceptor)\n"},"removeInterceptor":{"name":"## uni.removeInterceptor(name, interceptor?) @removeinterceptor","description":"åˆ é™¤æ‹¦æˆªå™¨","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| name | string | 是 | - | - | 需è¦åˆ 除拦截器的 API å称 |\n| interceptor | Interceptor \\| null | å¦ | - | - | 拦截器 | \n","returnValue":"","compatibility":"### removeInterceptor 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.97 | 4.11 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.interceptor.removeInterceptor)\n"},"interceptor":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/interceptor/interceptor.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/interceptor/interceptor\n>Template\n```vue\n<template>\r\n <view style=\"flex: 1;\">\r\n <button @click=\"addInterceptor\">æ·»åŠ è·¯ç”±æ‹¦æˆªå™¨</button>\r\n <button @click=\"removeInterceptor\">移除路由拦截器</button>\r\n <text>点击下方按钮{{msg}}</text>\r\n <button @click=\"navigateTo\">navigatorTo API跳转到测试页é¢</button>\n <navigator url=\"./page1\"><button class=\"navigatorButton\">navigator组件跳转到测试页é¢</button></navigator>\r\n </view>\r\n</template>\r\n\r\n\r\n\r\n<style>\r\n\r\n</style>\n\n```\n>Script\n```uts\n\r\n const interceptor = {\r\n invoke: function (options : NavigateToOptions) {\r\n console.log('拦截 navigateTo 接å£ä¼ å…¥å‚数为:', options)\r\n const url = './page2'\r\n uni.showToast({\r\n title: `é‡å®šå‘到页é¢:${url}`\r\n })\r\n options.url = url\r\n },\r\n success: function (res : NavigateBackSuccess) {\r\n console.log('拦截 navigateTo æŽ¥å£ success 返回å‚数为:', res)\r\n },\r\n fail: function (err : NavigateToFail) {\r\n console.log('拦截 navigateTo æŽ¥å£ fail 返回å‚数为:', err)\r\n },\r\n complete: function (res : NavigateToComplete) {\r\n console.log('拦截 navigateTo æŽ¥å£ complete 返回å‚数为:', res)\r\n }\r\n } as Interceptor\r\n export default {\r\n data() {\r\n return {\r\n msg: \"会跳转到测试页é¢1\"\r\n }\r\n },\r\n beforeUnmount() {\r\n // 移除 navigateTo 所有拦截器\r\n uni.removeInterceptor('navigateTo')\r\n },\r\n methods: {\r\n addInterceptor() {\r\n uni.addInterceptor('navigateTo', interceptor)\r\n uni.showToast({\r\n title: '页é¢è·³è½¬å·²æ‹¦æˆª'\r\n })\r\n this.msg = \",路由被劫æŒåˆ°æµ‹è¯•é¡µé¢2\"\r\n },\r\n removeInterceptor() {\r\n uni.removeInterceptor('navigateTo', interceptor)\r\n uni.showToast({\r\n title: '拦截器已移除'\r\n })\r\n this.msg = \"会跳转到测试页é¢1\"\r\n },\r\n navigateTo() {\r\n uni.navigateTo({\r\n url: './page1',\r\n success(res) {\r\n console.log('res:', res)\r\n },\r\n fail(err) {\r\n console.error('err:', err)\r\n },\r\n complete(res) {\r\n console.log('res:', res)\r\n }\r\n })\r\n }\r\n }\r\n }\r\n\n```\n:::"},"getLaunchOptionsSync":{"name":"## uni.getLaunchOptionsSync() @getlaunchoptionssync","description":"获å–本次å¯åŠ¨æ—¶çš„å‚数。返回值与App.onLaunch的回调å‚数一致<br/>","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| **OnLaunchOptions** |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| path | string | 是 | - | - | - | \n","compatibility":"### getLaunchOptionsSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [getLaunchOptionsSync](https://doc.dcloud.net.cn/uni-app-x/api/get-launch-options-sync.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.get-launch-options-sync)\n"},"get-launch-options-sync":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-launch-options-sync/get-launch-options-sync.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-launch-options-sync/get-launch-options-sync\n>Template\n```vue\n<template>\n <page-head title=\"getLaunchOptionsSync\"></page-head>\n <view class=\"uni-padding-wrap\">\n <button @click=\"getLaunchOptionsSync\">getLaunchOptionsSync</button>\n <view v-if=\"launchOptionsPath.length > 0\" class=\"uni-common-mt\">\n <text>应用å¯åŠ¨è·¯å¾„:</text>\n <text style=\"margin-top: 5px\">{{ launchOptionsPath }}</text>\n </view>\n </view>\n</template>\n\n\n\n```\n>Script\n```uts\n\nexport default {\n data() {\n return {\n checked: false,\n homePagePath: 'pages/tabBar/component',\n launchOptionsPath: '',\n }\n },\n methods: {\n getLaunchOptionsSync() {\n const launchOptions = uni.getLaunchOptionsSync()\n this.launchOptionsPath = launchOptions.path\n\n if (launchOptions.path == this.homePagePath) {\n this.checked = true\n }\n },\n },\n}\n\n```\n:::"},"exit":{"name":"## uni.exit(options?) @exit","description":"退出当å‰åº”用","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ExitOptions](#exitoptions-values) \\| null | å¦ | - | - | uni.exitå‚数定义 |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (res: [ExitSuccess](#exitsuccess-values)) => void \\| null | å¦ | - | - | uni.exitæˆåŠŸå›žè°ƒå‡½æ•°å®šä¹‰ |\n@| fail | (res: [IExitError](#iexiterror-values)) => void \\| null | å¦ | - | - | uni.exit失败回调函数定义 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | uni.exit完æˆå›žè°ƒå‡½æ•°å®šä¹‰ | \n\n##### ExitSuccess 的属性值 @exitsuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n\n##### IExitError 的属性值 @iexiterror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 12001 \\| 12002 | 是 | - | - | 错误ç <br/>- 12001: 系统ä¸æ”¯æŒ<br/>- 12002: 未知错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### exit 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | x |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.exit)\n","example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/exit/exit.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\n\t<view>\n\t\t<button @tap=\"exitAppClick\">退出应用</button>\n\t</view>\n</template>\n\n<script>\n\texport default {\n\t\tmethods: {\n\t\t\texitAppClick:function(){\n\t\t\t\tuni.exit({\n\t\t\t\t\tsuccess:function(res){\n\t\t\t\t\t\tconsole.log(res)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n</script>\n\n<style>\n\n</style>\n```"},"env":{"name":"## env","description":"","param":"### env 的属性值 @env-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| USER_DATA_PATH | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.99\",\"4.11\"]]}' /> | 应用专属å˜å‚¨ç©ºé—´çš„外置å˜å‚¨ç©ºé—´æ ¹ç›®å½•ä¸‹çš„files目录 |\n| CACHE_PATH | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.99\",\"4.11\"]]}' /> | 应用专属å˜å‚¨ç©ºé—´çš„外置å˜å‚¨ç©ºé—´æ ¹ç›®å½•ä¸‹çš„cache目录 |\n| SANDBOX_PATH | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.99\",\"4.11\"]]}' /> | 应用专属å˜å‚¨ç©ºé—´çš„外置å˜å‚¨ç©ºé—´æ ¹ç›®å½•ï¼ˆcaches/files) |\n","compatibility":"","returnValue":"","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.env)\n","example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/env/env.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\n <!-- #ifdef APP -->\n <text>æ“作日志</text><button size=\"mini\" @click=\"log=''\">清空日志</button>\n <text style=\"margin: 2px; padding: 2px; border: 1px solid #000000;\">{{ log }}</text>\n <scroll-view style=\"flex: 1;\">\n <!-- #endif -->\n <!-- #ifdef APP -->\n <button class=\"btnstyle\" type=\"primary\" @tap=\"geAbsPath(sandboxPath)\" id=\"btn-path\">应用外置沙盒目录uni.env.SANDBOX_PATH</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"geAbsPath(cachePath)\" id=\"btn-path\">缓å˜æ–‡ä»¶ç›®å½•uni.env.CACHE_PATH</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"geAbsPath(userPath)\" id=\"btn-path\">用户文件目录uni.env.USER_DATA_PATH</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"geAbsPath(internalSandboxPath)\"\n id=\"btn-path\">应用内置沙盒目录uni.env.ANDROID_INTERNAL_SANDBOX_PATH</button>\n <!-- #endif -->\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n<script>\n export default {\n\n data() {\n return {\n log: \"\",\n userPath: uni.env.USER_DATA_PATH,\n sandboxPath: uni.env.SANDBOX_PATH,\n cachePath: uni.env.CACHE_PATH,\n internalSandboxPath: uni.env.ANDROID_INTERNAL_SANDBOX_PATH,\n }\n },\n onLoad() {\n },\n\n methods: {\n geAbsPath(path ?: Any) {\n // #ifdef APP-ANDROID\n this.log += UTSAndroid.convert2AbsFullPath(path as String) + '\\n'\n // #endif\n\n }\n }\n }\n</script>\n\n<style>\n .btnstyle {\n margin: 4px;\n }\n</style>\n\n```"},"getPerformance":{"name":"## uni.getPerformance() @getperformance","description":"返回一个Performance对象实例<br/>","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [Performance](#performance-values) |\n\n#### Performance 的方法 @performance-values \n\n#### createObserver(callback) @createobserver\n创建全局性能事件监å¬å™¨\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (entries: [PerformanceObserverEntryList](#performanceobserverentrylist-values)) => void | 是 | - | - | - | \n\n##### PerformanceObserverEntryList 的方法 @performanceobserverentrylist-values \n\n##### getEntries() @getentries\n该方法返回当å‰åˆ—表ä¸çš„所有性能数æ®\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| Array\\<**PerformanceEntry**\\> |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| entryType | string | 是 | - | - | æŒ‡æ ‡ç±»åž‹ |\n@| name | string | 是 | - | - | æŒ‡æ ‡å称 |\n@| duration | number | 是 | - | - | 耗时 msã€‚ä»…å¯¹äºŽè¡¨ç¤ºé˜¶æ®µçš„æŒ‡æ ‡æœ‰æ•ˆã€‚ |\n@| startTime | number | 是 | - | - | 开始时间,ä¸åŒæŒ‡æ ‡çš„具体å«ä¹‰ä¼šæœ‰å·®å¼‚。 |\n@| path | string \\| null | å¦ | - | - | 页é¢è·¯å¾„。仅 render å’Œ navigation ç±»åž‹æŒ‡æ ‡æœ‰æ•ˆã€‚ |\n@| referrerPath | string \\| null | å¦ | - | - | 页é¢è·³è½¬æ¥æºé¡µé¢è·¯å¾„。仅 route æŒ‡æ ‡æœ‰æ•ˆã€‚ |\n@| pageId | number \\| null | å¦ | - | - | path 对应页é¢å®žä¾‹ Id(éšæœºç”Ÿæˆï¼Œä¸ä¿è¯é€’增)。仅 render/navigation æŒ‡æ ‡æœ‰æ•ˆã€‚ |\n@| referrerPageId | number \\| null | å¦ | - | - | referrerPath对应页é¢å®žä¾‹ Id(éšæœºç”Ÿæˆï¼Œä¸ä¿è¯é€’增)。仅 route æŒ‡æ ‡æœ‰æ•ˆã€‚ |\n@| navigationStart | number \\| null | å¦ | - | - | 路由真æ£å“应开始时间。仅 navigation ç±»åž‹æŒ‡æ ‡æœ‰æ•ˆã€‚ |\n@| navigationType | string \\| null | å¦ | - | - | 路由详细类型,与路由方法对应。仅 navigation ç±»åž‹æŒ‡æ ‡æœ‰æ•ˆã€‚ |\n@| initDataRecvTime | number \\| null | å¦ | - | - | 首次渲染å‚数在渲染层收到的时间。仅 firstRender æŒ‡æ ‡æœ‰æ•ˆã€‚ |\n@| viewLayerRenderEndTime | number \\| null | å¦ | - | - | 渲染层执行渲染结æŸæ—¶é—´ã€‚ä»… firstRender æŒ‡æ ‡æœ‰æ•ˆã€‚ | \n\n###### getEntries 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n##### getEntriesByType(entryType) @getentriesbytype\n获å–当å‰åˆ—表ä¸æ‰€æœ‰ç±»åž‹ä¸º \\[entryType]的性能数æ®\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| entryType | string | 是 | - | - | - | \n\n###### 返回值 \n\n| 类型 |\n| :- |\n| Array\\<[PerformanceEntry](#performanceentry-values)\\> |\n \n\n###### getEntriesByType 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n##### getEntriesByName(name, entryType) @getentriesbyname\n获å–当å‰åˆ—表ä¸æ‰€æœ‰å称为 \\[name] 且类型为 [entryType]的性能数æ®\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| name | string | 是 | - | - | - |\n| entryType | string | 是 | - | - | - | \n\n###### 返回值 \n\n| 类型 |\n| :- |\n| Array\\<[PerformanceEntry](#performanceentry-values)\\> |\n \n\n###### getEntriesByName 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| [PerformanceObserver](#performanceobserver-values) |\n\n##### PerformanceObserver 的方法 @performanceobserver-values \n\n##### observe(options) @observe\n开始监å¬\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **PerformanceObserverOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| buffered | boolean | å¦ | - | - | - |\n@| entryTypes | Array\\<string\\> | å¦ | - | - | - |\n@| type | string | å¦ | - | - | - | \n\n\n###### observe 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n##### disconnect() @disconnect\nåœæ¢ç›‘å¬\n\n\n###### disconnect 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n \n\n##### createObserver 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### getEntries() @getentries\n该方法返回当å‰ç¼“冲区ä¸çš„所有性能数æ®\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| Array\\<[PerformanceEntry](#performanceentry-values)\\> |\n \n\n##### getEntries 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### getEntriesByType(entryType) @getentriesbytype\n获å–当å‰ç¼“冲区ä¸æ‰€æœ‰ç±»åž‹ä¸º \\[entryType]的性能数æ®\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| entryType | string | 是 | - | - | - | \n\n##### 返回值 \n\n| 类型 |\n| :- |\n| Array\\<[PerformanceEntry](#performanceentry-values)\\> |\n \n\n##### getEntriesByType 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### getEntriesByName(name, entryType) @getentriesbyname\n获å–当å‰ç¼“冲区ä¸æ‰€æœ‰å称为 \\[name] 且类型为 [entryType]的性能数æ®\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| name | string | 是 | - | - | - |\n| entryType | string | 是 | - | - | - | \n\n##### 返回值 \n\n| 类型 |\n| :- |\n| Array\\<[PerformanceEntry](#performanceentry-values)\\> |\n \n\n##### getEntriesByName 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### setBufferSize(size) @setbuffersize\n设置缓冲区大å°ï¼Œé»˜è®¤ç¼“冲 30 æ¡æ€§èƒ½æ•°æ®\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| size | number | 是 | - | - | - | \n\n\n##### setBufferSize 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n \n","compatibility":"### getPerformance 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.91 | x |\n","tutorial":"\n### å‚è§\n- [getPerformance](https://doc.dcloud.net.cn/uni-app-x/api/getPerformance)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.get-performance)\n"},"navigateTo":{"name":"## uni.navigateTo(options) @navigateto","description":"ä¿ç•™å½“å‰é¡µé¢ï¼Œè·³è½¬åˆ°åº”用内的æŸä¸ªé¡µé¢<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [NavigateToOptions](#navigatetooptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| url | string ([string.PageURIString](/uts/data-type.md#ide-string)) | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 需è¦è·³è½¬çš„åº”ç”¨å†…éž tabBar 的页é¢çš„路径 , 路径åŽå¯ä»¥å¸¦å‚æ•° |\n@| animationType | string \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"x\"]]}' /> | 窗å£æ˜¾ç¤ºçš„动画类型<br/>- auto: 自动选择动画效果<br/>- none: æ— åŠ¨ç”»æ•ˆæžœ<br/>- slide-in-right: 从å³ä¾§æ¨ªå‘滑动效果<br/>- slide-in-left: 左侧横å‘滑动效果<br/>- slide-in-top: 从上侧竖å‘滑动效果<br/>- slide-in-bottom: 从下侧竖å‘滑动效果<br/>- fade-in: 从é€æ˜Žåˆ°ä¸é€æ˜Žé€æ¸æ˜¾ç¤ºæ•ˆæžœ<br/>- zoom-out: 从å°åˆ°å¤§é€æ¸æ”¾å¤§æ˜¾ç¤ºæ•ˆæžœ<br/>- zoom-fade-out: 从å°åˆ°å¤§é€æ¸æ”¾å¤§å¹¶ä¸”从é€æ˜Žåˆ°ä¸é€æ˜Žé€æ¸æ˜¾ç¤ºæ•ˆæžœ<br/>- pop-in: 从å³ä¾§å¹³ç§»å…¥æ ˆåŠ¨ç”»æ•ˆæžœ<br/>- UnionType => 'auto' \\| 'none' \\| 'slide-in-right' \\| 'slide-in-left' \\| 'slide-in-top' \\| 'slide-in-bottom' \\| 'fade-in' \\| 'zoom-out' \\| 'zoom-fade-out' \\| 'pop-in' |\n@| events | any \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"x\",\"x\"]]}' /> | 页é¢é—´é€šä¿¡æŽ¥å£ï¼Œç”¨äºŽç›‘å¬è¢«æ‰“开页é¢å‘é€åˆ°å½“å‰é¡µé¢çš„æ•°æ® |\n@| success | (result: AsyncApiSuccessResult) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [NavigateToFail](#navigatetofail-values)) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### NavigateToFail 的属性值 @navigatetofail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | 路由错误ç <br/>- 4: 框架内部异常 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### navigateTo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | √ | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/router?id=navigateto)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.navigator.navigateTo)\n"},"reLaunch":{"name":"## uni.reLaunch(options) @relaunch","description":"å…³é—所有页é¢ï¼Œæ‰“开到应用内的æŸä¸ªé¡µé¢<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ReLaunchOptions](#relaunchoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| url | string ([string.PageURIString](/uts/data-type.md#ide-string)) | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 需è¦è·³è½¬çš„应用内页é¢è·¯å¾„ , 路径åŽå¯ä»¥å¸¦å‚数。å‚数与路径之间使用?分隔,å‚数键与å‚数值用=相连,ä¸åŒå‚数用&分隔;如 'path?key=value&key2=value2',如果跳转的页é¢è·¯å¾„是 tabBar 页é¢åˆ™ä¸èƒ½å¸¦å‚æ•° |\n@| success | (result: AsyncApiSuccessResult) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [ReLaunchFail](#relaunchfail-values)) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### ReLaunchFail 的属性值 @relaunchfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### reLaunch 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | √ | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/router?id=relaunch)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.navigator.reLaunch)\n"},"navigateBack":{"name":"## uni.navigateBack(options?) @navigateback","description":"å…³é—当å‰é¡µé¢ï¼Œè¿”回上一页é¢æˆ–多级页é¢<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [NavigateBackOptions](#navigatebackoptions-values) \\| null | å¦ | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| delta | number \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 返回的页é¢æ•°ï¼Œå¦‚æžœ delta 大于现有页é¢æ•°ï¼Œåˆ™è¿”回到首页 |\n@| animationType | string \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"x\"]]}' /> | 窗å£å…³é—的动画类型<br/>- auto: 自动选择动画效果<br/>- none: æ— åŠ¨ç”»æ•ˆæžœ<br/>- slide-out-right: 横å‘å‘å³ä¾§æ»‘出å±å¹•åŠ¨ç”»<br/>- slide-out-left: 横å‘å‘左侧滑出å±å¹•åŠ¨ç”»<br/>- slide-out-top: ç«–å‘å‘上侧滑出å±å¹•åŠ¨ç”»<br/>- slide-out-bottom: ç«–å‘å‘下侧滑出å±å¹•åŠ¨ç”»<br/>- fade-out: 从ä¸é€æ˜Žåˆ°é€æ˜Žé€æ¸éšè—动画<br/>- zoom-in: 从大é€æ¸ç¼©å°å…³é—动画<br/>- zoom-fade-in: 从大é€æ¸ç¼©å°å¹¶ä¸”从ä¸é€æ˜Žåˆ°é€æ˜Žé€æ¸éšè—å…³é—动画<br/>- pop-out: 从å³ä¾§å¹³ç§»å‡ºæ ˆåŠ¨ç”»æ•ˆæžœ<br/>- UnionType => 'auto' \\| 'none' \\| 'slide-out-right' \\| 'slide-out-left' \\| 'slide-out-top' \\| 'slide-out-bottom' \\| 'fade-out' \\| 'zoom-in' \\| 'zoom-fade-in' \\| 'pop-out' |\n@| success | (result: AsyncApiSuccessResult) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"x\"]]}' /> | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [NavigateBackFail](#navigatebackfail-values)) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### NavigateBackFail 的属性值 @navigatebackfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### navigateBack 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | √ | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/router?id=navigateback)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.navigator.navigateBack)\n"},"redirectTo":{"name":"## uni.redirectTo(options) @redirectto","description":"å…³é—当å‰é¡µé¢ï¼Œè·³è½¬åˆ°åº”用内的æŸä¸ªé¡µé¢<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [RedirectToOptions](#redirecttooptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| url | string ([string.PageURIString](/uts/data-type.md#ide-string)) | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 需è¦è·³è½¬çš„åº”ç”¨å†…éž tabBar 的页é¢çš„路径 , 路径åŽå¯ä»¥å¸¦å‚æ•° |\n@| success | (result: AsyncApiSuccessResult) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [RedirectToFail](#redirecttofail-values)) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### RedirectToFail 的属性值 @redirecttofail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### redirectTo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | √ | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/router?id=redirectto)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.navigator.redirectTo)\n"},"switchTab":{"name":"## uni.switchTab(options) @switchtab","description":"跳转到 tabBar 页é¢ï¼Œå¹¶å…³é—å…¶ä»–æ‰€æœ‰éž tabBar 页é¢<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [SwitchTabOptions](#switchtaboptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| url | string ([string.PageURIString](/uts/data-type.md#ide-string)) | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 需è¦è·³è½¬çš„ tabBar 页é¢çš„路径,路径åŽä¸èƒ½å¸¦å‚æ•° |\n@| success | (result: AsyncApiSuccessResult) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [SwitchTabFail](#switchtabfail-values)) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SwitchTabFail 的属性值 @switchtabfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### switchTab 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | √ | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/router?id=switchtab)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.navigator.switchTab)\n"},"navigator":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/navigator/navigator.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/navigator/navigator\n>Template\n```vue\n<template>\r\n <!-- #ifdef APP -->\r\n <scroll-view style=\"flex: 1\">\r\n <!-- #endif -->\r\n <view>\r\n <page-head title=\"navigate\"></page-head>\r\n <view class=\"uni-padding-wrap uni-common-mt uni-common-mb\">\r\n <view class=\"direction-row\">\r\n <text class=\"label\">onLoad触å‘时间戳:</text>\r\n <text>{{ onLoadTime }}</text>\r\n </view>\r\n <view class=\"direction-row\">\r\n <text class=\"label\">onShow触å‘时间戳:</text>\r\n <text>{{ onShowTime }}</text>\r\n </view>\r\n <view class=\"direction-row\">\r\n <text class=\"label\">onReady触å‘时间戳:</text>\r\n <text>{{ onReadyTime }}</text>\r\n </view>\r\n <view class=\"direction-row\">\r\n <text class=\"label\">onHide触å‘时间戳:</text>\r\n <text>{{ onHideTime }}</text>\r\n </view>\r\n <view class=\"direction-row\">\r\n <text class=\"label\">onBackPress触å‘时间戳:</text>\r\n <text>è§æŽ§åˆ¶å°</text>\r\n </view>\r\n <view class=\"direction-row\">\r\n <text class=\"label\">onUnload触å‘时间戳:</text>\r\n <text>è§æŽ§åˆ¶å°</text>\r\n </view>\r\n <view class=\"uni-btn-v\">\r\n <button @tap=\"navigateTo\" class=\"uni-btn\">\r\n 跳转新页é¢ï¼Œå¹¶ä¼ 递数æ®\r\n </button>\r\n <button @tap=\"navigateBack\" class=\"uni-btn\">返回上一页</button>\r\n <button @tap=\"redirectTo\" class=\"uni-btn\">在当å‰é¡µé¢æ‰“å¼€</button>\r\n <button @tap=\"switchTab\" class=\"uni-btn\">切æ¢åˆ°æ¨¡æ¿é€‰é¡¹å¡</button>\r\n <button @tap=\"reLaunch\" class=\"uni-btn\">\r\n å…³é—所有页é¢ï¼Œæ‰“开首页\r\n </button>\r\n <button @tap=\"navigateToErrorPage\" class=\"uni-btn\">\r\n 打开ä¸å˜åœ¨çš„页é¢\r\n </button>\r\n </view>\r\n </view>\r\n </view>\r\n <!-- #ifdef APP -->\r\n </scroll-view>\r\n <!-- #endif -->\r\n</template>\r\n\r\n\r\n\r\n<style>\r\n .direction-row {\r\n flex-direction: row;\r\n }\r\n\r\n .label {\r\n width: 190px;\r\n }\r\n</style>\n\n```\n>Script\n```uts\n\r\n import { state, setLifeCycleNum } from '@/store/index.uts'\r\n\r\n export default {\r\n data() {\r\n return {\r\n onLoadTime: 0,\r\n onShowTime: 0,\r\n onReadyTime: 0,\r\n onHideTime: 0,\r\n }\r\n },\r\n onLoad() {\r\n this.onLoadTime = Date.now()\r\n console.log('onLoad', this.onLoadTime)\r\n },\r\n onShow() {\r\n this.onShowTime = Date.now()\r\n console.log('onShow', this.onShowTime)\r\n },\r\n onReady() {\r\n this.onReadyTime = Date.now()\r\n console.log('onReady', this.onReadyTime)\r\n },\r\n onHide() {\r\n this.onHideTime = Date.now()\r\n console.log('onHide', this.onHideTime)\r\n },\r\n onBackPress(options : OnBackPressOptions) : boolean | null {\r\n console.log('onBackPress', Date.now())\r\n console.log('onBackPress from', options.from)\r\n return null\r\n },\r\n onUnload() {\r\n console.log('onUnload', Date.now())\r\n },\r\n methods: {\r\n reLaunch() {\r\n uni.reLaunch({\r\n url: '/pages/tabBar/component',\r\n success(result) {\r\n console.log('reLaunch success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('reLaunch fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('reLaunch complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n navigateTo() {\r\n uni.navigateTo({\r\n url: '/pages/API/navigator/new-page/new-page-1?data=Hello',\r\n success(result) {\r\n console.log('navigateTo success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('navigateTo fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('navigateTo complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n navigateToErrorPage() {\r\n uni.navigateTo({\r\n url: '/pages/error-page/error-page',\r\n success(result) {\r\n console.log('navigateTo success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n fail(error) {\r\n console.log('navigateTo fail', error.errMsg)\r\n uni.showToast({\r\n title: error.errMsg,\r\n icon: 'none',\r\n })\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n complete(result) {\r\n console.log('navigateTo complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n navigateToDebounce() {\r\n uni.navigateTo({\r\n url: '/pages/API/navigator/new-page/new-page-1?data=debounce',\r\n success(result) {\r\n console.log('navigateTo success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('navigateTo fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('navigateTo complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n uni.navigateTo({\r\n url: '/pages/API/navigator/new-page/new-page-1?data=debounce',\r\n success(result) {\r\n console.log('navigateTo success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n fail(error) {\r\n console.log('navigateTo fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n complete(result) {\r\n console.log('navigateTo complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n // 自动化测试\r\n navigateToRelativePath1() {\r\n uni.navigateTo({\r\n url: 'new-page/new-page-1?data=new-page/new-page-1',\r\n success() {\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail() {\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete() {\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n // 自动化测试\r\n navigateToRelativePath2() {\r\n uni.navigateTo({\r\n url: './new-page/new-page-1?data=./new-page/new-page-1',\r\n success() {\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail() {\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete() {\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n // 自动化测试\r\n navigateToRelativePath3() {\r\n uni.navigateTo({\r\n url: '../navigator/new-page/new-page-1?data=../navigator/new-page/new-page-1',\r\n success() {\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail() {\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete() {\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n navigateBack() {\r\n uni.navigateBack({\r\n success(result) {\r\n console.log('navigateBack success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('navigateBack fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('navigateBack complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n navigateBackWithDelta1() {\r\n uni.navigateTo({\r\n url: '/pages/API/navigator/new-page/new-page-1',\r\n success() {\r\n uni.navigateBack({\r\n delta: 1,\r\n success(result) {\r\n console.log('navigateBack success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('navigateBack fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('navigateBack complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n })\r\n },\r\n navigateBackWithDelta100() {\r\n uni.navigateTo({\r\n url: '/pages/API/navigator/new-page/new-page-1',\r\n success() {\r\n uni.navigateBack({\r\n delta: 100,\r\n success(result) {\r\n console.log('navigateBack success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('navigateBack fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('navigateBack complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n })\r\n },\r\n redirectTo() {\r\n uni.redirectTo({\r\n url: '/pages/API/navigator/new-page/new-page-1?data=Hello',\r\n success(result) {\r\n console.log('redirectTo success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('redirectTo fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('redirectTo complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n switchTab() {\r\n uni.switchTab({\r\n url: '/pages/tabBar/template',\r\n success(result) {\r\n console.log('switchTab success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('switchTab fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('switchTab complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n // 自动化测试\r\n getLifeCycleNum() : number {\r\n return state.lifeCycleNum\r\n },\r\n // 自动化测试\r\n setLifeCycleNum(num : number) {\r\n setLifeCycleNum(num)\r\n },\r\n },\r\n }\r\n\n```\n:::"},"setNavigationBarColor":{"name":"## uni.setNavigationBarColor(options) @setnavigationbarcolor","description":"设置导航æ¡ã€çŠ¶æ€æ 颜色<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [SetNavigationBarColorOptions](#setnavigationbarcoloroptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| frontColor | \"#ffffff\" \\| \"#000000\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | å‰æ™¯é¢œè‰²å€¼ï¼ŒåŒ…括按钮ã€æ ‡é¢˜ã€çŠ¶æ€æ çš„é¢œè‰²ï¼Œä»…æ”¯æŒ #ffffff å’Œ #000000 |\n@| backgroundColor | [string.ColorString](/uts/data-type.md#ide-string) | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 背景颜色值,有效值为åå…进制颜色 |\n@| success | (result: AsyncApiSuccessResult) => void | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (error: [SetNavigationBarColorFail](#setnavigationbarcolorfail-values)) => void | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: [AsyncApiResult](#asyncapiresult-values)) => void | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.11\"]]}' /> | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SetNavigationBarColorFail 的属性值 @setnavigationbarcolorfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### setNavigationBarColor 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | √ | 4.11 |\n","tutorial":"\n### å‚è§\n- [setNavigationBarColor](https://doc.dcloud.net.cn/uni-app-x/api/set-navigation-bar-color.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-navigation-bar-color)\n"},"set-navigation-bar-color":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/set-navigation-bar-color/set-navigation-bar-color.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/set-navigation-bar-color/set-navigation-bar-color\n>Template\n```vue\n<template>\r\n <page-head title=\"setNavigationBarColor\"></page-head>\r\n <view class=\"uni-padding-wrap uni-common-mt\">\r\n <button @tap=\"setNavigationBarColor1\" class=\"uni-btn\">\r\n 设置导航æ¡èƒŒæ™¯ç»¿è‰²ï¼Œæ ‡é¢˜ç™½è‰²\r\n </button>\r\n <button @tap=\"setNavigationBarColor2\" class=\"uni-btn\">\r\n 设置导航æ¡èƒŒæ™¯çº¢è‰²ï¼Œæ ‡é¢˜é»‘色\r\n </button>\r\n <button @tap=\"goNavbarLite\" class=\"uni-btn\">\r\n 跳转自定义导航æ 页é¢\r\n </button>\r\n </view>\r\n</template>\r\n\r\n\n\n```\n>Script\n```uts\n\r\n import { state, setLifeCycleNum } from '@/store/index.uts'\r\n\r\n export default {\r\n methods: {\r\n setNavigationBarColor1() {\r\n uni.setNavigationBarColor({\r\n frontColor: '#ffffff',\r\n backgroundColor: '#00ff00',\r\n success: () => {\r\n console.log('setNavigationBarColor success')\r\n this.setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail: () => {\r\n console.log('setNavigationBarColor fail')\r\n this.setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete: () => {\r\n console.log('setNavigationBarColor complete')\r\n this.setLifeCycleNum(state.lifeCycleNum + 1)\r\n }\r\n })\r\n },\r\n setNavigationBarColor2() {\r\n uni.setNavigationBarColor({\r\n frontColor: '#000000',\r\n backgroundColor: '#ff0000',\r\n success: () => {\r\n console.log('setNavigationBarColor success')\r\n this.setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail: () => {\r\n console.log('setNavigationBarColor fail')\r\n this.setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete: () => {\r\n console.log('setNavigationBarColor complete')\r\n this.setLifeCycleNum(state.lifeCycleNum + 1)\r\n }\r\n })\r\n },\r\n // 自动化测试\r\n getLifeCycleNum() : number {\r\n return state.lifeCycleNum\r\n },\r\n // 自动化测试\r\n setLifeCycleNum(num : number) {\r\n setLifeCycleNum(num)\r\n },\r\n goNavbarLite() {\r\n uni.navigateTo({\r\n url: '/pages/template/navbar-lite/navbar-lite'\r\n })\r\n }\r\n },\r\n }\r\n\n```\n:::"},"setNavigationBarTitle":{"name":"## uni.setNavigationBarTitle(options) @setnavigationbartitle","description":"动æ€è®¾ç½®å½“å‰é¡µé¢çš„æ ‡é¢˜<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [SetNavigationBarTitleOptions](#setnavigationbartitleoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| title | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.97\",\"4.11\"]]}' /> | 页é¢æ ‡é¢˜ |\n@| success | (result: AsyncApiSuccessResult) => void | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.97\",\"4.11\"]]}' /> | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (error: [SetNavigationBarTitleFail](#setnavigationbartitlefail-values)) => void | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.97\",\"4.11\"]]}' /> | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: [AsyncApiResult](#asyncapiresult-values)) => void | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.97\",\"4.11\"]]}' /> | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SetNavigationBarTitleFail 的属性值 @setnavigationbartitlefail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### setNavigationBarTitle 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.97 | 4.11 |\n","tutorial":"\n### å‚è§\n- [setNavigationBarTitle](https://doc.dcloud.net.cn/uni-app-x/api/set-navigation-bar-title.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-navigation-bar-title)\n"},"set-navigation-bar-title":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/set-navigation-bar-title/set-navigation-bar-title.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/set-navigation-bar-title/set-navigation-bar-title\n>Template\n```vue\n<template>\n <page-head title=\"setNavigationBarTitle\"></page-head>\n <view class=\"uni-padding-wrap uni-common-mt\">\n <button @tap=\"setNavigationBarNewTitle\" class=\"uni-btn\">\n 设置当å‰é¡µé¢æ ‡é¢˜ä¸º: {{ newTitle }}\n </button>\n <button @tap=\"setNavigationBarLongTitle\" class=\"uni-btn\">\n è®¾ç½®è¶…é•¿æ ‡é¢˜\n </button>\n </view>\n</template>\n\n\n\n```\n>Script\n```uts\n\n import { state, setLifeCycleNum } from '@/store/index.uts'\n\n export default {\n data() {\n return {\n newTitle: 'new title',\n longTitle: 'long title long title long title long title long title long title long title long title long title long title'\n }\n },\n methods: {\n setNavigationBarNewTitle() {\n uni.setNavigationBarTitle({\n title: this.newTitle,\n success: () => {\n console.log('setNavigationBarTitle success')\n this.setLifeCycleNum(state.lifeCycleNum + 1)\n },\n fail: () => {\n console.log('setNavigationBarTitle fail')\n this.setLifeCycleNum(state.lifeCycleNum - 1)\n },\n complete: () => {\n console.log('setNavigationBarTitle complete')\n this.setLifeCycleNum(state.lifeCycleNum + 1)\n }\n })\n },\n setNavigationBarLongTitle() {\n uni.setNavigationBarTitle({\n title: this.longTitle,\n success() {\n console.log('setNavigationBarTitle success')\n },\n fail() {\n console.log('setNavigationBarTitle fail')\n },\n complete() {\n console.log('setNavigationBarTitle complete')\n }\n })\n },\n // 自动化测试\n getLifeCycleNum() : number {\n return state.lifeCycleNum\n },\n // 自动化测试\n setLifeCycleNum(num : number) {\n setLifeCycleNum(num)\n }\n },\n }\n\n```\n:::"},"showTabBar":{"name":"## uni.showTabBar(options?) @showtabbar","description":"显示 tabBar<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ShowTabBarOptions](#showtabbaroptions-values) \\| null | å¦ | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| animation | boolean | å¦ | - | - | 是å¦éœ€è¦åŠ¨ç”»æ•ˆæžœ |\n@| success | (result: AsyncApiSuccessResult) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [SetTabBarFail](#settabbarfail-values)) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SetTabBarFail 的属性值 @settabbarfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 100 \\| 200 | 是 | - | - | 错误ç <br/>- 100: TabBar ä¸å˜åœ¨<br/>- 200: å‚数错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### showTabBar 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [showTabBar](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#showtabbar)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.showTabBar)\n"},"hideTabBar":{"name":"## uni.hideTabBar(options?) @hidetabbar","description":"éšè— tabBar<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [HideTabBarOptions](#hidetabbaroptions-values) \\| null | å¦ | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| animation | boolean | å¦ | - | - | 是å¦éœ€è¦åŠ¨ç”»æ•ˆæžœ |\n@| success | (result: AsyncApiSuccessResult) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [SetTabBarFail](#settabbarfail-values)) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SetTabBarFail 的属性值 @settabbarfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 100 \\| 200 | 是 | - | - | 错误ç <br/>- 100: TabBar ä¸å˜åœ¨<br/>- 200: å‚数错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### hideTabBar 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [hideTabBar](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#hidetabbar)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.hideTabBar)\n"},"showTabBarRedDot":{"name":"## uni.showTabBarRedDot(options) @showtabbarreddot","description":"显示 tabBar æŸä¸€é¡¹çš„å³ä¸Šè§’的红点<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ShowTabBarRedDotOptions](#showtabbarreddotoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| index | number | 是 | - | - | tabBar的哪一项,从左边算起,索引从0开始 |\n@| success | (result: AsyncApiSuccessResult) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [SetTabBarFail](#settabbarfail-values)) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SetTabBarFail 的属性值 @settabbarfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 100 \\| 200 | 是 | - | - | 错误ç <br/>- 100: TabBar ä¸å˜åœ¨<br/>- 200: å‚数错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### showTabBarRedDot 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [showTabBarRedDot](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#showtabbarreddot)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.showTabBarRedDot)\n"},"hideTabBarRedDot":{"name":"## uni.hideTabBarRedDot(options) @hidetabbarreddot","description":"éšè— tabBar æŸä¸€é¡¹çš„å³ä¸Šè§’的红点<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [HideTabBarRedDotOptions](#hidetabbarreddotoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| index | number | 是 | - | - | tabBar的哪一项,从左边算起,索引从0开始 |\n@| success | (result: AsyncApiSuccessResult) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [SetTabBarFail](#settabbarfail-values)) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SetTabBarFail 的属性值 @settabbarfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 100 \\| 200 | 是 | - | - | 错误ç <br/>- 100: TabBar ä¸å˜åœ¨<br/>- 200: å‚数错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### hideTabBarRedDot 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [hideTabBarRedDot](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#hidetabbarreddot)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.hideTabBarRedDot)\n"},"setTabBarBadge":{"name":"## uni.setTabBarBadge(options) @settabbarbadge","description":"为 tabBar æŸä¸€é¡¹çš„å³ä¸Šè§’æ·»åŠ æ–‡æœ¬<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [SetTabBarBadgeOptions](#settabbarbadgeoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| index | number | 是 | - | - | tabBar的哪一项,从左边算起,索引从0开始 |\n@| text | string | 是 | - | - | 显示的文本,ä¸è¶…过 3 个åŠè§’å—符 |\n@| success | (result: AsyncApiSuccessResult) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [SetTabBarFail](#settabbarfail-values)) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SetTabBarFail 的属性值 @settabbarfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 100 \\| 200 | 是 | - | - | 错误ç <br/>- 100: TabBar ä¸å˜åœ¨<br/>- 200: å‚数错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### setTabBarBadge 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [setTabBarBadge](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#settabbarbadge)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.setTabBarBadge)\n"},"removeTabBarBadge":{"name":"## uni.removeTabBarBadge(options) @removetabbarbadge","description":"移除 tabBar æŸä¸€é¡¹å³ä¸Šè§’的文本<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [RemoveTabBarBadgeOptions](#removetabbarbadgeoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| index | number | 是 | - | - | tabBar的哪一项,从左边算起,索引从0开始 |\n@| success | (result: AsyncApiSuccessResult) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [SetTabBarFail](#settabbarfail-values)) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SetTabBarFail 的属性值 @settabbarfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 100 \\| 200 | 是 | - | - | 错误ç <br/>- 100: TabBar ä¸å˜åœ¨<br/>- 200: å‚数错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### removeTabBarBadge 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [removeTabBarBadge](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#removetabbarbadge)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.removeTabBarBadge)\n"},"setTabBarStyle":{"name":"## uni.setTabBarStyle(options) @settabbarstyle","description":"动æ€è®¾ç½® tabBar çš„æ•´ä½“æ ·å¼<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [SetTabBarStyleOptions](#settabbarstyleoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| color | string ([string.ColorString](/uts/data-type.md#ide-string)) | å¦ | - | - | tab 上的文å—默认颜色 |\n@| selectedColor | string ([string.ColorString](/uts/data-type.md#ide-string)) | å¦ | - | - | tab 上的文å—选ä¸æ—¶çš„颜色 |\n@| backgroundColor | string ([string.ColorString](/uts/data-type.md#ide-string)) | å¦ | - | - | tab 的背景色 |\n@| backgroundImage | string | å¦ | - | - | 图片背景 |\n@| backgroundRepeat | \"repeat\" \\| \"repeat-x\" \\| \"repeat-y\" \\| \"no-repeat\" | å¦ | - | - | 背景图平铺方å¼<br/>- repeat: 背景图片在垂直方å‘和水平方å‘平铺<br/>- repeat-x: 背景图片在水平方å‘平铺,垂直方å‘拉伸<br/>- repeat-y: 背景图片在垂直方å‘平铺,水平方å‘拉伸<br/>- no-repeat: 背景图片在垂直方å‘和水平方å‘都拉伸 |\n@| borderStyle | string | å¦ | - | - | tabbar上边框的颜色 |\n@| success | (result: AsyncApiSuccessResult) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [SetTabBarFail](#settabbarfail-values)) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SetTabBarFail 的属性值 @settabbarfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 100 \\| 200 | 是 | - | - | 错误ç <br/>- 100: TabBar ä¸å˜åœ¨<br/>- 200: å‚数错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### setTabBarStyle 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [setTabBarStyle](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#settabbarstyle)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.setTabBarStyle)\n"},"setTabBarItem":{"name":"## uni.setTabBarItem(options) @settabbaritem","description":"动æ€è®¾ç½® tabBar æŸä¸€é¡¹çš„内容<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [SetTabBarItemOptions](#settabbaritemoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| index | number | 是 | - | - | tabBar 的哪一项,从左边算起,索引从0开始 |\n@| text | string | å¦ | - | - | tab ä¸ŠæŒ‰é’®æ–‡å— |\n@| iconPath | string | å¦ | - | - | 图片路径 |\n@| selectedIconPath | string | å¦ | - | - | 选ä¸æ—¶çš„图片路径 |\n@| pagePath | string | å¦ | - | - | 页é¢ç»å¯¹è·¯å¾„ |\n@| iconfont | **SetTabBarItemIconFontOptions** | å¦ | - | - | å—ä½“å›¾æ ‡ï¼Œä¼˜å…ˆçº§é«˜äºŽ iconPath |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| text | string | 是 | - | - | å—库 Unicode ç |\n@@| selectedText | string | 是 | - | - | 选ä¸åŽå—库 Unicode ç |\n@@| fontSize | string | å¦ | - | - | å—ä½“å›¾æ ‡å—å·(px) |\n@@| color | string | å¦ | - | - | å—ä½“å›¾æ ‡é¢œè‰² |\n@@| selectedColor | string | å¦ | - | - | å—ä½“å›¾æ ‡é€‰ä¸é¢œè‰² |\n@| visible | boolean | å¦ | - | - | tab 是å¦æ˜¾ç¤º |\n@| success | (result: AsyncApiSuccessResult) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [SetTabBarFail](#settabbarfail-values)) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SetTabBarFail 的属性值 @settabbarfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 100 \\| 200 | 是 | - | - | 错误ç <br/>- 100: TabBar ä¸å˜åœ¨<br/>- 200: å‚数错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### setTabBarItem 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [setTabBarItem](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#settabbaritem)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.setTabBarItem)\n"},"startPullDownRefresh":{"name":"## uni.startPullDownRefresh(options?) @startpulldownrefresh","description":"开始下拉刷新<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [StartPullDownRefreshOptions](#startpulldownrefreshoptions-values) \\| null | å¦ | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (result: AsyncApiSuccessResult) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [StartPullDownRefreshFail](#startpulldownrefreshfail-values)) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### StartPullDownRefreshFail 的属性值 @startpulldownrefreshfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### startPullDownRefresh 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.io/uni-app-x/api/pull-down-refresh.html#startpulldownrefresh)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.pull-down-refresh.startPullDownRefresh)\n"},"stopPullDownRefresh":{"name":"## uni.stopPullDownRefresh() @stoppulldownrefresh","description":"åœæ¢å½“å‰é¡µé¢ä¸‹æ‹‰åˆ·æ–°<br/>","param":"","returnValue":"","compatibility":"### stopPullDownRefresh 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [stopPullDownRefresh](https://doc.dcloud.net.cn/uni-app-x/api/pull-down-refresh.html#stoppulldownrefresh)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.pull-down-refresh.stopPullDownRefresh)\n"},"pull-down-refresh":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/pull-down-refresh/pull-down-refresh.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/pull-down-refresh/pull-down-refresh\n>Template\n```vue\n<template>\n\t<scroll-view style=\"flex: 1;\">\n\t\t<!-- 实际开å‘ä¸ï¼Œé•¿åˆ—表应该使用list-view -->\n\t\t<view class=\"uni-padding-wrap uni-common-mt\">\n\t\t\t<text class=\"text\" v-for=\"(num,index) in data\" :key=\"index\">list - {{num}}</text>\n\t\t\t<view v-if=\"showLoadMore\">{{loadMoreText}}</view>\n\t\t</view>\n\t</scroll-view>\n</template>\n\n\n<style>\n\t.text {\n\t\tmargin: 6px 0;\n\t\twidth:100%;\n\t\tbackground-color: #fff;\n\t\theight: 52px;\n\t\tline-height: 52px;\n\t\ttext-align: center;\n\t\tcolor: #555;\n\t\tborder-radius: 4px;\n\t}\n</style>\n\n```\n>Script\n```uts\n\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\tdata: [] as Array<number>,\n\t\t\t\tloadMoreText: \"åŠ è½½ä¸...\",\n\t\t\t\tshowLoadMore: false,\n\t\t\t\tmax: 0\n\t\t\t}\n\t\t},\n\t\tonReady() {\n uni.startPullDownRefresh();\n\t\t\tthis.initData();\n\t\t},\n\t\tonReachBottom() {\n\t\t\tconsole.log(\"onReachBottom\");\n\t\t\tif (this.max > 40) {\n\t\t\t\tthis.loadMoreText = \"没有更多数æ®äº†!\"\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.showLoadMore = true;\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.setListData();\n\t\t\t}, 300);\n\t\t},\n\t\tonPullDownRefresh() {\n\t\t\tconsole.log('onPullDownRefresh');\n\t\t\tthis.initData();\n\t\t},\n\t\tmethods: {\n\t\t\tinitData(){\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthis.max = 0;\n\t\t\t\t\tthis.data = [];\n\t\t\t\t\tlet data:Array<number> = [];\n\t\t\t\t\tthis.max += 20;\n\t\t\t\t\tfor (let i:number = this.max - 19; i < this.max + 1; i++) {\n\t\t\t\t\t\tdata.push(i)\n\t\t\t\t\t}\n\t\t\t\t\tthis.data = this.data.concat(data);\n\t\t\t\t\tuni.stopPullDownRefresh();\n\t\t\t\t}, 1000);\n\t\t\t},\n\t\t\tsetListData() {\n\t\t\t\tlet data:Array<number> = [];\n\t\t\t\tthis.max += 10;\n\t\t\t\tfor (let i:number = this.max - 9; i < this.max + 1; i++) {\n\t\t\t\t\tdata.push(i)\n\t\t\t\t}\n\t\t\t\tthis.data = this.data.concat(data);\n\t\t\t}\n\t\t}\n\t}\n\n```\n:::"},"pageScrollTo":{"name":"## uni.pageScrollTo(options) @pagescrollto","description":"将页é¢æ»šåŠ¨åˆ°ç›®æ ‡ä½ç½®<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [PageScrollToOptions](#pagescrolltooptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| scrollTop | number \\| null | å¦ | - | - | 滚动到页é¢çš„ç›®æ ‡ä½ç½® |\n@| selector | string \\| null | å¦ | - | - | 选择器 |\n@| offsetTop | number \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.91\",\"4.11\"]]}' /> | å移è·ç¦»ï¼Œå¯ä»¥æ»šåŠ¨åˆ° selector åŠ å移è·ç¦»çš„ä½ç½® |\n@| duration | number \\| null | å¦ | - | - | 滚动动画的时长 |\n@| success | (result: AsyncApiSuccessResult) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [PageScrollToFail](#pagescrolltofail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### PageScrollToFail 的属性值 @pagescrolltofail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### pageScrollTo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [pageScrollTo](https://doc.dcloud.net.cn/uni-app-x/api/page-scroll-to.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.page-scroll-to)\n"},"page-scroll-to":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/page-scroll-to/page-scroll-to.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/page-scroll-to/page-scroll-to\n>Template\n```vue\n<template>\n <!-- #ifdef APP -->\n <scroll-view style=\"flex: 1\" scroll-with-animation=\"true\">\n <!-- #endif -->\n <view class=\"uni-padding-wrap\">\n <page-head :title=\"title\"></page-head>\n <button type=\"default\" class=\"btn-scrollTo\" @click=\"scrollTo\">\n scrollTo\n </button>\n <button type=\"default\" class=\"btn-scrollToElement\" @click=\"scrollToElement\">\n scrollToElement\n </button>\n <view class=\"uni-list\" v-for=\"(_, index) in 10\" :key=\"index\">\n <view class=\"uni-list-cell list-item\">{{ index }}</view>\n </view>\n <view class=\"custom-element\">scrollTo-custom-element</view>\n <view class=\"uni-list\" v-for=\"(_, index2) in 10\" :key=\"index2\">\n <view class=\"uni-list-cell list-item\">{{ index2 }}</view>\n </view>\n </view>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n\n\n<style>\n .list-item {\n height: 100px;\n padding-left: 30px;\n }\n</style>\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n title: 'pageScrollTo',\n }\n },\n methods: {\n scrollTo() {\n uni.pageScrollTo({\n scrollTop: 100,\n duration: 300,\n success: () => {\n console.log('success')\n },\n })\n },\n scrollToElement() {\n uni.pageScrollTo({\n selector: '.custom-element',\n duration: 300,\n success: () => {\n console.log('success')\n },\n })\n },\n },\n }\n\n```\n:::"},"onTabBarMidButtonTap":{"name":"## uni.onTabBarMidButtonTap(options) @ontabbarmidbuttontap","description":"监å¬ä¸é—´æŒ‰é’®çš„点击事件<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | () => void | 是 | - | - | - | \n","returnValue":"","compatibility":"### onTabBarMidButtonTap 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | x | x |\n","tutorial":"\n### å‚è§\n- [onTabBarMidButtonTap](https://doc.dcloud.net.cn/uni-app-x/api/on-tab-bar-mid-button-tap.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.on-tab-bar-mid-button-tap)\n"},"getElementById":{"name":"## uni.getElementById(id) @getelementbyid","description":"返回一个匹é…特定 ID çš„å…ƒç´ ï¼Œ 如果ä¸å˜åœ¨ï¼Œè¿”回 null。\\<br/>如果需è¦èŽ·å–指定的节点类型,需è¦ä½¿ç”¨ as 进行类型转æ¢ã€‚\\<br/>ID 区分大å°å†™ï¼Œä¸”应该是唯一的。如果å˜åœ¨å¤šä¸ªåŒ¹é…çš„å…ƒç´ ï¼Œåˆ™è¿”å›žç¬¬ä¸€ä¸ªåŒ¹é…çš„å…ƒç´ ã€‚<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| id | [string.IDString](/uts/data-type.md#ide-string) \\| string | 是 | - | - | - | \n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| [UniElement](/dom/unielement.md) \\| null | å¦ |\n \n","compatibility":"### getElementById 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [getElementById](https://doc.dcloud.net.cn/uni-app-x/api/get-element.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.dom.get-element.getElementById)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-element-by-id/get-element-by-id.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-element-by-id/get-element-by-id\n>Template\n```vue\n<template>\r\n <page-head id=\"page-head\" title=\"getElementById\"></page-head>\r\n <view style=\"margin: 0 15px;\">\r\n <text id=\"text\">this is text</text>\r\n <view id=\"view\" class=\"uni-common-mt\" style=\"border: 1px solid red\">this is view</view>\r\n <button class=\"uni-btn\" @click=\"changePageHeadBackgroundColor\">\r\n 修改 page-head 背景色\r\n </button>\r\n <button class=\"uni-btn\" @click=\"changeTextColor\">\r\n 修改 text å—体颜色\r\n </button>\r\n <button class=\"uni-btn\" @click=\"changeViewStyle\">\r\n 修改 view 宽高åŠèƒŒæ™¯è‰²\r\n </button>\r\n <button class=\"uni-btn\" @click=\"goMultipleRootNode\">\r\n è·³è½¬å¤šæ ¹èŠ‚ç‚¹ç¤ºä¾‹\r\n </button>\r\n </view>\r\n</template>\r\n\r\n\r\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n checked: false,\r\n homePagePath: '/pages/tabBar/component',\r\n launchOptionsPath: '',\r\n }\r\n },\n methods: {\r\n getElementByNotExistId() : Element | null {\r\n return uni.getElementById('not-exist-id')\r\n },\r\n changePageHeadBackgroundColor() {\r\n const pageHead = uni.getElementById('page-head')!\r\n pageHead.style.setProperty('background-color', 'red')\r\n },\r\n changeTextColor() {\r\n const text = uni.getElementById('text')!\r\n text.style.setProperty('color', 'red')\r\n },\r\n changeViewStyle() {\r\n const view = uni.getElementById<UniViewElement>('view')\r\n if (view !== null) {\r\n view.style.setProperty('width', '90%')\r\n view.style.setProperty('height', '50px')\r\n view.style.setProperty('background-color', '#007AFF')\r\n }\r\n },\r\n goMultipleRootNode() {\r\n uni.navigateTo({ url: '/pages/API/get-element-by-id/get-element-by-id-multiple-root-node' })\r\n },\n //自动化测试获å–textå…ƒç´ çš„offsetLeft属性值\n getTextOffsetLeft(): number {\n const text = uni.getElementById('text')!\n return text.offsetLeft\n }\r\n }\r\n }\r\n\n```\n:::"},"createSelectorQuery":{"name":"## uni.createSelectorQuery() @createselectorquery","description":"返回一个SelectorQuery对象实例<br/>","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) |\n\n#### SelectorQuery 的方法 @selectorquery-values \n\n#### in(component?) @in\n将选择器的选å–范围更改为自定义组件component内\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| component | any \\| null | å¦ | - | - | | \n\n##### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) |\n \n\n##### in 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### select(selector) @select\n在当å‰é¡µé¢ä¸‹é€‰æ‹©ç¬¬ä¸€ä¸ªåŒ¹é…选择器selector的节点\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| selector | string | 是 | - | - | - | \n\n##### 返回值 \n\n| 类型 |\n| :- |\n| [NodesRef](#nodesref-values) |\n\n##### NodesRef 的方法 @nodesref-values \n\n##### boundingClientRect(callback?) @boundingclientrect\næ·»åŠ èŠ‚ç‚¹çš„å¸ƒå±€ä½ç½®çš„查询请求,相对于显示区域,以åƒç´ 为å•ä½\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: any) => void \\| null | å¦ | - | - | | \n\n###### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) |\n \n\n###### boundingClientRect 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n##### scrollOffset(callback) @scrolloffset\næ·»åŠ èŠ‚ç‚¹çš„æ»šåŠ¨ä½ç½®æŸ¥è¯¢è¯·æ±‚,以åƒç´ 为å•ä½\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: any) => void | 是 | - | - | | \n\n###### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) |\n \n\n###### scrollOffset 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n##### fields(fields, callback) @fields\n获å–节点的相关信æ¯ï¼Œéœ€è¦èŽ·å–çš„å—段在fieldsä¸æŒ‡å®š\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| fields | **NodeField** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| id | boolean \\| null | å¦ | - | - | 是å¦è¿”回节点 id |\n@| dataset | boolean \\| null | å¦ | - | - | 是å¦è¿”回节点 dataset |\n@| rect | boolean \\| null | å¦ | - | - | 是å¦è¿”回节点布局ä½ç½®ï¼ˆleft right top bottom) |\n@| size | boolean \\| null | å¦ | - | - | 是å¦è¿”回节点尺寸(width height) |\n@| scrollOffset | boolean \\| null | å¦ | - | - | 是å¦è¿”回节点的 scrollLeft scrollTop,节点必须是 scroll-view 或者 viewport |\n@| properties | Array\\<string\\> \\| null | å¦ | - | - | 指定属性å列表,返回节点对应属性å的当å‰å±žæ€§å€¼ï¼ˆåªèƒ½èŽ·å¾—组件文档ä¸æ ‡æ³¨çš„常规属性值,id class style 和事件绑定的属性值ä¸å¯èŽ·å–) |\n@| computedStyle | Array\\<string\\> \\| null | å¦ | - | - | æŒ‡å®šæ ·å¼ååˆ—è¡¨ï¼Œè¿”å›žèŠ‚ç‚¹å¯¹åº”æ ·å¼å的当å‰å€¼ |\n@| context | boolean \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"x\",\"x\"]]}' /> | 是å¦è¿”回节点对应的 Context 对象 |\n| callback | (result: any) => void | 是 | - | - | | \n\n###### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) |\n \n\n###### fields 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n##### context(callback) @context\næ·»åŠ èŠ‚ç‚¹çš„ Context 对象查询请求\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: any) => void | 是 | - | - | | \n\n###### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) |\n \n\n###### context 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | x | x |\n\n\n##### node(callback) @node\nèŽ·å– Node 节点实例。目å‰æ”¯æŒ Canvas 的获å–。\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: any) => void | 是 | - | - | - | \n\n###### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) |\n \n\n###### node 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n \n\n##### select 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### selectAll(selector) @selectall\n在当å‰é¡µé¢ä¸‹é€‰æ‹©åŒ¹é…选择器selector的所有节点\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| selector | string | 是 | - | - | - | \n\n##### 返回值 \n\n| 类型 |\n| :- |\n| [NodesRef](#nodesref-values) |\n \n\n##### selectAll 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### selectViewport() @selectviewport\n选择显示区域\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| [NodesRef](#nodesref-values) |\n \n\n##### selectViewport 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### exec(callback) @exec\n执行所有的请求\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: Array\\<any\\>) => void \\| null | 是 | - | - | - | \n\n##### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| [NodesRef](#nodesref-values) \\| null | å¦ |\n \n\n##### exec 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n \n","compatibility":"### createSelectorQuery 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.91 | 4.11 |\n","tutorial":"\n### å‚è§\n- [createSelectorQuery](https://doc.dcloud.net.cn/uni-app-x/api/nodes-info.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.dom.nodes-info.createSelectorQuery)\n"},"nodes-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/nodes-info/nodes-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/nodes-info/nodes-info\n>Template\n```vue\n<template>\r\n <view class=\"page\" id=\"page\">\r\n <page-head :title=\"title\"></page-head>\r\n <button class=\"btn btn-get-node-info\" @click=\"getNodeInfo\">getNodeInfo</button>\r\n <button class=\"btn btn-get-all-node-info\" @click=\"getAllNodeInfo\">getAllNodeInfo</button>\r\n <view id=\"rect-1-2\" class=\"rect-1-2\">\r\n <view class=\"rect rect1\"></view>\r\n <view class=\"rect rect2\"></view>\r\n </view>\r\n <view class=\"rect-info-1-2\">\r\n <view class=\"rect-info\" v-for=\"(nodeInfo, index) in nodeInfoList\" :key=\"index\">\r\n <view class=\"node-info-item\">\r\n <text class=\"node-info-item-k\">left: </text>\r\n <text class=\"node-info-item-v\">{{nodeInfo.left}}</text>\r\n </view>\r\n <view class=\"node-info-item\">\r\n <text class=\"node-info-item-k\">top: </text>\r\n <text class=\"node-info-item-v\">{{nodeInfo.top}}</text>\r\n </view>\r\n <view class=\"node-info-item\">\r\n <text class=\"node-info-item-k\">right: </text>\r\n <text class=\"node-info-item-v\">{{nodeInfo.right}}</text>\r\n </view>\r\n <view class=\"node-info-item\">\r\n <text class=\"node-info-item-k\">bottom: </text>\r\n <text class=\"node-info-item-v\">{{nodeInfo.bottom}}</text>\r\n </view>\r\n <view class=\"node-info-item\">\r\n <text class=\"node-info-item-k\">width: </text>\r\n <text class=\"node-info-item-v\">{{nodeInfo.width}}</text>\r\n </view>\r\n <view class=\"node-info-item\">\r\n <text class=\"node-info-item-k\">height: </text>\r\n <text class=\"node-info-item-v\">{{nodeInfo.height}}</text>\r\n </view>\r\n </view>\r\n </view>\n <node-child class=\"node-child\"></node-child>\r\n </view>\r\n</template>\r\n\r\n\r\n\r\n<style>\r\n .page {\r\n padding: 15px;\r\n flex: 1;\r\n }\r\n\r\n .btn {\r\n margin-top: 15px;\r\n }\r\n\r\n .rect-1-2 {\r\n flex-direction: row;\r\n margin-top: 15px;\r\n }\r\n\r\n .rect {\r\n width: 150px;\r\n height: 100px;\r\n }\r\n\r\n .rect1 {\r\n background-color: dodgerblue;\r\n }\r\n\r\n .rect2 {\r\n margin-left: auto;\r\n background-color: seagreen;\r\n }\r\n\r\n .rect-info-1-2 {\r\n flex-direction: row;\r\n margin-top: 15px;\r\n }\r\n\r\n .rect-info {\r\n flex: 1;\r\n flex-direction: column;\r\n }\r\n\r\n .node-info-item {\r\n flex-direction: row;\r\n }\r\n\r\n .node-info-item-k {\r\n width: 72px;\r\n line-height: 2;\r\n }\r\n\r\n .node-info-item-v {\r\n font-weight: bold;\r\n line-height: 2;\r\n }\r\n</style>\n\n```\n>Script\n```uts\n\r\n import nodeChild from './nodes-info-child.uvue'\r\n\r\n type NodeInfoType = {\r\n left : number | null,\r\n top : number | null,\r\n right : number | null,\r\n bottom : number | null,\r\n width : number | null,\r\n height : number | null,\r\n }\r\n\r\n export default {\r\n components: {\r\n nodeChild\r\n },\r\n data() {\r\n return {\r\n title: 'createSelectorQuery',\r\n nodeInfoList: [] as NodeInfoType[],\r\n // 仅用于自动化测试\r\n rootNodeInfo: null as NodeInfoType | null,\r\n //供自动化测试使用\r\n // resizeRectValid: false\r\n }\r\n },\r\n onResize() {\r\n //供自动化测试使用\r\n /* var rect12Element = uni.getElementById(\"rect-1-2\")\r\n if(rect12Element != null) {\r\n var domRect = rect12Element.getBoundingClientRect()\r\n if(domRect.width > 100) {\r\n this.resizeRectValid = true\r\n }\r\n } */\r\n },\r\n methods: {\r\n // 仅用于自动化测试\r\n getRootNodeInfo(selector : string) {\r\n uni.createSelectorQuery().select(selector).boundingClientRect().exec((ret) => {\r\n if (ret.length == 1) {\r\n const nodeInfo = ret[0] as NodeInfo;\r\n const nodeType = {\r\n left: nodeInfo.left,\r\n top: nodeInfo.top,\r\n right: nodeInfo.right,\r\n bottom: nodeInfo.bottom,\r\n width: nodeInfo.width,\r\n height: nodeInfo.height,\r\n } as NodeInfoType;\r\n this.rootNodeInfo = nodeType\r\n }\r\n })\r\n },\r\n getNodeInfo() {\r\n uni.createSelectorQuery().select('.rect1').boundingClientRect().exec((ret) => {\r\n this.nodeInfoList.length = 0\r\n const i = ret[0] as NodeInfo\r\n this.nodeInfoList.push({\r\n left: i.left,\r\n top: i.top,\r\n right: i.right,\r\n bottom: i.bottom,\r\n width: i.width,\r\n height: i.height,\r\n } as NodeInfoType)\r\n })\r\n },\r\n getAllNodeInfo() {\r\n uni.createSelectorQuery().selectAll('.rect').boundingClientRect().exec((ret) => {\r\n this.nodeInfoList.length = 0\r\n const array = ret[0] as NodeInfo[]\r\n array.forEach((i) => {\r\n this.nodeInfoList.push({\r\n left: i.left,\r\n top: i.top,\r\n right: i.right,\r\n bottom: i.bottom,\r\n width: i.width,\r\n height: i.height,\r\n } as NodeInfoType)\r\n })\r\n })\r\n }\r\n }\r\n }\r\n\n```\n:::"},"showActionSheet":{"name":"## uni.showActionSheet(options) @showactionsheet","description":"从底部å‘上弹出æ“作èœå•","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ShowActionSheetOptions](#showactionsheetoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| title | string \\| null | å¦ | - | - | èœå•æ ‡é¢˜ |\n@| alertText | string \\| null | å¦ | - | - | è¦ç¤ºæ–‡æ¡ˆï¼ˆåŒèœå•æ ‡é¢˜, appæ— æ•ˆï¼‰ |\n@| itemList | Array\\<string\\> | 是 | - | - | 按钮的文å—数组 |\n@| itemColor | [string.ColorString](/uts/data-type.md#ide-string) \\| null | å¦ | - | - | 按钮的文å—颜色,å—ç¬¦ä¸²æ ¼å¼ï¼ˆiOS默认为系统控件颜色) |\n@| popover | **Popover** \\| null | å¦ | - | - | 大å±è®¾å¤‡å¼¹å‡ºåŽŸç”Ÿé€‰æ‹©æŒ‰é’®æ¡†çš„指示区域,默认居ä¸æ˜¾ç¤º |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| top | number | 是 | - | - | 指示区域åæ ‡ï¼Œä½¿ç”¨åŽŸç”Ÿ navigationBar 时一般需è¦åŠ 上 navigationBar 的高度 |\n@@| left | number | 是 | - | - | 指示区域åæ ‡ |\n@@| width | number | 是 | - | - | 指示区域宽度 |\n@@| height | number | 是 | - | - | 指示区域高度 |\n@| success | (res: [ShowActionSheetSuccess](#showactionsheetsuccess-values)) => void \\| null | å¦ | - | - | uni.showActionSheetæˆåŠŸå›žè°ƒå‡½æ•°å®šä¹‰ |\n@| fail | (res: [IPromptError](#iprompterror-values)) => void \\| null | å¦ | - | - | uni.showActionSheetæˆåŠŸå›žè°ƒå‡½æ•°å®šä¹‰ |\n@| complete | (res: any) => void \\| null | å¦ | - | - | uni.showActionSheetæˆåŠŸå›žè°ƒå‡½æ•°å®šä¹‰ | \n\n##### ShowActionSheetSuccess 的属性值 @showactionsheetsuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| tapIndex | number \\| null | å¦ | - | - | 用户点击的按钮,从上到下的顺åºï¼Œä»Ž0开始 |\n\n##### IPromptError 的属性值 @iprompterror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1 \\| 1001 | 是 | - | - | 错误ç <br/>- 1\t 撤销<br/>- 1001 请求å‚æ•°éžæ³• |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### showActionSheet 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showactionsheet)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.prompt.showActionSheet)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/action-sheet/action-sheet.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/action-sheet/action-sheet\n>Template\n```vue\n<template>\r\n <view>\r\n <page-head :title=\"title\"></page-head>\r\n <view class=\"uni-list\">\r\n <radio-group @change=\"radioChange\">\r\n <radio class=\"uni-list-cell uni-list-cell-pd\" v-for=\"(item, index) in items\" :key=\"item.value\"\r\n :class=\"index < items.length - 1 ? 'uni-list-cell-line': ''\" :value=\"item.value\" :checked=\"index === current\">\r\n {{item.name}}\r\n </radio>\r\n </radio-group>\r\n </view>\r\n <view class=\"uni-list\">\r\n <view class=\"uni-list-cell uni-list-cell-pd\">\r\n <view class=\"uni-list-cell-db\">自定义itemColor</view>\r\n <switch :checked=\"itemColorCustom\" @change=\"itemColorChange\" />\r\n </view>\r\n <view class=\"uni-list-cell uni-list-cell-pd\">\r\n <view class=\"uni-list-cell-db\">超长文本和空文本item</view>\r\n <switch :checked=\"itemContentLarge\" @change=\"itemContentLargeChange\" />\r\n </view>\r\n <view class=\"uni-list-cell uni-list-cell-pd\">\r\n <view class=\"uni-list-cell-db\">超过6个item</view>\r\n <switch :checked=\"itemNumLargeSelect\" @change=\"itemNumLargeChange\" />\r\n </view>\r\n </view>\r\n <view class=\"uni-padding-wrap\">\r\n <view class=\"uni-btn-v\">\r\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"actionSheetTap\" id=\"btn-action-sheet-show\">弹出action sheet</button>\r\n </view>\r\n </view>\r\n </view>\r\n</template>\r\n\n\n```\n>Script\n```uts\n\r\n type ItemType = {\r\n value : string,\r\n name : string,\r\n }\r\n export default {\r\n data() {\r\n return {\r\n title: 'action-sheet',\r\n itemColorCustom: false,\r\n itemContentLarge: false,\r\n itemNumLargeSelect: false,\n showErrorToast:true,\r\n items: [{\r\n value: 'æ ‡é¢˜',\r\n name: 'æœ‰æ ‡é¢˜'\r\n },\r\n {\r\n value: '',\r\n name: 'æ— æ ‡é¢˜'\r\n },\r\n {\r\n value: 'è¶…é•¿æ ‡é¢˜æµ‹è¯•å†…å®¹ï¼Œæµ‹è¯•è¶…è¿‡æ˜¾ç¤ºæœ€å¤§èŒƒå›´ä¹‹åŽçš„æ ·å¼-è¶…é•¿æ ‡é¢˜æµ‹è¯•å†…å®¹ï¼Œæµ‹è¯•è¶…è¿‡æ˜¾ç¤ºæœ€å¤§èŒƒå›´ä¹‹åŽçš„æ ·å¼',\r\n name: 'è¶…é•¿æ ‡é¢˜'\r\n }\r\n ] as ItemType[],\r\n current: 0,\r\n }\r\n },\n onLoad(){\n uni.showActionSheet({\n title: \"onLoad 调用示例,请手动å–消\",\n itemList:['item1', 'item2'],\n })\n },\r\n methods: {\n //自动化测试例专用\n jest_getWindowInfo() : GetWindowInfoResult {\n return uni.getWindowInfo();\n },\r\n radioChange(e : UniRadioGroupChangeEvent) {\r\n for (let i = 0; i < this.items.length; i++) {\r\n if (this.items[i].value === e.detail.value) {\r\n this.current = i;\r\n break;\r\n }\r\n }\r\n },\r\n itemContentLargeChange: function (e : UniSwitchChangeEvent) {\r\n this.itemContentLarge = e.detail.value\r\n },\r\n itemColorChange: function (e : UniSwitchChangeEvent) {\r\n this.itemColorCustom = e.detail.value\r\n },\r\n itemNumLargeChange: function (e : UniSwitchChangeEvent) {\r\n this.itemNumLargeSelect = e.detail.value\r\n },\r\n actionSheetTap() {\r\n\r\n let itemInfo = ['item1', 'item2', 'item3', 'item4']\r\n\r\n if (this.itemContentLarge) {\r\n itemInfo = ['ä¸¤ä¸ªé»„é¹‚é¸£ç¿ æŸ³ï¼Œä¸€è¡Œç™½é¹ä¸Šé’天。窗å«è¥¿å²åƒç§‹é›ªï¼Œé—¨æ³Šä¸œå´ä¸‡é‡Œèˆ¹', '水光潋滟晴方好,山色空蒙雨亦奇。 欲把西湖比西å,淡妆浓抹总相宜', '']\r\n }\n\n if (this.itemNumLargeSelect) {\r\n // 大é‡é€‰é¡¹æµ‹è¯•,ä¸èƒ½è¶…过6ä¸ªå…ƒç´ https://uniapp.dcloud.net.cn/api/ui/prompt.html#showactionsheet\r\n itemInfo = []\n for (var i = 1; i <= 10; i++) {\r\n itemInfo.push('ä¸¤ä¸ªé»„é¹‚é¸£ç¿ æŸ³ï¼Œä¸€è¡Œç™½é¹ä¸Šé’天');\r\n }\r\n }\r\n\r\n const that = this\r\n if (this.itemColorCustom) {\r\n uni.showActionSheet({\r\n title: this.items[this.current].value,\r\n itemList: itemInfo,\r\n itemColor: \"#ff00ff\",\r\n success: (e) => {\r\n console.log(e.tapIndex);\r\n uni.showToast({\r\n title: \"点击了第\" + e.tapIndex + \"个选项\",\r\n icon: \"none\"\r\n })\r\n },\r\n fail: (e) => {\n if(this.showErrorToast){\n uni.showToast({\n title: e.errMsg,\n icon: \"none\"\n })\n }\r\n console.log(e);\r\n }\r\n })\r\n } else {\r\n uni.showActionSheet({\r\n title: this.items[this.current].value,\r\n itemList: itemInfo,\r\n success: (e) => {\r\n console.log(e.tapIndex);\r\n uni.showToast({\r\n title: \"点击了第\" + e.tapIndex + \"个选项\",\r\n icon: \"none\"\r\n })\r\n },\r\n fail: (e) => {\r\n console.log(e);\n if(this.showErrorToast){\n uni.showToast({\n title: e.errMsg,\n icon: \"none\"\n })\n }\n }\r\n })\r\n }\r\n },\r\n }\r\n }\r\n\n```\n:::"},"showLoading":{"name":"## uni.showLoading(options) @showloading","description":"显示 loading æ示框, 需主动调用 uni.hideLoading æ‰èƒ½å…³é—æ示框。","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ShowLoadingOptions](#showloadingoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| title | string | 是 | - | - | æ示的内容,长度与 icon å–值有关。 |\n@| mask | boolean \\| null | å¦ | - | - | 是å¦æ˜¾ç¤ºé€æ˜Žè’™å±‚,防æ¢è§¦æ‘¸ç©¿é€ï¼Œé»˜è®¤ï¼šfalse |\n@| success | (res: ShowLoadingSuccess) => void \\| null | å¦ | - | - | uni.showLoadingæˆåŠŸå›žè°ƒå‡½æ•°å®šä¹‰ |\n@| fail | (res: [IPromptError](#iprompterror-values)) => void \\| null | å¦ | - | - | uni.showLoading失败回调函数定义 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | uni.showLoading完æˆå›žè°ƒå‡½æ•°å®šä¹‰ | \n\n##### IPromptError 的属性值 @iprompterror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1 \\| 1001 | 是 | - | - | 错误ç <br/>- 1\t 撤销<br/>- 1001 请求å‚æ•°éžæ³• |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### showLoading 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showloading)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.prompt.showLoading)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/loading/loading.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/loading/loading\n>Template\n```vue\n<template>\n <view>\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-list\">\n <view class=\"uni-list-cell uni-list-cell-pd\">\n <view class=\"uni-list-cell-db\">是å¦æ˜¾ç¤ºé€æ˜Žè’™å±‚-å±è”½ç‚¹å‡»äº‹ä»¶</view>\n <switch :checked=\"maskSelect\" @change=\"maskChange\" />\n </view>\n <view class=\"uni-padding-wrap\">\n <view class=\"uni-title uni-common-mt\">\n <text class=\"uni-title-text\"> è®¾ç½®æ ‡é¢˜ </text>\n </view>\n </view>\n <view class=\"uni-list uni-common-pl\">\n <radio-group @change=\"radioChange\">\n <radio class=\"uni-list-cell uni-list-cell-pd radio\" v-for=\"(item, index) in items\" :key=\"item.value\"\n :class=\"index < items.length - 1 ? 'uni-list-cell-line' : ''\" :value=\"item.value\"\n :checked=\"index === current\">\n {{ item.name }}\n </radio>\n </radio-group>\n </view>\n </view>\n <view class=\"uni-padding-wrap\">\n <view class=\"uni-btn-v\">\n <button class=\"uni-btn-v\" type=\"primary\" @click=\"showLoading\">显示 loading æ示框</button>\n <button class=\"uni-btn-v\" @click=\"hideLoading\">éšè— loading æ示框</button>\n <text>为方便演示,loading弹出3秒åŽè‡ªåŠ¨å…³é—</text>\n </view>\n </view>\n </view>\n</template>\n\n\n```\n>Script\n```uts\n\n type ItemType = {\n value : string\n name : string\n }\n export default {\n data() {\n return {\n title: 'loading',\n items: [\n {\n value: 'null',\n name: 'æ— æ ‡é¢˜',\n },\n {\n value: '三秒åŽè‡ªåŠ¨å…³é—',\n name: 'æ™®é€šæ ‡é¢˜',\n },\n {\n value: '超长文本内容,测试超出范围-超长文本内容,测试超出范围-三秒åŽè‡ªåŠ¨å…³é—',\n name: 'é•¿æ ‡é¢˜',\n },\n ] as ItemType[],\n current: 0,\n maskSelect: false,\n titleSelect: \"null\"\n }\n },\n onLoad(){\n uni.showLoading({\n \ttitle:'onLoad 调用示例,2秒åŽæ¶ˆå¤±'\n })\n setTimeout(function() {\n uni.hideLoading()\n }, 2000);\n },\n methods: {\n //自动化测试例专用\n jest_getWindowInfo() : GetWindowInfoResult {\n return uni.getWindowInfo();\n },\n\n radioChange(e : UniRadioGroupChangeEvent) {\n const selected = this.items.find((item) : boolean => {\n return item.value == e.detail.value\n })\n if (selected != null) {\n this.titleSelect = selected.value\n }\n },\n maskChange: function (e : UniSwitchChangeEvent) {\n this.maskSelect = e.detail.value\n },\n showLoading: function () {\n\n console.log(this.titleSelect)\n if (this.titleSelect == \"null\") {\n uni.showLoading({\n title: \"\",\n mask: this.maskSelect\n });\n } else {\n uni.showLoading({\n title: this.titleSelect,\n mask: this.maskSelect\n });\n }\n setTimeout(() => {\n this.hideLoading();\n }, 3000);\n },\n hideLoading: function () {\n uni.hideLoading();\n }\n }\n }\n\n```\n:::"},"hideLoading":{"name":"## uni.hideLoading() @hideloading","description":"éšè— loading æ示框。","param":"","returnValue":"","compatibility":"### hideLoading 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/ui/prompt.html#hideloading)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.prompt.hideLoading)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/loading/loading.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/loading/loading\n>Template\n```vue\n<template>\n <view>\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-list\">\n <view class=\"uni-list-cell uni-list-cell-pd\">\n <view class=\"uni-list-cell-db\">是å¦æ˜¾ç¤ºé€æ˜Žè’™å±‚-å±è”½ç‚¹å‡»äº‹ä»¶</view>\n <switch :checked=\"maskSelect\" @change=\"maskChange\" />\n </view>\n <view class=\"uni-padding-wrap\">\n <view class=\"uni-title uni-common-mt\">\n <text class=\"uni-title-text\"> è®¾ç½®æ ‡é¢˜ </text>\n </view>\n </view>\n <view class=\"uni-list uni-common-pl\">\n <radio-group @change=\"radioChange\">\n <radio class=\"uni-list-cell uni-list-cell-pd radio\" v-for=\"(item, index) in items\" :key=\"item.value\"\n :class=\"index < items.length - 1 ? 'uni-list-cell-line' : ''\" :value=\"item.value\"\n :checked=\"index === current\">\n {{ item.name }}\n </radio>\n </radio-group>\n </view>\n </view>\n <view class=\"uni-padding-wrap\">\n <view class=\"uni-btn-v\">\n <button class=\"uni-btn-v\" type=\"primary\" @click=\"showLoading\">显示 loading æ示框</button>\n <button class=\"uni-btn-v\" @click=\"hideLoading\">éšè— loading æ示框</button>\n <text>为方便演示,loading弹出3秒åŽè‡ªåŠ¨å…³é—</text>\n </view>\n </view>\n </view>\n</template>\n\n\n```\n>Script\n```uts\n\n type ItemType = {\n value : string\n name : string\n }\n export default {\n data() {\n return {\n title: 'loading',\n items: [\n {\n value: 'null',\n name: 'æ— æ ‡é¢˜',\n },\n {\n value: '三秒åŽè‡ªåŠ¨å…³é—',\n name: 'æ™®é€šæ ‡é¢˜',\n },\n {\n value: '超长文本内容,测试超出范围-超长文本内容,测试超出范围-三秒åŽè‡ªåŠ¨å…³é—',\n name: 'é•¿æ ‡é¢˜',\n },\n ] as ItemType[],\n current: 0,\n maskSelect: false,\n titleSelect: \"null\"\n }\n },\n onLoad(){\n uni.showLoading({\n \ttitle:'onLoad 调用示例,2秒åŽæ¶ˆå¤±'\n })\n setTimeout(function() {\n uni.hideLoading()\n }, 2000);\n },\n methods: {\n //自动化测试例专用\n jest_getWindowInfo() : GetWindowInfoResult {\n return uni.getWindowInfo();\n },\n\n radioChange(e : UniRadioGroupChangeEvent) {\n const selected = this.items.find((item) : boolean => {\n return item.value == e.detail.value\n })\n if (selected != null) {\n this.titleSelect = selected.value\n }\n },\n maskChange: function (e : UniSwitchChangeEvent) {\n this.maskSelect = e.detail.value\n },\n showLoading: function () {\n\n console.log(this.titleSelect)\n if (this.titleSelect == \"null\") {\n uni.showLoading({\n title: \"\",\n mask: this.maskSelect\n });\n } else {\n uni.showLoading({\n title: this.titleSelect,\n mask: this.maskSelect\n });\n }\n setTimeout(() => {\n this.hideLoading();\n }, 3000);\n },\n hideLoading: function () {\n uni.hideLoading();\n }\n }\n }\n\n```\n:::"},"showModal":{"name":"## uni.showModal(options) @showmodal","description":"显示模æ€å¼¹çª—,å¯ä»¥åªæœ‰ä¸€ä¸ªç¡®å®šæŒ‰é’®ï¼Œä¹Ÿå¯ä»¥åŒæ—¶æœ‰ç¡®å®šå’Œå–消按钮。类似于一个APIæ•´åˆäº† html ä¸ï¼šalertã€confirm。","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ShowModalOptions](#showmodaloptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| title | string \\| null | å¦ | - | - | æç¤ºçš„æ ‡é¢˜ |\n@| content | string \\| null | å¦ | - | - | æ示的内容 |\n@| showCancel | boolean \\| null | å¦ | true<br/>是å¦æ˜¾ç¤ºå–消按钮,默认为 true | - | |\n@| cancelText | string \\| null | å¦ | - | - | å–消按钮的文å—,默认为\"å–消\" |\n@| cancelColor | [string.ColorString](/uts/data-type.md#ide-string) \\| null | å¦ | - | - | å–消按钮的文å—颜色,默认为\"#000000\" |\n@| confirmText | string \\| null | å¦ | - | - | 确定按钮的文å—,默认为\"确定\" |\n@| confirmColor | [string.ColorString](/uts/data-type.md#ide-string) \\| null | å¦ | - | - | 确定按钮的文å—颜色 |\n@| editable | boolean \\| null | å¦ | false<br/>是å¦æ˜¾ç¤ºè¾“入框 | - | |\n@| placeholderText | string \\| null | å¦ | - | - | 显示输入框时的æ示文本 |\n@| success | (res: [ShowModalSuccess](#showmodalsuccess-values)) => void \\| null | å¦ | - | - | uni.showModalæˆåŠŸå›žè°ƒå‡½æ•°å®šä¹‰ |\n@| fail | (res: [IPromptError](#iprompterror-values)) => void \\| null | å¦ | - | - | uni.showModal失败回调函数定义 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | uni.showModal完æˆå›žè°ƒå‡½æ•°å®šä¹‰ | \n\n##### ShowModalSuccess 的属性值 @showmodalsuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| confirm | boolean | 是 | - | - | 为 true 时,表示用户点击了确定按钮 |\n| cancel | boolean | 是 | - | - | 为 true 时,表示用户点击了å–消(用于 Android 系统区分点击蒙层关é—还是点击å–消按钮关é—) |\n| content | string \\| null | å¦ | - | - | editable 为 true 时,用户输入的文本 |\n\n##### IPromptError 的属性值 @iprompterror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1 \\| 1001 | 是 | - | - | 错误ç <br/>- 1\t 撤销<br/>- 1001 请求å‚æ•°éžæ³• |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### showModal 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showmodal)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.prompt.showModal)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/modal/modal.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/modal/modal\n>Template\n```vue\n<template>\n <!-- #ifdef APP -->\n <scroll-view style=\"flex: 1\">\n <!-- #endif -->\n <view>\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-list\">\n <radio-group @change=\"radioChange\">\n <radio class=\"uni-list-cell uni-list-cell-pd\" v-for=\"(item, index) in items\" :key=\"item.value\"\n :class=\"index < items.length - 1 ? 'uni-list-cell-line' : ''\" :value=\"item.value\"\n :checked=\"index === current\">\n {{ item.name }}\n </radio>\n </radio-group>\n </view>\n <view class=\"uni-list\">\n <view class=\"uni-list-cell uni-list-cell-pd\">\n <view class=\"uni-list-cell-db\">是å¦æ˜¾ç¤ºå–消按钮</view>\n <switch :checked=\"showCancelSelect\" @change=\"showCancelChange\" />\n </view>\n <view class=\"uni-list-cell uni-list-cell-pd\">\n <view class=\"uni-list-cell-db\">定制å–消文案</view>\n <switch :checked=\"cancelTextSelect\" @change=\"cancelTextChange\" />\n </view>\n <view class=\"uni-list-cell uni-list-cell-pd\">\n <view class=\"uni-list-cell-db\">定制确认文案</view>\n <switch :checked=\"confirmTextSelect\" @change=\"confirmTextChange\" />\n </view>\n <view class=\"uni-list-cell uni-list-cell-pd\">\n <view class=\"uni-list-cell-db\">是å¦æ˜¾ç¤ºè¾“入框</view>\n <switch :checked=\"editableSelect\" @change=\"editableChange\" />\n </view>\n <view class=\"uni-list-cell uni-list-cell-pd\">\n <view class=\"uni-list-cell-db\">是å¦å®šåˆ¶è¾“å…¥æ示è¯</view>\n <switch :checked=\"placeholderTextSelect\" @change=\"placeholderTextChange\" />\n </view>\n </view>\n <view class=\"uni-padding-wrap uni-common-mt\">\n <view class=\"uni-btn-v\">\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"modalTap\" id=\"btn-modal-show\">\n modal测试\n </button>\n </view>\n <text>{{ exeRet }}</text>\n </view>\n </view>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n\n\n```\n>Script\n```uts\n\n type ItemType = {\n value : string,\n name : string,\n }\n export default {\n data() {\n return {\n title: 'modal',\n showCancelSelect: false,\n cancelTextSelect: false,\n confirmTextSelect: false,\n editableSelect: false,\n placeholderTextSelect: false,\n exeRet: \"\",\n items: [{\n value: 'æ ‡é¢˜',\n name: 'æœ‰æ ‡é¢˜'\n },\n {\n value: '',\n name: 'æ— æ ‡é¢˜'\n },\n {\n value: 'è¶…é•¿æ ‡é¢˜æµ‹è¯•å†…å®¹ï¼Œæµ‹è¯•è¶…è¿‡æ˜¾ç¤ºæœ€å¤§èŒƒå›´ä¹‹åŽçš„æ ·å¼-è¶…é•¿æ ‡é¢˜æµ‹è¯•å†…å®¹ï¼Œæµ‹è¯•è¶…è¿‡æ˜¾ç¤ºæœ€å¤§èŒƒå›´ä¹‹åŽçš„æ ·å¼',\n name: 'è¶…é•¿æ ‡é¢˜'\n }\n ] as ItemType[],\n current: 0\n }\n },\n onLoad() {\n uni.showModal({\n title: \"onLoad 调用示例,请手动å–消\",\n showCancel: false\n })\n },\n methods: {\n //自动化测试例专用\n jest_getWindowInfo() : GetWindowInfoResult {\n return uni.getWindowInfo();\n },\n showCancelChange: function (e : UniSwitchChangeEvent) {\n this.showCancelSelect = e.detail.value\n },\n cancelTextChange: function (e : UniSwitchChangeEvent) {\n this.cancelTextSelect = e.detail.value\n },\n confirmTextChange: function (e : UniSwitchChangeEvent) {\n this.confirmTextSelect = e.detail.value\n },\n editableChange: function (e : UniSwitchChangeEvent) {\n this.editableSelect = e.detail.value\n },\n placeholderTextChange: function (e : UniSwitchChangeEvent) {\n this.placeholderTextSelect = e.detail.value\n },\n radioChange(e : UniRadioGroupChangeEvent) {\n for (let i = 0; i < this.items.length; i++) {\n if (this.items[i].value === e.detail.value) {\n this.current = i;\n break;\n }\n }\n },\n modalTap: function () {\n let cancelTextVal : string\n let cancelColorVal = ''\n if (this.cancelTextSelect) {\n cancelTextVal = \"修改åŽçš„å–消文本\"\n cancelColorVal = \"#ff00ff\"\n } else {\n cancelTextVal = \"å–消\"\n }\n\n let confirmTextVal = '确定'\n let confirmColorVal = ''\n if (this.confirmTextSelect) {\n confirmTextVal = \"修改åŽçš„确定文本\"\n confirmColorVal = \"#00ffff\"\n }\n\n let placeholderTextVal = ''\n let contentVal = \"弹窗内容,告知当å‰çŠ¶æ€ã€ä¿¡æ¯å’Œè§£å†³æ–¹æ³•ï¼Œæè¿°æ–‡å—å°½é‡æŽ§åˆ¶åœ¨ä¸‰è¡Œå†…\"\n if (this.placeholderTextSelect) {\n placeholderTextVal = \"定制æ示信æ¯\"\n contentVal = \"\"\n }\n uni.showModal({\n title: this.items[this.current].value,\n editable: this.editableSelect,\n placeholderText: placeholderTextVal,\n content: contentVal,\n showCancel: this.showCancelSelect,\n cancelText: cancelTextVal,\n cancelColor: cancelColorVal,\n confirmText: confirmTextVal,\n confirmColor: confirmColorVal,\n success: (res) => {\n this.exeRet = JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = JSON.stringify(res)\n }\n })\n }\n }\n }\n\n```\n:::"},"showToast":{"name":"## uni.showToast(options) @showtoast","description":"显示消æ¯æ示框","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ShowToastOptions](#showtoastoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| title | string | 是 | - | - | æ示的内容,长度与 icon å–值有关。 |\n@| icon | \"success\" \\| \"error\" \\| \"fail\" \\| \"exception\" \\| \"loading\" \\| \"none\" | å¦ | - | - | icon值说明 success: 显示æˆåŠŸå›¾æ ‡ï¼Œerror: æ˜¾ç¤ºé”™è¯¯å›¾æ ‡ï¼› fail: æ˜¾ç¤ºé”™è¯¯å›¾æ ‡ï¼Œæ¤æ—¶titleæ–‡æœ¬æ— é•¿åº¦æ˜¾ç¤ºï¼› exception: æ˜¾ç¤ºå¼‚å¸¸å›¾æ ‡ï¼Œæ¤æ—¶titleæ–‡æœ¬æ— é•¿åº¦æ˜¾ç¤ºï¼› loading: æ˜¾ç¤ºåŠ è½½å›¾æ ‡ï¼›none: ä¸æ˜¾ç¤ºå›¾æ ‡ã€‚ |\n@| image | [string.ImageURIString](/uts/data-type.md#ide-string) \\| null | å¦ | - | - | è‡ªå®šä¹‰å›¾æ ‡çš„æœ¬åœ°è·¯å¾„ï¼ˆapp端暂ä¸æ”¯æŒgif) |\n@| mask | boolean \\| null | å¦ | - | - | 是å¦æ˜¾ç¤ºé€æ˜Žè’™å±‚,防æ¢è§¦æ‘¸ç©¿é€ï¼Œé»˜è®¤ï¼šfalse |\n@| duration | number \\| null | å¦ | - | - | æ示的延迟时间,å•ä½æ¯«ç§’,默认:1500 |\n@| position | \"top\" \\| \"center\" \\| \"bottom\" | å¦ | - | - | position值说明(仅App生效) top: 居上显示; center: å±…ä¸æ˜¾ç¤ºï¼›bottom: 居底显示 |\n@| success | (res: ShowToastSuccess) => void \\| null | å¦ | - | - | uni.showToastæˆåŠŸå›žè°ƒå‡½æ•°å®šä¹‰ |\n@| fail | (res: [IPromptError](#iprompterror-values)) => void \\| null | å¦ | - | - | uni.showToast失败回调函数定义 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | uni.showToast完æˆå›žè°ƒå‡½æ•°å®šä¹‰ | \n\n##### IPromptError 的属性值 @iprompterror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1 \\| 1001 | 是 | - | - | 错误ç <br/>- 1\t 撤销<br/>- 1001 请求å‚æ•°éžæ³• |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### showToast 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showtoast)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.prompt.showToast)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/toast/toast.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/toast/toast\n>Template\n```vue\n<template>\n <view>\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-padding-wrap\">\n <view class=\"uni-btn-v\">\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"toast1Tap\" id=\"btn-toast-default\" >点击弹出默认toast</button>\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"toastTapIconError\" id=\"btn-toast-errorIcon\">点击弹出设置iconçš„toast</button>\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"toast2Tap\" id=\"btn-toast-duration\">点击弹出设置durationçš„toast</button>\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"toast3Tap\" id=\"btn-toast-loading\">点击弹出显示loadingçš„toast</button>\n <!-- #ifndef MP-ALIPAY -->\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"toast4Tap\">点击弹出显示自定义图片的toast</button>\n <!-- #endif -->\n <!-- #ifdef APP -->\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"toast5Tap\" id=\"btn-toast-postion-bottom\">ç‚¹å‡»æ˜¾ç¤ºæ— å›¾æ ‡çš„å±…åº•toast</button>\n <!-- #endif -->\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"hideToast\" id=\"btn-toast-hide\">点击éšè—toast</button>\n </view>\n <text>{{exeRet}}</text>\n </view>\n </view>\n</template>\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n title: 'toast',\n exeRet: ''\n }\n },\n onLoad() {\n uni.showToast({\n title: 'onLoad 调用示例,2秒åŽæ¶ˆå¤±'\n })\n setTimeout(function () {\n uni.hideToast()\n }, 2000);\n },\n methods: {\n //自动化测试例专用\n jest_getWindowInfo() : GetWindowInfoResult {\n return uni.getWindowInfo();\n },\n toast1Tap: function () {\n uni.showToast({\n title: \"默认\",\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n toastTapIconError: function () {\n uni.showToast({\n title: \"默认\",\n icon: 'error',\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n toast2Tap: function () {\n uni.showToast({\n title: \"duration 3000\",\n duration: 3000,\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n toast3Tap: function () {\n uni.showToast({\n title: \"loading\",\n icon: \"loading\",\n duration: 5000,\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n toast4Tap: function () {\n uni.showToast({\n title: \"logo\",\n image: \"/static/uni.png\",\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n // #ifdef APP\n toast5Tap: function () {\n uni.showToast({\n title: \"显示一段轻æ示\",\n position: 'bottom',\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n // #endif\n hideToast: function () {\n uni.hideToast()\n }\n }\n }\n\n```\n:::"},"hideToast":{"name":"## uni.hideToast() @hidetoast","description":"éšè—消æ¯æ示框。","param":"","returnValue":"","compatibility":"### hideToast 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/ui/prompt.html#hidetoast)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.prompt.hideToast)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/toast/toast.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/toast/toast\n>Template\n```vue\n<template>\n <view>\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-padding-wrap\">\n <view class=\"uni-btn-v\">\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"toast1Tap\" id=\"btn-toast-default\" >点击弹出默认toast</button>\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"toastTapIconError\" id=\"btn-toast-errorIcon\">点击弹出设置iconçš„toast</button>\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"toast2Tap\" id=\"btn-toast-duration\">点击弹出设置durationçš„toast</button>\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"toast3Tap\" id=\"btn-toast-loading\">点击弹出显示loadingçš„toast</button>\n <!-- #ifndef MP-ALIPAY -->\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"toast4Tap\">点击弹出显示自定义图片的toast</button>\n <!-- #endif -->\n <!-- #ifdef APP -->\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"toast5Tap\" id=\"btn-toast-postion-bottom\">ç‚¹å‡»æ˜¾ç¤ºæ— å›¾æ ‡çš„å±…åº•toast</button>\n <!-- #endif -->\n <button class=\"uni-btn-v\" type=\"default\" @tap=\"hideToast\" id=\"btn-toast-hide\">点击éšè—toast</button>\n </view>\n <text>{{exeRet}}</text>\n </view>\n </view>\n</template>\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n title: 'toast',\n exeRet: ''\n }\n },\n onLoad() {\n uni.showToast({\n title: 'onLoad 调用示例,2秒åŽæ¶ˆå¤±'\n })\n setTimeout(function () {\n uni.hideToast()\n }, 2000);\n },\n methods: {\n //自动化测试例专用\n jest_getWindowInfo() : GetWindowInfoResult {\n return uni.getWindowInfo();\n },\n toast1Tap: function () {\n uni.showToast({\n title: \"默认\",\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n toastTapIconError: function () {\n uni.showToast({\n title: \"默认\",\n icon: 'error',\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n toast2Tap: function () {\n uni.showToast({\n title: \"duration 3000\",\n duration: 3000,\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n toast3Tap: function () {\n uni.showToast({\n title: \"loading\",\n icon: \"loading\",\n duration: 5000,\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n toast4Tap: function () {\n uni.showToast({\n title: \"logo\",\n image: \"/static/uni.png\",\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n // #ifdef APP\n toast5Tap: function () {\n uni.showToast({\n title: \"显示一段轻æ示\",\n position: 'bottom',\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n // #endif\n hideToast: function () {\n uni.hideToast()\n }\n }\n }\n\n```\n:::"},"loadFontFace":{"name":"## uni.loadFontFace(options) @loadfontface","description":"动æ€åŠ 载网络å—体<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [LoadFontFaceOptions](#loadfontfaceoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| global | boolean | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"x\"]]}' /> | 是å¦å…¨å±€ç”Ÿæ•ˆã€‚微信å°ç¨‹åº '2.10.0'起支æŒå…¨å±€ç”Ÿæ•ˆï¼Œéœ€åœ¨ app.vue ä¸è°ƒç”¨ã€‚ |\n@| family | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.10\"]]}' /> | 定义的å—体å称 |\n@| source | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.10\"]]}' /> | å—体资æºçš„地å€, App-Android å¹³å°ä¸æ”¯æŒ woffã€woff2 æ ¼å¼å—体文件 |\n@| desc | **LoadFontFaceOptionDesc** | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"x\",\"4.10\"]]}' /> | å¯é€‰çš„å—体æ述符 |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| style | string \\| null | å¦ | - | - | |\n@@| weight | string \\| null | å¦ | - | - | |\n@@| variant | string \\| null | å¦ | - | - | |\n@| success | (result: AsyncApiSuccessResult) => void | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.10\"]]}' /> | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (error: [LoadFontFaceFail](#loadfontfacefail-values)) => void | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.10\"]]}' /> | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: [AsyncApiResult](#asyncapiresult-values)) => void | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"√\",\"4.10\"]]}' /> | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### LoadFontFaceFail 的属性值 @loadfontfacefail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 4 \\| 99 \\| 101 \\| 100001 \\| 100002 \\| 200001 \\| 300001 \\| 300002 | 是 | - | - | 错误ç <br/>- 4: 框架内部异常<br/>- 99: page is not ready<br/>- 101: å‚数错误<br/>- 100001: family is null<br/>- 100002: source is null<br/>- 200001: local font not found<br/>- 300001: same source task is loading<br/>- 300002: download fail |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | å¦ |\n \n","compatibility":"### loadFontFace 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | √ | 4.10 |\n","tutorial":"\n### å‚è§\n- [loadFontFace](https://doc.dcloud.net.cn/uni-app-x/api/load-font-face.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.load-font-face)\n"},"load-font-face":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/load-font-face/load-font-face.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/load-font-face/load-font-face\n>Template\n```vue\n<template>\n <page-head title=\"loadFontFace\"></page-head>\n <view class=\"uni-padding-wrap\">\n <text class=\"font-size-20\">å…¨å±€åŠ è½½å—体:</text>\n <text class=\"font-size-20 line-height-40\" style=\"font-family: UniFontFamily\">font-family: uni.ttf</text>\n <view style=\"flex-direction: row;\">\n <text class=\"font-size-20\" style=\"font-family: UniFontFamily;\">{{\n uniIcon1\n }}</text>\n <text style=\"margin-left:5px;margin-right: 20px;line-height:22px;\">\\ue100</text>\n <text class=\"font-size-20\" style=\"font-family: UniFontFamily;\">{{\n uniIcon2\n }}</text>\n <text style=\"margin-left:5px;line-height:22px;\">\\ue101</text>\n </view>\n <text class=\"uni-common-mt font-size-20\">éžå…¨å±€åŠ è½½å—体:</text>\n <text class=\"font-size-20 line-height-40\" style=\"font-family: AlimamaDaoLiTiTTF\">font-family: 阿里妈妈刀隶体-ttf\n (网络å—体下载åŽç”Ÿæ•ˆ)</text>\n <text class=\"font-size-20 line-height-40\" style=\"font-family: AlimamaDaoLiTiOTF\">font-family:\n 阿里妈妈刀隶体-otf</text>\n <text class=\"item\" style=\"font-family: AlimamaDaoLiTiWOFF\">font-family: 阿里妈妈刀隶体-woff</text>\n <text class=\"item\" style=\"font-family: AlimamaDaoLiTiWOFF2\">font-family: 阿里妈妈刀隶体-woff2</text>\n <button class=\"uni-btn\" @click=\"navigateToChild\">跳转å页é¢æµ‹è¯•å—体生效范围</button>\n </view>\n</template>\n\n\n<style>\n .font-size-20 {\n font-size: 20px;\n }\n\n .line-height-40 {\n line-height: 40px;\n }\n</style>\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n uniIcon1: '\\ue100',\n uniIcon2: '\\ue101',\n }\n },\n onLoad() {\n uni.loadFontFace({\n global: true,\n family: 'UniFontFamily',\n source: \"url('/static/font/uni.ttf')\",\n success() {\n console.log('global loadFontFace uni.ttf success')\n },\n fail(error) {\n console.warn('global loadFontFace uni.ttf fail', error.errMsg)\n },\n })\n uni.loadFontFace({\n family: 'AlimamaDaoLiTiTTF',\n source:\n \"url('https://qiniu-web-assets.dcloud.net.cn/uni-app-x/static/font/AlimamaDaoLiTi.ttf')\",\n success() {\n console.log('loadFontFace Remote AlimamaDaoLiTi.ttf success')\n },\n fail(error) {\n console.warn('loadFontFace Remote AlimamaDaoLiTi.ttf fail', error.errMsg)\n },\n })\n uni.loadFontFace({\n family: 'AlimamaDaoLiTiOTF',\n source: \"url('/static/font/AlimamaDaoLiTi.otf')\",\n success() {\n console.log('loadFontFace AlimamaDaoLiTi.otf success')\n },\n fail(error) {\n console.warn('loadFontFace AlimamaDaoLiTi.otf fail', error.errMsg)\n },\n })\n uni.loadFontFace({\n family: 'AlimamaDaoLiTiWOFF',\n source: \"url('/static/font/AlimamaDaoLiTi.woff')\",\n success() {\n console.log('loadFontFace AlimamaDaoLiTi.woff success')\n },\n fail(error) {\n console.warn('loadFontFace AlimamaDaoLiTi.woff fail', error.errMsg)\n },\n })\n uni.loadFontFace({\n family: 'AlimamaDaoLiTiWOFF2',\n source: \"url('/static/font/AlimamaDaoLiTi.woff2')\",\n success() {\n console.log('loadFontFace AlimamaDaoLiTi.woff2 success')\n },\n fail(error) {\n console.warn('loadFontFace AlimamaDaoLiTi.woff2 fail', error.errMsg)\n },\n })\n },\n methods: {\n navigateToChild() {\n uni.navigateTo({\n url: '/pages/API/load-font-face/load-font-face-child',\n })\n },\n },\n }\n\n```\n:::"},"rpx2px":{"name":"## uni.rpx2px(number) @rpx2px","description":"å°†rpxå•ä½å€¼è½¬æ¢æˆpx","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| number | number | 是 | - | - | | \n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| number |\n \n","compatibility":"### rpx2px 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.02 | 4.02 | 4.11 |\n","tutorial":"\n### å‚è§\n- [rpx2px](https://doc.dcloud.net.cn/uni-app-x/api/rpx2px.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.rpx2px)\n","example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/rpx2px/rpx2px.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/rpx2px/rpx2px\n>Template\n```vue\n<template>\n <!-- #ifdef APP -->\n <scroll-view class=\"page-scroll-view\">\n <!-- #endif -->\n <view class=\"page\">\n <page-head :title=\"title\"></page-head>\n <view>\n <view class=\"item\">\n <text class=\"item-k\">输入:</text>\n <text class=\"item-v\">{{rpxValue}}rpx</text>\n </view>\n <view class=\"item\">\n <text class=\"item-k\">返回:</text>\n <text class=\"item-v\">{{pxValue}}px</text>\n </view>\n </view>\n <view>\n <button class=\"convert\" type=\"primary\" @click=\"rpx2px\">转æ¢</button>\n </view>\n </view>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n\n<style>\n .page {\n padding: 15px;\n }\n\n .item {\n flex-direction: row;\n }\n\n .item-k {\n width: 72px;\n line-height: 2;\n }\n\n .item-v {\n font-weight: bold;\n line-height: 2;\n }\n</style>\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n title: 'rpx2px',\n rpxValue: 750,\n pxValue: 0,\n result: false\n }\n },\n methods: {\n rpx2px: function () {\n this.pxValue = uni.rpx2px(this.rpxValue);\n\n // ä»…é™è‡ªåŠ¨åŒ–测试\n const windowInfo = uni.getWindowInfo();\n if (windowInfo.windowWidth == this.pxValue) {\n this.result = true\n }\n }\n }\n }\n\n```\n:::"},"setAppTheme":{"name":"## uni.setAppTheme(options) @setapptheme","description":"设置应用主题","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [SetAppThemeOptions](#setappthemeoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| theme | \"light\" \\| \"dark\" \\| \"auto\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | 主题 |\n@| success | (result: [SetAppThemeSuccessResult](#setappthemesuccessresult-values)) => void | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [IAppThemeFail](#iappthemefail-values)) => void | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SetAppThemeSuccessResult 的属性值 @setappthemesuccessresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| theme | string | 是 | - | - | - |\n\n##### IAppThemeFail 的属性值 @iappthemefail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 702001 \\| 2002000 | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | 错误ç <br/>- 702001 å‚数错误<br/>- 2002000 未知错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### setAppTheme 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.18 | 4.18 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.theme-change.setAppTheme)\n"},"onOsThemeChange":{"name":"## uni.onOsThemeChange(callback) @onosthemechange","description":"å¼€å¯ç›‘å¬ç³»ç»Ÿä¸»é¢˜å˜åŒ–","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (res: [OsThemeChangeResult](#osthemechangeresult-values)) => void | 是 | - | - | | \n\n#### OsThemeChangeResult 的属性值 @osthemechangeresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| osTheme | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | 系统主题 |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| number |\n \n","compatibility":"### onOsThemeChange 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.18 | 4.18 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.theme-change.onOsThemeChange)\n"},"offOsThemeChange":{"name":"## uni.offOsThemeChange(id) @offosthemechange","description":"å–消监å¬ç³»ç»Ÿä¸»é¢˜å˜åŒ–","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| id | number | 是 | - | - | | \n","returnValue":"","compatibility":"### offOsThemeChange 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.18 | 4.18 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.theme-change.offOsThemeChange)\n"},"onAppThemeChange":{"name":"## uni.onAppThemeChange(callback) @onappthemechange","description":"å¼€å¯ç›‘å¬åº”用主题å˜åŒ–","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (res: [AppThemeChangeResult](#appthemechangeresult-values)) => void | 是 | - | - | | \n\n#### AppThemeChangeResult 的属性值 @appthemechangeresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| appTheme | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | 应用主题 |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| number |\n \n","compatibility":"### onAppThemeChange 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.18 | 4.18 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.theme-change.onAppThemeChange)\n"},"offAppThemeChange":{"name":"## uni.offAppThemeChange(id) @offappthemechange","description":"å–消监å¬åº”用主题å˜åŒ–","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| id | number | 是 | - | - | | \n","returnValue":"","compatibility":"### offAppThemeChange 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.18 | 4.18 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.theme-change.offAppThemeChange)\n"},"theme-change":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/theme-change/theme-change.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\n <view class=\"uni-padding-wrap\">\n <view class=\"uni-common-mt item-box\">\n <text>osTheme:</text>\n <text id=\"theme\">{{ osTheme }}</text>\n </view>\n <view class=\"uni-common-mt item-box\">\n <text>应用当å‰ä¸»é¢˜:</text>\n <text id=\"theme\">{{ appTheme }}</text>\n </view>\n\n <view>\n <view class=\"uni-title uni-common-mt\">\n <text class=\"uni-title-text\"> 修改appTheme主题(æ¤å¤„仅为演示API,本应用并未完整适é…暗黑模å¼ï¼‰ </text>\n </view>\n </view>\n <view class=\"uni-list uni-common-pl\">\n <radio-group @change=\"radioChange\" class=\"radio-group\">\n <radio class=\"uni-list-cell uni-list-cell-pd radio\" v-for=\"(item, index) in items\" :key=\"item\"\n :class=\"index < items.length - 1 ? 'uni-list-cell-line' : ''\" :value=\"item\"\n :checked=\"index === current\">\n {{ item }}\n </radio>\n </radio-group>\n </view>\n\n </view>\n</template>\n\n<script>\n export default {\n data() {\n return {\n osThemeChangeId: 0,\n appThemeChangeId: 0,\n osTheme: \"light\" as string,\n appTheme: \"light\" as string,\n current: 0,\n items: [\n \"light\",\n \"dark\",\n \"auto\"\n ] as string[]\n }\n },\n methods: {\n bindOsThemeChange(): number {\n //注册osThemeå˜åŒ–监å¬\n return uni.onOsThemeChange((res: OsThemeChangeResult)=> {\n this.osTheme = res.osTheme\n })\n },\n bindAppThemeChange(): number {\n //注册appThemeå˜åŒ–监å¬\n return uni.onAppThemeChange((res: AppThemeChangeResult) => {\n this.appTheme = res.appTheme\n })\n },\n radioChange(e : UniRadioGroupChangeEvent) {\n const theme = e.detail.value\n this.setAppTheme(theme)\n uni.showToast({\n icon: 'none',\n title: '当å‰é€‰ä¸:'+theme,\n })\n },\n setAppTheme(value: string) {\n uni.setAppTheme({\n theme: value,\n success: function() {\n console.log(\"设置appTheme为\", value, \"æˆåŠŸ\")\n },\n fail: function(e: IAppThemeFail) {\n console.log(\"设置appTheme为\", value, \"失败,åŽŸå› :\", e.errMsg)\n }\n })\n }\n },\n onReady() {\n uni.getSystemInfo({\n success: (res:GetSystemInfoResult) => {\n this.osTheme = res.osTheme!\n this.appTheme = res.appTheme == \"auto\" ? res.osTheme! : res.appTheme!\n this.current = this.items.indexOf(res.appTheme!)\n }\n })\n this.osThemeChangeId = this.bindOsThemeChange()\n this.appThemeChangeId = this.bindAppThemeChange()\n },\n onUnload() {\n //注销监å¬\n uni.offAppThemeChange(this.appThemeChangeId)\n uni.offOsThemeChange(this.osThemeChangeId)\n uni.showToast({\n \"position\":\"bottom\",\n \"title\":\"å·²åœæ¢ç›‘å¬ä¸»é¢˜åˆ‡æ¢\"\n })\n }\n }\n</script>\n\n<style>\n .item-box {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n }\n .uni-list-cell {\n justify-content: flex-start;\n }\n</style>\n\n```"},"request":{"name":"## uni.request(param) @request","description":"å‘起网络请求。","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| param | [RequestOptions\\<T>](#requestoptions-values) | 是 | - | - | 网络请求å‚æ•° |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| url | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¼€å‘者æœåŠ¡å™¨æŽ¥å£åœ°å€<br/> |\n@| data | any \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 请求的å‚æ•° UTSJSONObject\\|string类型 |\n@| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设置请求的 header,header ä¸ä¸èƒ½è®¾ç½® Referer |\n@| method | \"GET\" \\| \"POST\" \\| \"PUT\" \\| \"PATCH\" \\| \"DELETE\" \\| \"HEAD\" \\| \"OPTIONS\" | å¦ | \"GET\" | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 请求方法<br/>- GET GET方法请求一个指定资æºçš„表示形å¼ï¼Œä½¿ç”¨ GET 的请求应该åªè¢«ç”¨äºŽèŽ·å–æ•°æ®ã€‚<br/>- POST POST方法用于将实体æ交到指定的资æºï¼Œé€šå¸¸å¯¼è‡´åœ¨æœåŠ¡å™¨ä¸Šçš„状æ€å˜åŒ–或副作用。<br/>- PUT PUT方法用有效载è·è¯·æ±‚替æ¢ç›®æ ‡èµ„æºçš„所有当å‰è¡¨ç¤ºã€‚<br/>- PATCH PATCH方法用于对资æºåº”用部分修改。<br/>- DELETE DELETEæ–¹æ³•åˆ é™¤æŒ‡å®šçš„èµ„æºã€‚<br/>- HEAD HEAD方法请求一个与GET请求的å“应相åŒçš„å“应,但没有å“应体。 <br/>- OPTIONS OPTIONS 方法用于æè¿°ç›®æ ‡èµ„æºçš„通信选项。 |\n@| timeout | number \\| null | å¦ | 60000 | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 超时时间,å•ä½ ms |\n@| withCredentials | boolean \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"x\",\"x\"]]}' /> | 跨域请求时是å¦æºå¸¦å‡è¯ï¼ˆcookies)<br/> |\n@| success | (option: [RequestSuccess\\<T>](#requestsuccess-values)) => void \\| null | å¦ | null | - | 网络请求æˆåŠŸå›žè°ƒã€‚ |\n@| fail | (option: [RequestFail](#requestfail-values)) => void \\| null | å¦ | null | - | 网络请求失败回调。 |\n@| complete | (option: any) => void \\| null | å¦ | null | - | 网络请求完æˆå›žè°ƒï¼ŒæˆåŠŸæˆ–者失败都会调用。 | \n\n##### RequestSuccess\\<T> 的属性值 @requestsuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| data | T \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¼€å‘者æœåŠ¡å™¨è¿”å›žçš„æ•°æ® |\n| statusCode | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¼€å‘者æœåŠ¡å™¨è¿”回的 HTTP 状æ€ç |\n| header | any | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¼€å‘者æœåŠ¡å™¨è¿”回的 HTTP Response Header |\n| cookies | Array\\<string\\> | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | å¼€å‘者æœåŠ¡å™¨è¿”回的 cookiesï¼Œæ ¼å¼ä¸ºå—符串数组 |\n\n##### RequestFail 的属性值 @requestfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 5 \\| 1000 \\| 100001 \\| 100002 \\| 600003 \\| 600009 \\| 602001 | 是 | - | - | 错误ç <br/>- 5 接å£è¶…æ—¶<br/>- 1000 æœåŠ¡ç«¯ç³»ç»Ÿé”™è¯¯<br/>- 100001 jsonæ•°æ®è§£æžé”™è¯¯<br/>- 100002 错误信æ¯json解æžå¤±è´¥<br/>- 600003 网络ä¸æ–<br/>- 600009 URLæ ¼å¼ä¸åˆæ³•<br/>- 602001 request系统错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [RequestTask](#requesttask-values) |\n\n#### RequestTask 的方法 @requesttask-values \n\n#### abort() @abort\nä¸æ–网络请求。\n\n\n##### abort 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n\n\n##### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/request.html#request)\n \n","compatibility":"### request 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/request.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.request)\n","example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/request/request.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/request/request\n>Template\n```vue\n<template>\r\n <view style=\"flex: 1;\">\r\n <view class=\"uni-padding-wrap uni-common-mt\">\r\n <view class=\"uni-common-mt\" style=\"border-width: 2px;border-style: solid; border-radius: 4px;\">\r\n <textarea :value=\"res\" class=\"uni-textarea\" style=\"width: 100%;\"></textarea>\r\n </view>\r\n <view>\r\n <text>åœ°å€ : {{ host + url}}</text>\r\n <text>è¯·æ±‚æ–¹å¼ : {{method}}</text>\r\n </view>\r\n <view class=\"uni-btn-v uni-common-mt\">\r\n <button type=\"primary\" @click=\"sendRequest\">å‘起请求</button>\r\n </view>\r\n </view>\r\n <scroll-view style=\"flex: 1;\" show-scrollbar=\"true\">\r\n <view style=\"padding: 20px;\">\r\n <text>设置请求方å¼</text>\r\n <view class=\"uni-common-pb\"></view>\r\n <view style=\"flex-direction: row;flex-wrap: wrap;\">\r\n <button style=\"padding: 5px; margin-right: 10px;\" type=\"primary\" size=\"mini\"\r\n @click=\"changeMethod('GET')\">GET</button>\r\n <button style=\"padding: 5px; margin-right: 10px; \" type=\"primary\" size=\"mini\"\r\n @click=\"changeMethod('POST')\">POST</button>\r\n <button style=\"padding: 5px; margin-right: 10px; \" type=\"primary\" size=\"mini\"\r\n @click=\"changeMethod('PUT')\">PUT</button>\r\n <button style=\"padding: 5px; margin-right: 10px;\" type=\"primary\" size=\"mini\"\r\n @click=\"changeMethod('DELETE')\">DELETE</button>\r\n <button style=\"padding: 5px; margin-right: 10px; \" type=\"primary\" size=\"mini\"\r\n @click=\"changeMethod('PATCH')\">PATCH</button>\r\n <button style=\"padding: 5px;margin-right: 10px;\" type=\"primary\" size=\"mini\"\r\n @click=\"changeMethod('OPTIONS')\">OPTIONS</button>\r\n <button style=\"padding: 5px;\" type=\"primary\" size=\"mini\" @click=\"changeMethod('HEAD')\">HEAD</button>\r\n </view>\r\n </view>\r\n <view style=\"padding: 20px;\">\r\n <text>请求返回错误ç 的接å£ï¼ˆé»˜è®¤ä¸ºGET)</text>\r\n <view class=\"uni-common-pb\"></view>\r\n <view style=\"flex-direction: row;flex-wrap: wrap;\">\r\n <button style=\"padding: 5px;\" type=\"primary\" size=\"mini\" v-for=\"(item, index) in errorCodeUrls\" :key=\"index\"\r\n @click=\"changeUrl(item)\">{{item}}</button>\r\n </view>\r\n </view>\r\n <view style=\"padding: 20px;\">\r\n <text>请求ä¸åŒheader的接å£ï¼ˆé»˜è®¤ä¸ºGET)</text>\r\n <view class=\"uni-common-pb\"></view>\r\n <view style=\"flex-direction: row;flex-wrap: wrap;\">\r\n <button style=\"padding: 5px;\" type=\"primary\" size=\"mini\" v-for=\"(item, index) in headerUrls\" :key=\"index\"\r\n @click=\"changeUrl(item)\">{{item}}</button>\r\n </view>\r\n </view>\r\n <view style=\"padding: 20px;\">\r\n <text>请求ä¸åŒcontent-type的接å£ï¼ˆé»˜è®¤ä¸ºGET)</text>\r\n <view class=\"uni-common-pb\"></view>\r\n <view style=\"flex-direction: row;flex-wrap: wrap;\">\r\n <button style=\"padding: 5px;\" type=\"primary\" size=\"mini\" v-for=\"(item, index) in contentTypeUrls\" :key=\"index\"\r\n @click=\"changeUrl(item)\">{{item}}</button>\r\n </view>\r\n </view>\r\n\r\n <view style=\"padding: 20px;\">\r\n <text>POST请求(有body)</text>\r\n <view class=\"uni-common-pb\"></view>\r\n <view style=\"flex-direction: row;flex-wrap: wrap;\">\r\n <button style=\"padding: 5px;\" type=\"primary\" size=\"mini\" v-for=\"(item, index) in postUrls\" :key=\"index\"\r\n @click=\"changeUrlFromPost(item)\">{{item}}</button>\r\n </view>\r\n </view>\r\n </scroll-view>\r\n </view>\r\n</template>\r\n\r\n\n```\n>Script\n```uts\n\n // #ifdef APP\n import {\n testInovkeRequest,\n CommonOptions\n } from '@/uni_modules/test-invoke-network-api'\n // #endif\n\n class GETDataType {\n data: UTSJSONObject | null = null\n }\n\r\n const duration = 2000\r\n const methodMap = {\r\n \"GET\": \"/api/http/method/get\",\r\n \"POST\": \"/api/http/method/post\",\r\n \"PUT\": \"/api/http/method/put\",\r\n \"DELETE\": \"/api/http/method/delete\",\r\n \"PATCH\": \"/api/http/method/patch\",\r\n \"OPTIONS\": \"/api/http/method/options\",\r\n \"HEAD\": \"/api/http/method/head\"\r\n }\r\n\r\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'request',\r\n res: '',\r\n task: null as RequestTask | null,\r\n host: \"https://request.dcloud.net.cn\",\r\n url: \"/api/http/method/get\",\r\n method: \"GET\" as RequestMethod | null,\r\n data: null as any | null,\r\n header: null as UTSJSONObject | null,\r\n errorCodeUrls: [\r\n \"/api/http/statusCode/200\",\r\n \"/api/http/statusCode/204\",\r\n \"/api/http/statusCode/301\",\r\n \"/api/http/statusCode/302\",\r\n \"/api/http/statusCode/307\",\r\n \"/api/http/statusCode/400\",\r\n \"/api/http/statusCode/401\",\r\n \"/api/http/statusCode/403\",\r\n \"/api/http/statusCode/404\",\r\n \"/api/http/statusCode/405\",\r\n \"/api/http/statusCode/500\",\r\n \"/api/http/statusCode/502\",\r\n \"/api/http/statusCode/503\",\r\n \"/api/http/statusCode/504\",\r\n ],\r\n headerUrls: [\r\n \"/api/http/header/ua\",\r\n \"/api/http/header/referer\",\r\n \"/api/http/header/requestCookie\",\r\n \"/api/http/header/setCookie\",\r\n \"/api/http/header/deleteCookie\"\r\n ],\r\n contentTypeUrls: [\r\n \"/api/http/contentType/text/plain\",\r\n \"/api/http/contentType/text/html\",\r\n \"/api/http/contentType/text/xml\",\r\n \"/api/http/contentType/image/gif\",\r\n \"/api/http/contentType/image/jpeg\",\r\n \"/api/http/contentType/image/png\",\r\n \"/api/http/contentType/application/json\",\r\n \"/api/http/contentType/application/octetStream\",\r\n ],\r\n postUrls: [\r\n \"/api/http/contentType/json\",\r\n \"/api/http/contentType/xWwwFormUrlencoded\",\r\n ],\r\n //自动化测试例专用\r\n jest_result: false\r\n }\r\n },\r\n onLoad() {\r\n },\r\n onUnload() {\r\n uni.hideLoading();\r\n this.task?.abort();\r\n },\r\n methods: {\r\n changeMethod(e : RequestMethod) {\r\n this.method = e;\r\n this.url = methodMap[e] as string;\r\n this.data = null;\r\n this.header = null;\r\n },\r\n changeUrl(e : string) {\r\n this.method = \"GET\";\r\n this.url = e;\r\n this.data = null;\r\n this.header = null;\r\n },\r\n changeUrlFromPost(e : string) {\r\n this.method = \"POST\";\r\n this.url = e;\r\n switch (e) {\r\n case \"/api/http/contentType/json\":\r\n this.header = {\r\n \"Content-Type\": \"application/json\"\r\n };\r\n this.data = {\r\n \"hello\": \"world\"\r\n };\r\n break;\r\n case \"/api/http/contentType/xWwwFormUrlencoded\":\r\n this.header = {\r\n \"Content-Type\": \"application/x-www-form-urlencoded\"\r\n };\r\n this.data = \"hello=world\";\r\n break;\r\n }\r\n },\r\n sendRequest() {\r\n uni.showLoading({\r\n title: \"请求ä¸...\"\r\n })\r\n this.task = uni.request({\r\n url: this.host + this.url,\r\n // dataType: \"json\",\r\n // responseType: \"json\",\r\n method: this.method,\r\n data: this.data,\r\n header: this.header,\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: (res) => {\r\n console.log('request success', JSON.stringify(res.data))\r\n console.log('request success header is :', JSON.stringify(res.header))\r\n uni.showToast({\r\n title: '请求æˆåŠŸ',\r\n icon: 'success',\r\n mask: true,\r\n duration: duration\r\n });\r\n this.res = '请求结果 : ' + JSON.stringify(res);\r\n },\r\n fail: (err) => {\r\n console.log('request fail', err);\r\n uni.showModal({\r\n content: err.errMsg,\r\n showCancel: false\r\n });\r\n },\r\n complete: () => {\r\n uni.hideLoading()\r\n },\r\n });\r\n },\r\n //自动化测试例专用\r\n jest_request() {\r\n uni.request({\r\n url: this.host + this.url,\r\n // dataType: \"json\",\r\n // responseType: \"json\",\r\n method: this.method,\r\n data: this.data,\r\n header: this.header,\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: () => {\r\n this.jest_result = true;\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\r\n jest_set_cookie() {\r\n uni.request({\r\n url: this.host + \"/api/http/header/setCookie\",\r\n method: \"GET\",\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: () => {\r\n this.jest_cookie_request(true)\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\r\n jest_delete_cookie() {\r\n uni.request({\r\n url: this.host + \"/api/http/header/deleteCookie\",\r\n method: \"GET\",\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: () => {\r\n this.jest_cookie_request(false)\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\r\n jest_cookie_request(needCookie : boolean) {\r\n uni.request({\r\n url: this.host + \"/api/http/header/requestCookie\",\r\n method: \"GET\",\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: (res) => {\n const requestCookie = (res.data as UTSJSONObject).getJSON(\"data\")?.getAny(\"requestCookie\")\r\n console.log(\"requestCookie \", requestCookie);\r\n if (requestCookie instanceof Array) {\r\n this.jest_result = needCookie ? requestCookie.length > 0 : requestCookie.length == 0\r\n } else {\r\n this.jest_result = needCookie ? (requestCookie as UTSJSONObject).toMap().size > 0 : (requestCookie as UTSJSONObject).toMap().size == 0\r\n }\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\r\n jest_timeout_null() {\r\n uni.request({\r\n url: this.host + (methodMap['GET'] as string),\r\n method: \"GET\",\r\n timeout: null,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: () => {\n this.jest_result = true;\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\n jest_get_with_data() {\n uni.request({\n url: \"https://unidemo.dcloud.net.cn/api/banner/36kr\",\n method: \"GET\",\n data:{\n column: 'id,post_id,title,author_name,cover,published_at' //需è¦çš„å—段å\n },\n timeout: 6000,\n sslVerify: false,\n withCredentials: false,\n firstIpv4: false,\n success: () => {\n this.jest_result = true;\n },\n fail: () => {\n this.jest_result = false;\n },\n });\n },\n jest_get_with_generics() {\n uni.request<GETDataType>({\n url: this.host + (methodMap['GET'] as string),\n method: \"GET\",\n timeout: null,\n sslVerify: false,\n withCredentials: false,\n firstIpv4: false,\n success: (res: RequestSuccess<GETDataType>) => {\n console.log(\"success :\", res.data?.data);\n this.jest_result = true;\n },\n fail: () => {\n this.jest_result = false;\n },\n });\n },\n jest_get_array() {\n uni.request<UTSJSONObject[]>({\n url: 'https://unidemo.dcloud.net.cn/api/news?column=title,author_name,cover,published_at',\n method: \"GET\",\n success: (res : RequestSuccess<UTSJSONObject[]>) => {\n console.log(res)\n if (res.statusCode == 200 && Array.isArray(res.data)) {\n this.jest_result = true\n } else {\n this.jest_result = false\n }\n },\n fail: () => {\n this.jest_result = false\n }\n });\n },\n jest_uts_module_invoked(){\n // #ifdef APP\n testInovkeRequest({\n success:(res: any)=>{\n console.log(\"success :\", res);\n this.jest_result = true\n },\n fail:(err: any)=>{\n console.log(\"fail :\", err);\n this.jest_result = false\n }\n } as CommonOptions)\n // #endif\n }\r\n }\r\n }\r\n\n```\n:::"},"uploadFile":{"name":"## uni.uploadFile(options) @uploadfile","description":"将本地资æºä¸Šä¼ 到开å‘者æœåŠ¡å™¨ã€‚","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [UploadFileOptions](#uploadfileoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| url | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¼€å‘者æœåŠ¡å™¨ url |\n@| filePath | string \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | è¦ä¸Šä¼ 文件资æºçš„路径, 支æŒuni.env |\n@| name | string \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 文件对应的 key , å¼€å‘者在æœåŠ¡å™¨ç«¯é€šè¿‡è¿™ä¸ª key å¯ä»¥èŽ·å–到文件二进制内容 |\n@| files | Array\\<**UploadFileOptionFiles**\\> \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 需è¦ä¸Šä¼ 的文件列表。 |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| name | string \\| null | å¦ | \"file\" | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | multipart æ交时,表å•çš„项目å,默认为 file,如果 name ä¸å¡«æˆ–填的值相åŒï¼Œå¯èƒ½å¯¼è‡´æœåŠ¡ç«¯è¯»å–文件时åªèƒ½è¯»å–到一个文件。 |\n@@| uri | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | è¦ä¸Šä¼ 文件资æºçš„路径 |\n@@| file | any \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | è¦ä¸Šä¼ 的文件对象 |\n@| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | HTTP 请求 Header, header ä¸ä¸èƒ½è®¾ç½® Referer |\n@| formData | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | HTTP 请求ä¸å…¶ä»–é¢å¤–çš„ form data |\n@| timeout | number \\| null | å¦ | 120000 | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 超时时间,å•ä½ ms |\n@| success | (result: [UploadFileSuccess](#uploadfilesuccess-values)) => void \\| null | å¦ | null | - | æˆåŠŸè¿”回的回调函数 |\n@| fail | (result: [UploadFileFail](#uploadfilefail-values)) => void \\| null | å¦ | null | - | 失败的回调函数 |\n@| complete | (result: any) => void \\| null | å¦ | null | - | 结æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### UploadFileSuccess 的属性值 @uploadfilesuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| data | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¼€å‘者æœåŠ¡å™¨è¿”å›žçš„æ•°æ® |\n| statusCode | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¼€å‘者æœåŠ¡å™¨è¿”回的 HTTP 状æ€ç |\n\n##### UploadFileFail 的属性值 @uploadfilefail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 5 \\| 1000 \\| 100001 \\| 100002 \\| 600003 \\| 600009 \\| 602001 | 是 | - | - | 错误ç <br/>- 5 接å£è¶…æ—¶<br/>- 1000 æœåŠ¡ç«¯ç³»ç»Ÿé”™è¯¯<br/>- 100001 jsonæ•°æ®è§£æžé”™è¯¯<br/>- 100002 错误信æ¯json解æžå¤±è´¥<br/>- 600003 网络ä¸æ–<br/>- 600009 URLæ ¼å¼ä¸åˆæ³•<br/>- 602001 request系统错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [UploadTask](#uploadtask-values) |\n\n#### UploadTask 的方法 @uploadtask-values \n\n#### abort() @abort\nä¸æ–ä¸Šä¼ ä»»åŠ¡ã€‚\n\n\n##### abort 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n\n\n##### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/network-file.html#uploadfile)\n\n#### onProgressUpdate(callback) @onprogressupdate\n监å¬ä¸Šä¼ 进度å˜åŒ–。\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [OnProgressUpdateResult](#onprogressupdateresult-values)) => void | 是 | - | - | | \n\n##### OnProgressUpdateResult 的属性值 @onprogressupdateresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| progress | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | ä¸Šä¼ è¿›åº¦ç™¾åˆ†æ¯” |\n| totalBytesSent | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å·²ç»ä¸Šä¼ çš„æ•°æ®é•¿åº¦ï¼Œå•ä½ Bytes |\n| totalBytesExpectedToSend | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 预期需è¦ä¸Šä¼ çš„æ•°æ®æ€»é•¿åº¦ï¼Œå•ä½ Bytes |\n\n\n##### onProgressUpdate 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n\n\n##### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/network-file.html#uploadfile)\n \n","compatibility":"### uploadFile 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/network-file.html#uploadfile)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.upload-file)\n"},"upload-file":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/upload-file/upload-file.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/upload-file/upload-file\n>Template\n```vue\n<template>\r\n <!-- #ifdef APP -->\r\n <scroll-view class=\"page-scroll-view\">\r\n <!-- #endif -->\r\n <view>\r\n <page-head :title=\"title\"></page-head>\r\n <view class=\"uni-padding-wrap uni-common-mt\">\r\n <view class=\"demo\">\r\n <image v-if=\"imageSrc\" :src=\"imageSrc\" class=\"image\" mode=\"widthFix\"></image>\r\n <text v-else class=\"uni-hello-addfile\" @click=\"chooseImage\">+ 选择图片</text>\r\n </view>\r\n </view>\r\n </view>\r\n <!-- #ifdef APP -->\r\n </scroll-view>\r\n <!-- #endif -->\r\n</template>\r\n\r\n\r\n<style>\r\n .image {\r\n width: 100%;\r\n }\r\n\r\n .demo {\r\n background: #fff;\r\n padding: 25px;\r\n justify-content: center;\r\n align-items: center;\r\n }\r\n\r\n .uni-hello-addfile {\r\n text-align: center;\r\n background: #fff;\r\n padding: 25px;\r\n margin-top: 10px;\r\n font-size: 19px;\r\n color: #808080;\r\n }\r\n</style>\r\n\n```\n>Script\n```uts\n\n // #ifdef APP\n import {\n testInovkeUploadFile,\n CommonOptions\n } from '@/uni_modules/test-invoke-network-api'\n // #endif\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'uploadFile',\r\n imageSrc: '',\r\n task: null as UploadTask | null,\r\n //自动化测试例专用\r\n jest_result: false,\r\n }\r\n },\r\n onLoad() {\r\n },\r\n onUnload() {\r\n this.imageSrc = '';\r\n uni.hideLoading();\r\n this.task?.abort();\r\n },\r\n methods: {\r\n chooseImage: function () {\r\n uni.chooseImage({\r\n count: 1,\r\n sizeType: ['compressed'],\r\n sourceType: ['album'],\r\n success: (res) => {\r\n console.log('chooseImage success, temp path is', res.tempFilePaths[0])\r\n var imageSrc = res.tempFilePaths[0]\r\n uni.showLoading({\r\n title: 'ä¸Šä¼ ä¸'\r\n })\r\n this.task = uni.uploadFile({\r\n url: 'https://unidemo.dcloud.net.cn/upload', //仅为示例,éžçœŸå®žçš„接å£åœ°å€\r\n filePath: imageSrc,\r\n name: 'file',\r\n formData: {\r\n 'user': 'test'\r\n },\r\n success: (res) => {\r\n console.log('uploadImage success, res is:', res)\r\n uni.hideLoading();\r\n uni.showToast({\r\n title: 'ä¸Šä¼ æˆåŠŸ',\r\n icon: 'success',\r\n duration: 1000\r\n })\r\n this.imageSrc = imageSrc\r\n },\r\n fail: (err) => {\r\n console.log('uploadImage fail', err);\r\n uni.hideLoading();\r\n uni.showModal({\r\n content: err.errMsg,\r\n showCancel: false\r\n });\r\n },\r\n });\r\n },\r\n fail: (err) => {\r\n console.log('chooseImage fail', err)\r\n }\r\n })\r\n },\r\n //自动化测试例专用\r\n jest_uploadFile() {\r\n const imageSrc = \"/static/uni.png\";\r\n this.task = uni.uploadFile({\r\n url: 'https://unidemo.dcloud.net.cn/upload', //仅为示例,éžçœŸå®žçš„接å£åœ°å€\r\n filePath: imageSrc,\r\n name: 'file',\r\n formData: {\r\n 'user': 'test'\r\n },\r\n success: () => {\r\n this.jest_result = true;\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n })\r\n },\r\n jest_set_cookie() {\r\n uni.request({\r\n url: \"https://request.dcloud.net.cn/api/http/header/setCookie\",\r\n method: \"GET\",\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: () => {\r\n this.jest_cookie_upload(true)\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\r\n\r\n jest_delete_cookie() {\r\n uni.request({\r\n url: \"https://request.dcloud.net.cn/api/http/header/deleteCookie\",\r\n method: \"GET\",\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: () => {\r\n this.jest_cookie_upload(false)\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\r\n jest_cookie_upload(needCookie : boolean) {\r\n const imageSrc = \"/static/uni.png\";\r\n this.task = uni.uploadFile({\r\n url: 'https://request.dcloud.net.cn/api/http/header/upload',\r\n filePath: imageSrc,\r\n name: 'file',\r\n success: (res : UploadFileSuccess) => {\r\n const data = JSON.parseObject(res.data)\r\n const errCode = data?.getNumber(\"errCode\")\r\n if (errCode != null && errCode == 1000) {\r\n this.jest_result = needCookie ? false : true;\r\n } else {\r\n this.jest_result = needCookie ? true : false;\r\n }\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n })\r\n },\r\n jest_files_upload() {\r\n const imageSrc = \"/static/uni.png\";\r\n this.task = uni.uploadFile({\r\n url: 'https://unidemo.dcloud.net.cn/upload',\r\n files: [\r\n {\r\n name: \"file1\",\r\n uri: imageSrc\r\n } as UploadFileOptionFiles,\r\n {\r\n name: \"file2\",\r\n uri: imageSrc\r\n } as UploadFileOptionFiles\r\n ],\r\n success: (res : UploadFileSuccess) => {\r\n if (res.statusCode == 200) {\r\n this.jest_result = true;\r\n }\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n })\r\n },\n jest_uts_module_invoked(){\n // #ifdef APP\n testInovkeUploadFile({\n success:(res: any)=>{\n console.log(\"success :\", res);\n this.jest_result = true\n },\n fail:(err: any)=>{\n console.log(\"fail :\", err);\n this.jest_result = false\n }\n } as CommonOptions)\n // #endif\n }\r\n }\r\n }\r\n\n```\n:::"},"downloadFile":{"name":"## uni.downloadFile(options) @downloadfile","description":"下载文件资æºåˆ°æœ¬åœ°ï¼Œå®¢æˆ·ç«¯ç›´æŽ¥å‘起一个 HTTP GET 请求,返回文件的本地临时路径。","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [DownloadFileOptions](#downloadfileoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| url | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 下载资æºçš„ url |\n@| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | HTTP 请求 Header,header ä¸ä¸èƒ½è®¾ç½® Referer |\n@| filePath | string \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 指定文件下载路径<br/>支æŒç›¸å¯¹è·¯å¾„与ç»å¯¹è·¯å¾„,例:<br/>`/imgs/pic.png`ã€`/storage/emulated/0/Android/data/io.dcloud.HBuilder/apps/HBuilder/temp/imgs/pic.png`<br/>并且支æŒæŒ‡å®šä¸‹è½½ç›®å½•ï¼Œä¾‹ï¼š<br/>`/imgs/`<br/>支æŒuni.envçš„å¹³å°å…¼å®¹æ€§ï¼šAndroid自3.9开始支æŒuni.env,iOS自4.13开始支æŒuni.env |\n@| timeout | number \\| null | å¦ | 120000 | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 超时时间,å•ä½ ms |\n@| success | (result: [DownloadFileSuccess](#downloadfilesuccess-values)) => void \\| null | å¦ | null | - | 下载æˆåŠŸåŽä»¥ tempFilePath çš„å½¢å¼ä¼ 给页é¢ï¼Œres = {tempFilePath: '文件的临时路径'} |\n@| fail | (result: [DownloadFileFail](#downloadfilefail-values)) => void \\| null | å¦ | null | - | 失败的回调函数 |\n@| complete | (result: any) => void \\| null | å¦ | null | - | 结æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### DownloadFileSuccess 的属性值 @downloadfilesuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| tempFilePath | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 临时文件路径,下载åŽçš„文件会å˜å‚¨åˆ°ä¸€ä¸ªä¸´æ—¶æ–‡ä»¶ |\n| statusCode | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¼€å‘者æœåŠ¡å™¨è¿”回的 HTTP 状æ€ç |\n\n##### DownloadFileFail 的属性值 @downloadfilefail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 5 \\| 1000 \\| 100001 \\| 100002 \\| 600003 \\| 600009 \\| 602001 | 是 | - | - | 错误ç <br/>- 5 接å£è¶…æ—¶<br/>- 1000 æœåŠ¡ç«¯ç³»ç»Ÿé”™è¯¯<br/>- 100001 jsonæ•°æ®è§£æžé”™è¯¯<br/>- 100002 错误信æ¯json解æžå¤±è´¥<br/>- 600003 网络ä¸æ–<br/>- 600009 URLæ ¼å¼ä¸åˆæ³•<br/>- 602001 request系统错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [DownloadTask](#downloadtask-values) |\n\n#### DownloadTask 的方法 @downloadtask-values \n\n#### abort() @abort\nä¸æ–下载任务。\n\n\n##### abort 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n\n\n##### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/network-file.html#downloadfile)\n\n#### onProgressUpdate(callback) @onprogressupdate\n监å¬ä¸‹è½½è¿›åº¦å˜åŒ–。\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [OnProgressDownloadResult](#onprogressdownloadresult-values)) => void | 是 | - | - | | \n\n##### OnProgressDownloadResult 的属性值 @onprogressdownloadresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| progress | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 下载进度百分比 |\n| totalBytesWritten | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å·²ç»ä¸‹è½½çš„æ•°æ®é•¿åº¦ï¼Œå•ä½ Bytes |\n| totalBytesExpectedToWrite | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 预期需è¦ä¸‹è½½çš„æ•°æ®æ€»é•¿åº¦ï¼Œå•ä½ Bytes |\n\n\n##### onProgressUpdate 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n\n\n##### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/network-file.html#downloadfile)\n \n","compatibility":"### downloadFile 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/network-file.html#downloadfile)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.download-file)\n"},"download-file":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/download-file/download-file.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/download-file/download-file\n>Template\n```vue\n<template>\r\n <!-- #ifdef APP -->\r\n <scroll-view style=\"flex: 1\">\r\n <!-- #endif -->\r\n <view>\r\n <page-head :title=\"title\"></page-head>\r\n <view>\r\n <view v-if=\"imageSrc\">\r\n <image class=\"img\" :src=\"imageSrc\" mode=\"aspectFit\" />\r\n </view>\r\n <view v-else style=\"margin: 10px;\">\r\n <text class=\"uni-hello-text\">点击按钮下载æœåŠ¡ç«¯ç¤ºä¾‹å›¾ç‰‡ï¼ˆä¸‹è½½ç½‘络文件到本地临时目录)</text>\r\n <button type=\"primary\" @tap=\"downloadImage\">下载</button>\r\n </view>\r\n </view>\r\n </view>\r\n <!-- #ifdef APP -->\r\n </scroll-view>\r\n <!-- #endif -->\r\n</template>\r\n\r\n\r\n<style>\r\n .img {\r\n margin: 0 auto;\r\n }\r\n</style>\n\n```\n>Script\n```uts\n\n\n // #ifdef APP\n import {\n testInovkeDownloadFile,\n CommonOptions\n } from '@/uni_modules/test-invoke-network-api'\n // #endif\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'downloadFile',\r\n imageSrc: '',\r\n task: null as DownloadTask | null,\r\n //自动化测试例专用\r\n jest_result: false\r\n }\r\n },\r\n onLoad() {\r\n },\r\n onUnload() {\r\n // this.imageSrc = '';\r\n uni.hideLoading();\r\n this.task?.abort();\r\n },\r\n methods: {\r\n downloadImage: function () {\r\n uni.showLoading({\r\n title: '下载ä¸'\r\n })\r\n var self = this\r\n this.task = uni.downloadFile({\r\n url: \"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni-app.png\",\r\n success: (res) => {\r\n console.log('downloadFile success, res is', res.tempFilePath)\r\n self.imageSrc = res.tempFilePath;\r\n uni.hideLoading();\r\n },\r\n fail: (err) => {\r\n console.log('downloadFile fail, err is:', err)\r\n uni.hideLoading();\r\n }\r\n });\r\n this.task?.onProgressUpdate((update) => {\r\n console.log(\"progress : \", update.progress);\r\n })\r\n },\r\n //自动化测试例专用\r\n jest_downloadFile() {\r\n uni.downloadFile({\r\n url: \"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni-app.png\",\r\n success: () => {\r\n this.jest_result = true\r\n },\r\n fail: () => {\r\n this.jest_result = false\r\n }\r\n });\r\n },\n\n jest_downloadFile_with_uni_env() {\n uni.downloadFile({\n url: \"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni-app.png\",\n filePath: `${uni.env.CACHE_PATH}/a/b/`,\n success: () => {\n this.jest_result = true\n },\n fail: () => {\n this.jest_result = false\n }\n });\n },\n\n jest_set_cookie(){\n uni.request({\n url: \"https://request.dcloud.net.cn/api/http/header/setCookie\",\n method: \"GET\",\n timeout: 6000,\n sslVerify: false,\n withCredentials: true,\n firstIpv4: false,\n success: () => {\n this.jest_cookie_download(true)\n },\n fail: () => {\n this.jest_result = false;\n },\n });\n },\n\n jest_delete_cookie(){\n uni.request({\n url: \"https://request.dcloud.net.cn/api/http/header/deleteCookie\",\n method: \"GET\",\n timeout: 6000,\n sslVerify: false,\n withCredentials: true,\n firstIpv4: false,\n success: () => {\n this.jest_cookie_download(false)\n },\n fail: () => {\n this.jest_result = false;\n },\n });\n },\n jest_cookie_download(needCookie: boolean){\n uni.downloadFile({\n url: \"https://request.dcloud.net.cn/api/http/header/download\",\n success: () => {\n this.jest_result = needCookie ? true : false;\n },\n fail: () => {\n this.jest_result = needCookie ? false : true;\n }\n });\n },\n jest_uts_module_invoked(){\n // #ifdef APP\n testInovkeDownloadFile({\n success:(res: any)=>{\n console.log(\"success :\", res);\n this.jest_result = true\n },\n fail:(err: any)=>{\n console.log(\"fail :\", err);\n this.jest_result = false\n }\n } as CommonOptions)\n // #endif\n },\n jest_special_characters_download(){\n uni.downloadFile({\n url: \"https://web-ext-storage.dcloud.net.cn/hello-uni-app-x/1789834995055525889-ä½ å¥½%23ä½ å¥½.png\",\n success: (res: DownloadFileSuccess) => {\n this.jest_result = true;\n console.log(\"res :\", res);\n },\n fail: () => {\n this.jest_result = false;\n }\n });\n }\r\n }\r\n }\r\n\n```\n:::"},"getNetworkType":{"name":"## uni.getNetworkType(options) @getnetworktype","description":"获å–网络类型","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [GetNetworkTypeOptions](#getnetworktypeoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (result: [GetNetworkTypeSuccess](#getnetworktypesuccess-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### GetNetworkTypeSuccess 的属性值 @getnetworktypesuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| networkType | string | 是 | - | - | 网络类型 |\n","returnValue":"","compatibility":"### getNetworkType 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/system/network?id=getnetworktype)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.get-network-type)\n"},"get-network-type":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-network-type/get-network-type.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-network-type/get-network-type\n>Template\n```vue\n<template>\r\n <page-head :title=\"title\"></page-head>\r\n <view class=\"uni-padding-wrap uni-common-mt\">\r\n <view style=\"background:#FFFFFF; padding:20px;\">\r\n <view class=\"uni-center\">网络状æ€</view>\r\n <view v-if=\"hasNetworkType == false\">\r\n <view class=\"uni-center uni-common-mt\">未获å–</view>\r\n <view class=\"uni-center uni-common-mt\">请点击下é¢æŒ‰é’®èŽ·å–网络状æ€</view>\r\n </view>\r\n <view v-if=\"hasNetworkType == true\">\r\n <view class=\"uni-center uni-common-mt\">{{networkType}}</view>\r\n </view>\r\n </view>\r\n <view class=\"uni-btn-v uni-common-mt\">\r\n <button type=\"primary\" @tap=\"getNetworkType\">获å–设备网络状æ€</button>\r\n <button class=\"uni-common-mt\" @tap=\"clear\">清空</button>\r\n </view>\r\n </view>\r\n</template>\r\n\r\n\r\n<style>\r\n\r\n</style>\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'getNetworkType',\r\n hasNetworkType: false,\r\n networkType: '',\r\n connectedWifi: '',\r\n //自动化测试例专用\r\n jest_result: false,\r\n }\r\n },\r\n onLoad() {\r\n },\r\n onUnload: function () {\r\n this.networkType = '';\r\n this.hasNetworkType = false;\r\n },\r\n methods: {\r\n getNetworkType: function () {\r\n uni.getNetworkType({\r\n success: (res) => {\r\n console.log(res)\r\n this.hasNetworkType = true;\r\n this.networkType = res.networkType\r\n },\r\n fail: () => {\r\n uni.showModal({\r\n content: '获å–失败ï¼',\r\n showCancel: false\r\n })\r\n }\r\n })\r\n },\r\n clear: function () {\r\n this.hasNetworkType = false;\r\n this.networkType = '';\r\n this.connectedWifi = '';\r\n },\r\n //自动化测试例专用\r\n jest_getNetworkType() {\r\n uni.getNetworkType({\r\n success: () => {\r\n this.jest_result = true;\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n }\r\n })\r\n }\r\n }\r\n }\r\n\n```\n:::"},"connectSocket":{"name":"## connectSocket(options) @connectsocket","description":"创建一个 WebSocket 连接。","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ConnectSocketOptions](#connectsocketoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| url | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | å¼€å‘者æœåŠ¡å™¨æŽ¥å£åœ°å€ |\n@| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 如果属性åå˜åœ¨ï¼Œä¸”类型为UTSJSONObject返回对应的结果,ä¸å˜åœ¨è¿”回null |\n@| protocols | Array\\<string\\> \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | åå议数组 |\n@| success | (result: [ConnectSocketSuccess](#connectsocketsuccess-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [ConnectSocketFail](#connectsocketfail-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### ConnectSocketSuccess 的属性值 @connectsocketsuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n\n##### ConnectSocketFail 的属性值 @connectsocketfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | 错误ç <br/>- 600009 URLæ ¼å¼ä¸åˆæ³• |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [SocketTask](#sockettask-values) |\n\n#### SocketTask 的方法 @sockettask-values \n\n#### send(options) @send\n通过 WebSocket 连接å‘é€æ•°æ®\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [SendSocketMessageOptions](#sendsocketmessageoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| data | any | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 需è¦å‘é€çš„内容 |\n@| success | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [SendSocketMessageFail](#sendsocketmessagefail-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SendSocketMessageFail 的属性值 @sendsocketmessagefail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 10001 \\| 10002 \\| 602001 | 是 | - | - | 错误ç <br/>- 10001 å‘é€æ•°æ®è¶…é™ï¼Œå‘é€é˜Ÿåˆ—ä¸èƒ½è¶…过16M大å°ã€‚<br/>- 10002 websocket未连接<br/>- 602001 websocket系统错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n\n##### send 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n\n\n##### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-send)\n\n#### close(options) @close\nå…³é— WebSocket 连接\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **CloseSocketOptions** | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| code | number \\| null | å¦ | 1000 | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 一个数å—值表示关é—连接的状æ€å·ï¼Œè¡¨ç¤ºè¿žæŽ¥è¢«å…³é—çš„åŽŸå› ã€‚å¦‚æžœè¿™ä¸ªå‚数没有被指定,默认的å–值是1000 (表示æ£å¸¸è¿žæŽ¥å…³é—) |\n@| reason | string \\| null | å¦ | \"\" | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 一个å¯è¯»çš„å—符串,表示连接被关é—çš„åŽŸå› ã€‚è¿™ä¸ªå—符串必须是ä¸é•¿äºŽ123å—节的UTF-8 文本(ä¸æ˜¯å—符) |\n@| success | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### close 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n\n\n##### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-close)\n\n#### onOpen(callback) @onopen\nç›‘å¬ WebSocket 连接打开事件\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | **OnSocketOpenCallbackResult** | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| header | any | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 连接æˆåŠŸçš„ HTTP å“应 Header | \n\n\n##### onOpen 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n\n\n##### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onopen)\n\n#### onClose(callback) @onclose\nç›‘å¬ WebSocket 连接关é—事件\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: any) => void | 是 | - | - | | \n\n\n##### onClose 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n\n\n##### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onclose)\n\n#### onError(callback) @onerror\nç›‘å¬ WebSocket 错误\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 是 | - | - | | \n\n\n##### onError 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n\n\n##### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onerror)\n\n#### onMessage(callback) @onmessage\nç›‘å¬ WebSocket 接å—到æœåŠ¡å™¨çš„消æ¯äº‹ä»¶\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [OnSocketMessageCallbackResult](#onsocketmessagecallbackresult-values)) => void | 是 | - | - | | \n\n##### OnSocketMessageCallbackResult 的属性值 @onsocketmessagecallbackresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| data | any | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | æœåŠ¡å™¨è¿”å›žçš„æ¶ˆæ¯ |\n\n\n##### onMessage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n\n\n##### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onmessage)\n \n","compatibility":"### connectSocket 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/websocket.html#connectsocket)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.connectSocket)\n"},"onSocketOpen":{"name":"## onSocketOpen(options) @onsocketopen","description":"监å¬WebSocket连接打开事件。","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | (result: [OnSocketOpenCallbackResult](#onsocketopencallbackresult-values)) => void | 是 | - | - | | \n","returnValue":"","compatibility":"### onSocketOpen 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketopen)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.onSocketOpen)\n"},"onSocketError":{"name":"## onSocketError(callback) @onsocketerror","description":"下载文件资æºåˆ°æœ¬åœ°ï¼Œå®¢æˆ·ç«¯ç›´æŽ¥å‘起一个 HTTP GET 请求,返回文件的本地临时路径。","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [OnSocketErrorCallbackResult](#onsocketerrorcallbackresult-values)) => void | 是 | - | - | | \n\n#### OnSocketErrorCallbackResult 的属性值 @onsocketerrorcallbackresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | é”™è¯¯ä¿¡æ¯ |\n","returnValue":"","compatibility":"### onSocketError 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketerror)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.onSocketError)\n"},"sendSocketMessage":{"name":"## sendSocketMessage(options) @sendsocketmessage","description":"通过 WebSocket 连接å‘é€æ•°æ®ï¼Œéœ€è¦å…ˆ uni.connectSocket,并在 uni.onSocketOpen 回调之åŽæ‰èƒ½å‘é€ã€‚","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [SendSocketMessageOptions](#sendsocketmessageoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| data | any | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 需è¦å‘é€çš„内容 |\n@| success | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [SendSocketMessageFail](#sendsocketmessagefail-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SendSocketMessageFail 的属性值 @sendsocketmessagefail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 10001 \\| 10002 \\| 602001 | 是 | - | - | 错误ç <br/>- 10001 å‘é€æ•°æ®è¶…é™ï¼Œå‘é€é˜Ÿåˆ—ä¸èƒ½è¶…过16M大å°ã€‚<br/>- 10002 websocket未连接<br/>- 602001 websocket系统错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### sendSocketMessage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/websocket.html#sendsocketmessage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.sendSocketMessage)\n"},"onSocketMessage":{"name":"## onSocketMessage(callback) @onsocketmessage","description":"监å¬WebSocket接å—到æœåŠ¡å™¨çš„消æ¯äº‹ä»¶ã€‚","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [OnSocketMessageCallbackResult](#onsocketmessagecallbackresult-values)) => void | 是 | - | - | | \n\n#### OnSocketMessageCallbackResult 的属性值 @onsocketmessagecallbackresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| data | any | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | æœåŠ¡å™¨è¿”å›žçš„æ¶ˆæ¯ |\n","returnValue":"","compatibility":"### onSocketMessage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketmessage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.onSocketMessage)\n"},"closeSocket":{"name":"## closeSocket(options) @closesocket","description":"å…³é— WebSocket 连接。","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **CloseSocketOptions** | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| code | number \\| null | å¦ | 1000 | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 一个数å—值表示关é—连接的状æ€å·ï¼Œè¡¨ç¤ºè¿žæŽ¥è¢«å…³é—çš„åŽŸå› ã€‚å¦‚æžœè¿™ä¸ªå‚数没有被指定,默认的å–值是1000 (表示æ£å¸¸è¿žæŽ¥å…³é—) |\n@| reason | string \\| null | å¦ | \"\" | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 一个å¯è¯»çš„å—符串,表示连接被关é—çš„åŽŸå› ã€‚è¿™ä¸ªå—符串必须是ä¸é•¿äºŽ123å—节的UTF-8 文本(ä¸æ˜¯å—符) |\n@| success | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n","returnValue":"","compatibility":"### closeSocket 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/websocket.html#closesocket)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.closeSocket)\n"},"onSocketClose":{"name":"## onSocketClose(callback) @onsocketclose","description":"监å¬WebSocketå…³é—。","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [OnSocketCloseCallbackResult](#onsocketclosecallbackresult-values)) => void | 是 | - | - | | \n\n#### OnSocketCloseCallbackResult 的属性值 @onsocketclosecallbackresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| code | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 一个数å—值表示关é—连接的状æ€å·ï¼Œè¡¨ç¤ºè¿žæŽ¥è¢«å…³é—çš„åŽŸå› ã€‚ |\n| reason | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 一个å¯è¯»çš„å—符串,表示连接被关é—çš„åŽŸå› ã€‚\t |\n","returnValue":"","compatibility":"### onSocketClose 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketclose)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.onSocketClose)\n"},"websocket-global":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/websocket-global/websocket-global.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/websocket-global/websocket-global\n>Template\n```vue\n<template>\r\n <page-head title=\"websocket通讯示例\"></page-head>\r\n <view class=\"uni-padding-wrap\">\r\n <view class=\"uni-btn-v\">\r\n <text class=\"websocket-msg\">{{ showMsg }}</text>\r\n <button class=\"uni-btn-v\" type=\"primary\" @click=\"connect\">\r\n 连接websocketæœåŠ¡\r\n </button>\r\n <button class=\"uni-btn-v\" v-show=\"connected\" type=\"primary\" @click=\"send\">\r\n å‘é€ä¸€æ¡æ¶ˆæ¯\r\n </button>\r\n <button class=\"uni-btn-v\" type=\"primary\" @click=\"close\">\r\n æ–å¼€websocketæœåŠ¡\r\n </button>\r\n <text class=\"websocket-tips\">å‘é€æ¶ˆæ¯åŽä¼šæ”¶åˆ°ä¸€æ¡æœåŠ¡å™¨è¿”回的消æ¯ï¼ˆä¸Žå‘é€çš„消æ¯å†…容一致)</text>\r\n </view>\r\n </view>\r\n</template>\r\n\r\n\r\n\r\n<style>\r\n .uni-btn-v {\r\n padding: 5px 0;\r\n }\r\n\r\n .uni-btn-v {\r\n margin: 10px 0;\r\n }\r\n\r\n .websocket-msg {\r\n padding: 40px 0px;\r\n text-align: center;\r\n font-size: 14px;\r\n line-height: 40px;\r\n color: #666666;\r\n }\r\n\r\n .websocket-tips {\r\n padding: 40px 0px;\r\n text-align: center;\r\n font-size: 14px;\r\n line-height: 24px;\r\n color: #666666;\r\n }\r\n</style>\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n connected: false,\r\n connecting: false,\r\n msg: '',\r\n roomId: '',\r\n platform: '',\r\n }\r\n },\r\n computed: {\r\n showMsg() : string {\r\n if (this.connected) {\r\n if (this.msg.length > 0) {\r\n return '收到消æ¯ï¼š' + this.msg\r\n } else {\r\n return 'ç‰å¾…接收消æ¯'\r\n }\r\n } else {\r\n return '尚未连接'\r\n }\r\n },\r\n },\r\n onLoad() {\r\n this.platform = uni.getSystemInfoSync().platform\r\n },\r\n onUnload() {\r\n uni.closeSocket({\r\n code: 1000,\r\n reason: 'close reason from client',\r\n success: (res : any) => {\r\n console.log('uni.closeSocket success', res)\r\n },\r\n fail: (err : any) => {\r\n console.log('uni.closeSocket fail', err)\r\n },\r\n } as CloseSocketOptions)\r\n uni.hideLoading()\r\n },\r\n methods: {\r\n connect() {\r\n if (this.connected || this.connecting) {\r\n uni.showModal({\r\n content: 'æ£åœ¨è¿žæŽ¥æˆ–者已ç»è¿žæŽ¥ï¼Œè¯·å‹¿é‡å¤è¿žæŽ¥',\r\n showCancel: false,\r\n })\r\n return\r\n }\r\n this.connecting = true\r\n uni.showLoading({\r\n title: '连接ä¸...',\r\n })\r\n uni.connectSocket({\r\n url: 'ws://websocket.dcloud.net.cn',\r\n header: null,\r\n protocols: null,\r\n success: (res : any) => {\r\n // 这里是接å£è°ƒç”¨æˆåŠŸçš„回调,ä¸æ˜¯è¿žæŽ¥æˆåŠŸçš„回调,请注æ„\r\n console.log('uni.connectSocket success', res)\r\n },\r\n fail: (err : any) => {\r\n // 这里是接å£è°ƒç”¨å¤±è´¥çš„回调,ä¸æ˜¯è¿žæŽ¥å¤±è´¥çš„回调,请注æ„\r\n console.log('uni.connectSocket fail', err)\r\n },\r\n })\r\n uni.onSocketOpen((res) => {\r\n this.connecting = false\r\n this.connected = true\r\n uni.hideLoading()\r\n\r\n uni.showToast({\r\n icon: 'none',\r\n title: '连接æˆåŠŸ',\r\n })\r\n console.log('onOpen', res)\r\n })\r\n uni.onSocketError((err) => {\r\n this.connecting = false\r\n this.connected = false\r\n uni.hideLoading()\r\n\r\n uni.showModal({\r\n content: '连接失败,å¯èƒ½æ˜¯websocketæœåŠ¡ä¸å¯ç”¨ï¼Œè¯·ç¨åŽå†è¯•',\r\n showCancel: false,\r\n })\r\n console.log('onError', err)\r\n })\r\n uni.onSocketMessage((res) => {\r\n this.msg = res.data as string\r\n console.log('onMessage', res)\r\n })\r\n uni.onSocketClose((res) => {\r\n this.connected = false\r\n this.msg = ''\r\n console.log('onClose', res)\r\n })\r\n },\r\n send() {\r\n uni.sendSocketMessage({\r\n data:\r\n 'from ' +\r\n this.platform +\r\n ' : ' +\r\n parseInt((Math.random() * 10000).toString()).toString(),\r\n success: (res : any) => {\r\n console.log(res)\r\n },\r\n fail: (err : any) => {\r\n console.log(err)\r\n },\r\n } as SendSocketMessageOptions)\r\n },\r\n close() {\r\n uni.closeSocket({\r\n code: 1000,\r\n reason: 'close reason from client',\r\n success: (res : any) => {\r\n console.log('uni.closeSocket success', res)\r\n },\r\n fail: (err : any) => {\r\n console.log('uni.closeSocket fail', err)\r\n },\r\n } as CloseSocketOptions)\r\n },\r\n },\r\n }\r\n\n```\n:::"},"getSystemInfo":{"name":"## uni.getSystemInfo(options) @getsysteminfo","description":"异æ¥èŽ·å–系统信æ¯","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [GetSystemInfoOptions](#getsysteminfooptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (result: [GetSystemInfoResult](#getsysteminforesult-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### GetSystemInfoResult 的属性值 @getsysteminforesult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| SDKVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | 客户端基础库版本<br/> |\n| appId | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | `manifest.json` ä¸åº”用appid。<br/> |\n| appLanguage | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 应用设置的è¯è¨€ã€‚<br/> |\n| appName | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | `manifest.json` ä¸åº”用å称。<br/> |\n| appVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | `manifest.json` ä¸åº”用版本å称。<br/> |\n| appVersionCode | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | `manifest.json` ä¸åº”用版本åå·ã€‚<br/> |\n| ~~brand~~ | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | 手机å“牌。 **已废弃,仅为了å‘下兼容ä¿ç•™** |\n| browserName | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æµè§ˆå™¨å称。`App` 端是系统 webview çš„åå—,比如 wkwebviewã€chrome。å°ç¨‹åºç«¯ä¸ºç©º<br/> |\n| browserVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æµè§ˆå™¨ç‰ˆæœ¬ã€webview 版本。<br/> |\n| deviceId | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备 ID<br/> |\n| deviceBrand | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备å“牌。如:`apple`ã€`huawei`。<br/> |\n| deviceModel | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备型å·<br/> |\n| deviceType | \"phone\" \\| \"pad\" \\| \"tv\" \\| \"watch\" \\| \"pc\" \\| \"undefined\" \\| \"car\" \\| \"vr\" \\| \"appliance\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备类型。<br/> |\n| devicePixelRatio | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备åƒç´ 比<br/> |\n| deviceOrientation | \"portrait\" \\| \"landscape\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备方å‘。 |\n| ~~language~~ | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 程åºè®¾ç½®çš„è¯è¨€ **已废弃,仅为了å‘下兼容ä¿ç•™** |\n| ~~model~~ | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æ‰‹æœºåž‹å· **已废弃,仅为了å‘下兼容ä¿ç•™** |\n| osName | \"ios\" \\| \"android\" \\| \"macos\" \\| \"windows\" \\| \"linux\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 系统å称\t<br/> |\n| osVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æ“作系统版本。如 ios 版本,andriod 版本<br/> |\n| osLanguage | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æ“作系统è¯è¨€<br/> |\n| osTheme | \"light\" \\| \"dark\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"√\",\"4.11\"]]}' /> | æ“作系统主题<br/> |\n| ~~pixelRatio~~ | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备åƒç´ 比 **已废弃,仅为了å‘下兼容ä¿ç•™** |\n| ~~platform~~ | \"ios\" \\| \"android\" \\| \"mac\" \\| \"windows\" \\| \"linux\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å®¢æˆ·ç«¯å¹³å° **已废弃,仅为了å‘下兼容ä¿ç•™** |\n| screenWidth | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å±å¹•å®½åº¦ï¼Œå•ä½ä¸ºpx<br/> |\n| screenHeight | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å±å¹•é«˜åº¦ï¼Œå•ä½ä¸ºpx<br/> |\n| statusBarHeight | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 状æ€æ 的高度,å•ä½ä¸ºpx<br/> |\n| ~~system~~ | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æ“作系统版本 **已废弃,仅为了å‘下兼容ä¿ç•™** |\n| safeArea | **SafeArea** | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 在竖å±æ£æ–¹å‘下的安全区域<br/> |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| left | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域左上角横åæ ‡ï¼Œå•ä½ä¸ºpx<br/> |\n@| right | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域å³ä¸‹è§’横åæ ‡ï¼Œå•ä½ä¸ºpx<br/> |\n@| top | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域左上角纵åæ ‡ï¼Œå•ä½ä¸ºpx<br/> |\n@| bottom | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域å³ä¸‹è§’纵åæ ‡ï¼Œå•ä½ä¸ºpx<br/> |\n@| width | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域的宽度,å•ä½ä¸ºpx<br/> |\n@| height | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域的高度,å•ä½ä¸ºpx<br/> |\n| safeAreaInsets | **SafeAreaInsets** | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 在竖å±æ£æ–¹å‘下的安全区域æ’å…¥ä½ç½®<br/> |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| left | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域左侧æ’å…¥ä½ç½®ï¼ˆè·ç¦»å·¦è¾¹è¾¹ç•Œè·ç¦»ï¼‰ï¼Œå•ä½ä¸ºpx<br/> |\n@| right | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域å³ä¾§æ’å…¥ä½ç½®ï¼ˆè·ç¦»å³è¾¹è¾¹ç•Œè·ç¦»ï¼‰ï¼Œå•ä½ä¸ºpx<br/> |\n@| top | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区顶部æ’å…¥ä½ç½®ï¼ˆè·ç¦»é¡¶éƒ¨è¾¹ç•Œè·ç¦»ï¼‰ï¼Œå•ä½ä¸ºpx<br/> |\n@| bottom | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域底部æ’å…¥ä½ç½®ï¼ˆè·ç¦»åº•éƒ¨è¾¹ç•Œè·ç¦»ï¼‰ï¼Œå•ä½ä¸ºpx<br/> |\n| ua | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | ç”¨æˆ·æ ‡è¯†ã€‚å°ç¨‹åºç«¯ä¸ºç©º<br/> |\n| ~~uniCompileVersion~~ | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | uni 编译器版本。 **已废弃,仅为了å‘下兼容ä¿ç•™** |\n| uniCompilerVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.18\",\"3.9\",\"4.11\"]]}' /> | uni 编译器版本。<br/> |\n| uniPlatform | \"app\" \\| \"web\" \\| \"mp-weixin\" \\| \"mp-alipay\" \\| \"mp-baidu\" \\| \"mp-toutiao\" \\| \"mp-lark\" \\| \"mp-qq\" \\| \"mp-kuaishou\" \\| \"mp-jd\" \\| \"mp-360\" \\| \"quickapp-webview\" \\| \"quickapp-webview-union\" \\| \"quickapp-webview-huawei\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | uni-app è¿è¡Œå¹³å°ï¼Œä¸Žæ¡ä»¶ç¼–译平å°ç›¸åŒã€‚<br/> |\n| uniRuntimeVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | uni è¿è¡Œæ—¶ç‰ˆæœ¬ã€‚<br/> |\n| ~~uniCompileVersionCode~~ | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | uni 编译器版本å·ã€‚ **已废弃,仅为了å‘下兼容ä¿ç•™** |\n| uniCompilerVersionCode | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.18\",\"3.9\",\"4.11\"]]}' /> | uni 编译器版本å·ã€‚<br/> |\n| uniRuntimeVersionCode | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | uni è¿è¡Œæ—¶ç‰ˆæœ¬å·ã€‚<br/> |\n| ~~version~~ | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 引擎版本å·ã€‚ **已废弃,仅为了å‘下兼容ä¿ç•™** |\n| romName | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | rom å称。Android 部分机型获å–ä¸åˆ°å€¼ã€‚iOS æ’为 `ios`<br/> |\n| romVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | rom 版本å·ã€‚Android 部分机型获å–ä¸åˆ°å€¼ã€‚iOS 为æ“作系统版本å·ï¼ˆåŒ `osVersion`)。<br/> |\n| windowWidth | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¯ä½¿ç”¨çª—å£å®½åº¦ï¼Œå•ä½ä¸ºpx<br/> |\n| windowHeight | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¯ä½¿ç”¨çª—å£é«˜åº¦ï¼Œå•ä½ä¸ºpx<br/> |\n| windowTop | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 内容区域è·ç¦»é¡¶éƒ¨çš„è·ç¦»ï¼ˆåŒCSSå˜é‡ `--window-top`),å•ä½ä¸ºpx<br/> |\n| windowBottom | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 内容区域è·ç¦»åº•éƒ¨çš„è·ç¦»ï¼ˆåŒCSSå˜é‡ `--window-bottom`),å•ä½ä¸ºpx<br/> |\n| osAndroidAPILevel | number \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"√\",\"x\"]]}' /> | Android 系统API库的版本。<br/> |\n| appTheme | \"light\" \\| \"dark\" \\| \"auto\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | 当å‰App的主题<br/> |\n","returnValue":"","compatibility":"### getSystemInfo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/system/info?id=getsysteminfo)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-system-info.getSystemInfo)\n"},"getSystemInfoSync":{"name":"## uni.getSystemInfoSync() @getsysteminfosync","description":"åŒæ¥èŽ·å–系统信æ¯","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| **GetSystemInfoResult** |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| SDKVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | 客户端基础库版本<br/> |\n@| appId | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | `manifest.json` ä¸åº”用appid。<br/> |\n@| appLanguage | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 应用设置的è¯è¨€ã€‚<br/> |\n@| appName | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | `manifest.json` ä¸åº”用å称。<br/> |\n@| appVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | `manifest.json` ä¸åº”用版本å称。<br/> |\n@| appVersionCode | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | `manifest.json` ä¸åº”用版本åå·ã€‚<br/> |\n@| ~~brand~~ | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | 手机å“牌。 **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| browserName | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æµè§ˆå™¨å称。`App` 端是系统 webview çš„åå—,比如 wkwebviewã€chrome。å°ç¨‹åºç«¯ä¸ºç©º<br/> |\n@| browserVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æµè§ˆå™¨ç‰ˆæœ¬ã€webview 版本。<br/> |\n@| deviceId | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备 ID<br/> |\n@| deviceBrand | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备å“牌。如:`apple`ã€`huawei`。<br/> |\n@| deviceModel | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备型å·<br/> |\n@| deviceType | \"phone\" \\| \"pad\" \\| \"tv\" \\| \"watch\" \\| \"pc\" \\| \"null\" \\| \"car\" \\| \"vr\" \\| \"appliance\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备类型。<br/> |\n@| devicePixelRatio | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备åƒç´ 比<br/> |\n@| deviceOrientation | \"portrait\" \\| \"landscape\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备方å‘。 |\n@| ~~language~~ | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 程åºè®¾ç½®çš„è¯è¨€ **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| ~~model~~ | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æ‰‹æœºåž‹å· **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| osName | \"ios\" \\| \"android\" \\| \"macos\" \\| \"windows\" \\| \"linux\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 系统å称\t<br/> |\n@| osVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æ“作系统版本。如 ios 版本,andriod 版本<br/> |\n@| osLanguage | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æ“作系统è¯è¨€<br/> |\n@| osTheme | \"light\" \\| \"dark\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"√\",\"4.11\"]]}' /> | æ“作系统主题<br/> |\n@| ~~pixelRatio~~ | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备åƒç´ 比 **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| ~~platform~~ | \"ios\" \\| \"android\" \\| \"mac\" \\| \"windows\" \\| \"linux\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å®¢æˆ·ç«¯å¹³å° **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| screenWidth | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å±å¹•å®½åº¦ï¼Œå•ä½ä¸ºpx<br/> |\n@| screenHeight | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å±å¹•é«˜åº¦ï¼Œå•ä½ä¸ºpx<br/> |\n@| statusBarHeight | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 状æ€æ 的高度,å•ä½ä¸ºpx<br/> |\n@| ~~system~~ | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æ“作系统版本 **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| safeArea | **SafeArea** | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 在竖å±æ£æ–¹å‘下的安全区域<br/> |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| left | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域左上角横åæ ‡ï¼Œå•ä½ä¸ºpx<br/> |\n@@| right | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域å³ä¸‹è§’横åæ ‡ï¼Œå•ä½ä¸ºpx<br/> |\n@@| top | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域左上角纵åæ ‡ï¼Œå•ä½ä¸ºpx<br/> |\n@@| bottom | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域å³ä¸‹è§’纵åæ ‡ï¼Œå•ä½ä¸ºpx<br/> |\n@@| width | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域的宽度,å•ä½ä¸ºpx<br/> |\n@@| height | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域的高度,å•ä½ä¸ºpx<br/> |\n@| safeAreaInsets | **SafeAreaInsets** | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 在竖å±æ£æ–¹å‘下的安全区域æ’å…¥ä½ç½®<br/> |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| left | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域左侧æ’å…¥ä½ç½®ï¼ˆè·ç¦»å·¦è¾¹è¾¹ç•Œè·ç¦»ï¼‰ï¼Œå•ä½ä¸ºpx<br/> |\n@@| right | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域å³ä¾§æ’å…¥ä½ç½®ï¼ˆè·ç¦»å³è¾¹è¾¹ç•Œè·ç¦»ï¼‰ï¼Œå•ä½ä¸ºpx<br/> |\n@@| top | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区顶部æ’å…¥ä½ç½®ï¼ˆè·ç¦»é¡¶éƒ¨è¾¹ç•Œè·ç¦»ï¼‰ï¼Œå•ä½ä¸ºpx<br/> |\n@@| bottom | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域底部æ’å…¥ä½ç½®ï¼ˆè·ç¦»åº•éƒ¨è¾¹ç•Œè·ç¦»ï¼‰ï¼Œå•ä½ä¸ºpx<br/> |\n@| ua | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | ç”¨æˆ·æ ‡è¯†ã€‚å°ç¨‹åºç«¯ä¸ºç©º<br/> |\n@| ~~uniCompileVersion~~ | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | uni 编译器版本。 **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| uniCompilerVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.18\",\"3.9\",\"4.11\"]]}' /> | uni 编译器版本。<br/> |\n@| uniPlatform | \"app\" \\| \"web\" \\| \"mp-weixin\" \\| \"mp-alipay\" \\| \"mp-baidu\" \\| \"mp-toutiao\" \\| \"mp-lark\" \\| \"mp-qq\" \\| \"mp-kuaishou\" \\| \"mp-jd\" \\| \"mp-360\" \\| \"quickapp-webview\" \\| \"quickapp-webview-union\" \\| \"quickapp-webview-huawei\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | uni-app è¿è¡Œå¹³å°ï¼Œä¸Žæ¡ä»¶ç¼–译平å°ç›¸åŒã€‚<br/> |\n@| uniRuntimeVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | uni è¿è¡Œæ—¶ç‰ˆæœ¬ã€‚<br/> |\n@| ~~uniCompileVersionCode~~ | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | uni 编译器版本å·ã€‚ **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| uniCompilerVersionCode | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.18\",\"3.9\",\"4.11\"]]}' /> | uni 编译器版本å·ã€‚<br/> |\n@| uniRuntimeVersionCode | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | uni è¿è¡Œæ—¶ç‰ˆæœ¬å·ã€‚<br/> |\n@| ~~version~~ | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 引擎版本å·ã€‚ **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| romName | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | rom å称。Android 部分机型获å–ä¸åˆ°å€¼ã€‚iOS æ’为 `ios`<br/> |\n@| romVersion | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | rom 版本å·ã€‚Android 部分机型获å–ä¸åˆ°å€¼ã€‚iOS 为æ“作系统版本å·ï¼ˆåŒ `osVersion`)。<br/> |\n@| windowWidth | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¯ä½¿ç”¨çª—å£å®½åº¦ï¼Œå•ä½ä¸ºpx<br/> |\n@| windowHeight | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¯ä½¿ç”¨çª—å£é«˜åº¦ï¼Œå•ä½ä¸ºpx<br/> |\n@| windowTop | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 内容区域è·ç¦»é¡¶éƒ¨çš„è·ç¦»ï¼ˆåŒCSSå˜é‡ `--window-top`),å•ä½ä¸ºpx<br/> |\n@| windowBottom | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 内容区域è·ç¦»åº•éƒ¨çš„è·ç¦»ï¼ˆåŒCSSå˜é‡ `--window-bottom`),å•ä½ä¸ºpx<br/> |\n@| osAndroidAPILevel | number \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"√\",\"x\"]]}' /> | Android 系统API库的版本。<br/> |\n@| appTheme | \"light\" \\| \"dark\" \\| \"auto\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | 当å‰App的主题<br/> | \n","compatibility":"### getSystemInfoSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/system/info?id=getsysteminfosync)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-system-info.getSystemInfoSync)\n"},"get-system-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-system-info/get-system-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-system-info/get-system-info\n>Template\n```vue\n<template>\r\n <!-- #ifdef APP -->\r\n <scroll-view style=\"flex: 1\">\r\n <!-- #endif -->\r\n <view>\r\n <page-head :title=\"title\"></page-head>\r\n <view class=\"uni-common-mt\">\r\n <view class=\"uni-list\">\r\n <view class=\"uni-list-cell\" v-for=\"(item, _) in items\" style=\"align-items: center\">\r\n <view class=\"uni-pd\">\r\n <view class=\"uni-label\" style=\"width: 180px\">{{\r\n item.label\r\n }}</view>\r\n </view>\r\n <view class=\"uni-list-cell-db\">\r\n <text style=\"width: 100%;\">{{ item.value == '' ? '未获å–' : item.value }}</text>\r\n </view>\r\n </view>\r\n </view>\r\n <view class=\"uni-padding-wrap\">\r\n <view class=\"uni-btn-v\">\r\n <button type=\"primary\" @tap=\"getSystemInfoSync\">\r\n åŒæ¥èŽ·å–设备系统信æ¯\r\n </button>\r\n <button type=\"primary\" @tap=\"getSystemInfo\" style=\"margin-top: 20px;\">\r\n 异æ¥èŽ·å–设备系统信æ¯\r\n </button>\r\n </view>\r\n </view>\r\n </view>\r\n </view>\r\n <!-- #ifdef APP -->\r\n </scroll-view>\r\n <!-- #endif -->\r\n</template>\r\n\r\n\r\n<style>\r\n .uni-pd {\r\n padding-left: 15px;\r\n }\r\n</style>\n\n```\n>Script\n```uts\n\r\n type Item = {\r\n label : string,\r\n value : string,\r\n }\r\n export default {\r\n data() {\r\n return {\r\n title: 'getSystemInfo',\r\n items: [] as Item[],\r\n }\r\n },\r\n onUnload: function () {\r\n },\r\n methods: {\r\n getSystemInfo: function () {\r\n uni.getSystemInfo({\r\n success: (res) => {\r\n this.items = [] as Item[];\n const res_str = JSON.stringify(res);\n const res_obj = JSON.parseObject(res_str);\n const res_map = res_obj!.toMap();\n let keys = [] as string[]\n res_map.forEach((_, key) => {\n keys.push(key);\n });\n keys.sort().forEach( key => {\n const value = res[key];\n if(value != null){\n const item = {\n \tlabel: key,\n \tvalue: \"\" + ((typeof value == \"object\")? JSON.stringify(value) : value)\n } as Item;\n this.items.push(item);\n }\n });\r\n },\r\n })\r\n },\r\n getSystemInfoSync: function () {\r\n this.items = [] as Item[];\r\n const res = uni.getSystemInfoSync()\n const res_str = JSON.stringify(res);\n const res_obj = JSON.parseObject(res_str);\n const res_map = res_obj!.toMap();\n let keys = [] as string[]\n res_map.forEach((_, key) => {\n keys.push(key);\n });\n keys.sort().forEach( key => {\n const value = res[key];\n if(value != null){\n const item = {\n \tlabel: key,\n \tvalue: \"\" + ((typeof value == \"object\")? JSON.stringify(value) : value)\n } as Item;\n this.items.push(item);\n }\n });\r\n },\r\n //自动化测试例专用\r\n jest_getSystemInfo() : GetSystemInfoResult {\r\n return uni.getSystemInfoSync();\r\n },\r\n }\r\n }\r\n\n```\n:::"},"getDeviceInfo":{"name":"## uni.getDeviceInfo(options?) @getdeviceinfo","description":"获å–设备信æ¯","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **GetDeviceInfoOptions** | å¦ | 包å«æ‰€æœ‰å—段的过滤对象 | - | \\[options=包å«æ‰€æœ‰å—段的过滤对象]过滤的å—段对象, ä¸ä¼ å‚数默认为获å–全部å—段。 |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filter | Array\\<string\\> | 是 | - | - | 过滤å—段的å—符串数组,å‡å¦‚è¦èŽ·å–指定å—æ®µï¼Œä¼ å…¥æ¤æ•°ç»„。 | \n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| **GetDeviceInfoResult** |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| ~~brand~~ | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | 设备å“牌 **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| deviceBrand | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | 设备å“牌<br/> |\n@| deviceId | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备 id 。由 uni-app 框架生æˆå¹¶å˜å‚¨ï¼Œæ¸…空 Storage 会导致改å˜<br/> |\n@| ~~model~~ | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备型å·\t **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| deviceModel | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备型å·\t<br/> |\n@| deviceType | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备类型phoneã€padã€pc\t<br/> |\n@| deviceOrientation | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | è®¾å¤‡æ–¹å‘ ç«–å± portraitã€æ¨ªå± landscape\t<br/> |\n@| devicePixelRatio | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备åƒç´ 比\t<br/> |\n@| system | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | æ“作系统åŠç‰ˆæœ¬\t<br/> |\n@| platform | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 客户端平å°\t<br/> |\n@| isRoot | boolean | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | 是å¦root。iOS 为是å¦è¶Šç‹±<br/> |\n@| isSimulator | boolean | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | 是å¦æ˜¯æ¨¡æ‹Ÿå™¨<br/> |\n@| isUSBDebugging | boolean | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"√\",\"x\"]]}' /> | adb是å¦å¼€å¯<br/> |\n@| osName | \"ios\" \\| \"android\" \\| \"macos\" \\| \"windows\" \\| \"linux\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.18\",\"4.18\",\"4.18\"]]}' /> | 系统å称\t<br/> |\n@| osVersion | string \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.18\",\"4.18\",\"4.18\"]]}' /> | æ“作系统版本。如 ios 版本,andriod 版本<br/> |\n@| osLanguage | string \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | æ“作系统è¯è¨€<br/> |\n@| osTheme | \"light\" \\| \"dark\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | æ“作系统主题<br/> |\n@| osAndroidAPILevel | number \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"x\"]]}' /> | Android 系统API库的版本。<br/> |\n@| romName | string \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | rom å称。Android 部分机型获å–ä¸åˆ°å€¼ã€‚iOS æ’为 `ios`<br/> |\n@| romVersion | string \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | rom 版本å·ã€‚Android 部分机型获å–ä¸åˆ°å€¼ã€‚iOS 为æ“作系统版本å·ï¼ˆåŒ `osVersion`)。<br/> | \n","compatibility":"### getDeviceInfo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/getDeviceInfo.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-device-info)\n"},"get-device-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-device-info/get-device-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-device-info/get-device-info\n>Template\n```vue\n<template>\r\n <!-- #ifdef APP -->\r\n <scroll-view class=\"page-scroll-view\">\r\n <!-- #endif -->\r\n <view>\r\n <page-head :title=\"title\"></page-head>\r\n <view class=\"uni-common-mt\">\r\n <view class=\"uni-list\">\r\n <view class=\"uni-list\">\r\n <view class=\"uni-list-cell\" v-for=\"(item, _) in items\" style=\"align-items: center\">\r\n <view class=\"uni-pd\">\r\n <view class=\"uni-label\" style=\"width: 180px\">{{\r\n item.label\r\n }}</view>\r\n </view>\r\n <view class=\"uni-list-cell-db\">\r\n <text style=\"width: 100%;\">{{ item.value == '' ? '未获å–' : item.value }}</text>\r\n </view>\r\n </view>\r\n </view>\r\n </view>\r\n <view class=\"uni-padding-wrap\">\r\n <view class=\"uni-btn-v\">\r\n <button type=\"primary\" @tap=\"getDeviceInfo\">获å–设备信æ¯</button>\r\n </view>\r\n </view>\r\n </view>\r\n </view>\r\n <!-- #ifdef APP -->\r\n </scroll-view>\r\n <!-- #endif -->\r\n</template>\r\n\r\n\r\n<style>\r\n .uni-pd {\r\n padding-left: 15px;\r\n }\r\n</style>\n\n```\n>Script\n```uts\n\r\n import { setDevicePixelRatio } from '@/store/index.uts'\r\n\r\n type Item = {\r\n label : string,\r\n value : string,\r\n }\r\n export default {\r\n data() {\r\n return {\r\n title: 'getDeviceInfo',\r\n items: [] as Item[],\r\n }\r\n },\r\n onUnload: function () {\r\n },\r\n methods: {\r\n getDeviceInfo: function () {\r\n const res = uni.getDeviceInfo();\r\n // 获å–åƒç´ 比, 供截图对比使用\r\n setDevicePixelRatio(res.devicePixelRatio !== null ? parseFloat(res.devicePixelRatio!) : 1)\r\n this.items = [] as Item[];\n\n const res_str = JSON.stringify(res);\n const res_obj = JSON.parseObject(res_str);\n const res_map = res_obj!.toMap();\n let keys = [] as string[]\n res_map.forEach((_, key) => {\n keys.push(key);\n });\n keys.sort().forEach( key => {\n const value = res[key];\n if(value != null){\n const item = {\n \tlabel: key,\n \tvalue: \"\" + ((typeof value == \"object\")? JSON.stringify(value) : value)\n } as Item;\n this.items.push(item);\n }\n });\r\n }\r\n }\r\n }\r\n\n```\n:::"},"getWindowInfo":{"name":"## uni.getWindowInfo() @getwindowinfo","description":"åŒæ¥èŽ·å–窗å£ä¿¡æ¯","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| **GetWindowInfoResult** |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| pixelRatio | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 设备åƒç´ 比<br/> |\n@| screenWidth | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å±å¹•å®½åº¦ï¼Œå•ä½ä¸ºpx<br/> |\n@| screenHeight | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å±å¹•é«˜åº¦ï¼Œå•ä½ä¸ºpx<br/> |\n@| windowWidth | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | å¯ä½¿ç”¨çª—å£å®½åº¦ï¼Œå•ä½ä¸ºpx<br/> |\n@| windowHeight | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | å¯ä½¿ç”¨çª—å£é«˜åº¦ï¼Œå•ä½ä¸ºpx<br/> |\n@| statusBarHeight | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 状æ€æ 的高度,å•ä½ä¸ºpx<br/> |\n@| windowTop | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 内容区域è·ç¦»é¡¶éƒ¨çš„è·ç¦»ï¼ˆåŒCSSå˜é‡ `--window-top`),å•ä½ä¸ºpx<br/> |\n@| windowBottom | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 内容区域è·ç¦»åº•éƒ¨çš„è·ç¦»ï¼ˆåŒCSSå˜é‡ `--window-bottom`),å•ä½ä¸ºpx<br/> |\n@| safeArea | **SafeArea** | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域在å±å¹•ä¸çš„ä½ç½®ä¿¡æ¯<br/> |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| left | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域左上角横åæ ‡ï¼Œå•ä½ä¸ºpx<br/> |\n@@| right | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域å³ä¸‹è§’横åæ ‡ï¼Œå•ä½ä¸ºpx<br/> |\n@@| top | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域左上角纵åæ ‡ï¼Œå•ä½ä¸ºpx<br/> |\n@@| bottom | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域å³ä¸‹è§’纵åæ ‡ï¼Œå•ä½ä¸ºpx<br/> |\n@@| width | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域的宽度,å•ä½ä¸ºpx<br/> |\n@@| height | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域的高度,å•ä½ä¸ºpx<br/> |\n@| safeAreaInsets | **SafeAreaInsets** | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域æ’å…¥ä½ç½®ï¼ˆä¸Žå±å¹•è¾¹ç•Œçš„è·ç¦»ï¼‰ä¿¡æ¯<br/> |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| left | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域左侧æ’å…¥ä½ç½®ï¼ˆè·ç¦»å·¦è¾¹è¾¹ç•Œè·ç¦»ï¼‰ï¼Œå•ä½ä¸ºpx<br/> |\n@@| right | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域å³ä¾§æ’å…¥ä½ç½®ï¼ˆè·ç¦»å³è¾¹è¾¹ç•Œè·ç¦»ï¼‰ï¼Œå•ä½ä¸ºpx<br/> |\n@@| top | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区顶部æ’å…¥ä½ç½®ï¼ˆè·ç¦»é¡¶éƒ¨è¾¹ç•Œè·ç¦»ï¼‰ï¼Œå•ä½ä¸ºpx<br/> |\n@@| bottom | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 安全区域底部æ’å…¥ä½ç½®ï¼ˆè·ç¦»åº•éƒ¨è¾¹ç•Œè·ç¦»ï¼‰ï¼Œå•ä½ä¸ºpx<br/> |\n@| screenTop | number | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 窗å£ä¸Šè¾¹ç¼˜çš„ y 值,å•ä½ä¸ºpx<br/> | \n","compatibility":"### getWindowInfo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/system/getWindowInfo.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-window-info)\n"},"get-window-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-window-info/get-window-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-window-info/get-window-info\n>Template\n```vue\n<template>\r\n <page-head :title=\"title\"></page-head>\r\n <view class=\"uni-common-mt\">\r\n <view class=\"uni-list\">\r\n <view class=\"uni-list-cell\" v-for=\"(item, _) in items\" style=\"align-items: center\">\r\n <view class=\"uni-pd\">\r\n <view class=\"uni-label\" style=\"width: 180px\">{{ item.label }}</view>\r\n </view>\r\n <view class=\"uni-list-cell-db\">\r\n <text style=\"width: 100%;\">{{ item.value == '' ? '未获å–' : item.value }}</text>\r\n </view>\r\n </view>\r\n </view>\r\n <view class=\"uni-padding-wrap\">\r\n <view class=\"uni-btn-v\">\r\n <button type=\"primary\" @tap=\"getWindowInfo\">获å–窗å£ä¿¡æ¯</button>\r\n </view>\r\n </view>\r\n </view>\r\n</template>\r\n\r\n\r\n<style>\r\n .uni-pd {\r\n padding-left: 15px;\r\n }\r\n</style>\n\n```\n>Script\n```uts\n\r\n import { setStatusBarHeight, setSafeArea } from '@/store/index.uts'\r\n // #ifdef APP-ANDROID\r\n import type { SafeArea } from '@/store/index.uts'\r\n // #endif\r\n\r\n type Item = {\r\n label : string,\r\n value : string,\r\n }\r\n export default {\r\n data() {\r\n return {\r\n title: 'getWindowInfo',\r\n items: [] as Item[],\r\n }\r\n },\r\n onUnload: function () {\r\n },\r\n onReady() {\r\n this.getWindowInfo()\r\n },\r\n methods: {\r\n getWindowInfo: function () {\r\n const res = uni.getWindowInfo();\r\n // 获å–状æ€æ 高度, 供截图对比使用\r\n setStatusBarHeight(res.statusBarHeight);\r\n // 获å–安全区信æ¯,供截图使用\r\n // #ifdef APP-ANDROID\r\n setSafeArea({\r\n top: res.safeArea.top,\r\n left: res.safeArea.left,\r\n right: res.safeArea.right,\r\n bottom: res.safeArea.bottom,\r\n width: res.safeArea.width,\r\n height: res.safeArea.height,\r\n } as SafeArea);\r\n // #endif\r\n // #ifdef APP-IOS\r\n setSafeArea({\r\n top: res.safeArea.top,\r\n left: res.safeArea.left,\r\n right: res.safeArea.right,\r\n bottom: res.safeArea.bottom,\r\n width: res.safeArea.width,\r\n height: res.safeArea.height,\r\n });\r\n // #endif\r\n this.items = [] as Item[];\r\n\r\n const res_str = JSON.stringify(res);\r\n const res_obj = JSON.parseObject(res_str);\r\n const res_map = res_obj!.toMap();\r\n let keys = [] as string[]\r\n res_map.forEach((_, key) => {\r\n keys.push(key);\r\n });\r\n keys.sort().forEach(key => {\r\n const value = res[key];\r\n if (value != null) {\r\n const item = {\r\n label: key,\r\n value: \"\" + ((typeof value == \"object\") ? JSON.stringify(value) : value)\r\n } as Item;\r\n this.items.push(item);\r\n }\r\n });\r\n },\r\n //自动化测试例专用\r\n jest_getWindowInfo() : GetWindowInfoResult {\r\n return uni.getWindowInfo();\r\n },\r\n }\r\n }\r\n\n```\n:::"},"getAppBaseInfo":{"name":"## uni.getAppBaseInfo(options?) @getappbaseinfo","description":"获å–app基本信æ¯","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **GetAppBaseInfoOptions** | å¦ | 包å«æ‰€æœ‰å—段的过滤对象 | - | \\[options=包å«æ‰€æœ‰å—段的过滤对象] 过滤的å—段对象, ä¸ä¼ å‚数默认为获å–全部å—段。 |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filter | Array\\<string\\> | 是 | - | - | 过滤å—段的å—符串数组,å‡å¦‚è¦èŽ·å–指定å—æ®µï¼Œä¼ å…¥æ¤æ•°ç»„。 | \n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| **GetAppBaseInfoResult** |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| appId | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | manifest.json ä¸åº”用appid,å³DCloud appid。\t<br/> |\n@| appName | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | `manifest.json` ä¸åº”用å称。<br/> |\n@| appVersion | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | `manifest.json` ä¸åº”用版本å称。<br/> |\n@| appVersionCode | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | `manifest.json` ä¸åº”用版本åå·ã€‚<br/> |\n@| appLanguage | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 应用设置的è¯è¨€enã€zh-Hansã€zh-Hantã€frã€es\t<br/> |\n@| language | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | 应用设置的è¯è¨€\t<br/> |\n@| ~~version~~ | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | 引擎版本å·ã€‚已废弃,仅为了å‘下兼容ä¿ç•™ **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| isUniAppX | boolean | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.18\",\"3.9\",\"4.11\"]]}' /> | 是å¦uni-app x<br/> |\n@| ~~uniCompileVersion~~ | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | uni 编译器版本 **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| uniCompilerVersion | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.18\",\"4.0\",\"4.11\"]]}' /> | uni 编译器版本<br/> |\n@| uniPlatform | \"app\" \\| \"web\" \\| \"mp-weixin\" \\| \"mp-alipay\" \\| \"mp-baidu\" \\| \"mp-toutiao\" \\| \"mp-lark\" \\| \"mp-qq\" \\| \"mp-kuaishou\" \\| \"mp-jd\" \\| \"mp-360\" \\| \"quickapp-webview\" \\| \"quickapp-webview-union\" \\| \"quickapp-webview-huawei\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.0\",\"3.9\",\"4.11\"]]}' /> | uni-app è¿è¡Œå¹³å°ã€‚<br/> |\n@| uniRuntimeVersion | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.18\",\"3.9\",\"4.11\"]]}' /> | uni è¿è¡Œæ—¶ç‰ˆæœ¬<br/> |\n@| ~~uniCompileVersionCode~~ | number | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | uni ç¼–è¯‘å™¨ç‰ˆæœ¬å· **已废弃,仅为了å‘下兼容ä¿ç•™** |\n@| uniCompilerVersionCode | number | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"4.18\",\"4.0\",\"4.11\"]]}' /> | uni 编译器版本å·<br/> |\n@| uniRuntimeVersionCode | number | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9\",\"4.11\"]]}' /> | uni è¿è¡Œæ—¶ç‰ˆæœ¬å·<br/> |\n@| packageName | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.97\",\"x\"]]}' /> | Android的包å<br/> |\n@| bundleId | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"x\",\"4.11\"]]}' /> | iOSçš„bundleId<br/> |\n@| signature | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.97\",\"4.11\"]]}' /> | Android: 应用ç¾åè¯ä¹¦çš„SHA1值(全部为å°å†™ï¼Œä¸é—´ä¸åŒ…å«â€œ:â€ï¼‰ã€‚ 为了ä¿è¯åº”用的安全性,请使用自己生æˆçš„è¯ä¹¦ï¼ˆä¸è¦ä½¿ç”¨å…¬å…±æµ‹è¯•è¯ä¹¦ï¼‰ã€‚<br/>iOS: 应用ç¾åè¯ä¹¦ä¸ç»‘定的Bundle ID(AppleID)的md5值(全部为å°å†™ï¼‰ã€‚<br/> |\n@| appTheme | \"light\" \\| \"dark\" \\| \"auto\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | 当å‰App的主题<br/> | \n","compatibility":"### getAppBaseInfo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/getAppBaseInfo.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-app-base-info)\n"},"get-app-base-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-app-base-info/get-app-base-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-app-base-info/get-app-base-info\n>Template\n```vue\n<template>\r\n <page-head :title=\"title\"></page-head>\r\n <view class=\"uni-common-mt\">\r\n <view class=\"uni-list\">\n <view class=\"uni-list-cell\" v-for=\"(item,_) in items\" style=\"align-items: center;\">\n <view class=\"uni-pd\">\n <view class=\"uni-label\" style=\"width:180px;\">{{item.label}}</view>\n </view>\n <view class=\"uni-list-cell-db\">\n <text style=\"width: 100%;\">{{ item.value == '' ? '未获å–' : item.value }}</text>\n </view>\n </view>\r\n </view>\r\n <view class=\"uni-padding-wrap\">\r\n <view class=\"uni-btn-v\">\r\n <button type=\"primary\" @tap=\"getAppBaseInfo\">获å–App基础信æ¯</button>\r\n </view>\r\n </view>\r\n </view>\r\n</template>\r\n\r\n\r\n<style>\r\n\t.uni-pd {\r\n\t\tpadding-left: 15px;\r\n\t}\r\n</style>\r\n\n```\n>Script\n```uts\n\n\ttype Item = {\n\t\tlabel : string,\n\t\tvalue : string,\n\t}\n\texport default {\r\n\t\tdata() {\r\n\t\t\treturn {\r\n\t\t\t\ttitle: 'getAppBaseInfo',\n\t\t\t\titems: [] as Item[],\r\n\t\t\t}\r\n\t\t},\r\n\t\tonUnload:function(){\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\tgetAppBaseInfo: function () {\n\t\t\t\tconst res = uni.getAppBaseInfo();\n const res_str = JSON.stringify(res);\n const res_obj = JSON.parseObject(res_str);\n const res_map = res_obj!.toMap();\n let keys = [] as string[]\n res_map.forEach((_, key) => {\n keys.push(key);\n });\n\n this.items = [] as Item[];\n keys.sort().forEach( key => {\n const value = res[key];\n if(value != null){\n const item = {\n \tlabel: key,\n \tvalue: \"\" + ((typeof value == \"object\")? JSON.stringify(value) : value)\n } as Item;\n this.items.push(item);\n }\n });\n\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\n```\n:::"},"getAppAuthorizeSetting":{"name":"## uni.getAppAuthorizeSetting() @getappauthorizesetting","description":"èŽ·å– APP 授æƒè®¾ç½®ã€‚","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| **GetAppAuthorizeSettingResult** |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| albumAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"x\",\"4.11\"]]}' /> | å…许 App 使用相册的开关(仅 iOS 支æŒï¼‰<br/>- authorized: å·²ç»èŽ·å¾—授æƒï¼Œæ— 需å†æ¬¡è¯·æ±‚授æƒ<br/>- denied: 请求授æƒè¢«æ‹’ç»ï¼Œæ— 法å†æ¬¡è¯·æ±‚授æƒï¼›ï¼ˆæ¤æƒ…况需è¦å¼•å¯¼ç”¨æˆ·æ‰“开系统设置,在设置页ä¸æ‰“å¼€æƒé™ï¼‰<br/>- not determined: 尚未请求授æƒï¼Œä¼šåœ¨App下一次调用系统相应æƒé™æ—¶è¯·æ±‚;(仅 iOS 会出现。æ¤ç§æƒ…况下引导用户打开系统设置,ä¸å±•ç¤ºå¼€å…³ï¼‰<br/>- config error: 当å‰åº”用没有é…置相册æƒé™æè¿° |\n@| bluetoothAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"x\",\"4.11\"]]}' /> | å…许 App 使用è“牙的开关(仅 iOS 支æŒï¼‰<br/>- authorized: å·²ç»èŽ·å¾—授æƒï¼Œæ— 需å†æ¬¡è¯·æ±‚授æƒ<br/>- denied: 请求授æƒè¢«æ‹’ç»ï¼Œæ— 法å†æ¬¡è¯·æ±‚授æƒï¼›ï¼ˆæ¤æƒ…况需è¦å¼•å¯¼ç”¨æˆ·æ‰“开系统设置,在设置页ä¸æ‰“å¼€æƒé™ï¼‰<br/>- not determined: 尚未请求授æƒï¼Œä¼šåœ¨App下一次调用系统相应æƒé™æ—¶è¯·æ±‚;(仅 iOS 会出现。æ¤ç§æƒ…况下引导用户打开系统设置,ä¸å±•ç¤ºå¼€å…³ï¼‰<br/>- config error: Androidå¹³å°æ²¡æœ‰è¯¥å€¼ï¼›iOSå¹³å°ï¼šå½“å‰åº”用没有é…ç½®è“牙æƒé™æè¿° |\n@| cameraAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | å…许 App 使用摄åƒå¤´çš„开关<br/>- authorized: å·²ç»èŽ·å¾—授æƒï¼Œæ— 需å†æ¬¡è¯·æ±‚授æƒ<br/>- denied: 请求授æƒè¢«æ‹’ç»ï¼Œæ— 法å†æ¬¡è¯·æ±‚授æƒï¼›ï¼ˆæ¤æƒ…况需è¦å¼•å¯¼ç”¨æˆ·æ‰“开系统设置,在设置页ä¸æ‰“å¼€æƒé™ï¼‰<br/>- not determined: 尚未请求授æƒï¼Œä¼šåœ¨App下一次调用系统相应æƒé™æ—¶è¯·æ±‚;(仅 iOS 会出现。æ¤ç§æƒ…况下引导用户打开系统设置,ä¸å±•ç¤ºå¼€å…³ï¼‰<br/>- config error: Androidå¹³å°ï¼šè¡¨ç¤ºæ²¡æœ‰é…ç½® `android.permission.CAMERA` æƒé™ï¼Œ[æƒé™é…置详情](https://uniapp.dcloud.net.cn/tutorial/app-nativeresource-android.html#permissions)ï¼›iOSå¹³å°ï¼šå½“å‰åº”用没有é…置相机æƒé™æè¿° |\n@| locationAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | å…许 App 使用定ä½çš„开关<br/>- authorized: å·²ç»èŽ·å¾—授æƒï¼Œæ— 需å†æ¬¡è¯·æ±‚授æƒ<br/>- denied: 请求授æƒè¢«æ‹’ç»ï¼Œæ— 法å†æ¬¡è¯·æ±‚授æƒï¼›ï¼ˆæ¤æƒ…况需è¦å¼•å¯¼ç”¨æˆ·æ‰“开系统设置,在设置页ä¸æ‰“å¼€æƒé™ï¼‰<br/>- not determined: 尚未请求授æƒï¼Œä¼šåœ¨App下一次调用系统相应æƒé™æ—¶è¯·æ±‚;(仅 iOS 会出现。æ¤ç§æƒ…况下引导用户打开系统设置,ä¸å±•ç¤ºå¼€å…³ï¼‰<br/>- config error: Androidå¹³å°ï¼šè¡¨ç¤ºæ²¡æœ‰é…ç½® `android.permission.ACCESS_COARSE_LOCATION` æƒé™ï¼Œ[æƒé™é…置详情](https://uniapp.dcloud.net.cn/tutorial/app-nativeresource-android.html#permissions)ï¼›iOSå¹³å°ï¼šå½“å‰åº”用没有é…置定ä½æƒé™æè¿° |\n@| locationAccuracy | \"reduced\" \\| \"full\" \\| \"unsupported\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 定ä½å‡†ç¡®åº¦ã€‚<br/>- reduced: 模糊定ä½<br/>- full: 精准定ä½<br/>- unsupported: ä¸æ”¯æŒï¼ˆåŒ…括用户拒ç»å®šä½æƒé™å’Œæ²¡æœ‰åŒ…å«å®šä½æƒé™æ述) |\n@| locationReducedAccuracy | boolean \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"x\",\"4.11\"]]}' /> | 定ä½å‡†ç¡®åº¦ï¼ˆæŽ¨è使用 locationAccuracy 属性)。true 表示模糊定ä½ï¼Œfalse 表示精确定ä½ï¼ˆä»… iOS 支æŒï¼‰ |\n@| microphoneAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | å…许 App 使用麦克风的开关<br/>- authorized: å·²ç»èŽ·å¾—授æƒï¼Œæ— 需å†æ¬¡è¯·æ±‚授æƒ<br/>- denied: 请求授æƒè¢«æ‹’ç»ï¼Œæ— 法å†æ¬¡è¯·æ±‚授æƒï¼›ï¼ˆæ¤æƒ…况需è¦å¼•å¯¼ç”¨æˆ·æ‰“开系统设置,在设置页ä¸æ‰“å¼€æƒé™ï¼‰<br/>- not determined: 尚未请求授æƒï¼Œä¼šåœ¨App下一次调用系统相应æƒé™æ—¶è¯·æ±‚;(仅 iOS 会出现。æ¤ç§æƒ…况下引导用户打开系统设置,ä¸å±•ç¤ºå¼€å…³ï¼‰<br/>- config error: Androidå¹³å°ï¼šè¡¨ç¤ºæ²¡æœ‰é…ç½® `android.permission.RECORD_AUDIO` æƒé™ï¼Œ[æƒé™é…置详情](https://uniapp.dcloud.net.cn/tutorial/app-nativeresource-android.html#permissions)ï¼›iOSå¹³å°ï¼šå½“å‰åº”用没有é…置麦克风æƒé™æè¿° |\n@| notificationAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | å…许 App 通知的开关<br/>- authorized: å·²ç»èŽ·å¾—授æƒï¼Œæ— 需å†æ¬¡è¯·æ±‚授æƒ<br/>- denied: 请求授æƒè¢«æ‹’ç»ï¼Œæ— 法å†æ¬¡è¯·æ±‚授æƒï¼›ï¼ˆæ¤æƒ…况需è¦å¼•å¯¼ç”¨æˆ·æ‰“开系统设置,在设置页ä¸æ‰“å¼€æƒé™ï¼‰<br/>- not determined: 尚未请求授æƒï¼Œä¼šåœ¨App下一次调用系统相应æƒé™æ—¶è¯·æ±‚;(仅 iOS 会出现。æ¤ç§æƒ…况下引导用户打开系统设置,ä¸å±•ç¤ºå¼€å…³ï¼‰<br/>- config error: Androidå¹³å°æ²¡æœ‰è¯¥å€¼ï¼›iOSå¹³å°ï¼šæ²¡æœ‰åŒ…å«æŽ¨é€æƒé™æè¿° |\n@| notificationAlertAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"x\",\"4.11\"]]}' /> | å…许 App 通知带有æ醒的开关(仅 iOS 支æŒï¼‰<br/>- authorized: å·²ç»èŽ·å¾—授æƒï¼Œæ— 需å†æ¬¡è¯·æ±‚授æƒ<br/>- denied: 请求授æƒè¢«æ‹’ç»ï¼Œæ— 法å†æ¬¡è¯·æ±‚授æƒï¼›ï¼ˆæ¤æƒ…况需è¦å¼•å¯¼ç”¨æˆ·æ‰“开系统设置,在设置页ä¸æ‰“å¼€æƒé™ï¼‰<br/>- not determined: 尚未请求授æƒï¼Œä¼šåœ¨App下一次调用系统相应æƒé™æ—¶è¯·æ±‚;(仅 iOS 会出现。æ¤ç§æƒ…况下引导用户打开系统设置,ä¸å±•ç¤ºå¼€å…³ï¼‰<br/>- config error: 当å‰åº”用没有é…置推é€æƒé™æè¿° |\n@| notificationBadgeAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"x\",\"4.11\"]]}' /> | å…许 App é€šçŸ¥å¸¦æœ‰æ ‡è®°çš„å¼€å…³ï¼ˆä»… iOS 支æŒï¼‰<br/>- authorized: å·²ç»èŽ·å¾—授æƒï¼Œæ— 需å†æ¬¡è¯·æ±‚授æƒ<br/>- denied: 请求授æƒè¢«æ‹’ç»ï¼Œæ— 法å†æ¬¡è¯·æ±‚授æƒï¼›ï¼ˆæ¤æƒ…况需è¦å¼•å¯¼ç”¨æˆ·æ‰“开系统设置,在设置页ä¸æ‰“å¼€æƒé™ï¼‰<br/>- not determined: 尚未请求授æƒï¼Œä¼šåœ¨App下一次调用系统相应æƒé™æ—¶è¯·æ±‚;(仅 iOS 会出现。æ¤ç§æƒ…况下引导用户打开系统设置,ä¸å±•ç¤ºå¼€å…³ï¼‰<br/>- config error: 当å‰åº”用没有é…置推é€æƒé™æè¿° |\n@| notificationSoundAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"x\",\"4.11\"]]}' /> | å…许 App 通知带有声音的开关(仅 iOS 支æŒï¼‰<br/>- authorized: å·²ç»èŽ·å¾—授æƒï¼Œæ— 需å†æ¬¡è¯·æ±‚授æƒ<br/>- denied: 请求授æƒè¢«æ‹’ç»ï¼Œæ— 法å†æ¬¡è¯·æ±‚授æƒï¼›ï¼ˆæ¤æƒ…况需è¦å¼•å¯¼ç”¨æˆ·æ‰“开系统设置,在设置页ä¸æ‰“å¼€æƒé™ï¼‰<br/>- not determined: 尚未请求授æƒï¼Œä¼šåœ¨App下一次调用系统相应æƒé™æ—¶è¯·æ±‚;(仅 iOS 会出现。æ¤ç§æƒ…况下引导用户打开系统设置,ä¸å±•ç¤ºå¼€å…³ï¼‰<br/>- config error: 当å‰åº”用没有é…置推é€æƒé™æè¿° | \n","compatibility":"### getAppAuthorizeSetting 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/system/getappauthorizesetting)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-app-authorize-setting)\n"},"get-app-authorize-setting":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-app-authorize-setting/get-app-authorize-setting.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\r\n <page-head :title=\"title\"></page-head>\r\n <view class=\"uni-common-mt\">\r\n <view class=\"uni-list\">\n <!-- #ifdef APP-IOS -->\n <view class=\"uni-list-cell\">\n <view class=\"uni-pd\">\n <view class=\"uni-label\" style=\"width:180px;\">是å¦æŽˆæƒä½¿ç”¨ç›¸å†Œ</view>\n </view>\n <view class=\"uni-list-cell-db\">\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"albumAuthorized\" />\n </view>\n </view>\n <view class=\"uni-list-cell\">\n <view class=\"uni-pd\">\n <view class=\"uni-label\" style=\"width:180px;\">是å¦æŽˆæƒä½¿ç”¨è“牙</view>\n </view>\n <view class=\"uni-list-cell-db\">\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"bluetoothAuthorized\" />\n </view>\n </view>\n <!-- #endif -->\r\n <view class=\"uni-list-cell\">\r\n <view class=\"uni-pd\">\r\n <view class=\"uni-label\" style=\"width:180px;\">是å¦æŽˆæƒä½¿ç”¨æ‘„åƒå¤´</view>\r\n </view>\r\n <view class=\"uni-list-cell-db\">\r\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"cameraAuthorized\" />\r\n </view>\r\n </view>\r\n <view class=\"uni-list-cell\">\r\n <view class=\"uni-pd\">\r\n <view class=\"uni-label\" style=\"width:180px;\">是å¦æŽˆæƒä½¿ç”¨å®šä½</view>\r\n </view>\r\n <view class=\"uni-list-cell-db\">\r\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"locationAuthorized\" />\r\n </view>\r\n </view>\r\n <view class=\"uni-list-cell\">\r\n <view class=\"uni-pd\">\r\n <view class=\"uni-label\" style=\"width:180px;\">定ä½å‡†ç¡®åº¦</view>\r\n </view>\r\n <view class=\"uni-list-cell-db\">\r\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"locationAccuracy\" />\r\n </view>\r\n </view>\r\n <view class=\"uni-list-cell\">\r\n <view class=\"uni-pd\">\r\n <view class=\"uni-label\" style=\"width:180px;\">是å¦æŽˆæƒä½¿ç”¨éº¦å…‹é£Ž</view>\r\n </view>\r\n <view class=\"uni-list-cell-db\">\r\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"microphoneAuthorized\" />\r\n </view>\r\n </view>\n\r\n <view class=\"uni-list-cell\">\r\n <view class=\"uni-pd\">\r\n <view class=\"uni-label\" style=\"width:180px;\">是å¦æŽˆæƒé€šçŸ¥</view>\r\n </view>\r\n <view class=\"uni-list-cell-db\">\r\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"notificationAuthorized\" />\r\n </view>\r\n </view>\n<!-- #ifdef APP-IOS -->\n <view class=\"uni-list-cell\">\n <view class=\"uni-pd\">\n <view class=\"uni-label\" style=\"width:180px;\">是å¦å…许通知带有æ醒</view>\n </view>\n <view class=\"uni-list-cell-db\">\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"notificationAlertAuthorized\" />\n </view>\n </view>\n\n <view class=\"uni-list-cell\">\n <view class=\"uni-pd\">\n <view class=\"uni-label\" style=\"width:180px;\">是å¦å…è®¸é€šçŸ¥å¸¦æœ‰æ ‡è®°</view>\n </view>\n <view class=\"uni-list-cell-db\">\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"notificationBadgeAuthorized\" />\n </view>\n </view>\n <view class=\"uni-list-cell\">\n <view class=\"uni-pd\">\n <view class=\"uni-label\" style=\"width:180px;\">是å¦å…许通知带有声音</view>\n </view>\n <view class=\"uni-list-cell-db\">\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"notificationSoundAuthorized\" />\n </view>\n </view>\n<!-- #endif -->\r\n </view>\r\n <view class=\"uni-padding-wrap\">\r\n <view class=\"uni-btn-v\">\r\n <button type=\"primary\" @tap=\"getAppAuthorizeSetting\">获å–App授æƒè®¾ç½®</button>\r\n </view>\r\n </view>\r\n </view>\r\n</template>\r\n<script>\r\n export default {\r\n data() {\r\n return {\r\n title: 'getAppAuthorizeSetting',\r\n cameraAuthorized: \"\",\n albumAuthorized: \"\",\r\n locationAuthorized: \"\",\r\n locationAccuracy: \"\",\r\n microphoneAuthorized: \"\",\n bluetoothAuthorized: \"\",\r\n notificationAuthorized: \"\",\n notificationAlertAuthorized: \"\",\n notificationBadgeAuthorized: \"\",\n notificationSoundAuthorized: \"\"\r\n }\r\n },\r\n onUnload: function () {\r\n },\r\n methods: {\r\n getAppAuthorizeSetting: function () {\r\n const res = uni.getAppAuthorizeSetting();\r\n this.cameraAuthorized = res.cameraAuthorized;\r\n this.locationAuthorized = res.locationAuthorized;\r\n this.locationAccuracy = res.locationAccuracy ?? \"unsupported\";\r\n this.microphoneAuthorized = res.microphoneAuthorized;\r\n this.notificationAuthorized = res.notificationAuthorized;\n // #ifdef APP-IOS\n this.notificationAlertAuthorized = res.notificationAlertAuthorized;\n this.notificationBadgeAuthorized = res.notificationBadgeAuthorized;\n this.notificationSoundAuthorized = res.notificationSoundAuthorized;\n this.bluetoothAuthorized = res.bluetoothAuthorized;\n this.albumAuthorized = res.albumAuthorized;\n // #endif\n\r\n }\r\n }\r\n }\r\n</script>\r\n\r\n<style>\r\n .uni-pd {\r\n padding-left: 15px;\r\n }\r\n</style>\n\n```"},"getSystemSetting":{"name":"## uni.getSystemSetting() @getsystemsetting","description":"获å–系统设置","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| **GetSystemSettingResult** |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| bluetoothEnabled | boolean | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | è“牙是å¦å¼€å¯<br/> |\n@| bluetoothError | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | è“牙的报错信æ¯<br/> |\n@| locationEnabled | boolean | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | ä½ç½®æ˜¯å¦å¼€å¯<br/> |\n@| wifiEnabled | boolean | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | wifi是å¦å¼€å¯<br/> |\n@| wifiError | string | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"x\"]]}' /> | wifi的报错信æ¯<br/> |\n@| deviceOrientation | \"portrait\" \\| \"landscape\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 设备方å‘<br/> | \n","compatibility":"### getSystemSetting 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/getsystemsetting.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-system-setting)\n"},"get-system-setting":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-system-setting/get-system-setting.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\r\n <page-head :title=\"title\"></page-head>\r\n <view class=\"uni-common-mt\">\r\n <view class=\"uni-list\">\r\n <view class=\"uni-list-cell\">\r\n <view class=\"uni-pd\">\r\n <view class=\"uni-label\" style=\"width:180px;\">è“牙的系统开关</view>\r\n </view>\r\n <view class=\"uni-list-cell-db\">\r\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"bluetoothEnabled\" />\r\n </view>\r\n </view>\r\n <view class=\"uni-list-cell\">\r\n <view class=\"uni-pd\">\r\n <view class=\"uni-label\" style=\"width:180px;\">地ç†ä½ç½®çš„系统开关</view>\r\n </view>\r\n <view class=\"uni-list-cell-db\">\r\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"locationEnabled\" />\r\n </view>\r\n </view>\r\n <view class=\"uni-list-cell\">\r\n <view class=\"uni-pd\">\r\n <view class=\"uni-label\" style=\"width:180px;\">Wi-Fi 的系统开关</view>\r\n </view>\r\n <view class=\"uni-list-cell-db\">\r\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"wifiEnabled\" />\r\n </view>\r\n </view>\r\n <view class=\"uni-list-cell\">\r\n <view class=\"uni-pd\">\r\n <view class=\"uni-label\" style=\"width:180px;\">设备方å‘</view>\r\n </view>\r\n <view class=\"uni-list-cell-db\">\r\n <input type=\"text\" :disabled=\"true\" placeholder=\"未获å–\" :value=\"deviceOrientation\" />\r\n </view>\r\n </view>\r\n </view>\r\n <view class=\"uni-padding-wrap\">\r\n <view class=\"uni-btn-v\">\r\n <button type=\"primary\" @tap=\"getSystemSetting\">获å–系统设置</button>\r\n </view>\r\n </view>\r\n </view>\r\n</template>\n\r\n<script>\r\n export default {\r\n data() {\r\n return {\r\n title: 'getSystemSetting',\r\n bluetoothEnabled: \"\",\r\n locationEnabled: \"\",\r\n wifiEnabled: \"\",\r\n deviceOrientation: \"\"\r\n }\r\n },\r\n onUnload: function () {\r\n },\r\n methods: {\r\n getSystemSetting: function () {\r\n const res = uni.getSystemSetting();\r\n this.bluetoothEnabled = (res.bluetoothEnabled ?? false) ? \"å¼€å¯\" : \"å…³é—\";\r\n this.locationEnabled = res.locationEnabled ? \"å¼€å¯\" : \"å…³é—\";\r\n this.wifiEnabled = (res.wifiEnabled ?? false) ? \"å¼€å¯\" : \"å…³é—\";\r\n this.deviceOrientation = res.deviceOrientation\n\n if(res.bluetoothError != null){\n this.bluetoothEnabled = \"æ— è“牙æƒé™\"\n }\n\n if(res.wifiError != null){\n this.wifiEnabled = \"æ— WiFiæƒé™\"\n }\n }\r\n }\r\n }\r\n</script>\r\n\r\n<style>\r\n .uni-pd {\r\n padding-left: 15px;\r\n }\r\n</style>\n\n```"},"installApk":{"name":"## uni.installApk(options) @installapk","description":"安装apk","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [InstallApkOptions](#installapkoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | string | 是 | - | - | apkæ–‡ä»¶åœ°å€ |\n@| success | (res: [InstallApkSuccess](#installapksuccess-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (err: [InstallApkFail](#installapkfail-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### InstallApkSuccess 的属性值 @installapksuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | 安装æˆåŠŸæ¶ˆæ¯ |\n\n##### InstallApkFail 的属性值 @installapkfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | 错误ç <br/>- 1300002 找ä¸åˆ°æ–‡ä»¶ |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### installApk 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.94 | x |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.install-apk)\n"},"install-apk":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/install-apk/install-apk.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\r\n <!-- #ifdef APP -->\r\n <scroll-view style=\"flex: 1\">\r\n <!-- #endif -->\r\n <view>\r\n <page-head :title=\"title\"></page-head>\r\n <view class=\"uni-common-mt\">\r\n <view class=\"uni-padding-wrap\">\r\n <view class=\"uni-btn-v\">\r\n <button type=\"primary\" @tap=\"installApk\">\r\n installApk\r\n </button>\r\n </view>\r\n </view>\r\n </view>\r\n </view>\r\n <!-- #ifdef APP -->\r\n </scroll-view>\r\n <!-- #endif -->\r\n</template>\r\n<script>\r\n export default {\r\n data() {\r\n return {\r\n title: 'installApk'\r\n }\r\n },\r\n onUnload: function () {\r\n },\r\n methods: {\r\n installApk: function () {\r\n uni.installApk({\r\n filePath: \"/static/test-apk/test.apk\",\r\n complete(res : any) {\n console.log(res);\r\n }\r\n })\r\n },\r\n }\r\n }\r\n</script>\r\n<style>\r\n</style>\n\n```"},"getPushClientId":{"name":"## uni.getPushClientId(options) @getpushclientid","description":"获å–客户端唯一的推é€æ ‡è¯†","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [GetPushClientIdOptions](#getpushclientidoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (result: [GetPushClientIdSuccess](#getpushclientidsuccess-values)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### GetPushClientIdSuccess 的属性值 @getpushclientidsuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| cid | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"4.18\"]]}' /> | 个推客户端推é€id,对应uni-id-device表的push_clientid<br/> |\n| errMsg | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"4.18\"]]}' /> | 错误æè¿°<br/> |\n","returnValue":"","compatibility":"### getPushClientId 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.98 | 4.18 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/plugins/push.html#getpushclientid)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.push.uni-push.getPushClientId)\n"},"onPushMessage":{"name":"## uni.onPushMessage(callback) @onpushmessage","description":"å¯åŠ¨ç›‘å¬æŽ¨é€æ¶ˆæ¯äº‹ä»¶","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [OnPushMessageCallbackResult](#onpushmessagecallbackresult-values)) => void | 是 | - | - | | \n\n#### OnPushMessageCallbackResult 的属性值 @onpushmessagecallbackresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| type | \"click\" \\| \"receive\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"4.18\"]]}' /> | 事件类型<br/>- click 从系统推é€æœåŠ¡ç‚¹å‡»æ¶ˆæ¯å¯åŠ¨åº”用事件<br/>- receive 应用从推é€æœåŠ¡å™¨æŽ¥æ”¶åˆ°æŽ¨é€æ¶ˆæ¯äº‹ä»¶ |\n| data | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"4.18\"]]}' /> | 消æ¯å†…容<br/> |\n","returnValue":"","compatibility":"### onPushMessage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.98 | 4.18 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/plugins/push.html#onpushmessage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.push.uni-push.onPushMessage)\n"},"offPushMessage":{"name":"## uni.offPushMessage(callback) @offpushmessage","description":"å…³é—推é€æ¶ˆæ¯ç›‘å¬äº‹ä»¶ï¼ŒiOS端调用会关é—所有监å¬ã€‚","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [OnPushMessageCallbackResult](#onpushmessagecallbackresult-values)) => void | 是 | - | - | | \n\n#### OnPushMessageCallbackResult 的属性值 @onpushmessagecallbackresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| type | \"click\" \\| \"receive\" | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"4.18\"]]}' /> | 事件类型<br/>- click 从系统推é€æœåŠ¡ç‚¹å‡»æ¶ˆæ¯å¯åŠ¨åº”用事件<br/>- receive 应用从推é€æœåŠ¡å™¨æŽ¥æ”¶åˆ°æŽ¨é€æ¶ˆæ¯äº‹ä»¶ |\n| data | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"4.18\"]]}' /> | 消æ¯å†…容<br/> |\n","returnValue":"","compatibility":"### offPushMessage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.98 | 4.18 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/plugins/push.html#offpushmessage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.push.uni-push.offPushMessage)\n"},"getChannelManager":{"name":"## uni.getChannelManager() @getchannelmanager","description":"获å–é€šçŸ¥æ¸ é“管ç†å™¨ï¼ŒAndroid 8系统以上æ‰å¯ä»¥è®¾ç½®é€šçŸ¥æ¸ é“,Android 8系统以下返回null。","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [ChannelManager](#channelmanager-values) |\n\n#### ChannelManager 的方法 @channelmanager-values \n\n#### setPushChannel(options) @setpushchannel\n设置推é€æ¸ é“<br/>\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **SetPushChannelOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| soundName | string \\| null | å¦ | null | - | æ·»åŠ çš„å£°éŸ³æ–‡ä»¶ï¼Œæ³¨æ„raw目录下必须è¦æœ‰ ,ä¸ä¼ æ¤å—段将使用默认铃音。 |\n@| channelId | string | 是 | - | - | é€šçŸ¥æ¸ é“id |\n@| channelDesc | string | 是 | - | - | é€šçŸ¥æ¸ é“æè¿° |\n@| enableLights | boolean \\| null | å¦ | false | - | 呼å¸ç¯é—ªçƒ |\n@| enableVibration | boolean \\| null | å¦ | false | - | 震动 |\n@| importance | number \\| null | å¦ | 3 | - | 通知的é‡è¦æ€§çº§åˆ«ï¼Œå¯é€‰èŒƒå›´IMPORTANCE_LOW:2ã€IMPORTANCE_DEFAULT:3ã€IMPORTANCE_HIGH:4 。 |\n@| lockscreenVisibility | number \\| null | å¦ | -1000 | - | é”å±å¯è§æ€§ï¼Œå¯é€‰èŒƒå›´VISIBILITY_PRIVATE:0ã€VISIBILITY_PUBLIC:1ã€VISIBILITY_SECRET:-1ã€VISIBILITY_NO_OVERRIDE:-1000。 | \n\n\n##### setPushChannel 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.98 | x |\n\n\n#### getAllChannels() @getallchannels\n获å–当å‰åº”ç”¨æ³¨å†Œçš„æ‰€æœ‰çš„é€šçŸ¥æ¸ é“。<br/>\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| Array\\<string\\> |\n \n\n##### getAllChannels 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.98 | x |\n\n \n","compatibility":"### getChannelManager 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.98 | x |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.push.uni-push.getChannelManager)\n"},"createPushMessage":{"name":"## uni.createPushMessage(options) @createpushmessage","description":"创建本地通知æ 消æ¯","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **CreatePushMessageOptions** | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| cover | boolean \\| null | å¦ | false | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"4.18\"]]}' /> | 是å¦è¦†ç›–上一次æç¤ºçš„æ¶ˆæ¯ |\n@| delay | number \\| null | å¦ | 0 | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"4.18\"]]}' /> | æ示消æ¯å»¶è¿Ÿæ˜¾ç¤ºçš„时间,å•ä½ä¸ºs |\n@| icon | string \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"x\"]]}' /> | 推é€æ¶ˆæ¯çš„å›¾æ ‡ |\n@| sound | string \\| null | å¦ | \"system\" | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"4.18\"]]}' /> | 推é€æ¶ˆæ¯çš„æ示音<br/>- system: 使用系统通知æ示音(默认值)<br/>- none: ä¸ä½¿ç”¨æ示音 |\n@| title | string \\| null | å¦ | Appçš„å称 | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"4.18\"]]}' /> | 推é€æ¶ˆæ¯çš„æ ‡é¢˜ |\n@| content | string | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"4.18\"]]}' /> | 消æ¯æ˜¾ç¤ºçš„内容,在系统通知ä¸å¿ƒä¸æ˜¾ç¤ºçš„文本内容<br/> |\n@| payload | any \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"4.18\"]]}' /> | 消æ¯æ‰¿è½½çš„æ•°æ®ï¼Œå¯æ ¹æ®ä¸šåŠ¡é€»è¾‘自定义数æ®æ ¼å¼ |\n@| when | number \\| null | å¦ | 当å‰æ—¶é—´ | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"x\"]]}' /> | 消æ¯ä¸Šæ˜¾ç¤ºçš„æ示时间 |\n@| channelId | string \\| null | å¦ | \"DcloudChannelID\" | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"x\"]]}' /> | æ¸ é“id |\n@| category | string \\| null | å¦ | null | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.98\",\"x\"]]}' /> | 通知类别 |\n@| success | (result: CreatePushMessageSuccess) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void \\| null | å¦ | null | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n","returnValue":"","compatibility":"### createPushMessage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.98 | 4.18 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/plugins/push.html#createpushmessage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.push.uni-push.createPushMessage)\n"},"getBatteryInfo":{"name":"## uni.getBatteryInfo(options) @getbatteryinfo","description":"获å–ç”µæ± ç”µé‡ä¿¡æ¯<br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-getbatteryinfo](https://ext.dcloud.net.cn/plugin?name=uni-getbatteryinfo)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [GetBatteryInfoOptions](#getbatteryinfooptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (res: [GetBatteryInfoSuccess](#getbatteryinfosuccess-values)) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ |\n@| fail | (res: UniError) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调 | \n\n##### GetBatteryInfoSuccess 的属性值 @getbatteryinfosuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n| level | number | 是 | - | - | 设备电é‡ï¼ŒèŒƒå›´1 - 100 |\n| isCharging | boolean | 是 | - | - | 是å¦æ£åœ¨å……ç”µä¸ |\n","returnValue":"","compatibility":"### getBatteryInfo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-battery-info.getBatteryInfo)\n"},"getBatteryInfoSync":{"name":"## uni.getBatteryInfoSync() @getbatteryinfosync","description":"获å–ç”µæ± ç”µé‡ä¿¡æ¯<br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-getbatteryinfo](https://ext.dcloud.net.cn/plugin?name=uni-getbatteryinfo)<br/>","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| **GetBatteryInfoResult** |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| level | number | 是 | - | - | 设备电é‡ï¼ŒèŒƒå›´1 - 100 |\n@| isCharging | boolean | 是 | - | - | 是å¦æ£åœ¨å……ç”µä¸ | \n","compatibility":"### getBatteryInfoSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-battery-info.getBatteryInfoSync)\n"},"get-battery-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-battery-info/get-battery-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-battery-info/get-battery-info\n>Template\n```vue\n<template>\n <view>\n <text>当å‰ç”µé‡ï¼š{{level}}%</text>\n <text>是å¦å……电ä¸ï¼š{{isCharging}}</text>\n </view>\n</template>\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n level: 0,\n isCharging: false\n }\n },\n onLoad() {\n try {\n uni.getBatteryInfo({\n success: res => {\n this.level = res.level;\n this.isCharging = res.isCharging;\n }\n });\n } catch (e) {\n console.error((e as Error).message);\n uni.showModal({\n content: (e as Error).message,\n showCancel: false\n });\n }\n }\n }\n\n```\n:::"},"startWifi":{"name":"## uni.startWifi(option) @startwifi","description":"åˆå§‹åŒ–Wi-Fi模å—<br/><br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| option | [WifiOption](#wifioption-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (res: [UniWifiResult](#uniwifiresult-values)) => void | å¦ | - | - | - |\n@| fail | (res: UniError) => void | å¦ | - | - | - |\n@| complete | (res: any) => void | å¦ | - | - | - | \n\n##### UniWifiResult 的属性值 @uniwifiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | - |\n| errMsg | string | 是 | - | - | - |\n| wifi | **UniWifiInfo** \\| null | å¦ | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| SSID | string | 是 | - | - | - |\n@| BSSID | string | å¦ | - | - | - |\n@| secure | boolean | å¦ | - | - | - |\n@| signalStrength | number | å¦ | - | - | - |\n@| frequency | number | å¦ | - | - | - |\n","returnValue":"","compatibility":"### startWifi 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/wifi.html#startwifi)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.startWifi)\n"},"stopWifi":{"name":"## uni.stopWifi(option) @stopwifi","description":"å…³é— Wi-Fi 模å—<br/><br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| option | [WifiOption](#wifioption-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (res: [UniWifiResult](#uniwifiresult-values)) => void | å¦ | - | - | - |\n@| fail | (res: UniError) => void | å¦ | - | - | - |\n@| complete | (res: any) => void | å¦ | - | - | - | \n\n##### UniWifiResult 的属性值 @uniwifiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | - |\n| errMsg | string | 是 | - | - | - |\n| wifi | **UniWifiInfo** \\| null | å¦ | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| SSID | string | 是 | - | - | - |\n@| BSSID | string | å¦ | - | - | - |\n@| secure | boolean | å¦ | - | - | - |\n@| signalStrength | number | å¦ | - | - | - |\n@| frequency | number | å¦ | - | - | - |\n","returnValue":"","compatibility":"### stopWifi 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | x | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/wifi.html#stopwifi)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.stopWifi)\n"},"connectWifi":{"name":"## uni.connectWifi(option) @connectwifi","description":"","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| option | [WifiConnectOption](#wificonnectoption-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| SSID | string | å¦ | - | - | - |\n@| BSSID | string | å¦ | - | - | - |\n@| password | string | å¦ | - | - | - |\n@| maunal | boolean | å¦ | - | - | - |\n@| partialInfo | boolean | å¦ | - | - | - |\n@| success | (res: [UniWifiResult](#uniwifiresult-values)) => void | å¦ | - | - | - |\n@| fail | (res: UniError) => void | å¦ | - | - | - |\n@| complete | (res: any) => void | å¦ | - | - | - | \n\n##### UniWifiResult 的属性值 @uniwifiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | - |\n| errMsg | string | 是 | - | - | - |\n| wifi | **UniWifiInfo** \\| null | å¦ | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| SSID | string | 是 | - | - | - |\n@| BSSID | string | å¦ | - | - | - |\n@| secure | boolean | å¦ | - | - | - |\n@| signalStrength | number | å¦ | - | - | - |\n@| frequency | number | å¦ | - | - | - |\n","returnValue":"","compatibility":"### connectWifi 兼容性 \n| Web | Android 系统版本 | Android | iOS |\n| :- | :- | :- | :- |\n| - | >=4.4 && <10.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/wifi.html#connectWifi)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.connectWifi)\n"},"getWifiList":{"name":"## uni.getWifiList(option) @getwifilist","description":"è¯·æ±‚èŽ·å– Wi-Fi 列表。wifiList æ•°æ®ä¼šåœ¨ onGetWifiList 注册的回调ä¸è¿”回。<br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| option | [WifiOption](#wifioption-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (res: [UniWifiResult](#uniwifiresult-values)) => void | å¦ | - | - | - |\n@| fail | (res: UniError) => void | å¦ | - | - | - |\n@| complete | (res: any) => void | å¦ | - | - | - | \n\n##### UniWifiResult 的属性值 @uniwifiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | - |\n| errMsg | string | 是 | - | - | - |\n| wifi | **UniWifiInfo** \\| null | å¦ | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| SSID | string | 是 | - | - | - |\n@| BSSID | string | å¦ | - | - | - |\n@| secure | boolean | å¦ | - | - | - |\n@| signalStrength | number | å¦ | - | - | - |\n@| frequency | number | å¦ | - | - | - |\n","returnValue":"","compatibility":"### getWifiList 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/wifi.html#getWifiList)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.getWifiList)\n"},"onGetWifiList":{"name":"## uni.onGetWifiList(callback) @ongetwifilist","description":"监å¬èŽ·å–到 Wi-Fi 列表数æ®äº‹ä»¶ã€‚<br/><br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (wifiInfo: any) => void | 是 | - | - | | \n","returnValue":"","compatibility":"### onGetWifiList 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/wifi.html#onGetWifiList)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.onGetWifiList)\n"},"offGetWifiList":{"name":"## uni.offGetWifiList(callback) @offgetwifilist","description":"移除获å–到 Wi-Fi 列表数æ®äº‹ä»¶çš„监å¬å‡½æ•°ã€‚<br/><br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | () => void | 是 | - | - | | \n","returnValue":"","compatibility":"### offGetWifiList 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/wifi.html#offGetWifiList)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.offGetWifiList)\n"},"getConnectedWifi":{"name":"## uni.getConnectedWifi(option) @getconnectedwifi","description":"获å–已连接的 Wi-Fi ä¿¡æ¯<br/><br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| option | [GetConnectedWifiOptions](#getconnectedwifioptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| partialInfo | boolean | å¦ | - | - | - |\n@| success | (res: [UniWifiResult](#uniwifiresult-values)) => void | å¦ | - | - | - |\n@| fail | (res: UniError) => void | å¦ | - | - | - |\n@| complete | (res: any) => void | å¦ | - | - | - | \n\n##### UniWifiResult 的属性值 @uniwifiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | - |\n| errMsg | string | 是 | - | - | - |\n| wifi | **UniWifiInfo** \\| null | å¦ | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| SSID | string | 是 | - | - | - |\n@| BSSID | string | å¦ | - | - | - |\n@| secure | boolean | å¦ | - | - | - |\n@| signalStrength | number | å¦ | - | - | - |\n@| frequency | number | å¦ | - | - | - |\n","returnValue":"","compatibility":"### getConnectedWifi 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/wifi.html#getConnectedWifi)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.getConnectedWifi)\n"},"onWifiConnected":{"name":"## uni.onWifiConnected(callback) @onwificonnected","description":"监å¬è¿žæŽ¥ä¸Š Wi-Fi 的事件<br/><br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (wifiInfo: [UniWifiResult](#uniwifiresult-values)) => void | 是 | - | - | | \n\n#### UniWifiResult 的属性值 @uniwifiresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | - |\n| errSubject | string | 是 | - | - | - |\n| errMsg | string | 是 | - | - | - |\n| wifi | **UniWifiInfo** \\| null | å¦ | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| SSID | string | 是 | - | - | - |\n@| BSSID | string | å¦ | - | - | - |\n@| secure | boolean | å¦ | - | - | - |\n@| signalStrength | number | å¦ | - | - | - |\n@| frequency | number | å¦ | - | - | - |\n","returnValue":"","compatibility":"### onWifiConnected 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/wifi.html#onWifiConnected)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.onWifiConnected)\n"},"onWifiConnectedWithPartialInfo":{"name":"## uni.onWifiConnectedWithPartialInfo(callback) @onwificonnectedwithpartialinfo","description":"监å¬è¿žæŽ¥ä¸Š Wi-Fi 的事件。<br/><br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (wifiInfo: [UniWifiInfoWithPartialInfo](#uniwifiinfowithpartialinfo-values)) => void | 是 | - | - | | \n\n#### UniWifiInfoWithPartialInfo 的属性值 @uniwifiinfowithpartialinfo-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| SSID | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### onWifiConnectedWithPartialInfo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/wifi.html#onWifiConnectedWithPartialInfo)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.onWifiConnectedWithPartialInfo)\n"},"offWifiConnected":{"name":"## uni.offWifiConnected(callback?) @offwificonnected","description":"移除连接上 Wi-Fi 的事件的监å¬å‡½æ•°ã€‚<br/><br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | () => void \\| null | å¦ | - | - | | \n","returnValue":"","compatibility":"### offWifiConnected 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/wifi.html#offWifiConnected)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.offWifiConnected)\n"},"onMemoryWarning":{"name":"## uni.onMemoryWarning(callback) @onmemorywarning","description":"å¼€å¯ç›‘å¬å†…å˜è¦å‘Š<br/><br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-memorywarning](https://ext.dcloud.net.cn/plugin?name=uni-memorywarning)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (res: [MemoryWarningCallbackResult](#memorywarningcallbackresult-values)) => void | 是 | - | - | | \n\n#### MemoryWarningCallbackResult 的属性值 @memorywarningcallbackresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| level | number | 是 | - | - | 内å˜è¦å‘Šç‰çº§(仅安å“å¹³å°æœ‰æ•ˆï¼ŒiOS始终是0) |\n","returnValue":"","compatibility":"### onMemoryWarning 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/memory.html#onmemorywarning)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.memory.onMemoryWarning)\n"},"offMemoryWarning":{"name":"## uni.offMemoryWarning(callback?) @offmemorywarning","description":"å–消监å¬å†…å˜ä¸è¶³å‘Šè¦äº‹ä»¶<br/><br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-memorywarning](https://ext.dcloud.net.cn/plugin?name=uni-memorywarning)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (res: [MemoryWarningCallbackResult](#memorywarningcallbackresult-values)) => void \\| null | å¦ | - | - | | \n\n#### MemoryWarningCallbackResult 的属性值 @memorywarningcallbackresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| level | number | 是 | - | - | 内å˜è¦å‘Šç‰çº§(仅安å“å¹³å°æœ‰æ•ˆï¼ŒiOS始终是0) |\n","returnValue":"","compatibility":"### offMemoryWarning 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/memory.html#offmemorywarning)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.memory.offMemoryWarning)\n"},"onUserCaptureScreen":{"name":"## uni.onUserCaptureScreen(callback?) @onusercapturescreen","description":"å¼€å¯æˆªå±ç›‘å¬<br/><br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-usercapturescreen](https://ext.dcloud.net.cn/plugin?name=uni-usercapturescreen)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (res: [OnUserCaptureScreenCallbackResult](#onusercapturescreencallbackresult-values)) => void \\| null | å¦ | - | - | | \n\n#### OnUserCaptureScreenCallbackResult 的属性值 @onusercapturescreencallbackresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| path | string | å¦ | - | - | 截å±æ–‡ä»¶è·¯å¾„(仅Android返回) |\n","returnValue":"","compatibility":"### onUserCaptureScreen 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/capture-screen.html#onusercapturescreen)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.captureScreen.onUserCaptureScreen)\n"},"offUserCaptureScreen":{"name":"## uni.offUserCaptureScreen(callback?) @offusercapturescreen","description":"å…³é—截å±ç›‘å¬<br/><br/>> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载æ’件:[uni-usercapturescreen](https://ext.dcloud.net.cn/plugin?name=uni-usercapturescreen)<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (res: [OnUserCaptureScreenCallbackResult](#onusercapturescreencallbackresult-values)) => void \\| null | å¦ | - | - | | \n\n#### OnUserCaptureScreenCallbackResult 的属性值 @onusercapturescreencallbackresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| path | string | å¦ | - | - | 截å±æ–‡ä»¶è·¯å¾„(仅Android返回) |\n","returnValue":"","compatibility":"### offUserCaptureScreen 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/system/capture-screen.html#offusercapturescreen)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.captureScreen.offUserCaptureScreen)\n"},"createRequestPermissionListener":{"name":"## uni.createRequestPermissionListener() @createrequestpermissionlistener","description":"创建一个监å¬æƒé™ç”³è¯·çš„对象。","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [RequestPermissionListener](#requestpermissionlistener-values) |\n\n#### RequestPermissionListener 的方法 @requestpermissionlistener-values \n\n#### onRequest(callback) @onrequest\n监å¬ç”³è¯·ç³»ç»Ÿæƒé™\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (permissions: Array\\<string\\>) => void | 是 | - | - | 申请系统æƒé™å›žè°ƒï¼Œpermissions为触å‘æƒé™ç”³è¯·çš„所有æƒé™ | \n\n\n##### onRequest 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### onConfirm(callback) @onconfirm\n监å¬å¼¹å‡ºç³»ç»Ÿæƒé™æŽˆæƒæ¡†\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (permissions: Array\\<string\\>) => void | 是 | - | - | 弹出系统æƒé™æŽˆæƒæ¡†å›žè°ƒï¼Œpermissions为触å‘弹出æƒé™æŽˆæƒæ¡†çš„所有æƒé™ | \n\n\n##### onConfirm 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### onComplete(callback) @oncomplete\n监å¬æƒé™ç”³è¯·å®Œæˆ\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (permissions: Array\\<string\\>) => void | 是 | - | - | æƒé™ç”³è¯·å®Œæˆå›žè°ƒï¼Œpermissions为申请完æˆçš„所有æƒé™ | \n\n\n##### onComplete 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### stop() @stop\nå–消所有监å¬\n\n\n##### stop 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n \n","compatibility":"### createRequestPermissionListener 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 4.0 | - |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.createRequestPermissionListener)\n","example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/create-request-permission-listener/create-request-permission-listener.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\n <!-- #ifdef APP -->\n <scroll-view style=\"flex:1\">\n <!-- #endif -->\n <page-head title=\"æƒé™ç”³è¯·ç›‘å¬\"></page-head>\n <view class=\"permission-alert\" id=\"permission-alert\" :style=\"{'transform':isPermissionAlertShow ? 'translateY(0)':'translateY(-110px)'}\">\n <text style=\"font-size: 20px;margin-bottom: 10px;margin-top: 5px;\">访问日历æƒé™ç”³è¯·è¯´æ˜Žï¼š</text>\n <text style=\"color: darkgray;\">uni-app xæ£åœ¨ç”³è¯·è®¿é—®æ—¥åŽ†æƒé™ç”¨äºŽæ¼”示,å…许或拒ç»å‡ä¸ä¼šèŽ·å–任何éšç§ä¿¡æ¯ã€‚</text>\n </view>\n <button type=\"primary\" style=\"margin: 10px;\" @click=\"requestPermission\">点击申请日历æƒé™</button>\n\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n<script>\n export default {\n data() {\n return {\n isPermissionAlertShow: false,\n permissionAlert: null as UniElement | null,\n timeoutId: -1,\n permissionListener: null as RequestPermissionListener | null\n }\n },\n\n onReady() {\n this.watchPermissionRRequest()\n },\n onUnload() {\n this.permissionListener?.stop()\n this.permissionListener = null\n clearTimeout(this.timeoutId)\n },\n methods: {\n watchPermissionRRequest() {\n this.permissionListener = uni.createRequestPermissionListener()\n this.permissionListener!.onConfirm((_) => {\n // TODO ç›®å‰onConfirm监å¬å®žçŽ°çš„在时间上ä¸å¤Ÿç²¾ç¡®ï¼Œæš‚时需è¦å»¶è¿Ÿå¼¹æ¡†ï¼ŒåŽç»ä¿®å¤\n // TODO 这里的弹框仅为演示,实际开å‘ä¸ç›‘å¬æƒé™ç”³è¯·çš„代ç 应该在app.uvueä¸ï¼Œå¼¹æ¡†åº”全局处ç†ï¼Œå¯å‚考https://gitcode.net/dcloud/uni-api/-/tree/master/uni_modules/uni-prompt/utssdk/app-android 代ç 自行å°è£…一个uts的全局弹框\n this.timeoutId = setTimeout(() => {\n this.isPermissionAlertShow = true\n }, 100)\n })\n this.permissionListener!.onComplete((_) => {\n clearTimeout(this.timeoutId)\n this.isPermissionAlertShow = false\n })\n },\n requestPermission() {\n // #ifdef APP-ANDROID\n if (UTSAndroid.checkSystemPermissionGranted(UTSAndroid.getUniActivity()!, [\"android.permission.READ_CALENDAR\"])) {\n uni.showToast({\n title: \"æƒé™å·²ç»åŒæ„了,ä¸éœ€è¦å†ç”³è¯·\",\n position: \"bottom\"\n })\n return\n }\n UTSAndroid.requestSystemPermission(UTSAndroid.getUniActivity()!, [\"android.permission.READ_CALENDAR\"], (_ : boolean, p : string[]) => {\n console.log(p)\n }, (_ : boolean, p : string[]) => {\n uni.showToast({\n title: \"æƒé™è¢«æ‹’ç»äº†\",\n position: \"bottom\"\n })\n console.log(p)\n })\n // #endif\n }\n }\n }\n</script>\n\n<style>\n .permission-alert {\n width: 90%;\n height: 100px;\n margin: 10px 5%;\n position: absolute;\n top: 0px;\n z-index: 3;\n border-radius: 5px;\n transition-property: transform;\n transition-duration: 200ms;\n background-color: white;\n padding: 10px;\n }\n</style>\n\n```"},"chooseImage":{"name":"## uni.chooseImage(options) @chooseimage","description":"从本地相册选择图片或使用相机æ‹ç…§","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ChooseImageOptions](#chooseimageoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| count | number \\| null | å¦ | 9 | - | 最多å¯ä»¥é€‰æ‹©çš„å›¾ç‰‡å¼ æ•°ï¼Œapp端ä¸é™åˆ¶ï¼Œå¾®ä¿¡å°ç¨‹åºæœ€å¤šå¯æ”¯æŒ20个。 |\n@| sourceType | Array\\<string\\> \\| null | å¦ | ['album','camera'\\] | - | album 从相册选图,camera 使用相机,默认二者都有 |\n@| success | (callback: [ChooseImageSuccess](#chooseimagesuccess-values)) => void \\| null | å¦ | - | - | æˆåŠŸåˆ™è¿”回图片的本地文件路径列表 tempFilePaths |\n@| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (callback: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### ChooseImageSuccess 的属性值 @chooseimagesuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errSubject | string | 是 | - | - | 调用APIçš„å称 |\n| errMsg | string | 是 | - | - | æè¿°ä¿¡æ¯ |\n| tempFilePaths | Array\\<string\\> | 是 | - | - | 图片的本地文件路径列表 |\n| tempFiles | any | 是 | - | - | 图片的本地文件列表 |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | - | 错误ç <br/>- 1101001 用户å–消<br/>- 1101002 urls至少包å«ä¸€å¼ 图片地å€<br/>- 1101003 文件ä¸å˜åœ¨<br/>- 1101004 å›¾ç‰‡åŠ è½½å¤±è´¥<br/>- 1101005 未获å–æƒé™<br/>- 1101006 图片或视频ä¿å˜å¤±è´¥<br/>- 1101007 图片è£å‰ªå¤±è´¥<br/>- 1101008 æ‹ç…§æˆ–录åƒå¤±è´¥<br/>- 1101009 图片压缩失败<br/>- 1101010 其他错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### chooseImage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/media/image?id=chooseimage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.choose-image)\n"},"choose-image":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/choose-image/choose-image.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/choose-image/choose-image\n>Template\n```vue\n<template>\n <!-- #ifdef APP -->\n <scroll-view class=\"page-scroll-view\">\n <!-- #endif -->\n <view>\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-common-mt\">\n <view class=\"uni-list\">\n <view class=\"uni-list-cell cell-pd\">\n <view class=\"uni-list-cell-left uni-label\">\n 图片æ¥æº\n </view>\n <view class=\"uni-list-cell-right\" @click=\"chooseImageSource\">\n <text class=\"click-t\">{{sourceType[sourceTypeIndex]}}</text>\n </view>\n </view>\n\n <view class=\"uni-list-cell cell-pd\">\n <view class=\"uni-list-cell-left uni-label\">\n 图片质é‡\n </view>\n <view class=\"uni-list-cell-right\" @click=\"chooseImageType\">\n <text class=\"click-t\">{{sizeType[sizeTypeIndex]}}</text>\n </view>\n </view>\n\n <view class=\"uni-list-cell cell-pd\">\n <view class=\"uni-list-cell-left uni-label\">\n æ•°é‡é™åˆ¶\n </view>\n <view class=\"uni-list-cell-right\">\n <input class=\"click-t\" :value=\"countIndex+1\" type=\"number\" :maxlength=\"1\" @confirm=\"chooseImageCount\" confirm-type=\"done\" />\n </view>\n </view>\n <view class=\"uni-list-cell cell-pd\">\n <view class=\"uni-list-cell-left uni-label\">\n 图åƒè£å‰ª\n </view>\n <view class=\"uni-list-cell-right\">\n <switch :checked=\"isCrop\" @change=\"switchCrop\"></switch>\n </view>\n </view>\n <view ref=\"cropOptionNode\" class=\"crop-option\" :style=\"{'height':isCrop?'200px':'0px','margin-bottom':isCrop?'11px':'0px'}\">\n <view class=\"uni-list-cell cell-pd\">\n <view class=\"uni-list-cell-left item_width\">\n 图片质é‡(%)\n </view>\n <view class=\"uni-list-cell-right\">\n <input :value=\"cropPercent\" @confirm=\"cropPercentConfim\" type=\"number\" maxlength=\"-1\"/>\n </view>\n </view>\n <view class=\"uni-list-cell cell-pd\">\n <view class=\"uni-list-cell-left item_width\">\n è£å‰ªå®½åº¦(px)\n </view>\n <view class=\"uni-list-cell-right\">\n <input :value=\"cropWidth\" @confirm=\"cropWidthConfim\" type=\"number\" maxlength=\"-1\"/>\n </view>\n </view>\n <view class=\"uni-list-cell cell-pd\">\n <view class=\"uni-list-cell-left item_width\">\n è£å‰ªé«˜åº¦(px)\n </view>\n <view class=\"uni-list-cell-right\">\n <input :value=\"cropHeight\" @confirm=\"cropHeightConfim\" type=\"number\" maxlength=\"-1\"/>\n </view>\n </view>\n <view class=\"uni-list-cell cell-pd\">\n <view class=\"uni-list-cell-left item_width\">\n ä¿ç•™åŽŸå®½é«˜\n </view>\n <view class=\"uni-list-cell-right\">\n <switch :checked=\"cropResize\" @change=\"cropResizeChange\"></switch>\n </view>\n </view>\n </view>\n </view>\n\n <view class=\"uni-list list-pd\" style=\"padding: 15px;\">\n <view class=\"uni-flex\" style=\"margin-bottom: 10px;\">\n <view class=\"uni-list-cell-left\">点击å¯é¢„览选好的图片</view>\n <view style=\"margin-left: auto;\">\n <text class=\"click-t\">{{imageList.length}}/{{countIndex+1}}</text>\n </view>\n </view>\n <view class=\"uni-flex\" style=\"flex-wrap: wrap;\">\n <view v-for=\"(image,index) in imageList\" :key=\"index\" class=\"uni-uploader__input-box\" style=\"border: 0;\">\n <image style=\"width: 104px; height: 104px;\" :src=\"image\" :data-src=\"image\" @tap=\"previewImage(index)\">\n </image>\n <image src=\"/static/plus.png\" class=\"image-remove\" @click=\"removeImage(index)\"></image>\n </view>\n <image class=\"uni-uploader__input-box\" @tap=\"chooseImage\" src=\"/static/plus.png\"></image>\n </view>\n </view>\n </view>\n </view>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n\n\n<style>\n .cell-pd {\n padding: 11px 15px;\n }\n\n .click-t {\n color: darkgray;\n }\n\n .list-pd {\n margin-top: 25px;\n }\n\n .uni-uploader__input-box {\n margin: 5px;\n width: 104px;\n height: 104px;\n border: 1px solid #D9D9D9;\n }\n\n .uni-uploader__input {\n position: absolute;\n z-index: 1;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n }\n\n .image-remove {\n transform: rotate(45deg);\n width: 25px;\n height: 25px;\n position: absolute;\n top: 0;\n right: 0;\n border-radius: 13px;\n background-color: rgba(200, 200, 200, 0.8);\n }\n\n .item_width {\n width: 130px;\n }\n\n .crop-option {\n margin-left: 11px;\n margin-right: 11px;\n border-radius: 11px;\n background-color: #eee;\n transition-property: height, margin-bottom;\n transition-duration: 200ms;\n }\n</style>\n\n```\n>Script\n```uts\n\n var sourceTypeArray = [\n ['camera'],\n ['album'],\n ['camera', 'album']\n ]\n var sizeTypeArray = [\n ['compressed'],\n ['original'],\n ['compressed', 'original']\n ]\n export default {\n data() {\n return {\n title: 'chooseImage',\n imageList: [] as Array<string>,\n sourceTypeIndex: 2,\n sourceType: ['æ‹ç…§', '相册', 'æ‹ç…§æˆ–相册'],\n sizeTypeIndex: 2,\n sizeType: ['压缩', '原图', '压缩或原图'],\n countIndex: 8,\n count: [1, 2, 3, 4, 5, 6, 7, 8, 9],\n isCrop: false,\n cropPercent: 80,\n cropWidth: 100,\n cropHeight: 100,\n cropResize: false\n }\n },\n onUnload() {\n this.imageList = [];\n this.sourceTypeIndex = 2\n this.sourceType = ['æ‹ç…§', '相册', 'æ‹ç…§æˆ–相册']\n this.sizeTypeIndex = 2\n this.sizeType = ['压缩', '原图', '压缩或原图']\n this.countIndex = 8\n },\n methods: {\n cropHeightConfim(e : InputConfirmEvent) {\n let value = parseInt(e.detail.value)\n if (value > 0) {\n this.cropHeight = value\n } else {\n uni.showToast({\n position: \"bottom\",\n title: \"è£å‰ªé«˜åº¦éœ€è¦å¤§äºŽ0\"\n })\n }\n },\n cropWidthConfim(e : InputConfirmEvent) {\n let value = parseInt(e.detail.value)\n if (value > 0) {\n this.cropWidth = value\n } else {\n uni.showToast({\n position: \"bottom\",\n title: \"è£å‰ªå®½åº¦éœ€è¦å¤§äºŽ0\"\n })\n }\n },\n cropPercentConfim(e : InputConfirmEvent) {\n let value = parseInt(e.detail.value)\n if (value > 0 && value <= 100) {\n this.cropPercent = value\n } else {\n uni.showToast({\n position: \"bottom\",\n title: \"请输入0~100之间的值\"\n })\n }\n },\n cropResizeChange(e : UniSwitchChangeEvent) {\n this.cropResize = e.detail.value\n },\n switchCrop(e : UniSwitchChangeEvent) {\n this.isCrop = e.detail.value\n },\n removeImage(index : number) {\n this.imageList.splice(index, 1)\n },\n chooseImageSource() {\n uni.showActionSheet({\n itemList: ['æ‹ç…§', '相册', 'æ‹ç…§æˆ–相册'],\n success: (e) => {\n this.sourceTypeIndex = e.tapIndex!\n }\n })\n },\n chooseImageType() {\n uni.showActionSheet({\n itemList: ['压缩', '原图', '压缩或原图'],\n success: (e) => {\n this.sizeTypeIndex = e.tapIndex!\n }\n })\n },\n chooseImageCount(event : InputConfirmEvent) {\n let count = parseInt(event.detail.value) - 1\n if (count < 0) {\n uni.showToast({\n position: \"bottom\",\n title: \"图片数é‡åº”该大于0\"\n })\n return\n }\n this.countIndex = count\n },\n chooseImage: function () {\n // var cropOption:ChooseImageCropOptions|null = this.isCrop ? null : new ChooseImageCropOptions( )\n if (this.imageList.length >= 9) {\n uni.showToast({\n position: \"bottom\",\n title: \"å·²ç»æœ‰9å¼ å›¾ç‰‡äº†ï¼Œè¯·åˆ é™¤éƒ¨åˆ†å›¾ç‰‡ä¹‹åŽé‡æ–°é€‰æ‹©\"\n })\n return\n }\n uni.chooseImage({\n sourceType: sourceTypeArray[this.sourceTypeIndex],\n sizeType: sizeTypeArray[this.sizeTypeIndex],\n crop: this.isCrop ? { \"quality\": this.cropPercent, \"width\": this.cropWidth, \"height\": this.cropHeight, \"resize\": this.cropResize } as ChooseImageCropOptions : null,\n count: this.imageList.length + this.count[this.countIndex] > 9 ? 9 - this.imageList.length : this.count[this.countIndex],\n success: (res) => {\n this.imageList = this.imageList.concat(res.tempFilePaths);\n },\n fail: (err) => {\n console.log(\"err: \", JSON.stringify(err));\n }\n })\n },\n previewImage: function (index : number) {\n uni.previewImage({\n current: index,\n urls: this.imageList\n })\n }\n }\n }\n\n```\n:::"},"previewImage":{"name":"## uni.previewImage(options) @previewimage","description":"预览图片","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [PreviewImageOptions](#previewimageoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| current | any \\| null | å¦ | - | - | current 为当å‰æ˜¾ç¤ºå›¾ç‰‡çš„链接/索引值,ä¸å¡«æˆ–å¡«å†™çš„å€¼æ— æ•ˆåˆ™ä¸º urls çš„ç¬¬ä¸€å¼ ã€‚APPå¹³å°ä»…支æŒç´¢å¼•å€¼ã€‚ |\n@| urls | Array\\<[string.ImageURIString](/uts/data-type.md#ide-string)\\> | 是 | - | - | 需è¦é¢„览的图片链接列表 |\n@| indicator | string \\| null | å¦ | - | - | å›¾ç‰‡æŒ‡ç¤ºå™¨æ ·å¼<br/>- default: 底部圆点指示器<br/>- number: 顶部数å—指示器<br/>- none: ä¸æ˜¾ç¤ºæŒ‡ç¤ºå™¨ |\n@| loop | boolean \\| null | å¦ | - | - | 是å¦å¯å¾ªçŽ¯é¢„览 |\n@| success | (callback: [PreviewImageSuccess](#previewimagesuccess-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (callback: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### PreviewImageSuccess 的属性值 @previewimagesuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errSubject | string | 是 | - | - | 调用APIçš„å称 |\n| errMsg | string | 是 | - | - | æè¿°ä¿¡æ¯ |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | - | 错误ç <br/>- 1101001 用户å–消<br/>- 1101002 urls至少包å«ä¸€å¼ 图片地å€<br/>- 1101003 文件ä¸å˜åœ¨<br/>- 1101004 å›¾ç‰‡åŠ è½½å¤±è´¥<br/>- 1101005 未获å–æƒé™<br/>- 1101006 图片或视频ä¿å˜å¤±è´¥<br/>- 1101007 图片è£å‰ªå¤±è´¥<br/>- 1101008 æ‹ç…§æˆ–录åƒå¤±è´¥<br/>- 1101009 图片压缩失败<br/>- 1101010 其他错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### previewImage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/media/image?id=previewimage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.preview-image.previewImage)\n"},"closePreviewImage":{"name":"## uni.closePreviewImage(options) @closepreviewimage","description":"å…³é—图片预览","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ClosePreviewImageOptions](#closepreviewimageoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (callback: [ClosePreviewImageSuccess](#closepreviewimagesuccess-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (callback: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### ClosePreviewImageSuccess 的属性值 @closepreviewimagesuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | é”™è¯¯ä¿¡æ¯ |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | - | 错误ç <br/>- 1101001 用户å–消<br/>- 1101002 urls至少包å«ä¸€å¼ 图片地å€<br/>- 1101003 文件ä¸å˜åœ¨<br/>- 1101004 å›¾ç‰‡åŠ è½½å¤±è´¥<br/>- 1101005 未获å–æƒé™<br/>- 1101006 图片或视频ä¿å˜å¤±è´¥<br/>- 1101007 图片è£å‰ªå¤±è´¥<br/>- 1101008 æ‹ç…§æˆ–录åƒå¤±è´¥<br/>- 1101009 图片压缩失败<br/>- 1101010 其他错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### closePreviewImage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/media/image?id=closepreviewimage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.preview-image.closePreviewImage)\n"},"preview-image":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/preview-image/preview-image.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/preview-image/preview-image\n>Template\n```vue\n<template>\n <!-- #ifdef APP -->\n <scroll-view style=\"flex: 1\">\n <!-- #endif -->\n <view style=\"padding-left: 8px; padding-right: 8px\">\n <view>\n <text class=\"text-desc\">å›¾ç‰‡æŒ‡ç¤ºå™¨æ ·å¼</text>\n <radio-group class=\"cell-ct\" style=\"background-color: white\" @change=\"onIndicatorChanged\">\n <view class=\"indicator-it\" v-for=\"(item, index) in indicator\" :key=\"item.value\">\n <radio :checked=\"index == 0\" :value=\"item.value\">{{\n item.name\n }}</radio>\n </view>\n </radio-group>\n </view>\n <view>\n <checkbox-group @change=\"onCheckboxChange\" style=\"margin-top: 16px; margin-bottom: 16px; margin-left: 8px\">\n <checkbox :checked=\"isLoop\" style=\"margin-right: 15px\">循环æ’放</checkbox>\n </checkbox-group>\n </view>\n <view style=\"background-color: white\">\n <text class=\"text-desc\">点击图片开始预览</text>\n <view class=\"cell-ct\" style=\"margin: 8px;\">\n <view class=\"cell cell-choose-image\" v-for=\"(image, index) in imageList\" :key=\"index\">\n <image style=\"width: 100px; height: 100px\" mode=\"aspectFit\" :src=\"image\" @click=\"previewImage(index)\">\n </image>\n </view>\n <image class=\"cell cell-choose-image\" src=\"/static/plus.png\" @click=\"chooseImage\">\n <view></view>\n </image>\n </view>\n </view>\n </view>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n\n\n<style>\n .text-desc {\n margin-top: 16px;\n margin-left: 8px;\n margin-bottom: 16px;\n font-weight: bold;\n }\n\n .cell-ct {\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n }\n\n .cell {\n margin-left: 3px;\n margin-right: 3px;\n width: 100px;\n height: 100px;\n }\n\n .cell-choose-image {\n border-width: 1px;\n border-style: solid;\n border-color: lightgray;\n }\n\n .indicator-it {\n margin: 8px;\n }\n</style>\n\n```\n>Script\n```uts\n\n type ItemType = {\n value : string,\n name : string\n }\n\n export default {\n data() {\n return {\n imageList: [\"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni@2x.png\", \"/static/uni.png\"],\n indicator: [{\n value: \"default\",\n name: \"圆点\"\n }, {\n value: \"number\",\n name: \"æ•°å—\"\n }, {\n value: \"none\",\n name: \"ä¸æ˜¾ç¤º\"\n }] as ItemType[],\n currentIndicator: \"default\",\n isLoop: true\n }\n },\n methods: {\n previewImage(index : number) {\n uni.previewImage({\n urls: this.imageList,\n current: index,\n indicator: this.currentIndicator,\n loop: this.isLoop\n })\n },\n chooseImage() {\n uni.chooseImage({\n sourceType: ['album'],\n success: (e) => {\n this.imageList = this.imageList.concat(e.tempFilePaths)\n },\n fail(_) {\n }\n })\n },\n onIndicatorChanged(e : UniRadioGroupChangeEvent) {\n this.currentIndicator = e.detail.value\n },\n onCheckboxChange(_ : UniCheckboxGroupChangeEvent) {\n this.isLoop = !this.isLoop\n }\n }\n }\n\n```\n:::"},"saveImageToPhotosAlbum":{"name":"## uni.saveImageToPhotosAlbum(options) @saveimagetophotosalbum","description":"ä¿å˜å›¾ç‰‡åˆ°ç³»ç»Ÿç›¸å†Œ","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [SaveImageToPhotosAlbumOptions](#saveimagetophotosalbumoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | [string.ImageURIString](/uts/data-type.md#ide-string) | 是 | - | - | 图片文件路径,å¯ä»¥æ˜¯ä¸´æ—¶æ–‡ä»¶è·¯å¾„也å¯ä»¥æ˜¯æ°¸ä¹…文件路径,ä¸æ”¯æŒç½‘络图片路径 |\n@| success | (callback: [SaveImageToPhotosAlbumSuccess](#saveimagetophotosalbumsuccess-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (callback: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SaveImageToPhotosAlbumSuccess 的属性值 @saveimagetophotosalbumsuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| path | string | 是 | - | - | ä¿å˜åˆ°ç›¸å†Œçš„图片路径 |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | - | 错误ç <br/>- 1101001 用户å–消<br/>- 1101002 urls至少包å«ä¸€å¼ 图片地å€<br/>- 1101003 文件ä¸å˜åœ¨<br/>- 1101004 å›¾ç‰‡åŠ è½½å¤±è´¥<br/>- 1101005 未获å–æƒé™<br/>- 1101006 图片或视频ä¿å˜å¤±è´¥<br/>- 1101007 图片è£å‰ªå¤±è´¥<br/>- 1101008 æ‹ç…§æˆ–录åƒå¤±è´¥<br/>- 1101009 图片压缩失败<br/>- 1101010 其他错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### saveImageToPhotosAlbum 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/media/image?id=saveimagetophotosalbum)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.save-image-to-photos-album)\n"},"save-image-to-photos-album":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/save-image-to-photos-album/save-image-to-photos-album.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\n <!-- #ifdef APP -->\n <scroll-view style=\"flex:1\">\n <!-- #endif -->\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-padding-wrap\">\n <image class=\"image\" src=\"/static/uni.png\"></image>\n <button class=\"margin-top-10\" type=\"primary\" @click=\"saveImage\">将图片ä¿å˜åˆ°æ‰‹æœºç›¸å†Œ</button>\n </view>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n<script>\n export default {\n data() {\n return {\n title: \"saveImageToPhotosAlbum\"\n }\n },\n methods: {\n saveImage() {\n uni.saveImageToPhotosAlbum({\n filePath: \"/static/uni.png\",\n success: (res) => {\n console.log(\"saveImageToPhotosAlbum success\", JSON.stringify(res));\n uni.showToast({\n position: \"center\",\n icon: \"none\",\n title: \"图片ä¿å˜æˆåŠŸï¼Œè¯·åˆ°æ‰‹æœºç›¸å†ŒæŸ¥çœ‹\"\n })\n },\n fail: (err) => {\n uni.showModal({\n title: \"ä¿å˜å›¾ç‰‡åˆ°ç›¸å†Œå¤±è´¥\",\n content: JSON.stringify(err),\n showCancel: false\n });\n }\n })\n }\n }\n }\n</script>\n\n<style>\n .margin-top-10 {\n margin-top: 10px;\n }\n\n .image {\n width: 196px;\n height: 196px;\n align-self: center;\n }\n</style>\n\n```"},"getImageInfo":{"name":"## uni.getImageInfo(options) @getimageinfo","description":"获å–图片信æ¯","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [GetImageInfoOptions](#getimageinfooptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| src | [string.ImageURIString](/uts/data-type.md#ide-string) | 是 | - | - | 图片的路径,å¯ä»¥æ˜¯ç›¸å¯¹è·¯å¾„,临时文件路径,å˜å‚¨æ–‡ä»¶è·¯å¾„,网络图片路径 |\n@| success | (callback: [GetImageInfoSuccess](#getimageinfosuccess-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (callback: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### GetImageInfoSuccess 的属性值 @getimageinfosuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| width | number | 是 | - | - | 图片宽度,å•ä½px |\n| height | number | 是 | - | - | 图片高度,å•ä½px |\n| path | string | 是 | - | - | 返回图片的本地路径 |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | - | 错误ç <br/>- 1101001 用户å–消<br/>- 1101002 urls至少包å«ä¸€å¼ 图片地å€<br/>- 1101003 文件ä¸å˜åœ¨<br/>- 1101004 å›¾ç‰‡åŠ è½½å¤±è´¥<br/>- 1101005 未获å–æƒé™<br/>- 1101006 图片或视频ä¿å˜å¤±è´¥<br/>- 1101007 图片è£å‰ªå¤±è´¥<br/>- 1101008 æ‹ç…§æˆ–录åƒå¤±è´¥<br/>- 1101009 图片压缩失败<br/>- 1101010 其他错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### getImageInfo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 4.18 | - |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/media/image?id=getimageinfo)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.get-image-info)\n"},"get-image-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-image-info/get-image-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-image-info/get-image-info\n>Template\n```vue\n<template>\n <!-- #ifdef APP -->\n <scroll-view style=\"flex:1\">\n <!-- #endif -->\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-padding-wrap\">\n <view class=\"uni-title\">\n <text class=\"uni-subtitle-text\">获å–本地相对路径图片信æ¯</text>\n </view>\n <image class=\"image\" :src=\"relativeImagePath\" mode=\"aspectFit\"></image>\n <text class=\"margin-top-10\">{{absoluteImageInfo}}</text>\n <view class=\"uni-title\">\n <text class=\"uni-subtitle-text\">获å–网络路径图片信æ¯</text>\n </view>\n <image class=\"image\" :src=\"remoteImagePath\" mode=\"aspectFit\"></image>\n <text class=\"margin-top-10\">{{remoteImageInfo}}</text>\n <view class=\"uni-title\">\n <text class=\"uni-subtitle-text\">获å–本地ç»å¯¹è·¯å¾„图片信æ¯</text>\n </view>\n <image class=\"image\" :src=\"absoluteImagePath\" mode=\"aspectFit\"></image>\n <text class=\"margin-top-10\">{{relativeImageInfo}}</text>\n <view class=\"uni-btn-v\">\n <button type=\"primary\" @click=\"chooseImage\">æ‹æ‘„照片或从相册ä¸é€‰æ‹©ç…§ç‰‡</button>\n </view>\n </view>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n\n\n<style>\n .image {\n align-self: center;\n }\n\n .margin-top-10 {\n margin-top: 10px;\n }\n</style>\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n title: \"getImageInfo\",\n relativeImagePath: \"/static/test-image/logo.png\",\n relativeImageInfo: \"\",\n absoluteImagePath: \"\",\n absoluteImageInfo: \"\",\n remoteImagePath: \"https://qiniu-web-assets.dcloud.net.cn/uni-app-x/static/img/building.jpg\",\n remoteImageInfo: \"\",\n }\n },\n methods: {\n chooseImage() {\n uni.chooseImage({\n count: 1,\n success: (res) => {\n this.absoluteImagePath = res.tempFilePaths[0];\n uni.getImageInfo({\n src: res.tempFilePaths[0],\n success: (_res) => {\n console.log(\"getImageInfo success\", JSON.stringify(res));\n this.relativeImageInfo = `图片宽度: ${_res.width}\\n图片高度: ${_res.height}\\n图片路径: ${_res.path}\\n图片方å‘: ${_res.orientation}\\nå›¾ç‰‡æ ¼å¼: ${_res.type}`;\n },\n fail: (err) => {\n uni.showModal({\n title: \"获å–图片信æ¯å¤±è´¥\",\n content: JSON.stringify(err),\n showCancel: false\n });\n }\n });\n }\n });\n }\n },\n onReady() {\n uni.getImageInfo({\n src: this.relativeImagePath,\n success: (res) => {\n console.log(\"getImageInfo success\", JSON.stringify(res));\n this.absoluteImageInfo = `图片宽度: ${res.width}\\n图片高度: ${res.height}\\n图片路径: ${res.path}\\n图片方å‘: ${res.orientation}\\nå›¾ç‰‡æ ¼å¼: ${res.type}`;\n },\n fail: (err) => {\n uni.showModal({\n title: \"获å–图片信æ¯å¤±è´¥\",\n content: JSON.stringify(err),\n showCancel: false\n });\n }\n });\n uni.getImageInfo({\n src: this.remoteImagePath,\n success: (res) => {\n console.log(\"getImageInfo success\", JSON.stringify(res));\n this.remoteImageInfo = `图片宽度: ${res.width}\\n图片高度: ${res.height}\\n图片路径: ${res.path}\\n图片方å‘: ${res.orientation}\\nå›¾ç‰‡æ ¼å¼: ${res.type}`;\n },\n fail: (err) => {\n uni.showModal({\n title: \"获å–图片信æ¯å¤±è´¥\",\n content: JSON.stringify(err),\n showCancel: false\n });\n }\n });\n }\n }\n\n```\n:::"},"compressImage":{"name":"## uni.compressImage(options) @compressimage","description":"压缩图片","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [CompressImageOptions](#compressimageoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| src | [string.ImageURIString](/uts/data-type.md#ide-string) | 是 | - | - | 图片路径,图片的路径,å¯ä»¥æ˜¯ç›¸å¯¹è·¯å¾„ã€ä¸´æ—¶æ–‡ä»¶è·¯å¾„ã€å˜å‚¨æ–‡ä»¶è·¯å¾„ |\n@| quality | number \\| null | å¦ | - | - | 压缩质é‡ï¼ŒèŒƒå›´0~100,数值越å°ï¼Œè´¨é‡è¶Šä½Žï¼ŒåŽ‹ç¼©çŽ‡è¶Šé«˜ï¼ˆä»…对jpg有效) |\n@| rotate | number \\| null | å¦ | - | - | 旋转度数,范围0~360 |\n@| ~~width~~ | string \\| null | å¦ | - | - | 缩放图片的宽度 **已废弃** |\n@| ~~height~~ | string \\| null | å¦ | - | - | 缩放图片的高度 **已废弃** |\n@| compressedHeight | number \\| null | å¦ | - | - | 压缩åŽå›¾ç‰‡çš„高度,å•ä½ä¸ºpx,若ä¸å¡«å†™åˆ™é»˜è®¤ä»¥compressedWidth为准ç‰æ¯”缩放 |\n@| compressedWidth | number \\| null | å¦ | - | - | 压缩åŽå›¾ç‰‡çš„宽度,å•ä½ä¸ºpx,若ä¸å¡«å†™åˆ™é»˜è®¤ä»¥compressedHeight为准ç‰æ¯”缩放。 |\n@| success | (callback: [CompressImageSuccess](#compressimagesuccess-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (callback: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### CompressImageSuccess 的属性值 @compressimagesuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| tempFilePath | string | 是 | - | - | 压缩åŽå›¾ç‰‡çš„临时文件路径 |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | - | 错误ç <br/>- 1101001 用户å–消<br/>- 1101002 urls至少包å«ä¸€å¼ 图片地å€<br/>- 1101003 文件ä¸å˜åœ¨<br/>- 1101004 å›¾ç‰‡åŠ è½½å¤±è´¥<br/>- 1101005 未获å–æƒé™<br/>- 1101006 图片或视频ä¿å˜å¤±è´¥<br/>- 1101007 图片è£å‰ªå¤±è´¥<br/>- 1101008 æ‹ç…§æˆ–录åƒå¤±è´¥<br/>- 1101009 图片压缩失败<br/>- 1101010 其他错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### compressImage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 4.18 | - |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/media/image?id=compressimage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.compress-image)\n"},"compress-image":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/compress-image/compress-image.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\n <!-- #ifdef APP -->\n <scroll-view style=\"flex:1\">\n <!-- #endif -->\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-padding-wrap\">\n <view class=\"image-container\">\n <image class=\"image\" :src=\"beforeCompressPath\" mode=\"aspectFit\"></image>\n <image class=\"image\" :src=\"afterCompressPath\" mode=\"aspectFit\"></image>\n </view>\n <view class=\"uni-title\">\n <text class=\"uni-subtitle-text\">压缩å‰å›¾ç‰‡ä¿¡æ¯</text>\n </view>\n <text>{{beforeCompressImageInfo}}</text>\n <view class=\"uni-title\">\n <text class=\"uni-subtitle-text\">压缩åŽå›¾ç‰‡ä¿¡æ¯</text>\n </view>\n <text>{{afterCompressImageInfo}}</text>\n <view class=\"uni-btn-v\">\n <button type=\"primary\" @click=\"chooseImage\">从相册ä¸é€‰å–待压缩的图片</button>\n </view>\n <view class=\"uni-btn-v\">\n <button type=\"primary\" @click=\"compressImage\">压缩图片</button>\n </view>\n </view>\n <input-data defaultValue=\"80\" title=\"压缩质é‡ï¼ŒèŒƒå›´0~100,数值越å°ï¼Œè´¨é‡è¶Šä½Žï¼ŒåŽ‹ç¼©çŽ‡è¶Šé«˜ï¼ˆä»…对jpg有效)\" type=\"number\"\n @confirm=\"onQualityConfirm\"></input-data>\n <input-data title=\"压缩åŽå›¾ç‰‡çš„宽度,å•ä½px\" type=\"string\" @confirm=\"onCompressedWidthConfirm\"></input-data>\n <input-data title=\"压缩åŽå›¾ç‰‡çš„高度,å•ä½px\" type=\"string\" @confirm=\"onCompressedHeightConfirm\"></input-data>\n <input-data defaultValue=\"auto\" title=\"压缩åŽå›¾ç‰‡çš„宽度,支æŒpxã€%ã€auto\" type=\"string\" @confirm=\"onWidthConfirm\"></input-data>\n <input-data defaultValue=\"auto\" title=\"压缩åŽå›¾ç‰‡çš„高度,支æŒpxã€%ã€auto\" type=\"string\" @confirm=\"onHeightConfirm\"></input-data>\n <input-data defaultValue=\"0\" title=\"旋转度数,范围0~360\" type=\"number\" @confirm=\"onRotateConfirm\"></input-data>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n<script>\n // #ifdef APP-ANDROID\n import FileInputStream from 'java.io.FileInputStream';\n // #endif\n export default {\n data() {\n return {\n title: \"compressImage\",\n beforeCompressImageInfo: \"\",\n afterCompressImageInfo: \"\",\n beforeCompressPath: \"\",\n afterCompressPath: \"\",\n quality: 80,\n compressedWidth: null as number | null,\n compressedHeight: null as number | null,\n width: \"auto\",\n height: \"auto\",\n rotate: 0\n }\n },\n methods: {\n compressImage() {\n if (this.beforeCompressPath == \"\") {\n uni.showToast({\n title: \"请先选择图片\",\n icon: \"error\"\n });\n return;\n }\n uni.showLoading({\n title: \"图片压缩ä¸\"\n });\n uni.compressImage({\n src: this.beforeCompressPath,\n quality: this.quality,\n compressedWidth: this.compressedWidth,\n compressedHeight: this.compressedHeight,\n width: this.width,\n height: this.height,\n rotate: this.rotate,\n success: (res) => {\n console.log(\"compressImage success\", JSON.stringify(res));\n this.afterCompressPath = res.tempFilePath;\n uni.showToast({\n title: \"压缩æˆåŠŸ\",\n icon: null\n });\n uni.getImageInfo({\n src: res.tempFilePath,\n success: (_res) => {\n this.afterCompressImageInfo = `图片宽度: ${_res.width}\\n图片高度: ${_res.height}\\n`;\n // #ifdef APP-ANDROID\n const size = new FileInputStream(res.tempFilePath.substring(\"file://\".length)).available() / 1024;\n this.afterCompressImageInfo = this.afterCompressImageInfo.concat(`图片大å°: ${size}KB`);\n // #endif\n }\n });\n },\n fail: (err) => {\n uni.showModal({\n title: \"压缩图片失败\",\n content: JSON.stringify(err),\n showCancel: false\n });\n },\n complete: (_) => {\n uni.hideLoading();\n }\n })\n },\n chooseImage() {\n uni.chooseImage({\n count: 1,\n sizeType: [\"original\"],\n sourceType: [\"album\"],\n success: (res) => {\n this.beforeCompressPath = res.tempFilePaths[0];\n uni.getImageInfo({\n src: res.tempFilePaths[0],\n success: (_res) => {\n this.beforeCompressImageInfo = `图片宽度: ${_res.width}\\n图片高度: ${_res.height}\\n`;\n // #ifdef APP-ANDROID\n const size = new FileInputStream(res.tempFilePaths[0].substring(\"file://\".length)).available() / 1024;\n this.beforeCompressImageInfo = this.beforeCompressImageInfo.concat(`图片大å°: ${size}KB`);\n // #endif\n }\n });\n }\n });\n },\n onQualityConfirm(value : number) {\n this.quality = value;\n },\n onCompressedWidthConfirm(value : string) {\n this.compressedWidth = parseInt(value);\n },\n onCompressedHeightConfirm(value : string) {\n this.compressedHeight = parseInt(value);\n },\n onWidthConfirm(value : string) {\n this.width = value;\n },\n onHeightConfirm(value : string) {\n this.height = value;\n },\n onRotateConfirm(value : number) {\n this.rotate = value;\n }\n }\n }\n</script>\n\n<style>\n .image {\n flex: 1;\n }\n\n .image-container {\n flex-direction: row;\n }\n</style>\n\n```"},"chooseVideo":{"name":"## uni.chooseVideo(options) @choosevideo","description":"æ‹æ‘„视频或从手机相册ä¸é€‰è§†é¢‘,返回视频的临时文件路径。","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ChooseVideoOptions](#choosevideooptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| sourceType | Array\\<string\\> \\| null | å¦ | - | - | album 从相册选视频,camera 使用相机æ‹æ‘„,默认为:['album', 'camera'\\] |\n@| success | (callback: [ChooseVideoSuccess](#choosevideosuccess-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸï¼Œè¿”回视频文件的临时文件路径,详è§è¿”回å‚数说明 |\n@| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (callback: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### ChooseVideoSuccess 的属性值 @choosevideosuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| tempFilePath | string | 是 | - | - | 选定视频的临时文件路径 |\n| duration | number | 是 | - | - | 选定视频的时间长度 |\n| size | number | 是 | - | - | 选定视频的数æ®é‡å¤§å° |\n| height | number | 是 | - | - | 返回选定视频的长 |\n| width | number | 是 | - | - | 返回选定视频的宽 |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | - | 错误ç <br/>- 1101001 用户å–消<br/>- 1101002 urls至少包å«ä¸€å¼ 图片地å€<br/>- 1101003 文件ä¸å˜åœ¨<br/>- 1101004 å›¾ç‰‡åŠ è½½å¤±è´¥<br/>- 1101005 未获å–æƒé™<br/>- 1101006 图片或视频ä¿å˜å¤±è´¥<br/>- 1101007 图片è£å‰ªå¤±è´¥<br/>- 1101008 æ‹ç…§æˆ–录åƒå¤±è´¥<br/>- 1101009 图片压缩失败<br/>- 1101010 其他错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### chooseVideo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 4.18 | 4.18 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/media/video?id=choosevideo)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.choose-video)\n"},"choose-video":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/choose-video/choose-video.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/choose-video/choose-video\n>Template\n```vue\n<template>\n <!-- #ifdef APP -->\n <scroll-view style=\"flex:1\">\n <!-- #endif -->\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-padding-wrap\">\n <video class=\"video\" :src=\"src\" :controls=\"true\"></video>\n <view class=\"uni-title\">\n <text class=\"uni-subtitle-text\">视频信æ¯</text>\n </view>\n <text>{{videoInfo}}</text>\n <view class=\"uni-btn-v\">\n <button type=\"primary\" @click=\"chooseVideo\">选å–视频</button>\n </view>\n <enum-data title=\"视频æ¥æº\" :items=\"sourceTypeItemTypes\" @change=\"onSourceTypeChange\"></enum-data>\n <enum-data title=\"æ‘„åƒå¤´\" :items=\"cameraItemTypes\" @change=\"onCameraChange\"></enum-data>\n </view>\n <input-data title=\"最长æ‹æ‘„时间,å•ä½ç§’\" defaultValue=\"60\" type=\"number\" @confirm=\"onMaxDurationConfirm\"></input-data>\n <!-- #ifdef APP -->\n <view class=\"uni-padding-wrap\">\n <boolean-data title=\"是å¦åŽ‹ç¼©\" :defaultValue=\"true\" @change=\"onCompressedChange\"></boolean-data>\n </view>\n <!-- #endif -->\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n\n\n<style>\n .video {\n align-self: center;\n width: 300px;\n height: 225px;\n }\n</style>\n\n```\n>Script\n```uts\n\n import { ItemType } from '@/components/enum-data/enum-data';\n export default {\n data() {\n return {\n title: \"chooseVideo\",\n src: \"\",\n sourceTypeItemTypes: [{ \"value\": 0, \"name\": \"从相册ä¸é€‰æ‹©è§†é¢‘\" }, { \"value\": 1, \"name\": \"æ‹æ‘„视频\" }, { \"value\": 2, \"name\": \"从相册ä¸é€‰æ‹©è§†é¢‘或æ‹æ‘„视频\" }] as ItemType[],\n sourceTypeItems: [[\"album\"], [\"camera\"], [\"album\", \"camera\"]],\n cameraItemTypes: [{ \"value\": 0, \"name\": \"åŽç½®æ‘„åƒå¤´\" }, { \"value\": 1, \"name\": \"å‰ç½®æ‘„åƒå¤´\" }] as ItemType[],\n cameraItems: [\"back\", \"front\"],\n sourceType: [\"album\", \"camera\"],\n compressed: true,\n maxDuration: 60,\n camera: \"back\",\n videoInfo: \"\"\n }\n },\n methods: {\n chooseVideo() {\n uni.chooseVideo({\n sourceType: this.sourceType,\n // #ifdef APP\n compressed: this.compressed,\n // #endif\n maxDuration: this.maxDuration,\n camera: this.camera,\n success: (res) => {\n console.log(\"chooseVideo success\", JSON.stringify(res));\n this.src = res.tempFilePath;\n this.videoInfo = `视频长度: ${res.duration}s\\n视频大å°: ${Math.ceil(res.size / 1024)}KB\\n视频宽度: ${res.width}\\n视频高度: ${res.height}\\n`;\n },\n fail: (err) => {\n uni.showModal({\n title: \"选择视频失败\",\n content: JSON.stringify(err),\n showCancel: false\n });\n }\n });\n },\n onSourceTypeChange(value : number) {\n this.sourceType = this.sourceTypeItems[value];\n },\n onCompressedChange(value : boolean) {\n this.compressed = value;\n },\n onMaxDurationConfirm(value : number) {\n this.maxDuration = value;\n },\n onCameraChange(value : number) {\n this.camera = this.cameraItems[value];\n }\n }\n }\n\n```\n:::"},"saveVideoToPhotosAlbum":{"name":"## uni.saveVideoToPhotosAlbum(options) @savevideotophotosalbum","description":"ä¿å˜è§†é¢‘到系统相册","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [SaveVideoToPhotosAlbumOptions](#savevideotophotosalbumoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | [string.VideoURIString](/uts/data-type.md#ide-string) | 是 | - | - | 视频文件路径,å¯ä»¥æ˜¯ä¸´æ—¶æ–‡ä»¶è·¯å¾„也å¯ä»¥æ˜¯æ°¸ä¹…文件路径 |\n@| success | (callback: SaveVideoToPhotosAlbumSuccess) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (callback: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### IMediaError 的属性值 @imediaerror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | - | 错误ç <br/>- 1101001 用户å–消<br/>- 1101002 urls至少包å«ä¸€å¼ 图片地å€<br/>- 1101003 文件ä¸å˜åœ¨<br/>- 1101004 å›¾ç‰‡åŠ è½½å¤±è´¥<br/>- 1101005 未获å–æƒé™<br/>- 1101006 图片或视频ä¿å˜å¤±è´¥<br/>- 1101007 图片è£å‰ªå¤±è´¥<br/>- 1101008 æ‹ç…§æˆ–录åƒå¤±è´¥<br/>- 1101009 图片压缩失败<br/>- 1101010 其他错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### saveVideoToPhotosAlbum 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.18 | 4.18 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/media/video?id=savevideotophotosalbum)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.save-video-to-photos-album)\n"},"save-video-to-photos-album":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/save-video-to-photos-album/save-video-to-photos-album.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\n <!-- #ifdef APP -->\n <scroll-view style=\"flex:1\">\n <!-- #endif -->\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-padding-wrap\">\n <video class=\"video\" :src=\"src\" :controls=\"true\"></video>\n <button type=\"primary\" class=\"margin-top-10\" @click=\"saveVideo\">将视频ä¿å˜åˆ°æ‰‹æœºç›¸å†Œ</button>\n </view>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n<script>\n export default {\n data() {\n return {\n title: 'saveVideoToPhotosAlbum',\n src: ''\n }\n },\n methods: {\n saveVideo() {\n uni.saveVideoToPhotosAlbum({\n filePath: this.src,\n success: (_) => {\n console.log(\"saveVideoToPhotosAlbum success\");\n uni.showToast({\n position: \"center\",\n icon: \"none\",\n title: \"视频ä¿å˜æˆåŠŸï¼Œè¯·åˆ°æ‰‹æœºç›¸å†ŒæŸ¥çœ‹\"\n });\n },\n fail: (err) => {\n uni.showModal({\n title: \"ä¿å˜è§†é¢‘到相册失败\",\n content: JSON.stringify(err),\n showCancel: false\n });\n }\n });\n }\n },\n onReady() {\n uni.showLoading({\n title: '视频下载ä¸'\n });\n uni.downloadFile({\n url: 'https://qiniu-web-assets.dcloud.net.cn/uni-app-x/static/video/swiper-vertical-video/uts.mp4',\n success: (res) => {\n console.log(\"download video success\", res.tempFilePath);\n this.src = res.tempFilePath;\n uni.hideLoading();\n }\n });\n }\n }\n</script>\n\n<style>\n .video {\n align-self: center;\n }\n\n .margin-top-10 {\n margin-top: 10px;\n }\n</style>\n\n```"},"getVideoInfo":{"name":"## uni.getVideoInfo(options) @getvideoinfo","description":"获å–视频详细信æ¯","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [GetVideoInfoOptions](#getvideoinfooptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| src | [string.VideoURIString](/uts/data-type.md#ide-string) | 是 | - | - | 视频文件路径,å¯ä»¥æ˜¯ä¸´æ—¶æ–‡ä»¶è·¯å¾„也å¯ä»¥æ˜¯æ°¸ä¹…文件路径 |\n@| success | (callback: [GetVideoInfoSuccess](#getvideoinfosuccess-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (callback: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### GetVideoInfoSuccess 的属性值 @getvideoinfosuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| duration | number | 是 | - | - | 视频长度 |\n| size | number | 是 | - | - | 视频大å°ï¼Œå•ä½ kB |\n| height | number | 是 | - | - | 视频的长,å•ä½ px |\n| width | number | 是 | - | - | 视频的宽,å•ä½ px |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | - | 错误ç <br/>- 1101001 用户å–消<br/>- 1101002 urls至少包å«ä¸€å¼ 图片地å€<br/>- 1101003 文件ä¸å˜åœ¨<br/>- 1101004 å›¾ç‰‡åŠ è½½å¤±è´¥<br/>- 1101005 未获å–æƒé™<br/>- 1101006 图片或视频ä¿å˜å¤±è´¥<br/>- 1101007 图片è£å‰ªå¤±è´¥<br/>- 1101008 æ‹ç…§æˆ–录åƒå¤±è´¥<br/>- 1101009 图片压缩失败<br/>- 1101010 其他错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### getVideoInfo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 4.18 | - |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/media/video?id=getvideoinfo)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.get-video-info)\n"},"get-video-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-video-info/get-video-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-video-info/get-video-info\n>Template\n```vue\n<template>\n <!-- #ifdef APP -->\n <scroll-view style=\"flex:1\">\n <!-- #endif -->\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-padding-wrap\">\n <view class=\"uni-title\">\n <text class=\"uni-subtitle-text\">获å–本地ç»å¯¹è·¯å¾„视频信æ¯</text>\n </view>\n <video class=\"video\" :src=\"absoluteVideoPath\" :controls=\"true\"></video>\n <text class=\"margin-top-10\">{{absoluteVideoInfo}}</text>\n <view class=\"uni-btn-v\">\n <button type=\"primary\" @click=\"chooseVideo\">æ‹æ‘„视频或从相册ä¸é€‰æ‹©è§†é¢‘</button>\n </view>\n </view>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n\n\n<style>\n .video {\n align-self: center;\n }\n\n .margin-top-10 {\n margin-top: 10px;\n }\n</style>\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n title: \"getVideoInfo\",\n absoluteVideoPath: \"\",\n absoluteVideoInfo: \"\",\n }\n },\n methods: {\n chooseVideo() {\n uni.chooseVideo({\n compressed: false,\n success: (res) => {\n this.absoluteVideoPath = res.tempFilePath;\n uni.getVideoInfo({\n src: res.tempFilePath,\n success: (_res) => {\n console.log(\"getVideoInfo success\", JSON.stringify(res));\n this.absoluteVideoInfo = `视频画é¢æ–¹å‘: ${_res.orientation}\\nè§†é¢‘æ ¼å¼: ${_res.type}\\n视频长度: ${_res.duration}s\\n视频大å°: ${_res.size}KB\\n视频宽度: ${_res.width}\\n视频高度: ${_res.height}\\n视频帧率: ${_res.fps}fps\\n视频ç 率: ${_res.bitrate}kbps`;\n },\n fail: (err) => {\n uni.showModal({\n title: \"获å–视频信æ¯å¤±è´¥\",\n content: JSON.stringify(err),\n showCancel: false\n });\n }\n });\n }\n });\n }\n }\n }\n\n```\n:::"},"compressVideo":{"name":"## uni.compressVideo(options) @compressvideo","description":"压缩视频","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [CompressVideoOptions](#compressvideooptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| src | [string.VideoURIString](/uts/data-type.md#ide-string) | 是 | - | - | 视频文件路径,å¯ä»¥æ˜¯ä¸´æ—¶æ–‡ä»¶è·¯å¾„也å¯ä»¥æ˜¯æ°¸ä¹…文件路径 |\n@| quality | string \\| null | å¦ | - | - | 压缩质é‡<br/>- low: 低<br/>- medium: ä¸<br/>- high: 高 |\n@| resolution | number \\| null | å¦ | - | - | 相对于原视频的分辨率比例,å–值范围(0, 1\\] |\n@| success | (callback: [CompressVideoSuccess](#compressvideosuccess-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (callback: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### CompressVideoSuccess 的属性值 @compressvideosuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| tempFilePath | string | 是 | - | - | 压缩åŽçš„ä¸´æ—¶æ–‡ä»¶åœ°å€ |\n| size | number | 是 | - | - | 压缩åŽçš„大å°ï¼Œå•ä½ kB |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | - | 错误ç <br/>- 1101001 用户å–消<br/>- 1101002 urls至少包å«ä¸€å¼ 图片地å€<br/>- 1101003 文件ä¸å˜åœ¨<br/>- 1101004 å›¾ç‰‡åŠ è½½å¤±è´¥<br/>- 1101005 未获å–æƒé™<br/>- 1101006 图片或视频ä¿å˜å¤±è´¥<br/>- 1101007 图片è£å‰ªå¤±è´¥<br/>- 1101008 æ‹ç…§æˆ–录åƒå¤±è´¥<br/>- 1101009 图片压缩失败<br/>- 1101010 其他错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### compressVideo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 4.18 | - |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/media/video?id=compressvideo)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.compress-video)\n"},"compress-video":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/compress-video/compress-video.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\n <!-- #ifdef APP -->\n <scroll-view style=\"flex:1\">\n <!-- #endif -->\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-padding-wrap\">\n <video class=\"video\" :src=\"beforeCompressPath\" :controls=\"true\"></video>\n <view class=\"uni-title\">\n <text class=\"uni-subtitle-text\">压缩å‰è§†é¢‘ä¿¡æ¯</text>\n </view>\n <text>{{beforeCompressVideoInfo}}</text>\n <video class=\"video\" :src=\"afterCompressPath\" :controls=\"true\"></video>\n <view class=\"uni-title\">\n <text class=\"uni-subtitle-text\">压缩åŽè§†é¢‘ä¿¡æ¯</text>\n </view>\n <text>{{afterCompressVideoInfo}}</text>\n <view class=\"uni-btn-v\">\n <button type=\"primary\" @click=\"chooseVideo\">从相册ä¸é€‰å–待压缩的视频</button>\n </view>\n <view class=\"uni-btn-v\">\n <button type=\"primary\" @click=\"compressVideo\">压缩视频</button>\n </view>\n <enum-data title=\"压缩质é‡\" :items=\"qualityItemTypes\" @change=\"onQualityChange\"></enum-data>\n <view class=\"uni-common-mt\">\n <text class=\"uni-title uni-title-text\">相对于原视频的分辨率比例,å–值范围(0, 1]</text>\n <slider :min=\"0.1\" :max=\"1\" :step=\"0.1\" :show-value=\"true\" @change=\"onResolutionChange\"></slider>\n </view>\n </view>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n<script>\n import { ItemType } from '@/components/enum-data/enum-data';\n export default {\n data() {\n return {\n title: \"compressVideo\",\n beforeCompressVideoInfo: \"\",\n afterCompressVideoInfo: \"\",\n beforeCompressPath: \"\",\n afterCompressPath: \"\",\n quality: null as string | null,\n bitrate: null as number | null,\n fps: null as number | null,\n resolution: null as number | null,\n qualityItemTypes: [{ \"value\": 0, \"name\": \"low(低)\" }, { \"value\": 1, \"name\": \"medium(ä¸)\" }, { \"value\": 2, \"name\": \"high(高)\" }] as ItemType[],\n qualityItems: [\"low\", \"medium\", \"high\"]\n }\n },\n methods: {\n compressVideo() {\n if (this.beforeCompressPath == \"\") {\n uni.showToast({\n title: \"请先选择视频\",\n icon: \"error\"\n });\n return;\n }\n uni.showLoading({\n title: \"视频压缩ä¸\"\n });\n uni.compressVideo({\n src: this.beforeCompressPath,\n quality: this.quality,\n resolution: this.resolution,\n success: (res) => {\n console.log(\"compressVideo success\", JSON.stringify(res));\n this.afterCompressPath = res.tempFilePath;\n uni.showToast({\n title: \"压缩æˆåŠŸ\",\n icon: null\n });\n uni.getVideoInfo({\n src: res.tempFilePath,\n success: (_res) => {\n this.afterCompressVideoInfo = `视频画é¢æ–¹å‘: ${_res.orientation}\\nè§†é¢‘æ ¼å¼: ${_res.type}\\n视频长度: ${_res.duration}s\\n视频大å°: ${_res.size}KB\\n视频宽度: ${_res.width}\\n视频高度: ${_res.height}\\n视频帧率: ${_res.fps}fps\\n视频ç 率: ${_res.bitrate}kbps`;\n }\n });\n },\n fail: (err) => {\n uni.showModal({\n title: \"压缩视频失败\",\n content: JSON.stringify(err),\n showCancel: false\n });\n },\n complete: (_) => {\n uni.hideLoading();\n }\n });\n },\n chooseVideo() {\n uni.chooseVideo({\n sourceType: [\"album\"],\n compressed: false,\n success: (res) => {\n this.beforeCompressPath = res.tempFilePath;\n uni.getVideoInfo({\n src: res.tempFilePath,\n success: (_res) => {\n this.beforeCompressVideoInfo = `视频画é¢æ–¹å‘: ${_res.orientation}\\nè§†é¢‘æ ¼å¼: ${_res.type}\\n视频长度: ${_res.duration}s\\n视频大å°: ${_res.size}KB\\n视频宽度: ${_res.width}\\n视频高度: ${_res.height}\\n视频帧率: ${_res.fps}fps\\n视频ç 率: ${_res.bitrate}kbps`;\n }\n });\n }\n });\n },\n onQualityChange(value : number) {\n this.quality = this.qualityItems[value];\n },\n onResolutionChange(event : UniSliderChangeEvent) {\n this.resolution = event.detail.value;\n }\n }\n }\n</script>\n\n<style>\n .video {\n align-self: center;\n }\n\n .image-container {\n flex-direction: row;\n }\n</style>\n\n```"},"getLocation":{"name":"## uni.getLocation(options) @getlocation","description":"获å–当å‰çš„地ç†ä½ç½®ã€é€Ÿåº¦","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [GetLocationOptions](#getlocationoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| type | \"wgs84\" \\| \"gcj02\" | å¦ | wgs84 | - | 默认为 wgs84 返回 gps åæ ‡ï¼Œgcj02 返回å¯ç”¨äºŽuni.openLocationçš„åæ ‡ï¼Œweb端需é…ç½®å®šä½ SDK ä¿¡æ¯æ‰å¯æ”¯æŒ gcj02 |\n@| altitude | boolean \\| null | å¦ | false | - | ä¼ å…¥ true 会返回高度信æ¯ï¼Œç”±äºŽèŽ·å–高度需è¦è¾ƒé«˜ç²¾ç¡®åº¦ï¼Œä¼šå‡æ…¢æŽ¥å£è¿”回速度 |\n@| geocode | boolean \\| null | å¦ | false | - | ä¼ å…¥ true 会解æžåœ°å€ |\n@| highAccuracyExpireTime | number \\| null | å¦ | 3000 | - | 高精度定ä½è¶…时时间(ms),指定时间内返回最高精度,该值3000ms以上高精度定ä½æ‰æœ‰æ•ˆæžœ |\n@| isHighAccuracy | boolean \\| null | å¦ | false | - | å¼€å¯é«˜ç²¾åº¦å®šä½ |\n@| success | (result: [GetLocationSuccess](#getlocationsuccess-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [IGetLocationFail](#igetlocationfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### GetLocationSuccess 的属性值 @getlocationsuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| latitude | number | 是 | 0 | - | 纬度,浮点数,范围为-90~90,负数表示å—纬 |\n| longitude | number | 是 | 0 | - | ç»åº¦ï¼ŒèŒƒå›´ä¸º-180~180ï¼Œè´Ÿæ•°è¡¨ç¤ºè¥¿ç» |\n| speed | number | 是 | 0 | - | 速度,浮点数,å•ä½m/s |\n| accuracy | number | 是 | - | - | ä½ç½®çš„精确度 |\n| altitude | number | 是 | 0 | - | 高度,å•ä½ m |\n| verticalAccuracy | number | 是 | 0 | - | 垂直精度,å•ä½ m(Android æ— æ³•èŽ·å–,返回 0) |\n| horizontalAccuracy | number | 是 | 0 | - | 水平精度,å•ä½ m |\n| address | any \\| null | å¦ | null | - | 地å€ä¿¡æ¯ |\n\n##### IGetLocationFail 的属性值 @igetlocationfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1505004 \\| 1505005 \\| 1505021 \\| 1505022 \\| 1505023 \\| 1505024 \\| 1505025 \\| 1505026 | 是 | - | - | 错误ç <br/>- 1505004 缺失æƒé™<br/>- 1505005 缺失高精度æƒé™æŽˆæƒï¼ˆiOS特有)<br/>- 1505021 超时<br/>- 1505022 ä¸æ”¯æŒçš„定ä½ç±»åž‹<br/>- 1505023 ä¸æ”¯æŒé€†åœ°ç†ç¼–ç <br/>- 1505024 没有找到具体的定ä½å¼•æ“Žï¼Œè¯·å®šä½å¼€å…³æ˜¯å¦å·²æ‰“å¼€<br/>- 1505025 逆地ç†ç¼–ç æ•èŽ·å¤±è´¥<br/>- 1505026 æ•èŽ·å®šä½å¤±è´¥ |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### getLocation 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/location/location?id=getlocation)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.location.get-location)\n"},"get-location":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-location/get-location.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-location/get-location\n>Template\n```vue\n<template>\n <page-head :title=\"title\"></page-head>\n <view style=\"padding: 4px;\">\n <text class=\"hello-text\">\n 定ä½åŠŸèƒ½é»˜è®¤è°ƒç”¨æ“作系统定ä½API实现。\\n\n éƒ¨åˆ†æ‰‹æœºå› gms兼容ä¸å¥½å¯èƒ½å¯¼è‡´æ— 法定ä½ã€‚\\n\n gcjå›½æ ‡ã€é€†åœ°ç†ä¿¡æ¯ç‰åŠŸèƒ½éœ€ä¸‰æ–¹sdk定ä½ã€‚如果需è¦ç±»ä¼¼èƒ½åŠ›å¯ä»¥ä¸‹è½½è…¾è®¯å®šä½æ’件,打包自定义基座。å‚考示例:</text>\n <u-link :href=\"'https://ext.dcloud.net.cn/plugin?id=14569'\" :text=\"'https://ext.dcloud.net.cn/plugin?id=14569'\" :inWhiteList=\"true\"></u-link>\n </view>\n\n <view class=\"uni-padding-wrap uni-common-mt\">\n <view class=\"uni-list\">\n <radio-group @change=\"radioChange\">\n <radio class=\"uni-list-cell uni-list-cell-pd\" v-for=\"(item, index) in items\" :key=\"item.value\"\n :class=\"index < items.length - 1 ? 'uni-list-cell-line': ''\" :value=\"item.value\"\n :checked=\"index === current\">\n {{item.name}}\n </radio>\n </radio-group>\n </view>\n <view class=\"uni-list-cell uni-list-cell-pd\">\n <view class=\"uni-list-cell-db\">高度信æ¯</view>\n <switch :checked=\"altitudeSelect\" @change=\"altitudeChange\" />\n </view>\n <view class=\"uni-list-cell uni-list-cell-pd\">\n <view class=\"uni-list-cell-db\">å¼€å¯é«˜ç²¾åº¦å®šä½</view>\n <switch :checked=\"isHighAccuracySelect\" @change=\"highAccuracySelectChange\" />\n </view>\n <view class=\"uni-list-cell uni-list-cell-pd\">\n <view class=\"uni-list-cell-db\">是å¦è§£æžåœ°å€ä¿¡æ¯</view>\n <switch :checked=\"geocodeSelect\" @change=\"geocodeChange\" />\n </view>\n <text>{{exeRet}}</text>\n <view class=\"uni-btn-v\">\n <button class=\"uni-btn\" type=\"default\" @tap=\"getLocationTap\">获å–定ä½</button>\n </view>\n </view>\n</template>\n\n\n```\n>Script\n```uts\n\n type ItemType = {\n value : 'wgs84' | 'gcj02',\n name : string,\n }\n export default {\n data() {\n return {\n title: 'get-location',\n altitudeSelect: false,\n isHighAccuracySelect: false,\n geocodeSelect: false,\n exeRet: '',\n items: [\n {\n value: 'wgs84',\n name: 'wgs84'\n },\n {\n value: 'gcj02',\n name: 'gcj02'\n }\n ] as ItemType[],\n current: 0,\n }\n },\n methods: {\n altitudeChange: function (e : UniSwitchChangeEvent) {\n this.altitudeSelect = e.detail.value\n },\n geocodeChange: function (e : UniSwitchChangeEvent) {\n this.geocodeSelect = e.detail.value\n },\n highAccuracySelectChange: function (e : UniSwitchChangeEvent) {\n this.isHighAccuracySelect = e.detail.value\n },\n radioChange(e : UniRadioGroupChangeEvent) {\n for (let i = 0; i < this.items.length; i++) {\n if (this.items[i].value === e.detail.value) {\n this.current = i;\n break;\n }\n }\n },\n getLocationTap: function () {\n uni.showLoading({\n title: '定ä½ä¸'\n })\n uni.getLocation(({\n type: this.items[this.current].value,\n altitude: this.altitudeSelect,\n isHighAccuracy: this.isHighAccuracySelect,\n geocode: this.geocodeSelect,\n success: (res : any) => {\n uni.hideLoading()\n console.log(res);\n this.exeRet = JSON.stringify(res)\n },\n fail: (res : any) => {\n uni.hideLoading()\n console.log(res);\n this.exeRet = JSON.stringify(res)\n },\n complete: (res : any) => {\n uni.hideLoading()\n console.log(res);\n this.exeRet = JSON.stringify(res)\n }\n }));\n\n\n }\n\n }\n }\n\n```\n:::"},"getStorageInfo":{"name":"## uni.getStorageInfo(options) @getstorageinfo","description":"uni.getStorageInfo函数定义<br/>异æ¥èŽ·å–å½“å‰ storage 的相关信æ¯ã€‚<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [GetStorageInfoOptions](#getstorageinfooptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (res: [GetStorageInfoSuccess](#getstorageinfosuccess-values)) => void \\| null | å¦ | - | - | uni.getStorageInfoæˆåŠŸå›žè°ƒå‡½æ•°å®šä¹‰ |\n@| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | å¦ | - | - | uni.getStorageInfo失败回调函数定义 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | uni.getStorageInfo完æˆå›žè°ƒå‡½æ•°å®šä¹‰ | \n\n##### GetStorageInfoSuccess 的属性值 @getstorageinfosuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| keys | Array\\<string\\> | 是 | - | - | å½“å‰ storage ä¸æ‰€æœ‰çš„ key |\n| currentSize | number | 是 | - | - | 当å‰å 用的空间大å°, å•ä½ï¼škb |\n| limitSize | number | 是 | - | - | é™åˆ¶çš„空间大å°, å•ä½ï¼škb |\n","returnValue":"","compatibility":"### getStorageInfo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/storage/storage.html#getstorageinfo)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.getStorageInfo)\n"},"getStorageInfoSync":{"name":"## uni.getStorageInfoSync() @getstorageinfosync","description":"uni.getStorageInfoSync函数定义<br/>åŒæ¥èŽ·å–å½“å‰ storage 的相关信æ¯ã€‚<br/><br/>","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| **GetStorageInfoSuccess** |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| keys | Array\\<string\\> | 是 | - | - | å½“å‰ storage ä¸æ‰€æœ‰çš„ key |\n@| currentSize | number | 是 | - | - | 当å‰å 用的空间大å°, å•ä½ï¼škb |\n@| limitSize | number | 是 | - | - | é™åˆ¶çš„空间大å°, å•ä½ï¼škb | \n","compatibility":"### getStorageInfoSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/storage/storage.html#getstorageinfosync)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.getStorageInfoSync)\n"},"getStorage":{"name":"## uni.getStorage(options) @getstorage","description":"uni.getStorage函数定义<br/>从本地å˜å‚¨ä¸å¼‚æ¥èŽ·å–指定 key 对应的内容。<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [GetStorageOptions](#getstorageoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| key | string | 是 | - | - | 本地å˜å‚¨ä¸çš„指定的 key |\n@| success | (res: [GetStorageSuccess](#getstoragesuccess-values)) => void \\| null | å¦ | - | - | uni.getStorageæˆåŠŸå›žè°ƒå‡½æ•°å®šä¹‰ |\n@| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | å¦ | - | - | uni.getStorage失败回调函数定义 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | uni.getStorage完æˆå›žè°ƒå‡½æ•°å®šä¹‰ | \n\n##### GetStorageSuccess 的属性值 @getstoragesuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| data | any \\| null | å¦ | - | - | key 对应的内容 |\n","returnValue":"","compatibility":"### getStorage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/storage/storage.html#getstorage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.getStorage)\n"},"getStorageSync":{"name":"## uni.getStorageSync(key) @getstoragesync","description":"uni.getStorageSync函数定义<br/>从本地å˜å‚¨ä¸åŒæ¥èŽ·å–指定 key 对应的内容。<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| key | string | 是 | - | - | 本地å˜å‚¨ä¸çš„指定的 key | \n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| any \\| null | å¦ |\n \n","compatibility":"### getStorageSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/storage/storage.html#getstoragesync)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.getStorageSync)\n"},"setStorage":{"name":"## uni.setStorage(options) @setstorage","description":"uni.setStorage函数定义<br/>将数æ®å˜å‚¨åœ¨æœ¬åœ°storageå˜å‚¨ä¸æŒ‡å®šçš„ key ä¸ï¼Œä¼šè¦†ç›–掉原æ¥è¯¥ key 对应的内容,这是一个异æ¥æŽ¥å£ã€‚ <br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **SetStorageOptions** | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| key | string | 是 | - | - | 本地å˜å‚¨ä¸çš„指定的 key |\n@| data | any | 是 | - | - | 需è¦å˜å‚¨çš„内容,åªæ”¯æŒèƒ½é€šè¿‡ JSON.stringify åºåˆ—化的对象 |\n@| success | (res: SetStorageSuccess) => void \\| null | å¦ | - | - | uni.setStorageæˆåŠŸå›žè°ƒå‡½æ•°å®šä¹‰ |\n@| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | å¦ | - | - | uni.setStorage失败回调函数定义 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | uni.setStorage完æˆå›žè°ƒå‡½æ•°å®šä¹‰ | \n","returnValue":"","compatibility":"### setStorage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/storage/storage.html#setstorage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.setStorage)\n"},"setStorageSync":{"name":"## uni.setStorageSync(key, data) @setstoragesync","description":"uni.setStorageSync函数定义<br/>å°† data å˜å‚¨åœ¨æœ¬åœ°storageå˜å‚¨ä¸æŒ‡å®šçš„ key ä¸ï¼Œä¼šè¦†ç›–掉原æ¥è¯¥ key 对应的内容,这是一个åŒæ¥æŽ¥å£ã€‚<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| key | string | 是 | - | - | 本地storageå˜å‚¨ä¸çš„指定的 key |\n| data | any | 是 | - | - | 需è¦å˜å‚¨çš„内容,åªæ”¯æŒèƒ½é€šè¿‡ JSON.stringify åºåˆ—化的对象 | \n","returnValue":"","compatibility":"### setStorageSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/storage/storage.html#setstoragesync)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.setStorageSync)\n"},"removeStorage":{"name":"## uni.removeStorage(options) @removestorage","description":"uni.removeStorage函数定义<br/>从本地å˜å‚¨ä¸å¼‚æ¥ç§»é™¤æŒ‡å®š key。<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **RemoveStorageOptions** | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| key | string | 是 | - | - | 本地å˜å‚¨ä¸çš„指定的 key |\n@| success | (res: RemoveStorageSuccess) => void \\| null | å¦ | - | - | uni.removeStorageæˆåŠŸå›žè°ƒå‡½æ•°å®šä¹‰ |\n@| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | å¦ | - | - | uni.removeStorage失败回调函数定义 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | uni.removeStorage完æˆå›žè°ƒå‡½æ•°å®šä¹‰ | \n","returnValue":"","compatibility":"### removeStorage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](hhttps://uniapp.dcloud.net.cn/api/storage/storage.html#removestorage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.removeStorage)\n"},"removeStorageSync":{"name":"## uni.removeStorageSync(key) @removestoragesync","description":"uni.removeStorageSync函数定义<br/>从本地å˜å‚¨ä¸åŒæ¥ç§»é™¤æŒ‡å®š key。<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| key | string | 是 | - | - | 本地å˜å‚¨ä¸çš„指定的 key | \n","returnValue":"","compatibility":"### removeStorageSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/storage/storage.html#removestoragesync)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.removeStorageSync)\n"},"clearStorage":{"name":"## uni.clearStorage(option?) @clearstorage","description":"uni.clearStorage函数定义<br/>清除本地数æ®å˜å‚¨ã€‚<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| option | **ClearStorageOptions** \\| null | å¦ | - | - | uni.removeStorageå‚数定义 |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (res: ClearStorageSuccess) => void \\| null | å¦ | - | - | uni.clearStorage æˆåŠŸå›žè°ƒå‡½æ•°å®šä¹‰ |\n@| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | å¦ | - | - | uni.clearStorage 失败回调函数定义 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | uni.clearStorage 完æˆå›žè°ƒå‡½æ•°å®šä¹‰ | \n","returnValue":"","compatibility":"### clearStorage 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/storage/storage.html#clearstorage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.clearStorage)\n"},"clearStorageSync":{"name":"## uni.clearStorageSync() @clearstoragesync","description":"uni.clearStorageSync函数定义<br/>清除本地数æ®å˜å‚¨ã€‚<br/>","param":"","returnValue":"","compatibility":"### clearStorageSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/storage/storage.html#clearstoragesync)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.clearStorageSync)\n"},"storage":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/storage/storage.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/storage/storage\n>Template\n```vue\n<template>\n <!-- #ifdef APP -->\n <scroll-view class=\"page-scroll-view\">\n <!-- #endif -->\n <view>\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-common-mt\">\n <view class=\"uni-list\">\n <view class=\"uni-list-cell uni-list-cell-line\">\n <view class=\"uni-list-cell-left\">\n <view class=\"uni-label\">key</view>\n </view>\n <view class=\"uni-list-cell-db\">\n <input class=\"uni-input\" type=\"text\" placeholder=\"请输入key\" name=\"key\" :value=\"key\" maxlength=\"-1\" @input=\"keyChange\" />\n </view>\n </view>\n <view class=\"uni-list-cell\">\n <view class=\"uni-list-cell-left\">\n <view class=\"uni-label\">value</view>\n </view>\n <view class=\"uni-list-cell-db\">\n <input class=\"uni-input\" type=\"text\" placeholder=\"请输入value\" name=\"data\"\n :value=\"typeof data === 'string' ? data : JSON.stringify(data)\" maxlength=\"-1\" @input=\"dataChange\" />\n </view>\n </view>\n </view>\n <view class=\"uni-padding-wrap\">\n <view class=\"uni-btn-v\">\n <button class=\"uni-btn btn-getStorageInfoASync\" type=\"primary\" @tap=\"getStorageInfo\">\n 获å–å˜å‚¨æ¦‚è¿°ä¿¡æ¯-异æ¥\n </button>\n <button class=\"uni-btn btn-getStorageInfoSync\" @tap=\"getStorageInfoSync\">\n 获å–å˜å‚¨æ¦‚è¿°ä¿¡æ¯-åŒæ¥\n </button>\n </view>\n <text>{{ storageInfo }}</text>\n <view class=\"uni-flex uni-row\">\n <button type=\"default\" style=\"width:50%\" @tap=\"strMock\">\n å¡«å……å—符串\n </button>\n <button type=\"default\" style=\"width:50%\" @tap=\"complexMock\">\n å¡«å……å¤æ‚对象\n </button>\n </view>\n <view class=\"uni-flex uni-row\">\n <button type=\"default\" style=\"width:50%\" @tap=\"numberMock\">\n å¡«å……æ•´åž‹\n </button>\n <button type=\"default\" style=\"width:50%\" @tap=\"floatMock\">\n 填充浮点型\n </button>\n </view>\n <view class=\"uni-flex uni-row\">\n <button type=\"default\" style=\"width:50%\" @tap=\"jsonLikeMock\">\n å¡«å……jsonå—符串\n </button>\n <button type=\"default\" style=\"width:50%\" @tap=\"longLikeMock\">\n å¡«å……æ•´æ•°å—符串\n </button>\n </view>\n <view class=\"uni-flex uni-row\">\n <button type=\"default\" style=\"width:50%\" @tap=\"floatLikeMock\">\n 填充浮点å—符串\n </button>\n <button type=\"default\" style=\"width:50%\" @tap=\"negativeLikeMock\">\n å¡«å……è´Ÿæ•°å—符串\n </button>\n </view>\n </view>\n <view class=\"uni-padding-wrap\">\n <view class=\"uni-btn-v\">\n <button type=\"primary\" class=\"uni-btn btn-setstorageAsync\" @tap=\"setStorage\">\n å˜å‚¨æ•°æ®-异æ¥\n </button>\n <button class=\"uni-btn btn-getstorageAsync\" @tap=\"getStorage\">读å–æ•°æ®-异æ¥</button>\n <button class=\"uni-btn btn-removeStorageInfoASync\" @tap=\"removeStorage\">移除数æ®-异æ¥</button>\n <button class=\"uni-btn btn-clearStorageInfoASync\" @tap=\"clearStorage\">清ç†æ•°æ®-异æ¥</button>\n </view>\n\n <view class=\"uni-btn-v\">\n <button type=\"primary\" class=\"uni-btn btn-setstorageSync\" @tap=\"setStorageSync\">\n å˜å‚¨æ•°æ®-åŒæ¥\n </button>\n <button class=\"uni-btn btn-getstorageSync\" @tap=\"getStorageSync\">读å–æ•°æ®-åŒæ¥</button>\n <button class=\"uni-btn btn-removeStorageInfoSync\" @tap=\"removeStorageSync\">\n 移除数æ®-åŒæ¥\n </button>\n <button class=\"uni-btn btn-clearStorageInfoSync\" @tap=\"clearStorageSync\">\n 清ç†æ•°æ®-åŒæ¥\n </button>\n </view>\n </view>\n </view>\n </view>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n\n\n<style>\n</style>\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n title: 'get/set/clearStorage',\n key: '',\n data: '' as any,\n apiGetData: '' as any | null,\n storageInfo: '',\n }\n },\n methods: {\n getStorageInfo() {\n uni.getStorageInfo({\n success: (res) => {\n this.apiGetData = res\n this.storageInfo = JSON.stringify(res)\n },\n })\n },\n getStorageInfoSync() {\n try {\n const res = uni.getStorageInfoSync()\n this.apiGetData = res\n this.storageInfo = JSON.stringify(res)\n } catch (e) {\n // error\n console.log(e)\n }\n },\n jsonLikeMock() {\n this.key = 'key_' + Math.random()\n this.data = JSON.stringify({\n name: \"james\",\n age: 12,\n from: \"american\"\n });\n\n },\n longLikeMock() {\n this.key = 'key_' + Math.random()\n this.data = \"1234567890\"\n },\n floatLikeMock() {\n this.key = 'key_' + Math.random()\n this.data = \"321456.1234567890\"\n },\n negativeLikeMock() {\n this.key = 'key_' + Math.random()\n this.data = \"-321456\"\n },\n strMock() {\n this.key = 'key_' + Math.random()\n this.data = '测试å—符串数æ®ï¼Œé•¿åº¦ä¸º16个å—符'\n },\n complexMock() {\n this.key = 'key_' + Math.random()\n let jsonObj = {\n name: 'å¼ ä¸‰',\n age: 12,\n classMate: [\n {\n id: 1001,\n name: 'æŽå››',\n },\n {\n id: 1002,\n name: 'jack ma',\n },\n ],\n }\n this.data = jsonObj\n },\n numberMock() {\n this.key = 'key_' + Math.random()\n this.data = 10011\n },\n floatMock() {\n this.key = 'key_' + Math.random()\n this.data = 3.1415926535893384626\n },\n\n keyChange: function (e : InputEvent) {\n this.key = e.detail.value\n },\n dataChange: function (e : InputEvent) {\n this.data = e.detail.value\n },\n getStorage: function () {\n var key = this.key\n if (key.length == 0) {\n uni.showModal({\n title: '读å–æ•°æ®å¤±è´¥',\n content: 'key ä¸èƒ½ä¸ºç©º',\n showCancel: false,\n })\n } else {\n let that = this\n uni.getStorage({\n key: key,\n success: (res) => {\n\n that.apiGetData = res.data\n let desc : string = typeof this.apiGetData\n if (\"object\" == desc) {\n desc = desc + \": \" + JSON.stringify(this.apiGetData)\n } else {\n desc = desc + \": \" + this.apiGetData\n }\n\n uni.showModal({\n title: '读å–æ•°æ®æˆåŠŸ',\n content: desc,\n showCancel: false,\n })\n },\n fail: () => {\n uni.showModal({\n title: '读å–æ•°æ®å¤±è´¥',\n content: '找ä¸åˆ° key 对应的数æ®',\n showCancel: false,\n })\n },\n })\n }\n },\n getStorageSync: function () {\n var key = this.key\n if (key.length == 0) {\n uni.showModal({\n title: '读å–æ•°æ®å¤±è´¥',\n content: 'key ä¸èƒ½ä¸ºç©º',\n showCancel: false,\n })\n } else {\n this.apiGetData = uni.getStorageSync(key)\n\n let desc : string = typeof this.apiGetData\n if (\"object\" == desc) {\n desc = desc + \": \" + JSON.stringify(this.apiGetData)\n } else {\n desc = desc + \": \" + this.apiGetData\n }\n\n uni.showModal({\n title: '读å–æ•°æ®æˆåŠŸ',\n content: desc,\n showCancel: false,\n })\n }\n },\n setStorage: function () {\n var key = this.key\n var data = this.data\n if (key.length == 0) {\n uni.showModal({\n title: 'ä¿å˜æ•°æ®å¤±è´¥',\n content: 'key ä¸èƒ½ä¸ºç©º',\n showCancel: false,\n })\n } else {\n uni.setStorage({\n key: key,\n data: data,\n success: () => {\n uni.showModal({\n title: 'å˜å‚¨æ•°æ®æˆåŠŸ',\n showCancel: false,\n })\n },\n fail: () => {\n uni.showModal({\n title: '储å˜æ•°æ®å¤±è´¥!',\n showCancel: false,\n })\n },\n })\n }\n },\n setStorageSync: function () {\n var key = this.key\n var data = this.data\n if (key.length == 0) {\n uni.showModal({\n title: 'ä¿å˜æ•°æ®å¤±è´¥',\n content: 'key ä¸èƒ½ä¸ºç©º',\n showCancel: false,\n })\n } else {\n uni.setStorageSync(key, data)\n uni.showModal({\n title: 'å˜å‚¨æ•°æ®æˆåŠŸ',\n showCancel: false,\n })\n }\n },\n removeStorage: function () {\n uni.removeStorage({\n key: this.key,\n success: () => {\n uni.showModal({\n title: '移除数æ®æˆåŠŸ',\n showCancel: false,\n })\n },\n fail: () => {\n uni.showModal({\n title: '移除数æ®å¤±è´¥',\n showCancel: false,\n })\n },\n })\n },\n removeStorageSync: function () {\n uni.removeStorageSync(this.key)\n uni.showModal({\n title: '移除数æ®æˆåŠŸ',\n showCancel: false,\n })\n },\n clearStorage: function () {\n this.key = ''\n this.data = ''\n uni.clearStorage({\n success: function (_) {\n uni.showModal({\n title: '清除数æ®æˆåŠŸ',\n showCancel: false,\n })\n },\n fail: function (_) {\n uni.showModal({\n title: '清除数æ®å¤±è´¥',\n showCancel: false,\n })\n },\n })\n },\n clearStorageSync: function () {\n this.key = ''\n this.data = ''\n uni.clearStorageSync()\n uni.showModal({\n title: '清除数æ®æˆåŠŸ',\n content: ' ',\n showCancel: false,\n })\n },\n },\n }\n\n```\n:::"},"getFileSystemManager":{"name":"## uni.getFileSystemManager() @getfilesystemmanager","description":"获å–文件管ç†å™¨","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [FileSystemManager](#filesystemmanager-values) |\n\n#### FileSystemManager 的方法 @filesystemmanager-values \n\n#### readFile(options) @readfile\n读å–本地文件内容\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ReadFileOptions](#readfileoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| encoding | \"base64\" \\| \"utf-8\" | 是 | - | - | base64 / utf-8 |\n@| filePath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | 文件路径,支æŒç›¸å¯¹åœ°å€å’Œç»å¯¹åœ°å€ï¼Œapp-androidå¹³å°æ”¯æŒä»£ç 包文件目录 |\n@| success | (res: [ReadFileSuccessResult](#readfilesuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 通用的错误返回结果回调 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 通用的结æŸè¿”回结果回调 | \n\n##### ReadFileSuccessResult 的属性值 @readfilesuccessresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| data | string | 是 | - | - | - |\n\n##### IFileSystemManagerFail 的属性值 @ifilesystemmanagerfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1200002 \\| 1300002 \\| 1300013 \\| 1300021 \\| 1300022 \\| 1300066 \\| 1301003 \\| 1301005 \\| 1300201 \\| 1300202 \\| 1301111 \\| 1302003 \\| 1300009 | 是 | - | - | 错误ç <br/>- 1200002 ç±»åž‹é”™è¯¯ã€‚ä»…æ”¯æŒ base64 / utf-8<br/>- 1300002 未找到文件<br/>- 1300013 æ— æƒé™<br/>- 1300021 是目录<br/>- 1300022 å‚æ•°æ— æ•ˆ<br/>- 1300066 目录éžç©º<br/>- 1301003 对目录的éžæ³•æ“作<br/>- 1301005 文件已å˜åœ¨<br/>- 1300201 系统错误<br/>- 1300202 超出文件å˜å‚¨é™åˆ¶çš„最大尺寸<br/>- 1301111 brotli解压失败<br/>- 1302003 æ ‡å¿—æ— æ•ˆ<br/>- 1300009 文件æ述符错误 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n\n##### readFile 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n\n\n#### readFileSync(filePath, encoding?) @readfilesync\nFileSystemManager.readFile çš„åŒæ¥ç‰ˆæœ¬å‚æ•°\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| filePath | string | 是 | - | - | 文件路径,支æŒç›¸å¯¹åœ°å€å’Œç»å¯¹åœ°å€ï¼Œapp-androidå¹³å°æ”¯æŒä»£ç 包文件目录 |\n| encoding | string \\| null | å¦ | - | - | base64 / utf-8 | \n\n##### 返回值 \n\n| 类型 |\n| :- |\n| string |\n \n\n##### readFileSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### writeFile(options) @writefile\n写文件\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [WriteFileOptions](#writefileoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | 文件路径,åªæ”¯æŒç»å¯¹åœ°å€ |\n@| encoding | \"ascii\" \\| \"base64\" \\| \"utf-8\" | 是 | - | - | 指定写入文件的å—符编ç <br/>支æŒ:ascii base64 utf-8 |\n@| data | string | 是 | - | - | 写入的文本内容 |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 通用的æ£ç¡®è¿”回结果回调 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### FileManagerSuccessResult 的属性值 @filemanagersuccessresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n\n\n##### writeFile 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n\n\n#### writeFileSync(filePath, data, encoding) @writefilesync\nFileSystemManager.writeFile çš„åŒæ¥ç‰ˆæœ¬\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| filePath | string | 是 | - | - | 文件路径,åªæ”¯æŒç»å¯¹åœ°å€ |\n| data | string | 是 | - | - | 写入的文本内容 |\n| encoding | string | 是 | - | - | 指定写入文件的å—符编ç ,支æŒ:ascii base64 utf-8 | \n\n\n##### writeFileSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### unlink(options) @unlink\nåˆ é™¤æ–‡ä»¶\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **UnLinkOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | 文件路径,åªæ”¯æŒç»å¯¹åœ°å€ |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### unlink 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n\n\n#### unlinkSync(filePath) @unlinksync\nFileSystemManager.unlink çš„åŒæ¥ç‰ˆæœ¬\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| filePath | string | 是 | - | - | 文件路径,åªæ”¯æŒç»å¯¹åœ°å€ | \n\n\n##### unlinkSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### mkdir(options) @mkdir\n创建目录\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MkDirOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| dirPath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | 创建的目录路径 (本地路径) |\n@| recursive | boolean | 是 | - | - | 是å¦åœ¨é€’归创建该目录的上级目录åŽå†åˆ›å»ºè¯¥ç›®å½•ã€‚如果对应的上级目录已ç»å˜åœ¨ï¼Œåˆ™ä¸åˆ›å»ºè¯¥ä¸Šçº§ç›®å½•ã€‚如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,å†åœ¨ a 目录下创建 b 目录,以æ¤ç±»æŽ¨ç›´è‡³åˆ›å»º a/b/c 目录下的 d 目录。 |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### mkdir 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n\n\n#### mkdirSync(dirPath, recursive) @mkdirsync\nFileSystemManager.mkdir çš„åŒæ¥ç‰ˆæœ¬\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| dirPath | string | 是 | - | - | 创建的目录路径 (本地路径) |\n| recursive | boolean | 是 | - | - | 是å¦åœ¨é€’归创建该目录的上级目录åŽå†åˆ›å»ºè¯¥ç›®å½•ã€‚如果对应的上级目录已ç»å˜åœ¨ï¼Œåˆ™ä¸åˆ›å»ºè¯¥ä¸Šçº§ç›®å½•ã€‚如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,å†åœ¨ a 目录下创建 b 目录,以æ¤ç±»æŽ¨ç›´è‡³åˆ›å»º a/b/c 目录下的 d 目录。 | \n\n\n##### mkdirSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### rmdir(options) @rmdir\nåˆ é™¤ç›®å½•\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **RmDirOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| dirPath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | è¦åˆ 除的目录路径 (本地路径) |\n@| recursive | boolean | 是 | - | - | 是å¦é€’å½’åˆ é™¤ç›®å½•ã€‚å¦‚æžœä¸º trueï¼Œåˆ™åˆ é™¤è¯¥ç›®å½•å’Œè¯¥ç›®å½•ä¸‹çš„æ‰€æœ‰å目录以åŠæ–‡ä»¶ã€‚ |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### rmdir 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n\n\n#### rmdirSync(dirPath, recursive) @rmdirsync\nFileSystemManager.rmdir çš„åŒæ¥ç‰ˆæœ¬\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| dirPath | string | 是 | - | - | è¦åˆ 除的目录路径 (本地路径) |\n| recursive | boolean | 是 | - | - | 是å¦é€’å½’åˆ é™¤ç›®å½•ã€‚å¦‚æžœä¸º trueï¼Œåˆ™åˆ é™¤è¯¥ç›®å½•å’Œè¯¥ç›®å½•ä¸‹çš„æ‰€æœ‰å目录以åŠæ–‡ä»¶ã€‚ | \n\n\n##### rmdirSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### readdir(options) @readdir\n读å–目录内文件列表\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ReadDirOptions](#readdiroptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| dirPath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | è¦è¯»å–的目录路径 (本地路径) |\n@| success | (res: [ReadDirSuccessResult](#readdirsuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### ReadDirSuccessResult 的属性值 @readdirsuccessresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| files | Array\\<string\\> | 是 | - | - | - |\n\n\n##### readdir 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n\n\n#### readdirSync(dirPath) @readdirsync\nFileSystemManager.readdir çš„åŒæ¥ç‰ˆæœ¬\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| dirPath | string | 是 | - | - | è¦è¯»å–的目录路径 (本地路径) | \n\n##### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Array\\<string\\> \\| null | å¦ |\n \n\n##### readdirSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### access(options) @access\n判æ–文件/目录是å¦å˜åœ¨\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **AccessOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| path | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | è¦åˆ 除的目录路径 (本地路径) |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### access 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n\n\n#### accessSync(path) @accesssync\nFileSystemManager.access çš„åŒæ¥ç‰ˆæœ¬\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| path | string | 是 | - | - | è¦åˆ 除的目录路径 (本地路径) | \n\n\n##### accessSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### rename(options) @rename\né‡å‘½å文件。å¯ä»¥æŠŠæ–‡ä»¶ä»Ž oldPath 移动到 newPath\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **RenameOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| oldPath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | æºæ–‡ä»¶è·¯å¾„,支æŒæœ¬åœ°è·¯å¾„ |\n@| newPath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | 新文件路径,支æŒæœ¬åœ°è·¯å¾„ |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### rename 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n\n\n#### renameSync(oldPath, newPath) @renamesync\nFileSystemManager.rename çš„åŒæ¥ç‰ˆæœ¬\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| oldPath | string | 是 | - | - | æºæ–‡ä»¶è·¯å¾„,支æŒæœ¬åœ°è·¯å¾„ |\n| newPath | string | 是 | - | - | 新文件路径,支æŒæœ¬åœ°è·¯å¾„ | \n\n\n##### renameSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### copyFile(options) @copyfile\nå¤åˆ¶æ–‡ä»¶\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **CopyFileOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| srcPath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | æºæ–‡ä»¶è·¯å¾„,支æŒæœ¬åœ°è·¯å¾„ |\n@| destPath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | 新文件路径,支æŒæœ¬åœ°è·¯å¾„ |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### copyFile 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n\n\n#### copyFileSync(srcPath, destPath) @copyfilesync\nFileSystemManager.copyFile çš„åŒæ¥ç‰ˆæœ¬\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| srcPath | string | 是 | - | - | æºæ–‡ä»¶è·¯å¾„,支æŒæœ¬åœ°è·¯å¾„ |\n| destPath | string | 是 | - | - | 新文件路径,支æŒæœ¬åœ°è·¯å¾„ | \n\n\n##### copyFileSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### getFileInfo(options) @getfileinfo\n获å–该本地临时文件 或 本地缓å˜æ–‡ä»¶ ä¿¡æ¯\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [GetFileInfoOptions](#getfileinfooptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | è¦è¯»å–的文件路径 (本地路径) |\n@| digestAlgorithm | \"md5\" \\| \"sha1\" | 是 | - | - | md5 / sha1 |\n@| success | (res: [GetFileInfoSuccessResult](#getfileinfosuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### GetFileInfoSuccessResult 的属性值 @getfileinfosuccessresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| digest | string | 是 | - | - | - |\n| size | number | 是 | - | - | - |\n| errMsg | string | 是 | - | - | - |\n\n\n##### getFileInfo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n\n\n#### stat(options) @stat\n获å–文件 Stats 对象\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [StatOptions](#statoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| path | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | 文件/目录路径 (本地路径) |\n@| recursive | boolean | 是 | - | - | 是å¦é€’归获å–目录下的æ¯ä¸ªæ–‡ä»¶çš„ Stats ä¿¡æ¯ |\n@| success | (res: [StatSuccessResult](#statsuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### StatSuccessResult 的属性值 @statsuccessresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | - |\n| stats | Array\\<[FileStats](#filestats-values)\\> | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| path | string | 是 | - | - | - |\n@| stats | [Stats](#stats-values) | 是 | - | - | - |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| mode | number | 是 | - | - | 文件的类型和å˜å–çš„æƒé™ï¼Œå¯¹åº” POSIX stat.st_mode<br/>注æ„androidä¸ï¼Œæ–‡ä»¶ç±»åž‹åªåŒ…å«æ˜¯å¦æ˜¯ç›®å½•ä¸Žæ–‡ä»¶ï¼Œ<br/>å¦å¤–在androidä¸è¿™é‡Œçš„æƒé™æŒ‡çš„是当å‰è¿›ç¨‹å¯¹æ–‡ä»¶æˆ–者文件夹是å¦æœ‰è¯»ï¼Œå†™ï¼Œæ‰§è¡Œçš„æƒé™ï¼Œ<br/>这里没有与 POSIX stat.st_mode对应的组,其他人ç‰ç›¸å…³æƒé™çš„æ•°æ®è¿”回,åªæœ‰æ‰€æœ‰è€…的相关æƒé™ |\n@@| size | number | 是 | - | - | 文件大å°ï¼Œå•ä½ï¼šB,对应 POSIX stat.st_size |\n@@| lastAccessedTime | number | 是 | - | - | 文件最近一次被å˜å–或被执行的时间,UNIX 时间戳,对应 POSIX stat.st_atime<br/>注æ„:androidä¸ç”±äºŽç³»ç»Ÿé™åˆ¶æ— 法获å–è¯¥æ•°æ® |\n@@| lastModifiedTime | number | 是 | - | - | 文件最åŽä¸€æ¬¡è¢«ä¿®æ”¹çš„时间,UNIX 时间戳,对应 POSIX stat.st_mtime |\n\n##### Stats 的方法 @stats-values \n\n##### isDirectory() @isdirectory\n判æ–当å‰æ–‡ä»¶æ˜¯å¦ä¸€ä¸ªç›®å½•\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| boolean |\n \n\n###### isDirectory 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n##### isFile() @isfile\n判æ–当å‰æ–‡ä»¶æ˜¯å¦ä¸€ä¸ªæ™®é€šæ–‡ä»¶\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| boolean |\n \n\n###### isFile 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n\n##### stat 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n\n\n#### statSync(path, recursive) @statsync\nFileSystemManager.stat çš„åŒæ¥ç‰ˆæœ¬\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| path | string | 是 | - | - | 文件/目录路径 (本地路径) |\n| recursive | boolean | 是 | - | - | 是å¦é€’归获å–目录下的æ¯ä¸ªæ–‡ä»¶çš„ Stats ä¿¡æ¯ | \n\n##### 返回值 \n\n| 类型 |\n| :- |\n| Array\\<[FileStats](#filestats-values)\\> |\n \n\n##### statSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### appendFile(options) @appendfile\nåœ¨æ–‡ä»¶ç»“å°¾è¿½åŠ å†…å®¹\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **AppendFileOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | è¦è¿½åŠ 内容的文件路径 (本地路径) |\n@| encoding | \"ascii\" \\| \"base64\" \\| \"utf-8\" | 是 | - | - | 指定写入文件的å—符编ç <br/>支æŒ:ascii base64 utf-8 |\n@| data | string | 是 | - | - | è¦è¿½åŠ 的文本 |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### appendFile 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### appendFileSync(filePath, data, encoding) @appendfilesync\nFileSystemManager.appendFile çš„åŒæ¥ç‰ˆæœ¬\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| filePath | string | 是 | - | - | è¦è¿½åŠ 内容的文件路径 (本地路径) |\n| data | string | 是 | - | - | è¦è¿½åŠ 的文本 |\n| encoding | string | 是 | - | - | 指定写入文件的å—符编ç 支æŒ:ascii base64 utf-8 | \n\n\n##### appendFileSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### saveFile(options) @savefile\nä¿å˜ä¸´æ—¶æ–‡ä»¶åˆ°æœ¬åœ°ã€‚æ¤æŽ¥å£ä¼šç§»åŠ¨ä¸´æ—¶æ–‡ä»¶ï¼Œå› æ¤è°ƒç”¨æˆåŠŸåŽï¼ŒtempFilePath å°†ä¸å¯ç”¨ã€‚\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [SaveFileOptions](#savefileoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| tempFilePath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | 临时å˜å‚¨æ–‡ä»¶è·¯å¾„ (本地路径) |\n@| filePath | [string.URIString](/uts/data-type.md#ide-string) \\| null | å¦ | - | - | è¦å˜å‚¨çš„文件路径 (本地路径) |\n@| success | (res: [SaveFileSuccessResult](#savefilesuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### SaveFileSuccessResult 的属性值 @savefilesuccessresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| savedFilePath | string | 是 | - | - | å˜å‚¨åŽçš„文件路径 (本地路径) |\n\n\n##### saveFile 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### saveFileSync(tempFilePath, filePath?) @savefilesync\nFileSystemManager.saveFile çš„åŒæ¥ç‰ˆæœ¬\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| tempFilePath | string | 是 | - | - | 临时å˜å‚¨æ–‡ä»¶è·¯å¾„ (本地路径) |\n| filePath | string \\| null | å¦ | - | - | è¦å˜å‚¨çš„文件路径 (本地路径) | \n\n##### 返回值 \n\n| 类型 |\n| :- |\n| string |\n \n\n##### saveFileSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### removeSavedFile(options) @removesavedfile\nåˆ é™¤è¯¥å°ç¨‹åºä¸‹å·²ä¿å˜çš„本地缓å˜æ–‡ä»¶\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **RemoveSavedFileOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | 需è¦åˆ 除的文件路径 (本地路径) |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### removeSavedFile 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### unzip(options) @unzip\n解压文件\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **UnzipFileOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| zipFilePath | string | 是 | - | - | æºæ–‡ä»¶è·¯å¾„,支æŒæœ¬åœ°è·¯å¾„, åªå¯ä»¥æ˜¯ zip 压缩文件 |\n@| targetPath | string | 是 | - | - | ç›®æ ‡ç›®å½•è·¯å¾„, 支æŒæœ¬åœ°è·¯å¾„ |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### unzip 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### getSavedFileList(options) @getsavedfilelist\n获å–该已ä¿å˜çš„本地缓å˜æ–‡ä»¶åˆ—表\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [GetSavedFileListOptions](#getsavedfilelistoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (res: [GetSavedFileListResult](#getsavedfilelistresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### GetSavedFileListResult 的属性值 @getsavedfilelistresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| fileList | Array\\<string\\> | 是 | - | - | - |\n\n\n##### getSavedFileList 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### truncate(options) @truncate\n对文件内容进行截æ–æ“作\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **TruncateFileOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | è¦æˆªæ–的文件路径 (本地路径) |\n@| length | number | 是 | - | - | 截æ–ä½ç½®ï¼Œé»˜è®¤0。如果 length å°äºŽæ–‡ä»¶é•¿åº¦ï¼ˆå—节),则åªæœ‰å‰é¢ length 个å—节会ä¿ç•™åœ¨æ–‡ä»¶ä¸ï¼Œå…¶ä½™å†…å®¹ä¼šè¢«åˆ é™¤ï¼›<br/>如果 length 大于文件长度,ä¸åšå¤„ç† |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### truncate 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### truncateSync(filePath, length?) @truncatesync\n对文件内容进行截æ–æ“作 (truncate çš„åŒæ¥ç‰ˆæœ¬)\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| filePath | string | 是 | - | - | è¦æˆªæ–的文件路径 (本地路径) |\n| length | number | å¦ | - | - | 截æ–ä½ç½®ï¼Œé»˜è®¤0。如果 length å°äºŽæ–‡ä»¶é•¿åº¦ï¼ˆå—节),则åªæœ‰å‰é¢ length 个å—节会ä¿ç•™åœ¨æ–‡ä»¶ä¸ï¼Œå…¶ä½™å†…å®¹ä¼šè¢«åˆ é™¤ï¼›å¦‚æžœ length 大于文件长度,ä¸åšå¤„ç† | \n\n\n##### truncateSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### readCompressedFile(options) @readcompressedfile\n读å–指定压缩类型的本地文件内容\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ReadCompressedFileOptions](#readcompressedfileoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | è¦è¯»å–的文件的路径 (本地用户文件或代ç 包文件),app-androidå¹³å°æ”¯æŒä»£ç 包文件目录 |\n@| compressionAlgorithm | string | 是 | - | - | 文件压缩类型,目å‰ä»…æ”¯æŒ 'br'。 |\n@| success | (res: [ReadCompressedFileResult](#readcompressedfileresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### ReadCompressedFileResult 的属性值 @readcompressedfileresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| data | string | 是 | - | - | - |\n\n\n##### readCompressedFile 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### readCompressedFileSync(filePath, compressionAlgorithm) @readcompressedfilesync\nåŒæ¥è¯»å–指定压缩类型的本地文件内容\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| filePath | string | 是 | - | - | è¦è¯»å–的文件的路径 (本地用户文件或代ç 包文件),app-androidå¹³å°æ”¯æŒä»£ç 包文件目录 |\n| compressionAlgorithm | string | 是 | - | - | 文件压缩类型,目å‰ä»…æ”¯æŒ 'br'。 | \n\n##### 返回值 \n\n| 类型 |\n| :- |\n| string |\n \n\n##### readCompressedFileSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### open(options) @open\n打开文件,返回文件æ述符\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [OpenFileOptions](#openfileoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | è¦è¿½åŠ 内容的文件路径 (本地路径) |\n@| flag | \"a\" \\| \"ax\" \\| \"a+\" \\| \"ax+\" \\| \"r\" \\| \"r+\" \\| \"w\" \\| \"wx\" \\| \"w+\" \\| \"wx\" \\| \"wx+\" | 是 | - | - | æ–‡ä»¶ç³»ç»Ÿæ ‡å¿—ï¼Œé»˜è®¤å€¼: 'r' |\n@| success | (res: [OpenFileSuccessResult](#openfilesuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### OpenFileSuccessResult 的属性值 @openfilesuccessresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| fd | string | 是 | - | - | - |\n\n\n##### open 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### openSync(options) @opensync\nåŒæ¥æ‰“开文件,返回文件æ述符\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **OpenFileSyncOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | è¦è¿½åŠ 内容的文件路径 (本地路径) |\n@| flag | \"a\" \\| \"ax\" \\| \"a+\" \\| \"ax+\" \\| \"r\" \\| \"r+\" \\| \"w\" \\| \"wx\" \\| \"w+\" \\| \"wx\" \\| \"wx+\" | 是 | - | - | æ–‡ä»¶ç³»ç»Ÿæ ‡å¿—ï¼Œé»˜è®¤å€¼: 'r' | \n\n##### 返回值 \n\n| 类型 |\n| :- |\n| string |\n \n\n##### openSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### write(options) @write\n写入文件\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [WriteOptions](#writeoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| fd | string | 是 | - | - | 文件æ述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接å£èŽ·å¾— |\n@| data | string | 是 | - | - | 写入的内容 |\n@| encoding | \"ascii\" \\| \"base64\" \\| \"utf-8\" | 是 | - | - | 指定写入文件的å—符编ç <br/>支æŒ:ascii base64 utf-8 |\n@| success | (res: [WriteResult](#writeresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### WriteResult 的属性值 @writeresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| bytesWritten | number | 是 | - | - | 实际被写入到文件ä¸çš„å—节数(注æ„,被写入的å—节数ä¸ä¸€å®šä¸Žè¢«å†™å…¥çš„å—符串å—符数相åŒï¼‰ |\n\n\n##### write 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### writeSync(options) @writesync\nåŒæ¥å†™å…¥æ–‡ä»¶\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **WriteSyncOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| fd | string | 是 | - | - | 文件æ述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接å£èŽ·å¾— |\n@| data | string | 是 | - | - | 写入的内容 |\n@| encoding | \"ascii\" \\| \"base64\" \\| \"utf-8\" | 是 | - | - | 指定写入文件的å—符编ç <br/>支æŒ:ascii base64 utf-8 | \n\n##### 返回值 \n\n| 类型 |\n| :- |\n| [WriteResult](#writeresult-values) |\n \n\n##### writeSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### close(options) @close\nå…³é—文件\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **CloseOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| fd | string | 是 | - | - | 需è¦è¢«å…³é—的文件æ述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接å£èŽ·å¾— |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### close 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### closeSync(options) @closesync\nåŒæ¥å…³é—文件\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **CloseSyncOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| fd | string | 是 | - | - | 需è¦è¢«å…³é—的文件æ述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接å£èŽ·å¾— | \n\n\n##### closeSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### fstat(options) @fstat\n获å–文件的状æ€ä¿¡æ¯\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [FStatOptions](#fstatoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| fd | string | 是 | - | - | 文件æ述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接å£èŽ·å¾— |\n@| success | (res: [FStatSuccessResult](#fstatsuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### FStatSuccessResult 的属性值 @fstatsuccessresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| stats | [Stats](#stats-values) | 是 | - | - | Stats 对象,包å«äº†æ–‡ä»¶çš„状æ€ä¿¡æ¯ |\n\n\n##### fstat 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### fstatSync(options) @fstatsync\nåŒæ¥èŽ·å–文件的状æ€ä¿¡æ¯\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **FStatSyncOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| fd | string | 是 | - | - | 文件æ述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接å£èŽ·å¾— | \n\n##### 返回值 \n\n| 类型 |\n| :- |\n| [Stats](#stats-values) |\n \n\n##### fstatSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### ftruncate(options) @ftruncate\n对文件内容进行截æ–æ“作\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **FTruncateFileOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| fd | string | 是 | - | - | 文件æ述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接å£èŽ·å¾— |\n@| length | number | 是 | - | - | 截æ–ä½ç½®ï¼Œé»˜è®¤0。如果 length å°äºŽæ–‡ä»¶é•¿åº¦ï¼ˆå—节),则åªæœ‰å‰é¢ length 个å—节会ä¿ç•™åœ¨æ–‡ä»¶ä¸ï¼Œå…¶ä½™å†…å®¹ä¼šè¢«åˆ é™¤ï¼›<br/>如果 length 大于文件长度,ä¸åšå¤„ç† |\n@| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### ftruncate 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### ftruncateSync(options) @ftruncatesync\nåŒæ¥å¯¹æ–‡ä»¶å†…容进行截æ–æ“作\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **FTruncateFileSyncOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| fd | string | 是 | - | - | 文件æ述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接å£èŽ·å¾— |\n@| length | number | 是 | - | - | 截æ–ä½ç½®ï¼Œé»˜è®¤0。如果 length å°äºŽæ–‡ä»¶é•¿åº¦ï¼ˆå—节),则åªæœ‰å‰é¢ length 个å—节会ä¿ç•™åœ¨æ–‡ä»¶ä¸ï¼Œå…¶ä½™å†…å®¹ä¼šè¢«åˆ é™¤ï¼›<br/>如果 length 大于文件长度,ä¸åšå¤„ç† | \n\n\n##### ftruncateSync 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n\n#### readZipEntry(options) @readzipentry\n读å–压缩包内的文件\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [ReadZipEntryOptions](#readzipentryoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| filePath | [string.URIString](/uts/data-type.md#ide-string) | 是 | - | - | è¦è¯»å–的压缩包的路径 (本地路径),app-androidå¹³å°æ”¯æŒä»£ç 包文件目录 |\n@| encoding | \"ascii\" \\| \"base64\" \\| \"utf-8\" | 是 | - | - | 统一指定读å–文件的å—符编ç ,åªåœ¨ entries 值为\"all\"时有效。<br/>如果 entries 值为\"all\"且ä¸ä¼ encoding,则以 string æ ¼å¼è¯»å–文件的内容 |\n@| entries | Array\\<**EntryItem**\\> \\| null | å¦ | - | - | è¦è¯»å–的压缩包内的文件列表(当ä¸ä¼ 入时表示读å–压缩包内所有文件) |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| path | string | 是 | - | - | 压缩包内文件路径 |\n@@| encoding | \"ascii\" \\| \"base64\" \\| \"base64\" | 是 | - | - | 指定写入文件的å—符编ç <br/>支æŒ:ascii base64 utf-8 |\n@| success | (res: [EntriesResult](#entriesresult-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨çš„回调函数 |\n@| fail | (res: [IFileSystemManagerFail](#ifilesystemmanagerfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### EntriesResult 的属性值 @entriesresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| result | Map\\<string, ZipFileItem> | 是 | - | - | 文件路径 |\n\n\n##### readZipEntry 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.13 | x |\n\n \n","compatibility":"### getFileSystemManager 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.file.filemanager.getFileSystemManager)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-file-system-manager/get-file-system-manager.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\n <!-- #ifdef APP -->\n <text>显示简易æ“作日志,详细日志需真机è¿è¡ŒæŸ¥çœ‹</text><button size=\"mini\" @click=\"log=''\">清空日志</button>\n <text style=\"margin: 2px; padding: 2px; border: 1px solid #000000;\">{{ log }}</text>\n <scroll-view style=\"flex: 1;\">\n <!-- #endif -->\n <button class=\"btnstyle\" type=\"primary\" @tap=\"statFileInfoTest\"\n id=\"btn-stat-file\">递归获å–目录filesçš„Stats对象{{statFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"mkdirTest\" id=\"btn-mkdir\">创建文件夹{{mkdirFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"writeFileTest\" id=\"btn-write-file\">覆盖写入文件{{writeFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"readDirTest\" id=\"btn-read-dir\">读å–文件夹{{readDir}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"readFileTest\" id=\"btn-read-file\">读å–文件{{readFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"copyFileTest\"\n id=\"btn-copy-file\">å¤åˆ¶æ–‡ä»¶{{copyFromFile}}到{{copyToFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"renameFileTest\"\n id=\"btn-rename-file\">é‡å‘½å文件{{renameFromFile}}到{{renameToFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"accessFileTest\" id=\"btn-access-file\">判æ–文件{{accessFile}}是å¦å˜åœ¨</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"getFileInfoTest\"\n id=\"btn-get-file-info\">获å–文件信æ¯{{getFileInfoFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"unlinkTest\" id=\"btn-unlink-file\">åˆ é™¤æ–‡ä»¶{{unlinkFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"copyStaticToFilesTest\"\n id=\"btn-copyStatic-file\">从static目录å¤åˆ¶æ–‡ä»¶åˆ°a目录</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"unlinkAllFileTest\"\n id=\"btn-clear-file\">åˆ é™¤æ–‡ä»¶å¤¹{{rmDirFile}}下的所有文件</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"rmdirTest\" id=\"btn-remove-dir\">åˆ é™¤æ–‡ä»¶å¤¹{{rmDirFile}}</button>\n\n\n <!-- #ifdef APP-ANDROID -->\n <button class=\"btnstyle\" type=\"primary\" @tap=\"statFileInfoSyncTest\"\n id=\"btn-stat-file-sync\">åŒæ¥é€’归获å–目录filesçš„Stats对象{{statFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"appendFileTest\" id=\"btn-append-file\">在文件{{readFile}}ç»“å°¾è¿½åŠ å†…å®¹</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"appendFileSyncTest\"\n id=\"btn-append-file-sync\">åŒæ¥åœ¨æ–‡ä»¶{{readFile}}ç»“å°¾è¿½åŠ å†…å®¹</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"writeFileSyncTest\"\n id=\"btn-write-file-sync\">åŒæ¥è¦†ç›–写入文件{{writeFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"readFileSyncTest\" id=\"btn-read-file-sync\">åŒæ¥è¯»å–文件{{readFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"unlinkSyncTest\"\n id=\"btn-unlink-file-sync\">åŒæ¥åˆ 除文件{{unlinkFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"mkdirSyncTest\" id=\"btn-mkdir-sync\">åŒæ¥åˆ›å»ºæ–‡ä»¶å¤¹{{mkdirFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"rmdirSyncTest\" id=\"btn-remove-dir-sync\">åŒæ¥åˆ 除文件夹{{rmDirFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"readDirSyncTest\" id=\"btn-read-dir-sync\">åŒæ¥è¯»å–文件夹{{readDir}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"accessFileSyncTest\"\n id=\"btn-access-file-sync\">åŒæ¥åˆ¤æ–文件{{accessFile}}是å¦å˜åœ¨</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"renameFileSync\"\n id=\"btn-rename-file-sync\">åŒæ¥é‡å‘½å文件{{renameFromFile}}到{{renameToFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"copyFileSyncTest\"\n id=\"btn-copy-file-sync\">åŒæ¥å¤åˆ¶æ–‡ä»¶{{copyFromFile}}到{{copyToFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"saveFileTest\" id=\"btn-save-file\">ä¿å˜ä¸´æ—¶æ–‡ä»¶åˆ°æœ¬åœ°</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"saveFileSyncTest\" id=\"btn-save-file-sync\">åŒæ¥ä¿å˜ä¸´æ—¶æ–‡ä»¶åˆ°æœ¬åœ°</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"removeSavedFileTest\" id=\"btn-remove-saved-file\">åˆ é™¤å·²ä¿å˜çš„本地文件</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"unzipFileTest\" id=\"btn-unzip-file-sync\">解压文件</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"getSavedFileListTest\"\n id=\"btn-getsaved-filelist\">获å–该已ä¿å˜çš„本地缓å˜æ–‡ä»¶åˆ—表</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"truncateFileTest\"\n id=\"btn-truncate-file\">对文件{{writeFile}}内容进行截æ–æ“作</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"truncateFileSyncTest\"\n id=\"btn-truncate-file-sync\">åŒæ¥å¯¹æ–‡ä»¶{{writeFile}}内容进行截æ–æ“作</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"readCompressedFileTest\"\n id=\"btn-compressed-file\">读å–指定压缩类型的本地文件内容</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"readCompressedFileSyncTest\"\n id=\"btn-compressed-file-sync\">åŒæ¥è¯»å–指定压缩类型的本地文件内容</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"openFileTest\" id=\"btn-open-file\">打开文件{{readFile}},返回æ述符</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"openFileSyncTest('r')\"\n id=\"btn-open-file-sync\">åŒæ¥æ‰“开文件{{readFile}},返回æ述符</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"closeTest\" id=\"btn-close-file\">通过文件æ述符关é—文件{{readFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"closeSyncTest\"\n id=\"btn-close-file-sync\">通过文件æ述符åŒæ¥å…³é—文件{{readFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"writeTest\" id=\"btn-write\">通过文件æ述符写入文件{{readFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"writeSyncTest\" id=\"btn-write-sync\">åŒæ¥é€šè¿‡æ–‡ä»¶æ述符写入文件{{readFile}}</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"fstatTest\" id=\"btn-fstat-file\">通过文件æ述符获å–{{statFile}}的状æ€ä¿¡æ¯</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"fstatSyncTest\"\n id=\"btn-fstat-file-sync\">åŒæ¥é€šè¿‡æ–‡ä»¶æ述符获å–{{statFile}}的状æ€ä¿¡æ¯</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"ftruncateFileTest\"\n id=\"btn-ftruncate-file\">通过文件æ述符对文件{{writeFile}}内容进行截æ–</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"ftruncateFileSyncTest\"\n id=\"btn-ftruncate-file-sync\">åŒæ¥é€šè¿‡æ–‡ä»¶æ述符对文件{{writeFile}}内容进行截æ–</button>\n <button class=\"btnstyle\" type=\"primary\" @tap=\"readZipEntry\" id=\"btn-readzip-entry\">读å–压缩包内的文件</button>\n <view style=\"height: 4px;\"></view>\n <!-- #endif -->\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n<script>\n export default {\n\n data() {\n return {\n log: \"\",\n /**\n * 自动化测试需è¦å…³é—log\n */\n logAble: true,\n fileListSuccess: [] as string[],\n fileListComplete: [] as string[],\n accessFileRet: '',\n lastFailError: new UniError(\"uni-file-manager\", 1300000, \"mock error\"),\n lastCompleteError: new UniError(\"uni-file-manager\", 1300000, \"mock error\"),\n readDir: 'a',\n readFileRet: \"\",\n writeFileContent: \"ä¸æ–‡ en.\\r\\n\\tæ¢è¡Œ\",\n appendFileContent: \"append content\",\n getFileInfoAlgorithm: \"md5\",\n getFileInfoSize: -1,\n getFileInfoDigest: \"\",\n unlinkFile: 'a/1.txt',\n accessFile: 'a/1.txt',\n writeFile: 'a/1.txt',\n writeData: 'insert data哈哈哈',\n brFile: 'a/1.txt.br',\n temFile: 'a/1.txt',\n copyFromFile: 'a/1.txt',\n copyToFile: 'a/2.txt',\n renameFromFile: 'a/2.txt',\n renameToFile: 'a/3.txt',\n getFileInfoFile: 'a/1.txt',\n statFile: '',\n rmDirFile: 'a',\n mkdirFile: 'a',\n readFile: 'a/1.txt',\n recursiveVal: true,\n done: false,\n writeFileEncoding: \"utf-8\",\n readFileEncoding: \"utf-8\",\n statsRet: [] as Array<FileStats>,\n unzipFile: 'zip/1.zip',\n targetZip: \"unzip\",\n renameFileRet: '',\n saveFileRet: '',\n removeSavedFileRet: '',\n fd: '',\n closeFileRet: '',\n bytesWritten: 0,\n fstat: null as Stats | null,\n ftruncateRet: '',\n readZipFile: 'to.zip',\n getSavedFileListRet: '',\n /**\n * 待测试的全局环境å˜é‡\n */\n basePath: uni.env.USER_DATA_PATH,\n copyToBasePath: uni.env.USER_DATA_PATH,\n globalTempPath: uni.env.CACHE_PATH,\n globalRootPath: uni.env.SANDBOX_PATH,\n globalUserDataPath: uni.env.USER_DATA_PATH\n }\n },\n onLoad() {\n },\n\n methods: {\n statFileInfoTest: function (_ : any) {\n const fileManager = uni.getFileSystemManager()\n fileManager.stat({\n // path: `${this.basePath}${this.statFile}`, //USER_DATA_PATH\n path: `${this.globalTempPath}${this.statFile}`, //CACHE_PATH\n recursive: this.recursiveVal,\n success: (res : StatSuccessResult) => {\n if (this.logAble) {\n this.log += 'statFileInfoTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('statFileInfoTest success', res)\n this.statsRet = res.stats\n console.log('this.statsRet', this.statsRet)\n },\n fail: (res:IUniError ) => {\n if (this.logAble) {\n this.log += 'statFileInfoTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('statFileInfoTest fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n },\n complete: (res : any) => {\n console.log(\"statFileInfoTest complete\", res)\n this.done = true\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n }\n } as StatOptions)\n },\n\n getFileInfoTest: function () {\n const fileManager = uni.getFileSystemManager()\n\n fileManager.getFileInfo({\n filePath: `${this.basePath}${this.getFileInfoFile}`,\n digestAlgorithm: this.getFileInfoAlgorithm,\n success: (res : GetFileInfoSuccessResult) => {\n if (this.logAble) {\n this.log += 'getFileInfoTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n this.getFileInfoSize = res.size\n this.getFileInfoDigest = res.digest\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'getFileInfoTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n },\n complete: (res : any) => {\n console.log(\"complete\", res)\n this.done = true\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n }\n } as GetFileInfoOptions)\n },\n\n copyFileTest: function () {\n const fileManager = uni.getFileSystemManager()\n\n fileManager.copyFile({\n srcPath: `${this.basePath}${this.copyFromFile}`,\n destPath: `${this.copyToBasePath}${this.copyToFile}`,\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'copyFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'copyFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n },\n complete: (res : any) => {\n console.log(\"complete\", res)\n this.done = true\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n }\n } as CopyFileOptions)\n },\n\n renameFileTest: function () {\n const fileManager = uni.getFileSystemManager()\n\n fileManager.rename({\n oldPath: `${this.basePath}${this.renameFromFile}`,\n newPath: `${this.basePath}${this.renameToFile}`,\n success: (res) => {\n if (this.logAble) {\n this.log += 'renameFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'renameFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n },\n complete: (res : any) => {\n this.done = true\n console.log(\"complete\", res)\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n }\n } as RenameOptions)\n },\n\n readDirTest: function () {\n const fileManager = uni.getFileSystemManager()\n fileManager.readdir({\n dirPath: `${this.basePath}${this.readDir}`,\n success: (res : ReadDirSuccessResult) => {\n if (this.logAble) {\n this.log += 'readDirTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log(\"success\", res)\n this.fileListSuccess = res.files\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'readDirTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n },\n complete: (res : any) => {\n console.log(\"complete\", res)\n this.done = true\n if (res instanceof UniError) {\n this.lastCompleteError = res\n } else {\n this.fileListComplete = (res as ReadDirSuccessResult).files\n }\n }\n } as ReadDirOptions)\n },\n\n writeFileTest: function (_ : any) {\n const fileManager = uni.getFileSystemManager()\n\n fileManager.writeFile({\n filePath: `${this.basePath}${this.writeFile}`,\n data: this.writeFileContent,\n encoding: this.writeFileEncoding,\n success: (res) => {\n if (this.logAble) {\n this.log += 'writeFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'writeFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail')\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n },\n complete: (res : any) => {\n this.done = true\n console.log(\"complete\")\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n\n }\n } as WriteFileOptions)\n },\n\n readFileTest: function () {\n const fileManager = uni.getFileSystemManager()\n\n fileManager.readFile({\n filePath: `${this.basePath}${this.readFile}`,\n encoding: this.readFileEncoding,\n success: (res : ReadFileSuccessResult) => {\n if (this.logAble) {\n this.log += 'readFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n this.readFileRet = res.data\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'readFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n },\n complete: (res : any) => {\n console.log(\"complete\", res)\n this.done = true\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n }\n } as ReadFileOptions)\n },\n\n rmdirTest: function () {\n const fileManager = uni.getFileSystemManager()\n fileManager.rmdir({\n dirPath: `${this.basePath}${this.rmDirFile}`,\n recursive: this.recursiveVal,\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'rmdirTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'rmdirTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n },\n complete: (res : any) => {\n console.log(\"complete\", res)\n this.done = true\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n }\n } as RmDirOptions)\n },\n\n mkdirTest: function () {\n // 准备测试数æ®\n const fileManager = uni.getFileSystemManager()\n\n fileManager.mkdir({\n dirPath: `${this.basePath}${this.mkdirFile}`,\n recursive: this.recursiveVal,\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'mkdirTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'mkdirTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (res : any) => {\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n this.done = true\n console.log(\"complete\", res)\n }\n } as MkDirOptions)\n\n },\n accessFileTest: function () {\n this.accessFileRet = ''\n const fileManager = uni.getFileSystemManager()\n fileManager.access({\n path: `${this.basePath}${this.accessFile}`,\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'accessFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n this.accessFileRet = res.errMsg\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'accessFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (res : any) => {\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n console.log(\"complete\", res)\n this.done = true\n }\n } as AccessOptions)\n\n },\n unlinkTest: function () {\n const fileManager = uni.getFileSystemManager()\n\n fileManager.unlink({\n filePath: `${this.basePath}${this.unlinkFile}`,\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'unlinkTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'unlinkTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (res : any) => {\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n console.log(\"complete\", res)\n this.done = true\n }\n } as UnLinkOptions)\n },\n unlinkAllFileTest: function () {\n const fileManager = uni.getFileSystemManager()\n fileManager.readdir({\n dirPath: `${this.basePath}${this.rmDirFile}`,\n success: (res : ReadDirSuccessResult) => {\n console.log(\"success to readdir\", res)\n res.files.forEach(element => {\n console.log(element)\n let filePath : string\n if (this.rmDirFile.length <= 0) {\n filePath = `${this.basePath}${element}`\n } else {\n filePath = `${this.basePath}${this.rmDirFile}/${element}`\n }\n fileManager.unlink({\n filePath: filePath,\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'unlinkAllFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success unlink', res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'unlinkAllFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail unlink', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (res : any) => {\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n console.log(\"complete unlink\", res)\n this.done = true\n }\n } as UnLinkOptions)\n });\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'unlinkAllFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail to readdir', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (res : any) => {\n console.log(\"complete readdir\", res)\n this.done = true\n if (res instanceof UniError) {\n this.lastCompleteError = res\n } else {\n this.fileListComplete = (res as ReadDirSuccessResult).files\n }\n }\n } as ReadDirOptions)\n },\n copyStaticToFilesTest: function () {\n const fileManager = uni.getFileSystemManager()\n\n fileManager.copyFile({\n srcPath: \"/static/list-mock/mock.json\",\n destPath: `${this.copyToBasePath}/a/mock.json`,\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'copyFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'copyFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (res : any) => {\n console.log(\"complete\", res)\n this.done = true\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n }\n } as CopyFileOptions)\n },\n //start\n appendFileTest: function (_ : any) {\n const fileManager = uni.getFileSystemManager()\n fileManager.appendFile({\n filePath: `${this.basePath}${this.writeFile}`,\n data: this.appendFileContent,\n encoding: this.writeFileEncoding,\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'appendFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'appendFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail')\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (res : any) => {\n this.done = true\n console.log(\"complete\")\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n\n }\n } as AppendFileOptions)\n },\n writeFileSyncTest: function (_ : any) {\n try {\n const fileManager = uni.getFileSystemManager()\n fileManager.writeFileSync(`${this.basePath}${this.writeFile}`, this.writeFileContent, this.writeFileEncoding)\n if (this.logAble) {\n this.log += 'writeFileSyncTest success:' + '\\n\\n'\n }\n this.done = true\n } catch (e) {\n if (this.logAble) {\n this.log += 'writeFileSyncTest fail:' + e + '\\n\\n'\n }\n this.done = true\n }\n\n },\n readFileSyncTest: function () {\n try {\n const fileManager = uni.getFileSystemManager()\n let data = fileManager.readFileSync(\n `${this.basePath}${this.readFile}`,\n this.readFileEncoding)\n if (this.logAble) {\n this.log += 'readFileSyncTest result:' + data + '\\n\\n'\n }\n this.done = true\n this.readFileRet = data\n } catch (e) {\n if (this.logAble) {\n this.log += 'readFileSyncTest fail:' + e + '\\n\\n'\n }\n this.done = true\n }\n\n },\n unlinkSyncTest: function () {\n try {\n const fileManager = uni.getFileSystemManager()\n fileManager.unlinkSync(\n `${this.basePath}${this.unlinkFile}`)\n this.done = true\n } catch (e) {\n if (this.logAble) {\n this.log += 'unlinkSyncTest fail:' + e + '\\n\\n'\n }\n this.done = true\n }\n },\n mkdirSyncTest: function () {\n // 准备测试数æ®\n try {\n const fileManager = uni.getFileSystemManager()\n fileManager.mkdirSync(`${this.basePath}${this.mkdirFile}`, this.recursiveVal)\n this.done = true\n } catch (e) {\n this.done = true\n if (this.logAble) {\n this.log += 'mkdirSyncTest fail:' + e + '\\n\\n'\n }\n }\n\n },\n rmdirSyncTest: function () {\n try {\n const fileManager = uni.getFileSystemManager()\n fileManager.rmdirSync(\n `${this.basePath}${this.rmDirFile}`,\n this.recursiveVal)\n this.done = true\n } catch (e) {\n if (this.logAble) {\n this.log += 'rmdirSyncTest fail:' + e + '\\n\\n'\n }\n this.done = true\n }\n },\n readDirSyncTest: function () {\n try {\n const fileManager = uni.getFileSystemManager()\n let res = fileManager.readdirSync(\n `${this.basePath}${this.readDir}`)\n if (this.logAble) {\n this.log += 'readDirTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n if (res != null) {\n this.fileListSuccess = res\n }\n this.done = true\n } catch (e) {\n if (this.logAble) {\n this.log += 'rmdirSyncTest fail:' + e + '\\n\\n'\n }\n this.done = true\n }\n },\n accessFileSyncTest: function () {\n this.accessFileRet = ''\n const fileManager = uni.getFileSystemManager()\n try {\n fileManager.accessSync(`${this.basePath}${this.accessFile}`)\n this.done = true\n this.accessFileRet = 'access:ok'\n } catch (e) {\n if (this.logAble) {\n this.log += 'rmdirSyncTest fail:' + e + '\\n\\n'\n }\n this.done = true\n }\n },\n renameFileSync: function () {\n const fileManager = uni.getFileSystemManager()\n try {\n fileManager.renameSync(`${this.basePath}${this.renameFromFile}`,\n `${this.basePath}${this.renameToFile}`)\n this.done = true\n this.renameFileRet = \"rename:ok\"\n\n } catch (e) {\n if (this.logAble) {\n this.log += 'rmdirSyncTest fail:' + e + '\\n\\n'\n }\n console.log('renameSync:' + e)\n this.done = true\n }\n },\n copyFileSyncTest: function () {\n const fileManager = uni.getFileSystemManager()\n try {\n fileManager.copyFileSync(\n `${this.basePath}${this.copyFromFile}`,\n `${this.copyToBasePath}${this.copyToFile}`)\n this.done = true\n } catch (e) {\n if (this.logAble) {\n this.log += 'rmdirSyncTest fail:' + e + '\\n\\n'\n }\n this.done = true\n }\n },\n appendFileSyncTest: function (_ : any) {\n const fileManager = uni.getFileSystemManager()\n try {\n fileManager.appendFileSync(\n `${this.basePath}${this.writeFile}`,\n this.appendFileContent,\n this.writeFileEncoding)\n this.done = true\n } catch (e) {\n if (this.logAble) {\n this.log += 'rmdirSyncTest fail:' + e + '\\n\\n'\n }\n this.done = true\n }\n },\n saveFileTest: function (_ : any) {\n const fileManager = uni.getFileSystemManager()\n fileManager.saveFile({\n tempFilePath: `${this.globalTempPath}${this.temFile}`,\n // filePath:`${this.basePath}local/`,\n success: (res : SaveFileSuccessResult) => {\n if (this.logAble) {\n this.log += 'saveFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n this.saveFileRet = res.savedFilePath\n this.done = true\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'saveFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('saveFileTest fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n this.done = true\n },\n complete: (_) => {\n this.done = true\n }\n } as SaveFileOptions)\n },\n saveFileSyncTest: function (_ : any) {\n const fileManager = uni.getFileSystemManager()\n try {\n fileManager.saveFileSync(\n `${this.globalTempPath}${this.temFile}`, `${this.basePath}/`)\n // filePath:`${this.basePath}local/`,)\n this.done = true\n\n //todo åŽé¢æ‰“å¼€\n // this.saveFileRet=res\n } catch (e) {\n console.log('saveFileSyncTest:' + e)\n this.done = true\n }\n },\n unzipFileTest: function (_ : any) {\n const fileManager = uni.getFileSystemManager()\n try {\n fileManager.mkdirSync(`${this.basePath}${this.targetZip}`, true)\n } catch (e) {\n console.error(e)\n }\n fileManager.unzip({\n zipFilePath: '/static/filemanager/to.zip',\n targetPath: `${this.basePath}${this.targetZip}`,\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'unzipFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('success', res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'unzipFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (_) => {\n this.done = true\n }\n } as UnzipFileOptions)\n },\n\n getSavedFileListTest: function () {\n const fileManager = uni.getFileSystemManager()\n fileManager.getSavedFileList({\n success: (res : GetSavedFileListResult) => {\n if (this.logAble) {\n this.log += 'getSavedFileListTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log(\"getSavedFileListTest success\", res)\n this.fileListSuccess = res.fileList\n this.getSavedFileListRet = \"getSavedFileList:ok\"\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'getSavedFileListTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('getSavedFileListTest fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n this.getSavedFileListRet = JSON.stringify(res)\n },\n complete: (res : any) => {\n console.log(\"complete\", res)\n this.done = true\n if (res instanceof UniError) {\n this.lastCompleteError = res\n } else {\n this.fileListComplete = (res as GetSavedFileListResult).fileList\n }\n }\n } as GetSavedFileListOptions)\n },\n truncateFileTest() {\n const fileManager = uni.getFileSystemManager()\n fileManager.truncate({\n filePath: `${this.basePath}${this.writeFile}`,\n length: 7,\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'truncateFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log(\"success\", res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'truncateFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (res : any) => {\n console.log(\"complete\", res)\n this.done = true\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n }\n } as TruncateFileOptions)\n },\n truncateFileSyncTest() {\n const fileManager = uni.getFileSystemManager()\n try {\n fileManager.truncateSync(\n `${this.basePath}${this.writeFile}`,\n 4)\n this.done = true\n } catch (e) {\n console.log(e)\n this.done = true\n }\n },\n readCompressedFileTest() {\n const fileManager = uni.getFileSystemManager()\n fileManager.readCompressedFile({\n filePath: '/static/filemanager/1.txt.br',\n compressionAlgorithm: \"br\",\n success: (res : ReadCompressedFileResult) => {\n if (this.logAble) {\n this.log += 'readCompressedFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log(\"success\", res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'readCompressedFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (_) => {\n this.done = true\n }\n } as ReadCompressedFileOptions)\n },\n readCompressedFileSyncTest() {\n console.log('readCompressedFileSyncTest')\n const fileManager = uni.getFileSystemManager()\n try {\n let data = fileManager.readCompressedFileSync(\n '/static/filemanager/1.txt.br',\n \"br\")\n if (this.logAble) {\n this.log += data\n }\n this.done = true\n } catch (e) {\n if (this.logAble) {\n this.log += 'readCompressedFileSyncTest fail:' + e + '\\n\\n'\n }\n this.done = true\n }\n\n },\n removeSavedFileTest() {\n console.log(\"removeSavedFileTest enter\")\n const fileManager = uni.getFileSystemManager()\n fileManager.removeSavedFile({\n filePath: `${this.basePath}${this.writeFile}`,\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'removeSavedFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n this.removeSavedFileRet = res.errMsg\n console.log(\"removeSavedFileTest success\", res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'removeSavedFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('removeSavedFileTest fail', res)\n },\n complete: (_) => {\n this.done = true\n }\n } as RemoveSavedFileOptions)\n },\n\n statFileInfoSyncTest: function (_ : any) {\n const fileManager = uni.getFileSystemManager()\n try {\n let res = fileManager.statSync(\n // path: `${this.basePath}${this.statFile}`, //USER_DATA_PATH\n `${this.globalTempPath}${this.statFile}`, //CACHE_PATH\n this.recursiveVal)\n if (this.logAble) {\n this.log += 'statFileInfoSyncTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n this.statsRet = res\n this.done = true\n } catch (e) {\n if (this.logAble) {\n this.log += 'statFileInfoSyncTest fail:' + e + '\\n\\n'\n }\n this.done = true\n }\n\n },\n openFileTest() {\n const fileManager = uni.getFileSystemManager()\n fileManager.open({\n filePath: `${this.basePath}${this.readFile}`,\n flag: \"a\",\n success: (res : OpenFileSuccessResult) => {\n if (this.logAble) {\n this.log += 'openFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log(\"success\", res)\n this.fd = res.fd\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'openFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (_) => {\n this.done = true\n }\n } as OpenFileOptions)\n },\n openFileSyncTest(param : string) : string {\n const fileManager = uni.getFileSystemManager()\n try {\n let fd = fileManager.openSync({\n filePath: `${this.basePath}${this.readFile}`,\n flag: param,\n } as OpenFileSyncOptions)\n if (this.logAble) {\n this.log += 'openFileSyncTest success:' + fd + '\\n\\n'\n }\n this.done = true\n this.fd = fd\n return fd\n } catch (e) {\n if (this.logAble) {\n this.log += 'openFileSyncTest fail:' + JSON.stringify(e) + '\\n\\n'\n }\n console.log('fail', e)\n this.done = true\n }\n return \"\"\n },\n closeSyncTest() {\n console.log('closeSyncTest')\n const fileManager = uni.getFileSystemManager()\n try {\n console.log('closeSync')\n fileManager.closeSync({\n fd: this.openFileSyncTest('r')\n } as CloseSyncOptions)\n if (this.logAble) {\n this.log += 'closeSyncTest success:' + '\\n\\n'\n }\n this.done = true\n this.closeFileRet = \"close:ok\"\n } catch (e) {\n if (this.logAble) {\n this.log += 'closeSyncTest fail:' + JSON.stringify(e) + '\\n\\n'\n }\n console.log('fail', e)\n this.done = true\n }\n },\n closeTest() {\n const fileManager = uni.getFileSystemManager()\n fileManager.close({\n fd: this.openFileSyncTest('r'),\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'closeTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n this.closeFileRet = res.errMsg\n console.log(\"success\", res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'closeTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (_) => {\n this.done = true\n }\n\n } as CloseOptions)\n },\n writeTest() {\n const fileManager = uni.getFileSystemManager()\n try {\n fileManager.mkdirSync(`${this.basePath}${this.mkdirFile}`, true)\n } catch (e) {\n console.error(e)\n }\n\n fileManager.write({\n fd: this.openFileSyncTest('w+'),\n data: this.writeData,\n encoding: \"utf-8\",\n success: (res : WriteResult) => {\n if (this.logAble) {\n this.log += 'writeTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log(\"success\", res)\n this.bytesWritten = res.bytesWritten\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'writeTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (_) => {\n this.done = true\n }\n\n } as WriteOptions)\n },\n writeSyncTest() {\n const fileManager = uni.getFileSystemManager()\n try {\n fileManager.mkdirSync(`${this.basePath}${this.mkdirFile}`, true)\n } catch (e) {\n console.error(e)\n }\n fileManager.open({\n filePath: `${this.basePath}${this.readFile}`,\n flag: \"r+\",\n success: (res : OpenFileSuccessResult) => {\n console.log(\"success\", res)\n if (res.fd.length <= 0) {\n this.done = true\n return\n }\n try {\n let ret = fileManager.writeSync({\n fd: res.fd,\n data: this.writeData,\n encoding: \"utf-8\"\n } as WriteSyncOptions)\n if (this.logAble) {\n this.log += 'writeSyncTest success:' + JSON.stringify(ret) + '\\n\\n'\n }\n console.log(\"success\", ret)\n this.done = true\n this.bytesWritten = ret.bytesWritten\n } catch (e) {\n if (this.logAble) {\n this.log += 'writeSyncTest fail:' + JSON.stringify(e) + '\\n\\n'\n }\n console.log('fail', e)\n this.done = true\n }\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'openFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n this.done = true\n }\n } as OpenFileOptions)\n\n },\n fstatTest() {\n const fileManager = uni.getFileSystemManager()\n fileManager.fstat({\n fd: this.openFileSyncTest('r'),\n success: (res : FStatSuccessResult) => {\n if (this.logAble) {\n this.log += 'fstatTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log(\"success\", res)\n this.fstat = res.stats\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'fstatTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (_) => {\n this.done = true\n }\n\n } as FStatOptions)\n },\n fstatSyncTest() {\n const fileManager = uni.getFileSystemManager()\n try {\n let stat =\n fileManager.fstatSync({\n fd: this.openFileSyncTest('r'),\n } as FStatSyncOptions)\n if (this.logAble) {\n this.log += 'fstatSyncTest success:' + JSON.stringify(stat) + '\\n\\n'\n }\n this.done = true\n this.fstat = stat\n } catch (e) {\n if (this.logAble) {\n this.log += 'fstatSyncTest fail:' + JSON.stringify(e) + '\\n\\n'\n }\n this.done = true\n }\n },\n ftruncateFileTest() {\n const fileManager = uni.getFileSystemManager()\n fileManager.ftruncate({\n fd: this.openFileSyncTest('r+'),\n length: 6,\n success: (res : FileManagerSuccessResult) => {\n if (this.logAble) {\n this.log += 'ftruncateFileTest success:' + JSON.stringify(res) + '\\n\\n'\n }\n this.ftruncateRet = res.errMsg\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'ftruncateFileTest fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n },\n complete: (res : any) => {\n console.log(\"complete\", res)\n this.done = true\n if (res instanceof UniError) {\n this.lastCompleteError = res\n }\n }\n } as FTruncateFileOptions)\n },\n ftruncateFileSyncTest() {\n const fileManager = uni.getFileSystemManager()\n try {\n fileManager.ftruncateSync({\n fd: this.openFileSyncTest('r+'),\n length: 4\n } as FTruncateFileSyncOptions)\n if (this.logAble) {\n this.log += 'ftruncateFileSyncTest success:' + '\\n\\n'\n }\n this.done = true\n this.ftruncateRet = 'ftruncate:ok'\n } catch (e) {\n if (this.logAble) {\n this.log += 'ftruncateFileSyncTest fail:' + JSON.stringify(e) + '\\n\\n'\n }\n this.done = true\n }\n },\n readZipEntry() {\n const fileManager = uni.getFileSystemManager()\n fileManager.readZipEntry({\n filePath: '/static/filemanager/to.zip',\n encoding: 'utf-8',\n success: (res : EntriesResult) => {\n if (this.logAble) {\n this.log += 'readZipEntry success:size=' + res.result.size + '\\n\\n'\n }\n console.log(\"success\", res)\n },\n fail: (res : IUniError) => {\n if (this.logAble) {\n this.log += 'readZipEntry fail:' + JSON.stringify(res) + '\\n\\n'\n }\n console.log('fail', res)\n this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)\n\n }\n } as ReadZipEntryOptions)\n },\n\n },\n\n }\n</script>\n\n<style>\n .btnstyle {\n margin: 4px;\n }\n</style>\n\n```"},"getUniverifyManager":{"name":"## uni.getUniverifyManager() @getuniverifymanager","description":"获å–一键登录管ç†å¯¹è±¡","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [UniverifyManager](#univerifymanager-values) |\n\n#### UniverifyManager 的方法 @univerifymanager-values \n\n#### preLogin(options) @prelogin\n预登录\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [PreLoginOptions](#preloginoptions-values) | 是 | - | - | 预登录å‚æ•° |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | () => void | å¦ | - | - | - |\n@| fail | (err: [PreLoginFail](#preloginfail-values)) => void | å¦ | - | - | - |\n@| complete | (res: any) => void | å¦ | - | - | - | \n\n##### PreLoginFail 的属性值 @preloginfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1000 \\| 1001 \\| 1002 \\| 1004 \\| 4001 \\| 30004 \\| 30005 \\| 30006 | 是 | - | - | 1000 当å‰åº”用appid尚未开通uni一键登录<br/>1001 应用所有者账å·ä¿¡æ¯å¼‚常,请检查账å·ä¸€é”®ç™»å½•æœåŠ¡æ˜¯å¦æ£å¸¸<br/>1002 应用所有者账å·ä¿¡æ¯å¼‚常,请检查账å·ä½™é¢æ˜¯å¦å……足<br/>1004 uni一键登录应用ä¸å˜åœ¨<br/>4001 å‚数异常<br/>30004 其他错误<br/>30005 预登录失败<br/>30006 一键登录失败 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n\n##### preLogin 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.99 | 4.18 |\n\n\n#### login(options) @login\n登录\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [LoginOptions](#loginoptions-values) | 是 | - | - | 登录å‚æ•° |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| univerifyStyle | **UniverifyStyle** | å¦ | - | - | ç™»å½•é¡µæ ·å¼ |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| fullScreen | boolean | å¦ | - | - | 是å¦å…¨å± |\n@@| logoPath | string | å¦ | - | - | logo路径 |\n@@| backgroundColor | string | å¦ | - | - | 登录页背景色 |\n@@| loginBtnText | string | å¦ | - | - | ç™»å½•æŒ‰é’®æ–‡å— |\n@| success | (res: [LoginSuccess](#loginsuccess-values)) => void | å¦ | - | - | - |\n@| fail | (err: [LoginFail](#loginfail-values)) => void | å¦ | - | - | - |\n@| complete | (res: any) => void | å¦ | - | - | - | \n\n##### LoginSuccess 的属性值 @loginsuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| openId | string | 是 | - | - | 登录授æƒå”¯ä¸€æ ‡è¯† |\n| accessToken | string | 是 | - | - | token |\n\n##### LoginFail 的属性值 @loginfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 1000 \\| 1001 \\| 1002 \\| 1004 \\| 4001 \\| 30004 \\| 30005 \\| 30006 | 是 | - | - | 1000 当å‰åº”用appid尚未开通uni一键登录<br/>1001 应用所有者账å·ä¿¡æ¯å¼‚常,请检查账å·ä¸€é”®ç™»å½•æœåŠ¡æ˜¯å¦æ£å¸¸<br/>1002 应用所有者账å·ä¿¡æ¯å¼‚常,请检查账å·ä½™é¢æ˜¯å¦å……足<br/>1004 uni一键登录应用ä¸å˜åœ¨<br/>4001 å‚数异常<br/>30004 其他错误<br/>30005 预登录失败<br/>30006 一键登录失败 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n\n##### login 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.99 | 4.18 |\n\n\n#### close() @close\nå…³é—登录页\n\n\n##### close 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.99 | 4.18 |\n\n\n#### isPreLoginValid() @ispreloginvalid\n预登录是å¦æœ‰æ•ˆ\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| boolean |\n \n\n##### isPreLoginValid 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.99 | 4.18 |\n\n \n","compatibility":"### getUniverifyManager 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.99 | 4.18 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/univerify.html#univerifymanager)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.login_verify.univerify.getUniverifyManager)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-univerify-manager/get-univerify-manager.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\n <view>\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-padding-wrap uni-common-mt\">\n <view class=\"uni-btn-v uni-common-mt\">\n <button type=\"primary\" @click=\"verify(false)\">一键登录(åŠå±ï¼‰</button>\n </view>\n <view class=\"uni-btn-v uni-common-mt\">\n <button type=\"primary\" @click=\"verify(true)\">一键登录(全å±ï¼‰</button>\n </view>\n </view>\n </view>\n</template>\n\n<script>\n export default {\n data() {\n return {\n title: '一键登录',\n univerifyManager: null as UniverifyManager | null\n }\n },\n onLoad() {\n this.univerifyManager = uni.getUniverifyManager();\n // 预登录\n this.univerifyManager?.preLogin({\n success: () => {\n console.log(\"pre login success\");\n },\n fail: (err : PreLoginFail) => {\n console.error(\"pre login fail => \" + JSON.stringify(err));\n uni.showModal({\n title: '预登录失败',\n content: JSON.parseObject(err.cause?.cause?.message ?? \"\")?.getString(\"errorDesc\") ?? err.errMsg,\n showCancel: false\n });\n }\n } as PreLoginOptions);\n },\n methods: {\n verify(fullScreen : boolean) {\n // æ ¡éªŒé¢„ç™»å½•æ˜¯å¦æœ‰æ•ˆ\n const isPreLoginValid = this.univerifyManager?.isPreLoginValid() ?? false;\n if (isPreLoginValid) {\n // 预登录有效,执行登录\n this.login(fullScreen);\n } else {\n // é¢„ç™»å½•æ— æ•ˆï¼Œæ‰§è¡Œé¢„ç™»å½•\n this.univerifyManager?.preLogin({\n success: () => {\n console.log(\"pre login success\");\n this.login(fullScreen);\n },\n fail: (err : PreLoginFail) => {\n console.error(\"pre login fail => \" + JSON.stringify(err));\n uni.showModal({\n title: '预登录失败',\n content: JSON.parseObject(err.cause?.cause?.message ?? \"\")?.getString(\"errorDesc\") ?? err.errMsg,\n showCancel: false\n });\n }\n } as PreLoginOptions);\n }\n },\n login(fullScreen : boolean) {\n this.univerifyManager?.login({\n // ç™»å½•é¡µæ ·å¼\n univerifyStyle: {\n fullScreen: fullScreen,\n backgroundColor: \"#FFFFFF\",\n loginBtnText: \"一键登录\",\n logoPath: \"/static/logo.png\"\n } as UniverifyStyle,\n success: (res : LoginSuccess) => {\n console.log(\"login success => \" + JSON.stringify(res));\n // 云函数å–å·\n uniCloud.callFunction({\n name: 'univerify',\n data: {\n access_token: res.accessToken, // 客户端一键登录接å£è¿”回的access_token\n openid: res.openId // 客户端一键登录接å£è¿”回的openid\n }\n }).then(res => {\n // å…³é—登录页\n this.univerifyManager?.close();\n setTimeout(() => {\n uni.showModal({\n title: 'å–å·æˆåŠŸ',\n content: res.result.getJSON(\"res\")?.getString(\"phoneNumber\"),\n showCancel: false\n });\n }, 100);\n }).catch(err => {\n console.error(JSON.stringify(err));\n // å…³é—登录页\n this.univerifyManager?.close();\n setTimeout(() => {\n uni.showModal({\n title: 'å–å·å¤±è´¥',\n content: (err as Error).message,\n showCancel: false\n });\n }, 100);\n });\n },\n fail: (err : LoginFail) => {\n console.error(\"login fail => \" + err);\n uni.showModal({\n title: '登录失败',\n content: JSON.parseObject(err.cause?.cause?.message ?? \"\")?.getString(\"errorDesc\") ?? err.errMsg,\n showCancel: false\n });\n }\n } as LoginOptions);\n }\n }\n }\n</script>\n\n<style>\n\n</style>\n\n```"},"getFacialRecognitionMetaInfo":{"name":"## uni.getFacialRecognitionMetaInfo() @getfacialrecognitionmetainfo","description":"获å–阿里云实人认è¯meta info","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| string |\n \n","compatibility":"### getFacialRecognitionMetaInfo 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.login_verify.facial-recognition-verify.getFacialRecognitionMetaInfo)\n"},"startFacialRecognitionVerify":{"name":"## uni.startFacialRecognitionVerify(faceStyle) @startfacialrecognitionverify","description":"å¯åŠ¨äººè„¸è¯†åˆ«","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| faceStyle | [StartFacialRecognitionVerifyOptions](#startfacialrecognitionverifyoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| certifyId | string | 是 | - | - | certifyId 调用实人认è¯çš„id |\n@| progressBarColor | string \\| null | å¦ | - | - | 活体检测页é¢çš„进度æ¡é¢œè‰²ã€‚ |\n@| screenOrientation | \"land\" \\| \"port\" | å¦ | \"port\" | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"-\",\"3.9\",\"4.11\"]]}' /> | 认è¯æ—¶å±å¹•æ–¹å‘<br/>- land 横å±<br/>- port ç«–å± |\n@| success | (res: [StartFacialRecognitionVerifySuccess](#startfacialrecognitionverifysuccess-values)) => void \\| null | å¦ | - | - | æˆåŠŸå›žè°ƒ |\n@| fail | (res: [IFacialRecognitionVerifyError](#ifacialrecognitionverifyerror-values)) => void \\| null | å¦ | - | - | 失败回调 |\n@| complete | (res: any) => void \\| null | å¦ | - | - | 完æˆå›žè°ƒ | \n\n##### StartFacialRecognitionVerifySuccess 的属性值 @startfacialrecognitionverifysuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | 错误ç |\n| errSubject | string | 是 | - | - | 调用APIçš„å称 |\n| errMsg | string | 是 | - | - | é”™è¯¯çš„è¯¦ç»†ä¿¡æ¯ |\n| cause | **SourceError** | å¦ | - | - | 错误æ¥æº |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| subject | string \\| null | å¦ | - | - | æºé”™è¯¯æ¨¡å—å称 |\n@| message | string | 是 | - | - | æºé”™è¯¯æè¿°ä¿¡æ¯ |\n@| code | number | 是 | - | - | æºé”™è¯¯çš„错误ç |\n@| name | string | 是 | - | - | - |\n@| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | |\n\n##### IFacialRecognitionVerifyError 的属性值 @ifacialrecognitionverifyerror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 10010 \\| 10012 \\| 10011 \\| 10013 \\| 10020 \\| 10001 \\| 10002 | 是 | - | - | 错误ç <br/>- 10001 certifyId ä¸èƒ½ä¸ºç©º<br/>- 10002 \"当å‰è®¾å¤‡ä¸æ”¯æŒ\"<br/>- 10010 刷脸异常<br/>- 10012 网络异常<br/>- 10011 验è¯ä¸æ–<br/>- 10013 刷脸验è¯å¤±è´¥<br/>- 10020 设备设置时间异常 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### startFacialRecognitionVerify 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9 | 4.11 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.login_verify.facial-recognition-verify.startFacialRecognitionVerify)\n"},"facial-recognition-verify":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/facial-recognition-verify/facial-recognition-verify.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\n <!-- #ifdef APP -->\n <scroll-view class=\"page-scroll-view\">\n <!-- #endif -->\n <view>\n <page-head :title=\"title\"></page-head>\n <view class=\"uni-padding-wrap uni-common-mt\">\n <view class=\"uni-btn-v uni-common-mt\">\n <input class=\"uni-input\" type=\"text\" v-model=\"realName\" name=\"real-name\"\n placeholder=\"姓å\" maxlength=\"-1\"/>\n </view>\n <view class=\"uni-btn-v uni-common-mt\">\n <input class=\"uni-input\" type=\"text\" v-model=\"idCard\" name=\"id-card\"\n placeholder=\"身份è¯å·\" maxlength=\"-1\"/>\n </view>\n <view class=\"uni-btn-v uni-common-mt\">\n <button type=\"primary\" @click=\"facialRecognition\">开始人脸识别</button>\n </view>\n </view>\n </view>\n <!-- #ifdef APP -->\n </scroll-view>\n <!-- #endif -->\n</template>\n\n<script>\n export default {\n data() {\n return {\n title: '实人认è¯',\n realName: '',\n idCard: ''\n }\n },\n onReady() {\n },\n methods: {\n facialRecognition() {\n const realName = this.realName.trim()\n const idCard = this.idCard.trim()\n if (realName == '' || idCard == '') {\n uni.showModal({\n title: '错误',\n content: '姓å和身份è¯å·ä¸å¯ä¸ºç©º',\n showCancel: false\n })\n return\n }\n const testFacialCo = uniCloud.importObject('facial-recognition-co')\n let metaInfo = uni.getFacialRecognitionMetaInfo();\n testFacialCo.getCertifyId({\n realName,\n idCard,\n metaInfo\n })\n .then((res : UTSJSONObject) : Promise<string> => {\n const certifyId = res['certifyId'] as string\n return new Promise((\n resolve : (res : string) => void,\n reject : (err : Error) => void\n ) => {\n uni.startFacialRecognitionVerify({\n certifyId,\n success() {\n resolve(certifyId)\n },\n fail(err) {\n reject(new Error(err.errMsg))\n }\n })\n })\n })\n .then((certifyId : string) : Promise<UTSJSONObject> => {\n return testFacialCo.getAuthResult(certifyId)\n })\n .then((res : UTSJSONObject) => {\n console.log('res', res)\n })\n .catch((err : any | null) => {\n console.error('error', err)\n })\n }\n }\n }\n</script>\n\n<style>\n</style>\n\n```"},"createRewardedVideoAd":{"name":"## uni.createRewardedVideoAd(option) @createrewardedvideoad","description":"创建激励视频广告对象","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| option | **CreateRewardedVideoAdOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| adpid | string | 是 | - | - | å¹¿å‘Šä½ id |\n@| urlCallback | **UrlCallbackOptions** \\| null | å¦ | - | - | æœåŠ¡å™¨å›žè°ƒé€ä¼ å‚æ•° |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| userId | string \\| null | å¦ | - | - | é€ä¼ 到æœåŠ¡å™¨ç«¯çš„userId |\n@@| extra | string \\| null | å¦ | - | - | é€ä¼ 到æœåŠ¡å™¨ç«¯çš„extra,ä¸æŽ¨è设置过于å¤æ‚çš„å—符串 | \n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [RewardedVideoAd](#rewardedvideoad-values) |\n\n#### RewardedVideoAd 的方法 @rewardedvideoad-values \n\n#### show() @show\nå¹¿å‘ŠåŠ è½½æˆåŠŸä¹‹åŽï¼Œè°ƒç”¨æ¤æ–¹æ³•å±•ç¤ºå¹¿å‘Š\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| Promise\\<any> |\n \n\n##### show 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### load() @load\nåŠ è½½å¹¿å‘Š\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| Promise\\<any> |\n \n\n##### load 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### destroy() @destroy\n销æ¯å¹¿å‘Š\n\n\n##### destroy 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### onLoad(callback) @onload\n绑定广告 load 事件的监å¬å™¨\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: any) => void | 是 | - | - | - | \n\n\n##### onLoad 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### offLoad(callback) @offload\n解除绑定 load 事件的监å¬å™¨\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: any) => void | 是 | - | - | - | \n\n\n##### offLoad 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### onError(callback) @onerror\n绑定 error 事件的监å¬å™¨\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [IUniAdError](#iuniaderror-values)) => void | 是 | - | - | - | \n\n##### IUniAdError 的属性值 @iuniaderror-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | number | 是 | - | - | 错误ç <br/>- -5001 广告ä½æ ‡è¯†adpidä¸ºç©ºï¼Œè¯·ä¼ å…¥æœ‰æ•ˆçš„adpid<br/>- -5002 æ— æ•ˆçš„å¹¿å‘Šä½æ ‡è¯†adpid,请使用æ£ç¡®çš„adpid<br/>- -5003 广告ä½æœªå¼€é€šå¹¿å‘Šï¼Œè¯·åœ¨å¹¿å‘Šå¹³å°ç”³è¯·å¹¶ç¡®ä¿å·²å®¡æ ¸é€šè¿‡<br/>- -5004 æ— å¹¿å‘Šæ¨¡å—,打包时请é…ç½®è¦ä½¿ç”¨çš„广告模å—<br/>- -5005 å¹¿å‘ŠåŠ è½½å¤±è´¥ï¼Œè¯·ç¨åŽé‡è¯•<br/>- -5006 广告已ç»å±•ç¤ºè¿‡äº†ï¼Œè¯·é‡æ–°åŠ è½½<br/>- -5007 广告ä¸å¯ç”¨æˆ–已过期,请é‡æ–°è¯·æ±‚<br/>- -5008 广告ä¸å¯ç”¨æˆ–已过期,请é‡æ–°è¯·æ±‚<br/>- -5009 广告类型ä¸ç¬¦ï¼Œè¯·æ£€æŸ¥åŽå†è¯•<br/>- -5011 æ‰“åŒ…æˆ–å¼€é€šçš„æ¸ é“,ä¸æ”¯æŒæ¤ç±»åž‹å¹¿å‘Š<br/>- -5013 广告æ’放失败,请é‡æ–°åŠ è½½ |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n\n\n##### onError 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### offError(callback) @offerror\n解除绑定 error 事件的监å¬å™¨\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [IUniAdError](#iuniaderror-values)) => void | 是 | - | - | - | \n\n\n##### offError 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### onClose(callback) @onclose\n绑定 close 事件的监å¬å™¨\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [VideoAdClose](#videoadclose-values)) => void | 是 | - | - | - | \n\n##### VideoAdClose 的属性值 @videoadclose-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| isEnded | boolean | 是 | - | - | trueæ ‡è¯†å¹¿å‘Šæ’放完毕或者达到å‘放奖励的æ¡ä»¶ |\n\n\n##### onClose 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### offClose(callback) @offclose\n解除绑定 close 事件的监å¬å™¨\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [VideoAdClose](#videoadclose-values)) => void | 是 | - | - | - | \n\n\n##### offClose 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### onAdClicked(callback) @onadclicked\n绑定广告å¯ç‚¹å‡»å±å¹•åŒºåŸŸäº‹ä»¶çš„监å¬å™¨\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: any) => void | 是 | - | - | - | \n\n\n##### onAdClicked 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### onVerify(callback) @onverify\n绑定 verify 事件的监å¬å™¨\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| callback | (result: [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md)) => void | 是 | - | - | - | \n\n\n##### onVerify 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n \n","compatibility":"### createRewardedVideoAd 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 4.0 | 4.22 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ad.createRewardedVideoAd)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/rewarded-video-ad/rewarded-video-ad.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\n <page-head title=\"激励视频广告\"></page-head>\n <button :type=\"btnType\" style=\"margin: 10px;\" :disabled=\"btnDisable\" @click=\"showAd()\">{{btnText}}</button>\n</template>\n\n<script>\n export default {\n data() {\n return {\n btnText: \"\",\n btnType: \"primary\",\n btnDisable: false,\n rewardAd: null as RewardedVideoAd | null,\n isAdLoadSuccess: false\n }\n },\n onReady() {\n this.loadAd()\n },\n methods: {\n loadAd() {\n if (this.btnDisable)\n return\n this.btnDisable = true\n this.btnText = \"æ£åœ¨åŠ 载广告\"\n this.btnType = \"primary\"\n if (this.rewardAd == null) {\n this.rewardAd = uni.createRewardedVideoAd({\n adpid: \"1507000689\" //æ¤å¤„为测试广告ä½ï¼Œå®žé™…å¼€å‘ä¸è¯·åœ¨uni-adåŽå°ç”³è¯·è‡ªå·±çš„广告ä½åŽæ›¿æ¢\n })\n this.rewardAd!.onError((_) => {\n this.btnType = \"warn\"\n this.btnText = \"å¹¿å‘ŠåŠ è½½å¤±è´¥ï¼Œç‚¹å‡»é‡è¯•\"\n this.btnDisable = false\n })\n this.rewardAd!.onLoad((_) => {\n this.btnType = \"primary\"\n this.btnText = \"å¹¿å‘ŠåŠ è½½æˆåŠŸï¼Œç‚¹å‡»è§‚看\"\n this.btnDisable = false\n this.isAdLoadSuccess = true\n })\n this.rewardAd!.onClose((e) => {\n // 测试广告ä½æ— 法通过æœåŠ¡å™¨å›žè°ƒã€‚实际开å‘ä¸ï¼Œä½¿ç”¨è‡ªå·±çš„广告ä½åŽï¼Œéœ€å‚考uni-ad文档编写æœåŠ¡å™¨å›žè°ƒçš„代ç ,在æœåŠ¡ç«¯å‘放奖励\n this.isAdLoadSuccess = false\n uni.showToast({\n title: \"激励视频\" + (e.isEnded ? \"\" : \"未\") + \"æ’放完毕\",\n position: \"bottom\"\n })\n this.loadAd()\n })\n }\n this.rewardAd!.load()\n },\n showAd() {\n if (this.isAdLoadSuccess) {\n this.rewardAd!.show()\n } else {\n this.loadAd()\n }\n }\n }\n }\n</script>\n\n<style>\n\n</style>\n\n```"},"requestPayment":{"name":"## uni.requestPayment(options) @requestpayment","description":"请求支付","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [RequestPaymentOptions](#requestpaymentoptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| provider | string | 是 | - | - | 支付æœåŠ¡æ供商,通过 [uni.getProvider](https://doc.dcloud.net.cn/uni-app-x/api/get-provider.html) 获å–,ç›®å‰æ”¯æŒæ”¯ä»˜å®æ”¯ä»˜(alipay),微信支付(wxpay) |\n@| orderInfo | string | 是 | - | - | 订å•æ•°æ® |\n@| success | (result: [RequestPaymentSuccess](#requestpaymentsuccess-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: [IRequestPaymentFail](#irequestpaymentfail-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### RequestPaymentSuccess 的属性值 @requestpaymentsuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| data | any \\| null | å¦ | - | - | |\n\n##### IRequestPaymentFail 的属性值 @irequestpaymentfail-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errCode | 700600 \\| 701100 \\| 701110 \\| 700601 \\| 700602 \\| 700603 \\| 700000 \\| 700604 \\| 700800 \\| 700801 | 是 | - | - | 错误ç <br/>- 700600 æ£åœ¨å¤„ç†ä¸ï¼Œæ”¯ä»˜ç»“果未知(有å¯èƒ½å·²ç»æ”¯ä»˜æˆåŠŸï¼‰ï¼Œè¯·æŸ¥è¯¢å•†å®¶è®¢å•åˆ—表ä¸è®¢å•çš„支付状æ€<br/>- 701100 订å•æ”¯ä»˜å¤±è´¥ã€‚<br/>- 701110 é‡å¤è¯·æ±‚。<br/>- 700601 用户ä¸é€”å–消。<br/>- 700602 网络连接出错。<br/>- 700603 支付结果未知(有å¯èƒ½å·²ç»æ”¯ä»˜æˆåŠŸï¼‰ï¼Œè¯·æŸ¥è¯¢å•†å®¶è®¢å•åˆ—表ä¸è®¢å•çš„支付状æ€ã€‚<br/>- 700000 其它支付错误。<br/>- 700604 微信没有安装。<br/>- 700800 没有é…置对应的URL Scheme。<br/>- 700801 没有é…置对应的universal Link。 |\n| errSubject | string | 是 | - | - | 统一错误主题(模å—)å称 |\n| data | any \\| null | å¦ | - | - | 错误信æ¯ä¸åŒ…å«çš„æ•°æ® |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | å¦ | - | - | æºé”™è¯¯ä¿¡æ¯ï¼Œå¯ä»¥åŒ…å«å¤šä¸ªé”™è¯¯ï¼Œè¯¦è§SourceError |\n| errMsg | string | 是 | - | - | - |\n","returnValue":"","compatibility":"### requestPayment 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.02 | 4.18 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](https://uniapp.dcloud.net.cn/api/plugins/payment.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.payment.requestPayment)\n","example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/request-payment/request-payment.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/request-payment/request-payment\n>Template\n```vue\n<template>\r\n\t<page-head title=\"å‘起支付\"></page-head>\r\n\r\n\t<template v-if=\"providerList.length > 0\">\r\n\t\t<button style=\"margin-top: 20px;\" type=\"primary\" v-for=\"(item,index) in providerList\" :key=\"index\"\r\n\t\t\t@click=\"requestPayment(item)\">{{item.name}}支付</button>\r\n\t</template>\r\n</template>\r\n\r\n\r\n\r\n<style>\r\n\r\n</style>\n\n```\n>Script\n```uts\n\r\n\texport type PayItem = { id : string, name : string, provider ?: UniProvider }\r\n\texport default {\r\n\t\tdata() {\r\n\t\t\treturn {\r\n\t\t\t\tbtnText: \"支付å®æ”¯ä»˜\",\r\n\t\t\t\tbtnType: \"primary\",\r\n\t\t\t\torderInfo: \"\",\r\n\t\t\t\terrorCode: 0,\r\n\t\t\t\terrorMsg: \"\",\r\n\t\t\t\tcomplete: false,\r\n\t\t\t\tproviderList: [] as PayItem[]\r\n\t\t\t}\r\n\t\t},\r\n\t\tonLoad: function () {\r\n\t\t\tuni.getProvider({\r\n\t\t\t\tservice: \"payment\",\r\n\t\t\t\tsuccess: (e) => {\r\n\t\t\t\t\tconsole.log(\"payment success:\" + JSON.stringify(e));\r\n\t\t\t\t\tlet array = e.provider as string[]\r\n\t\t\t\t\tarray.forEach((value : string) => {\r\n\t\t\t\t\t\tswitch (value) {\r\n\t\t\t\t\t\t\tcase 'alipay':\r\n\t\t\t\t\t\t\t\tthis.providerList.push({\r\n\t\t\t\t\t\t\t\t\tname: '支付å®',\r\n\t\t\t\t\t\t\t\t\tid: \"alipay\",\r\n\t\t\t\t\t\t\t\t\tprovider: e.providers.find((item) : boolean => {\r\n\t\t\t\t\t\t\t\t\t\treturn item.id == 'alipay'\r\n\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t} as PayItem);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 'wxpay':\r\n\t\t\t\t\t\t\t\tthis.providerList.push({\r\n\t\t\t\t\t\t\t\t\tname: '微信',\r\n\t\t\t\t\t\t\t\t\tid: \"wxpay\",\r\n\t\t\t\t\t\t\t\t\tprovider: e.providers.find((item) : boolean => {\r\n\t\t\t\t\t\t\t\t\t\treturn item.id == 'wxpay'\r\n\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t} as PayItem);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})\r\n\t\t\t\t},\r\n\t\t\t\tfail: (e) => {\r\n\t\t\t\t\tconsole.log(\"获å–支付通é“失败:\", e);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\trequestPayment(e : PayItem) {\r\n\t\t\t\tconst provider = e.id\r\n\t\t\t\tif (provider == \"alipay\") {\r\n\t\t\t\t\tthis.payAli()\r\n\t\t\t\t} else if (provider == \"wxpay\") {\n\r\n\t\t\t\t\tif (e.provider != null && e.provider?.isAppExist==false) {\r\n\t\t\t\t\t\tuni.showToast({\r\n\t\t\t\t\t\t\ttitle: \"微信没有安装\",\n\t\t\t\t\t\t\ticon:'error'\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.payWX()\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tpayAli() {\r\n\t\t\t\tuni.showLoading({\r\n\t\t\t\t\ttitle: \"请求ä¸...\"\r\n\t\t\t\t})\r\n\t\t\t\tuni.request({\r\n\t\t\t\t\turl: 'https://demo.dcloud.net.cn/payment/alipay/?total=0.01',\r\n\t\t\t\t\tmethod: 'GET',\r\n\t\t\t\t\ttimeout: 6000,\r\n\t\t\t\t\tsuccess: (res) => {\r\n\t\t\t\t\t\tthis.orderInfo = JSON.stringify(res.data);\r\n\t\t\t\t\t\tconsole.log(\"====\" + this.orderInfo)\r\n\t\t\t\t\t\tuni.hideLoading()\r\n\t\t\t\t\t\tuni.requestPayment({\r\n\t\t\t\t\t\t\tprovider: \"alipay\",\r\n\t\t\t\t\t\t\torderInfo: res.data as string,\r\n\t\t\t\t\t\t\tfail: (res) => {\r\n\t\t\t\t\t\t\t\tconsole.log(JSON.stringify(res))\r\n\t\t\t\t\t\t\t\tthis.errorCode = res.errCode\r\n\t\t\t\t\t\t\t\tuni.showToast({\r\n\t\t\t\t\t\t\t\t\ticon: 'error',\r\n\t\t\t\t\t\t\t\t\ttitle: 'errorCode:' + this.errorCode\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tsuccess: (res) => {\r\n\t\t\t\t\t\t\t\tconsole.log(JSON.stringify(res))\r\n\t\t\t\t\t\t\t\tuni.showToast({\r\n\t\t\t\t\t\t\t\t\ticon: 'success',\r\n\t\t\t\t\t\t\t\t\ttitle: '支付æˆåŠŸ'\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t},\r\n\t\t\t\t\tfail: (e) => {\r\n\t\t\t\t\t\tconsole.log(e)\r\n\t\t\t\t\t\tuni.hideLoading()\r\n\t\t\t\t\t},\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\tpayWX() {\r\n\t\t\t\tuni.showLoading({\r\n\t\t\t\t\ttitle: \"请求ä¸...\"\r\n\t\t\t\t})\r\n\t\t\t\tlet url = 'https://demo.dcloud.net.cn/payment/wxpayv3.__UNI__uniappx/?total=0.01'\r\n\t\t\t\tconst res = uni.getAppBaseInfo();\n\t\t\t\tlet packageName:string | null\n\n\t\t\t\t// #ifdef APP-ANDROID\n\t\t\t\tpackageName = res.packageName\n\t\t\t\t// #endif\n\n\t\t\t\t// #ifdef APP-IOS\n\t\t\t\tpackageName = res.bundleId\n\t\t\t\t// #endif\n\n\t\t\t\tif (packageName == 'io.dcloud.hellouniappx') {//hello uniappx\n\t\t\t\t url = 'https://demo.dcloud.net.cn/payment/wxpayv3.__UNI__HelloUniAppX/?total=0.01'\n\t\t\t\t}\r\n\t\t\t\tuni.request({\r\n\t\t\t\t\turl: url,\r\n\t\t\t\t\tmethod: 'GET',\r\n\t\t\t\t\ttimeout: 6000,\r\n\t\t\t\t\theader: {\r\n\t\t\t\t\t\t\"Content-Type\": \"application/json\"\r\n\t\t\t\t\t} as UTSJSONObject,\r\n\t\t\t\t\tsuccess: (res) => {\r\n\t\t\t\t\t\tconsole.log(res.data)\r\n\t\t\t\t\t\tuni.hideLoading()\r\n\t\t\t\t\t\tuni.requestPayment({\r\n\t\t\t\t\t\t\tprovider: \"wxpay\",\r\n\t\t\t\t\t\t\torderInfo: JSON.stringify(res.data),\r\n\t\t\t\t\t\t\tfail: (res) => {\r\n\t\t\t\t\t\t\t\tconsole.log(JSON.stringify(res))\r\n\t\t\t\t\t\t\t\tthis.errorCode = res.errCode\r\n\t\t\t\t\t\t\t\tuni.showToast({\r\n\t\t\t\t\t\t\t\t\tduration: 5000,\r\n\t\t\t\t\t\t\t\t\ticon: 'error',\r\n\t\t\t\t\t\t\t\t\ttitle: 'errorCode:' + this.errorCode,\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tsuccess: (res) => {\r\n\t\t\t\t\t\t\t\tconsole.log(JSON.stringify(res))\r\n\t\t\t\t\t\t\t\tuni.showToast({\r\n\t\t\t\t\t\t\t\t\tduration: 5000,\r\n\t\t\t\t\t\t\t\t\ticon: 'success',\r\n\t\t\t\t\t\t\t\t\ttitle: '支付æˆåŠŸ'\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t},\r\n\t\t\t\t\tfail: (res) => {\r\n\t\t\t\t\t\tuni.hideLoading()\r\n\t\t\t\t\t\tconsole.log(res)\r\n\t\t\t\t\t},\r\n\t\t\t\t});\r\n\t\t\t},\r\n\r\n\t\t\t//自动化测试使用\r\n\t\t\tjest_pay() {\r\n\t\t\t\tuni.requestPayment({\r\n\t\t\t\t\tprovider: \"alipay\",\r\n\t\t\t\t\torderInfo: this.orderInfo,\r\n\t\t\t\t\tfail: (res : RequestPaymentFail) => {\r\n\t\t\t\t\t\tthis.errorCode = res.errCode\r\n\t\t\t\t\t\tthis.complete = true\r\n\t\t\t\t\t},\r\n\t\t\t\t\tsuccess: (res : RequestPaymentSuccess) => {\r\n\t\t\t\t\t\tconsole.log(JSON.stringify(res))\r\n\t\t\t\t\t\tthis.complete = true\r\n\t\t\t\t\t}\r\n\t\t\t\t} as RequestPaymentOptions)\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\n```\n:::"},"createWebviewContext":{"name":"## uni.createWebviewContext(webviewId, component?) @createwebviewcontext","description":"创建 web-view 组件的上下文对象,用于æ“作 web-view 的行为。","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| webviewId | [string.WebviewIdString](/uts/data-type.md#ide-string) | 是 | - | - | - |\n| component | ComponentPublicInstance \\| null | å¦ | - | - | | \n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| [WebviewContext](#webviewcontext-values) \\| null | å¦ |\n\n#### WebviewContext 的方法 @webviewcontext-values \n\n#### back() @back\nåŽé€€åˆ° web-view ç»„ä»¶ç½‘é¡µåŠ è½½åŽ†å²çš„上一页,如果ä¸å˜åœ¨ä¸Šä¸€é¡µåˆ™æ²¡æœ‰ä»»ä½•æ•ˆæžœã€‚\n\n\n##### back 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n\n\n#### forward() @forward\nå‰è¿›åˆ° web-view ç»„ä»¶ç½‘é¡µåŠ è½½åŽ†å²çš„下一页,如果ä¸å˜åœ¨ä¸‹ä¸€é¡µåˆ™æ²¡æœ‰ä»»ä½•æ•ˆæžœã€‚\n\n\n##### forward 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n\n\n#### reload() @reload\né‡æ–°åŠ è½½ web-view 组件当å‰é¡µé¢ã€‚\n\n\n##### reload 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n\n\n#### stop() @stop\nåœæ¢åŠ è½½ web-view 组件当å‰ç½‘页,该方法ä¸èƒ½é˜»æ¢å·²ç»åŠ 载的 html 文档,但是能够阻æ¢æœªå®Œæˆçš„图片åŠå»¶è¿ŸåŠ 载的资æºã€‚\n\n\n##### stop 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n\n\n#### evalJS(js) @evaljs\n在网页ä¸æ‰§è¡ŒæŒ‡å®šçš„js脚本,在 uvue 页é¢ä¸å¯é€šè¿‡æ¤æ–¹æ³•å‘ web-view ç»„ä»¶åŠ è½½çš„é¡µé¢å‘é€æ•°æ®\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| js | string | 是 | - | - | - | \n\n\n##### evalJS 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | 3.9.0 | 4.11 |\n\n \n","compatibility":"### createWebviewContext 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9.0 | 4.11 |\n","tutorial":"\n### å‚è§\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.component.create-webview-context)\n"},"createVideoContext":{"name":"## uni.createVideoContext(videoId, component?) @createvideocontext","description":"创建并返回 video 上下文 videoContext 对象","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| videoId | [string.VideoIdString](/uts/data-type.md#ide-string) | 是 | - | - | - |\n| component | ComponentPublicInstance \\| null | å¦ | - | - | | \n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| [VideoContext](#videocontext-values) \\| null | å¦ |\n\n#### VideoContext 的方法 @videocontext-values \n\n#### play() @play\næ’放\n\n\n##### play 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n\n\n#### pause() @pause\næš‚åœ\n\n\n##### pause 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n\n\n#### seek(position) @seek\n跳转到指定ä½ç½®\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| position | number | 是 | - | - | 跳转到指定ä½ç½®(秒) | \n\n\n##### seek 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n\n\n#### stop() @stop\nåœæ¢è§†é¢‘\n\n\n##### stop 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n\n\n#### sendDanmu(danmu) @senddanmu\nå‘é€å¼¹å¹•\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| danmu | **Danmu** | 是 | - | - | text, color |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| text | string \\| null | å¦ | - | - | å¼¹å¹•æ–‡å— |\n@| color | string \\| null | å¦ | - | - | 弹幕颜色 |\n@| time | number \\| null | å¦ | - | - | 显示时刻 | \n\n\n##### sendDanmu 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n\n\n#### playbackRate(rate) @playbackrate\n设置å€é€Ÿæ’放\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| rate | number | 是 | - | - | , 支æŒå€çŽ‡ 0.5/0.8/1.0/1.25/1.5 | \n\n\n##### playbackRate 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n\n\n#### requestFullScreen(direction?) @requestfullscreen\n进入全å±\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| direction | **RequestFullScreenOptions** | å¦ | - | - | , 0\\|æ£å¸¸ç«–å‘, 90\\|å±å¹•é€†æ—¶é’ˆ90度, -90\\|å±å¹•é¡ºæ—¶é’ˆ90度 |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| direction | number \\| null | å¦ | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"3.9.0\",\"4.11\"]]}' /> | direction<br/>- 0: æ£å¸¸ç«–å‘<br/>- 90: å±å¹•é€†æ—¶é’ˆ90度<br/>- -90: å±å¹•é¡ºæ—¶é’ˆ90度 | \n\n\n##### requestFullScreen 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n\n\n#### exitFullScreen() @exitfullscreen\n退出全å±\n\n\n##### exitFullScreen 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9.0 | 4.11 |\n\n \n","compatibility":"### createVideoContext 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | √ | 4.11 |\n","tutorial":"\n### å‚è§\n- [å‚è§uni-app相关文档](http://uniapp.dcloud.io/api/media/video-context?id=createVideoContext)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.component.create-video-context)\n"},"createMapContext":{"name":"## uni.createMapContext(mapId, currentComponent?) @createmapcontext","description":"创建并返回 map 上下文 mapContext 对象<br/>","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| mapId | string | 是 | - | - | - |\n| currentComponent | ComponentPublicInstance | å¦ | - | - | - | \n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [MapContext](#mapcontext-values) |\n\n#### MapContext 的方法 @mapcontext-values \n\n#### getCenterLocation(options) @getcenterlocation\n获å–当å‰åœ°å›¾ä¸å¿ƒçš„ç»çº¬åº¦ï¼Œè¿”回的是 gcj02 åæ ‡ç³»ï¼Œå¯ä»¥ç”¨äºŽ uni.openLocation\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [MapContextGetCenterLocationOptions](#mapcontextgetcenterlocationoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (result: [LocationObject](#locationobject-values)) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 ,res = { longitude: \"ç»åº¦\", latitude: \"纬度\"} |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### LocationObject 的属性值 @locationobject-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| latitude | number | 是 | - | - | 纬度,浮点数,范围为-90~90,负数表示å—纬 |\n| longitude | number | 是 | - | - | ç»åº¦ï¼ŒèŒƒå›´ä¸º-180~180ï¼Œè´Ÿæ•°è¡¨ç¤ºè¥¿ç» |\n\n\n##### getCenterLocation 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### moveToLocation(options) @movetolocation\n将地图ä¸å¿ƒç§»åŠ¨åˆ°å½“å‰å®šä½ç‚¹ï¼Œéœ€è¦é…åˆmap组件的show-location使用\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextMoveToLocationOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| latitude | number | å¦ | - | - | 纬度,浮点数,范围为-90~90,负数表示å—纬 |\n@| longitude | number | å¦ | - | - | ç»åº¦ï¼ŒèŒƒå›´ä¸º-180~180ï¼Œè´Ÿæ•°è¡¨ç¤ºè¥¿ç» |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### moveToLocation 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### translateMarker(options) @translatemarker\n平移marker,带动画\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [MapContextTranslateMarkerOptions](#mapcontexttranslatemarkeroptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| markerId | number | 是 | - | - | 指定marker |\n@| destination | [LocationObject](#locationobject-values) | 是 | - | - | 指定markerç§»åŠ¨åˆ°çš„ç›®æ ‡ç‚¹ |\n@| autoRotate | boolean | å¦ | - | - | 移动过程ä¸æ˜¯å¦è‡ªåŠ¨æ—‹è½¬marker |\n@| rotate | number | å¦ | - | - | marker的旋转角度 |\n@| moveWithRotate | boolean | å¦ | - | - | 平移和旋转åŒæ—¶è¿›è¡Œï¼Œé»˜è®¤å€¼false(仅微信å°ç¨‹åº2.13.0支æŒï¼‰ |\n@| duration | number | å¦ | - | - | 动画æŒç»æ—¶é•¿ï¼Œé»˜è®¤å€¼1000ms,平移与旋转分别计算 |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### MapContextTranslateMarkerOptions 的方法 @mapcontexttranslatemarkeroptions-values \n\n##### animationEnd(result) @animationend\n动画结æŸå›žè°ƒå‡½æ•°\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| result | any | 是 | - | - | - | \n\n\n###### animationEnd 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n\n##### translateMarker 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### includePoints(options) @includepoints\n缩放视野展示所有ç»çº¬åº¦\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextIncludePointsOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| points | Array\\<[LocationObject](#locationobject-values)\\> | 是 | - | - | è¦æ˜¾ç¤ºåœ¨å¯è§†åŒºåŸŸå†…çš„åæ ‡ç‚¹åˆ—è¡¨ï¼Œ[{latitude, longitude}\\] |\n@| padding | Array\\<number\\> | å¦ | - | - | åæ ‡ç‚¹å½¢æˆçš„矩形边缘到地图边缘的è·ç¦»ï¼Œå•ä½åƒç´ ã€‚æ ¼å¼ä¸º\\[上,å³,下,å·¦]安å“上åªèƒ½è¯†åˆ«æ•°ç»„第一项,上下左å³çš„padding一致。开å‘者工具暂ä¸æ”¯æŒpaddingå‚数。 |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### includePoints 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### getRegion(options) @getregion\n获å–当å‰åœ°å›¾çš„视野范围\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [MapContextGetRegionOptions](#mapcontextgetregionoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (result: [MapContextGetRegionResult](#mapcontextgetregionresult-values)) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数,res = {southwest, northeast},西å—角与东北角的ç»çº¬åº¦ |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### MapContextGetRegionResult 的属性值 @mapcontextgetregionresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| southwest | [LocationObject](#locationobject-values) | 是 | - | - | 西å—角的ç»çº¬åº¦ |\n| northeast | [LocationObject](#locationobject-values) | 是 | - | - | 东北角的ç»çº¬åº¦ |\n\n\n##### getRegion 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### getScale(options) @getscale\n获å–当å‰åœ°å›¾çš„缩放级别\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [MapContextGetScaleOptions](#mapcontextgetscaleoptions-values) | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| success | (result: [MapContextGetScaleResult](#mapcontextgetscaleresult-values)) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数,res = {scale} |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### MapContextGetScaleResult 的属性值 @mapcontextgetscaleresult-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| scale | number | 是 | - | - | 地图缩放级别 |\n\n\n##### getScale 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### addCustomLayer(options) @addcustomlayer\næ·»åŠ ä¸ªæ€§åŒ–å›¾å±‚\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextAddCustomLayerOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| layerId | string | 是 | - | - | 个性化图层id |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### addCustomLayer 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### addGroundOverlay(options) @addgroundoverlay\n创建自定义图片图层,图片会éšç€åœ°å›¾ç¼©æ”¾è€Œç¼©æ”¾\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextAddGroundOverlayOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| id | string | 是 | - | - | 图片图层 id |\n@| src | string | 是 | - | - | 图片路径,支æŒç½‘络图片ã€ä¸´æ—¶è·¯å¾„ã€ä»£ç 包路径 |\n@| bounds | **Bounds** | 是 | - | - | 图片覆盖的ç»çº¬åº¦èŒƒå›´ |\n@@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@@| :- | :- | :- | :- | :-: | :- |\n@@| southwest | [LocationObject](#locationobject-values) | 是 | - | - | 西å—角的ç»çº¬åº¦ |\n@@| northeast | [LocationObject](#locationobject-values) | 是 | - | - | 东北角的ç»çº¬åº¦ |\n@| visible | boolean | å¦ | - | - | 是å¦å¯è§ |\n@| zIndex | number | å¦ | - | - | å›¾å±‚ç»˜åˆ¶é¡ºåº |\n@| opacity | number | å¦ | - | - | 图层é€æ˜Žåº¦ |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### addGroundOverlay 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### addMarkers(options) @addmarkers\næ·»åŠ marker\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextAddMarkersOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| markers | Array\\<any\\> | 是 | - | - | åŒä¼ å…¥ map 组件的 marker 属性 |\n@| clear | boolean | 是 | - | - | 是å¦å…ˆæ¸…空地图上所有 marker |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### addMarkers 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### fromScreenLocation(options) @fromscreenlocation\n获å–å±å¹•ä¸Šçš„点对应的ç»çº¬åº¦ï¼Œåæ ‡åŽŸç‚¹ä¸ºåœ°å›¾å·¦ä¸Šè§’\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextFromScreenLocationOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| x | number | 是 | - | - | x åæ ‡å€¼ |\n@| y | number | 是 | - | - | y åæ ‡å€¼ |\n@| success | (result: [LocationObject](#locationobject-values)) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### fromScreenLocation 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### initMarkerCluster(options) @initmarkercluster\nåˆå§‹åŒ–点èšåˆçš„é…置,未调用时采用默认é…ç½®\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextInitMarkerClusterOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| enableDefaultStyle | boolean | 是 | - | - | å¯ç”¨é»˜è®¤çš„èšåˆæ ·å¼ |\n@| zoomOnClick | boolean | 是 | - | - | 点击已ç»èšåˆçš„æ ‡è®°ç‚¹æ—¶æ˜¯å¦å®žçŽ°èšåˆåˆ†ç¦» |\n@| gridSize | number | 是 | - | - | èšåˆç®—法的å¯èšåˆè·ç¦»ï¼Œå³è·ç¦»å°äºŽè¯¥å€¼çš„点会èšåˆè‡³ä¸€èµ·ï¼Œä»¥åƒç´ 为å•ä½ |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### initMarkerCluster 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### moveAlong(options) @movealong\n沿指定路径移动 marker,用于轨迹回放ç‰åœºæ™¯ã€‚动画完æˆæ—¶è§¦å‘回调事件,若动画进行ä¸ï¼Œå¯¹åŒä¸€ marker å†æ¬¡è°ƒç”¨ moveAlong 方法,å‰ä¸€æ¬¡çš„动画将被打æ–。\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextMoveAlongOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| markerId | number | 是 | - | - | 指定 marker |\n@| path | Array\\<[LocationObject](#locationobject-values)\\> | 是 | - | - | 移动路径的åæ ‡ä¸²ï¼Œåæ ‡ç‚¹æ ¼å¼ {longitude, latitude} |\n@| autoRotate | boolean | å¦ | - | - | æ ¹æ®è·¯å¾„æ–¹å‘è‡ªåŠ¨æ”¹å˜ marker 的旋转角度 |\n@| duration | number | 是 | - | - | 平滑移动的时间 |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### moveAlong 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### openMapApp(options) @openmapapp\n拉起地图APP选择导航。\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextOpenMapAppOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| destination | string | 是 | - | - | 目的地å称 |\n@| latitude | number | 是 | - | - | 目的地纬度 |\n@| longitude | number | 是 | - | - | 目的地ç»åº¦ |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### openMapApp 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### removeCustomLayer(options) @removecustomlayer\n移除个性化图层\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextRemoveCustomLayerOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| layerId | string | 是 | - | - | 个性化图层id |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### removeCustomLayer 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### removeGroundOverlay(options) @removegroundoverlay\n移除自定义图片图层\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextRemoveGroundOverlayOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| id | string | 是 | - | - | 图片图层 id |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### removeGroundOverlay 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### removeMarkers(options) @removemarkers\n移除 marker\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextRemoveMarkersOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| markerIds | Array\\<any\\> | 是 | - | - | è¦è¢«åˆ 除的markerçš„id属性组æˆçš„数组 |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### removeMarkers 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### setCenterOffset(options) @setcenteroffset\n设置地图ä¸å¿ƒç‚¹å移,å‘åŽå‘下为增长,å±å¹•æ¯”例范围(0.25~0.75),默认å移为[0.5, 0.5\\]\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextSetCenterOffsetOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| offset | Array\\<number\\> | 是 | - | - | å移é‡ï¼Œä¸¤ä½æ•°ç»„ |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### setCenterOffset 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### toScreenLocation(options) @toscreenlocation\n获å–ç»çº¬åº¦å¯¹åº”çš„å±å¹•åæ ‡ï¼Œåæ ‡åŽŸç‚¹ä¸ºåœ°å›¾å·¦ä¸Šè§’ã€‚\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextToScreenLocationOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| latitude | number | 是 | - | - | 纬度 |\n@| longitude | number | 是 | - | - | ç»åº¦ |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### toScreenLocation 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### updateGroundOverlay(options) @updategroundoverlay\n更新自定义图片图层。\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | **MapContextUpdateGroundOverlayOptions** | 是 | - | - | - |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| id | string | 是 | - | - | 图片图层 id |\n@| src | string | 是 | - | - | 图片路径,支æŒç½‘络图片ã€ä¸´æ—¶è·¯å¾„ã€ä»£ç 包路径 |\n@| bounds | [Bounds](#bounds-values) | 是 | - | - | 图片路径,支æŒç½‘络图片ã€ä¸´æ—¶è·¯å¾„ã€ä»£ç 包路径 |\n@| visible | boolean | å¦ | - | - | 是å¦å¯è§ |\n@| zIndex | number | å¦ | - | - | å›¾å±‚ç»˜åˆ¶é¡ºåº |\n@| opacity | number | å¦ | - | - | 图层é€æ˜Žåº¦ |\n@| success | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调函数 |\n@| fail | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n\n##### updateGroundOverlay 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### on(event, callback) @on\n监å¬åœ°å›¾äº‹ä»¶ã€‚\n##### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| event | \"markerClusterCreate\" \\| \"markerClusterClick\" | 是 | - | - | - |\n| callback | (args?: Array\\<any\\>) => any | 是 | - | - | - | \n\n\n##### on 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n#### $getAppMap() @$getappmap\n获å–原生地图对象 plus.maps.Map\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| any |\n \n\n##### $getAppMap 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n \n","compatibility":"### createMapContext 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | x | x |\n","tutorial":"\n### å‚è§\n- [createMapContext](https://doc.dcloud.net.cn/uni-app-x/api/create-map-context.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.component.create-map-context)\n"},"getProvider":{"name":"## uni.getProvider(options) @getprovider","description":"获å–æœåŠ¡ä¾›åº”商","param":"### å‚æ•° \n\n| å称 | 类型 | å¿…å¡« | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| options | [GetProviderOptions](#getprovideroptions-values) | 是 | - | - | |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| service | string | 是 | - | - | æœåŠ¡ç±»åž‹ï¼Œå¯å–值“paymentâ€<br/>- payment: 支付 (Alipayã€Wxpay) |\n@| success | (result: [GetProviderSuccess](#getprovidersuccess-values)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨æˆåŠŸçš„回调 |\n@| fail | (result: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨å¤±è´¥çš„回调函数 |\n@| complete | (result: any) => void \\| null | å¦ | - | - | 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ | \n\n##### GetProviderSuccess 的属性值 @getprovidersuccess-values \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| service | string | 是 | - | - | æœåŠ¡ç±»åž‹<br/>- payment: 支付 |\n| provider | Array\\<string\\> | 是 | - | - | 得到的æœåŠ¡ä¾›åº”商 |\n| providers | Array\\<**UniProvider**\\> | 是 | - | <CompatibilityTable table='{\"headers\":[{\"title\":\"Web\"},{\"title\":\"Android\"},{\"title\":\"iOS\"}],\"rows\":[[\"x\",\"4.18\",\"4.18\"]]}' /> | 得到的æœåŠ¡ä¾›åº”商æœåŠ¡å¯¹è±¡ |\n@| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n@| :- | :- | :- | :- | :-: | :- |\n@| id | string | 是 | - | - | æœåŠ¡ä¾›åº”å•†æ ‡è¯† |\n@| description | string | 是 | - | - | æœåŠ¡ä¾›åº”商æè¿° |\n@| isAppExist | boolean | 是 | - | - | 判æ–æœåŠ¡ä¾›åº”商ä¾èµ–çš„App是å¦å®‰è£…(仅支æŒå¾®ä¿¡æ”¯ä»˜ï¼‰ |\n| errMsg | string | 是 | - | - | é”™è¯¯ä¿¡æ¯ |\n","returnValue":"","compatibility":"### getProvider 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.11 | 4.18 |\n","tutorial":"\n### å‚è§\n- [getProvider](https://doc.dcloud.net.cn/uni-app-x/api/get-provider.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.tripartite.get-provider)\n"},"get-provider":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-provider/get-provider.uvue) \n >\n> 该 API ä¸æ”¯æŒ Web,请è¿è¡Œ hello uni-app x 到 App å¹³å°ä½“验 \n```uvue\n<template>\r\n <!-- #ifdef APP -->\r\n <scroll-view class=\"page-scroll-view\">\r\n <!-- #endif -->\r\n <view class=\"page\">\r\n <page-head :title=\"title\"></page-head>\r\n <view class=\"service-item\" v-for=\"(item, index) in serviceList\" :key=\"index\">\r\n <text class=\"service-name\">{{item.name}}:</text>\r\n <view class=\"provider-list\">\r\n <text class=\"provider-item\" v-for=\"(item2, index2) in item.provider\" :key=\"index2\">{{item2}}</text>\r\n </view>\r\n </view>\r\n <button class=\"btn-get-provider\" type=\"primary\" @click=\"getProvider\">getProvider</button>\r\n </view>\r\n <!-- #ifdef APP -->\r\n </scroll-view>\r\n <!-- #endif -->\r\n</template>\r\n\r\n<script>\r\n type ProviderItem = {\r\n service : string,\r\n name : string,\r\n provider : string[]\r\n }\r\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'provider',\r\n serviceList: [\r\n { service: \"oauth\", name: \"登陆\", provider: [] },\r\n { service: \"share\", name: \"分享\", provider: [] },\r\n { service: \"payment\", name: \"支付\", provider: [] },\r\n { service: \"push\", name: \"推é€\", provider: [] },\r\n { service: \"location\", name: \"定ä½\", provider: [] }\r\n ] as ProviderItem[]\r\n }\r\n },\r\n methods: {\r\n getProvider() {\r\n this.serviceList.forEach((item : ProviderItem) => {\r\n uni.getProvider({\r\n service: item.service,\r\n success: (e) => {\r\n this.updateProvider(e.service, e.provider);\r\n }\r\n })\r\n })\r\n },\r\n updateProvider(service : string, provider : string[]) {\r\n const item : ProviderItem | null = this.serviceList.find((item : ProviderItem) : boolean => {\r\n return item.service == service\r\n });\r\n if (item != null) {\r\n item.provider = provider\r\n }\r\n }\r\n }\r\n }\r\n</script>\r\n\r\n<style>\r\n .page {\r\n padding: 15px;\r\n }\r\n\r\n .service-item {\r\n margin-top: 10px;\r\n }\r\n\r\n .service-name {\r\n font-weight: bold;\r\n }\r\n\r\n .provider-list {\r\n margin-left: 32px;\r\n }\r\n\r\n .provider-item {\r\n line-height: 1.5;\r\n }\r\n\r\n .btn-get-provider {\r\n margin-top: 30px;\r\n }\r\n</style>\n\n```"},"general_type":{"name":"## 通用类型\n","param":"### GeneralCallbackResult \n\n| å称 | 类型 | 必备 | 默认值 | 兼容性 | æè¿° |\n| :- | :- | :- | :- | :-: | :- |\n| errMsg | string | 是 | - | - | é”™è¯¯ä¿¡æ¯ |\n"}} \ No newline at end of file