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);