| | |
| | | }, FEEDBACK_TOAST_DURATION); |
| | | }; |
| | | |
| | | const handlePreviewImage = (currentUrl: string) => { |
| | | if (!currentUrl) { |
| | | return; |
| | | } |
| | | const imageUrls = mediaItems |
| | | .filter((item) => item.mediaType !== 'video') |
| | | .map((item) => item.server?.url || item.localUrl) |
| | | .filter((url): url is string => !!url); |
| | | if (imageUrls.length === 0) { |
| | | return; |
| | | } |
| | | Taro.previewImage({ |
| | | current: currentUrl, |
| | | urls: imageUrls |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * 切换问题类型多选状态。 |
| | | */ |
| | |
| | | controls={false} |
| | | /> |
| | | ) : ( |
| | | <Image className='feedback-media-thumb' src={item.server?.url || item.localUrl} mode='aspectFill' /> |
| | | <Image |
| | | className='feedback-media-thumb' |
| | | src={item.server?.url || item.localUrl} |
| | | mode='aspectFill' |
| | | onClick={() => handlePreviewImage(item.server?.url || item.localUrl)} |
| | | /> |
| | | )} |
| | | {item.status === 'uploading' && ( |
| | | <View className='feedback-media-mask'> |