From 30ee4cd888d5eb7645fa618ad18b3e0e7be7b4a1 Mon Sep 17 00:00:00 2001 From: amass <168062547@qq.com> Date: Mon, 26 Jun 2023 18:48:15 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=89=8B=E6=9C=BA=E6=A0=A1=E9=AA=8C=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=97=B6=EF=BC=8C=E4=B8=8D=E8=AE=A9=E5=8F=91=E9=80=81?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MainPage.js | 12 ++++++++---- src/PlayerBar.js | 1 + src/business/utilities.js | 14 ++++++++++++-- src/components/DynamicCodeForm.js | 1 + 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/MainPage.js b/src/MainPage.js index 98efb34..b55049c 100644 --- a/src/MainPage.js +++ b/src/MainPage.js @@ -49,7 +49,11 @@ const ClickHanlde = styled('div', { shouldForwardProp: (prop) => prop !== 'open' const Main = styled('main', { shouldForwardProp: (prop) => prop !== 'open' })( ({ theme, open }) => ({ flex: 1, - padding: theme.spacing(3), + paddingTop: 0, + paddingLeft: theme.spacing(3), + paddingRight: theme.spacing(3), + paddingBottom: theme.spacing(3), + marginTop: 48, transition: theme.transitions.create('margin', { easing: theme.transitions.easing.sharp, duration: theme.transitions.duration.leavingScreen, @@ -65,10 +69,10 @@ const Main = styled('main', { shouldForwardProp: (prop) => prop !== 'open' })( }), ); -const LyricItem = ({ empty, hasLyric, lyricsBrowserStyle, currentLyric, currentTime }) => { +const LyricItem = ({ empty, hasLyric, currentLyric, currentTime }) => { if (empty) { return
- +
} }; diff --git a/src/PlayerBar.js b/src/PlayerBar.js index 11492e6..8864be4 100644 --- a/src/PlayerBar.js +++ b/src/PlayerBar.js @@ -30,6 +30,7 @@ export default function ({ width, lyric, currentTime }) { useEffect(() => { player.current.url = currentBlob setPlaybackRate(1.0); // 恢复默认 + dispatch(setCurrentTime(0)); console.log(player.current.url); }, [currentBlob]); diff --git a/src/business/utilities.js b/src/business/utilities.js index f202787..37f47f1 100644 --- a/src/business/utilities.js +++ b/src/business/utilities.js @@ -1,9 +1,19 @@ // 间隔多长时间取一个采样点 // duration 秒,有小数点 const sampleInterval = (duration) => { - let interval = (duration > 20 * 60) ? 200 : 100; + let interval = 100; let isFirefox = window.navigator.userAgent.includes("Firefox"); - if (isFirefox && (interval < 400)) interval = 400; // firefox canvas width 不能过长 + if (isFirefox) {// firefox canvas width 不能过长 + if (duration > 20 * 60) { + interval = 400; + } else if (duration > 10 * 60) { + interval = 200; + } + } else { + if (duration > 20 * 60) { + interval = 200; + } + } return interval; } diff --git a/src/components/DynamicCodeForm.js b/src/components/DynamicCodeForm.js index b09a01d..03aa3a6 100644 --- a/src/components/DynamicCodeForm.js +++ b/src/components/DynamicCodeForm.js @@ -28,6 +28,7 @@ export default function ({ udid, firstEnter, onChange, agreeAgreement, onAgreeCh const onClick = (event) => { event.preventDefault(); + if (!validatePhoneNumber(account)) return; code.current.disabled = true; yzs.send_phone_code(udid, account) setSeconds(60);