diff --git a/vmall/react-native-image-picker.md b/vmall/react-native-image-picker.md index 6fe1b345cfc4fe06236a69cdd26294c15c11e913..446ebccc59cb0353b7b26629bb19152253f56db6 100644 --- a/vmall/react-native-image-picker.md +++ b/vmall/react-native-image-picker.md @@ -1,4 +1,4 @@ -> 模板版本:v0.1.1 +> 模板版本:v0.1.2

react-native-image-picker

@@ -204,9 +204,13 @@ ohpm install ## 属性 +> [!tip] "Platform"列表示该属性在原三方库上支持的平台。 + +> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 + ### Options -| 名称 | 说明 | 类型 | 是否必填 | 原库平台 | 鸿蒙支持 | +| Name | Description | Type | Required | Platform | HarmonyOS Support | | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | -------- | --------------- | -------- | | mediaType | photo or video or mixed(launchCamera on Android does not support 'mixed'). Web only supports 'photo' for now. | string | yes | iOS Android Web | yes | | maxWidth | To resize the image. | number | no | iOS Android | no | @@ -218,14 +222,14 @@ ohpm install | includeBase64 | If true, creates base64 string of the image (Avoid using on large image files due to performance). | boolean | no | iOS Android Web | no | | includeExtra | If true, will include extra data which requires library permissions to be requested (i.e. exif data). | boolean | no | iOS Android | no | | saveToPhotos | (Boolean) Only for launchCamera, saves the image/video file captured to public photo. | boolean | no | iOS Android | no | -| selectionLimit | Supports providing any integer value. Use 0 to allow any number of files on iOS version >= 14 & Android version >= 13. Default is 1. | number | no | iOS Android Web | yes | +| selectionLimit | Supports providing any integer value. Use 0 to allow any number of files on iOS version >= 14 & Android version >= 13, Use 0 to allow up to 50 files on HarmonyOS. Default is 1. | number | no | iOS Android Web | yes | | presentationStyle | Controls how the picker is presented. currentContext, pageSheet, fullScreen, formSheet, popover, overFullScreen, overCurrentContext. Default is currentContext. | string | no | iOS | no | | formatAsMp4 | Converts the selected video to MP4 (iOS Only). | boolean | no | iOS | no | | assetRepresentationMode | A mode that determines which representation to use if an asset contains more than one. Possible values: 'auto', 'current', 'compatible'. Default is 'auto'. | boolean | no | iOS | no | ### The Response Object -| 名称 | 说明 | 类型 | 是否必填 | 原库平台 | 鸿蒙支持 | +| Name | Description | Type | Required | Platform | HarmonyOS Support | | ------------ | ------------------------------------------------------- | ------- | -------- | --------------- | -------- | | didCancel | true if the user cancelled the process | boolean | no | iOS Android Web | yes | | errorCode | Check ErrorCode for all error codes | string | no | iOS Android Web | no | @@ -234,7 +238,7 @@ ohpm install ### Asset Object -| 名称 | 说明 | 类型 | 是否必填 | 原库平台 | 鸿蒙支持 | +| Name | Description | Type | Required | Platform | HarmonyOS Support | | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -------- | --------------- | -------- | | base64 | The base64 string of the image (photos only) | string | no | iOS Android Web | no | | uri | The file uri in app specific cache storage. Except when picking video from Android gallery where you will get read only content uri, to get file uri in this case copy the file to app specific storage using any react-native library. For web it uses the base64 as uri. | string | yes | iOS Android Web | yes | @@ -247,11 +251,11 @@ ohpm install | duration | The selected video duration in seconds | number | no | iOS Android | no | | bitrate | The average bitrate (in bits/sec) of the selected video, if available. (Android only) | number | no | Android | no | | timestamp | Timestamp of the asset. Only included if 'includeExtra' is true | string | no | iOS Android | no | -| id | local identifier of the photo or video. On Android, this is the same as fileName | string | no | iOS Android | yes | +| id | local identifier of the photo or video. On Android & HarmonyOS, this is the same as fileName | string | no | iOS Android | yes | ## 静态方法 -| 名称 | 说明 | 类型 | 是否必填 | 原库平台 | 鸿蒙支持 | +| Name | Description | Type | Required | Platform | HarmonyOS Support | | ------------------ | -------------------------------------- | -------- | -------- | --------------- | -------- | | launchCamera | Launch camera to take photo or video. | function | yes | iOS Android Web | no | | launchImageLibrary | Launch gallery to pick image or video. | function | yes | iOS Android Web | yes |