From c4ae8f2806690ad7421d59ade43ea71f600ec4d8 Mon Sep 17 00:00:00 2001 From: imeepos Date: Thu, 4 Sep 2025 22:25:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20loading=E9=A1=B5=E9=9D=A2=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=9B=BE=E7=89=87=E5=92=8C=E8=A7=86=E9=A2=91=E5=B1=95?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/generate/index.tsx | 64 +++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 20 deletions(-) diff --git a/src/pages/generate/index.tsx b/src/pages/generate/index.tsx index 6011cf5..40198c7 100644 --- a/src/pages/generate/index.tsx +++ b/src/pages/generate/index.tsx @@ -1,4 +1,4 @@ -import { View, Text, Button, Image } from '@tarojs/components' +import { View, Text, Button, Image, Video } from '@tarojs/components' import { useEffect, useState } from 'react' import Taro, { switchTab, navigateTo } from '@tarojs/taro' import { useServerSdk } from '../../hooks/index' @@ -98,26 +98,50 @@ export default function Generate() { ) - const renderSuccess = () => ( - - - 处理完成! - {result?.outputUrl && ( - - - - )} + const renderSuccess = () => { + // 检测是否为视频 + const isVideo = result?.outputUrl && /\.(mp4|webm|ogg|mov|avi|mkv|flv)$/i.test(result.outputUrl) + + return ( + + + 处理完成! + {result?.outputUrl && ( + + {isVideo ? ( + + )} + + + + + - - - - - - ) + ) + } const renderError = () => (