From 94d300d0be2e506c3e686b0e2567ff3a9a4363b5 Mon Sep 17 00:00:00 2001 From: callmeyan Date: Wed, 25 Dec 2024 20:37:49 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E6=9B=B4=E6=96=B0=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/video/player.tsx | 3 +- src/pages/library/components/search-form.tsx | 70 +++++++++++-------- src/pages/library/components/video-detail.tsx | 26 +++---- src/pages/library/components/video-item.tsx | 9 +-- src/pages/library/index.tsx | 39 ++++++----- src/routes/index.tsx | 4 +- 6 files changed, 77 insertions(+), 74 deletions(-) diff --git a/src/components/video/player.tsx b/src/components/video/player.tsx index d76fc51..6a9d1f5 100644 --- a/src/components/video/player.tsx +++ b/src/components/video/player.tsx @@ -24,6 +24,7 @@ type Props = { onChange?: (state: State) => void; onProgress?: (current:number,duration:number) => void; muted?: boolean; + autoPlay?: boolean; } export type PlayerInstance = { play: (url: string, currentTime: number) => void; @@ -79,7 +80,7 @@ export const Player = React.forwardRef((props, ref) => { controls: props.showControls, // muted:props.muted, poster: props.poster, - autoplay: true, + autoplay: typeof(props.autoPlay) != 'undefined' ? props.autoPlay : true, licenseUrl: 'https://license.vod2.myqcloud.com/license/v2/1328581896_1/v_cube.license' } ) diff --git a/src/pages/library/components/search-form.tsx b/src/pages/library/components/search-form.tsx index 0491ff2..cd4b560 100644 --- a/src/pages/library/components/search-form.tsx +++ b/src/pages/library/components/search-form.tsx @@ -1,49 +1,59 @@ import {Button, Form, Input, Select, Space} from "antd"; import {useSetState} from "ahooks"; -import {PlayCircleOutlined} from "@ant-design/icons"; +import {PlayCircleOutlined, SearchOutlined} from "@ant-design/icons"; import {SearchListTimes} from "@/pages/news/components/news-source.ts"; +import React from "react"; +import TimeSelect from "@/components/form/time-select.tsx"; type Props = { onSearch?: (params: VideoSearchParams) => void; onBtnStartClick?: () => Promise; - loading?:boolean; + loading?: boolean; } -export default function SearchForm({onSearch, onBtnStartClick,loading}: Props) { + +export default function SearchForm({onSearch, onBtnStartClick, loading}: Props) { const [state, setState] = useSetState<{ pushing?: boolean; - }>({}) - const onFinish = (values) => { + time_flag: number; + title?: string; + }>({ + time_flag:0 + }) + + const onFinish = (params: Partial) => { onSearch?.({ - ...values, - pagination: {page: 1, limit: 10} + time_flag: params.time_flag, + title: params.title, + pagination: {page: 1, limit: 12} }) - //console.log(values) } - return (
+ const handleTimeFilter = (time_flag: number) => { + setState({time_flag}) + onFinish({ + title:state.title,time_flag + }) + } + + return (
- className={""} layout="inline" onFinish={onFinish} initialValues={{title:'',time_flag:0}}> - - - - - } + onChange={e=>setState({title: e.target.value})} + onPressEnter={()=>onFinish(state)} + onBlur={()=>onFinish(state)} + allowClear + placeholder={'请输入视频标题关键字进行信息'} + /> + +