diff --git a/flutter_inappwebview_ohos/ohos/src/main/ets/components/plugin/webview/in_app_webview/InAppWebViewClient.ets b/flutter_inappwebview_ohos/ohos/src/main/ets/components/plugin/webview/in_app_webview/InAppWebViewClient.ets index 5b92c4708bf316f83a455ce14c42f47f6efac9da..88dbfa966e0e825e365bf607fe4153bbe0670ef2 100644 --- a/flutter_inappwebview_ohos/ohos/src/main/ets/components/plugin/webview/in_app_webview/InAppWebViewClient.ets +++ b/flutter_inappwebview_ohos/ohos/src/main/ets/components/plugin/webview/in_app_webview/InAppWebViewClient.ets @@ -288,74 +288,6 @@ export default class InAppWebViewClient { } } - //缺少从系统直接选择全部,这里做了一个弹窗选择 这里OHOS存在一个bug。 - ActionSheet.show({ - title: '请选择', - message: '', - autoCancel: true, - isModal: true, - cancel: () => { - Log.d(TAG, 'actionSheet canceled') - event.result.handleFileList([]); - }, - alignment: DialogAlignment.Center, - offset: { - dx: 0, dy: 100 - }, - sheets: [ - { - title: '相册', - action: () => { - Log.d(TAG, 'apples') - let photoSelectOptions = new picker.PhotoSelectOptions(); - photoSelectOptions.MIMEType = (images && video) ? picker.PhotoViewMIMETypes.IMAGE_VIDEO_TYPE : - (images ? picker.PhotoViewMIMETypes.IMAGE_TYPE : picker.PhotoViewMIMETypes.VIDEO_TYPE); - photoSelectOptions.maxSelectNumber = allowMultiple ? 100000 : 1 - let photoPicker = new picker.PhotoViewPicker(); - photoPicker.select(photoSelectOptions).then((photoSelectResult: picker.PhotoSelectResult) => { - event.result.handleFileList(photoSelectResult.photoUris); - Log.d(TAG, - 'PhotoViewPicker.select successfully, photoSelectResult uri: ' + JSON.stringify(photoSelectResult)); - }).catch((err: BusinessError) => { - event.result.handleFileList([]); - Log.e(TAG, 'PhotoViewPicker.select failed with err: ' + JSON.stringify(err)); - }); - } - }, - { - title: '档案', - action: () => { - let documentPicker = new picker.DocumentViewPicker(); - let documentSelectOptions = new picker.DocumentSelectOptions(); - documentSelectOptions.maxSelectNumber = allowMultiple ? 100000 : 1 - documentSelectOptions.fileSuffixFilters = acceptTypes; - documentPicker.select(documentSelectOptions).then((documentSelectResult) => { - Log.d(TAG, - 'documentViewPicker.select to file succeed and uri is:' + JSON.stringify(documentSelectResult)); - event.result.handleFileList(documentSelectResult); - }).catch((err: BusinessError) => { - event.result.handleFileList([]); - Log.d(TAG, `Invoke documentViewPicker.select failed, code is ${err.code}, message is ${err.message}`); - }) - } - }, - { - title: '音频', - action: () => { - let audioSelectOptions = new picker.AudioSelectOptions(); - let audioPicker = new picker.AudioViewPicker(); - audioPicker.select(audioSelectOptions).then((audioSelectResult: Array) => { - event.result.handleFileList(audioSelectResult); - Log.d(TAG, - 'AudioViewPicker.select successfully, audioSelectResult uri: ' + JSON.stringify(audioSelectResult)); - }).catch((err: BusinessError) => { - Log.d(TAG, 'AudioViewPicker.select failed with err: ' + JSON.stringify(err)); - event.result.handleFileList([]); - }); - } - } - ] - }) return false; } onResourceLoad = (event: Any) => {