1.手机校验错误时,不让发送验证码。

This commit is contained in:
amass 2023-06-26 18:48:15 +08:00
parent bc2550f64f
commit 30ee4cd888
4 changed files with 22 additions and 6 deletions

View File

@ -49,7 +49,11 @@ const ClickHanlde = styled('div', { shouldForwardProp: (prop) => prop !== 'open'
const Main = styled('main', { shouldForwardProp: (prop) => prop !== 'open' })( const Main = styled('main', { shouldForwardProp: (prop) => prop !== 'open' })(
({ theme, open }) => ({ ({ theme, open }) => ({
flex: 1, 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', { transition: theme.transitions.create('margin', {
easing: theme.transitions.easing.sharp, easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.leavingScreen, 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) { if (empty) {
return <div style={{ return <div style={{
height: "calc(100vh - 250px)", height: "calc(100vh - 298px)",
marginTop: 48, marginTop: 48,
display: "flex", display: "flex",
alignItems: "center", alignItems: "center",
@ -101,7 +105,7 @@ const RecordPlayer = ({ loading, empty, playerBarWidth, currentTime, hasLyric, c
} else { } else {
return <div> return <div>
<PlayerBar width={playerBarWidth} currentTime={currentTime} lyric={currentLyric} /> <PlayerBar width={playerBarWidth} currentTime={currentTime} lyric={currentLyric} />
<LyricItem empty={empty} /> <LyricItem empty={empty} hasLyric={hasLyric} currentLyric={currentLyric} currentTime={currentTime} />
</div> </div>
} }
}; };

View File

@ -30,6 +30,7 @@ export default function ({ width, lyric, currentTime }) {
useEffect(() => { useEffect(() => {
player.current.url = currentBlob player.current.url = currentBlob
setPlaybackRate(1.0); // 恢复默认 setPlaybackRate(1.0); // 恢复默认
dispatch(setCurrentTime(0));
console.log(player.current.url); console.log(player.current.url);
}, [currentBlob]); }, [currentBlob]);

View File

@ -1,9 +1,19 @@
// 间隔多长时间取一个采样点 // 间隔多长时间取一个采样点
// duration 秒,有小数点 // duration 秒,有小数点
const sampleInterval = (duration) => { const sampleInterval = (duration) => {
let interval = (duration > 20 * 60) ? 200 : 100; let interval = 100;
let isFirefox = window.navigator.userAgent.includes("Firefox"); 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; return interval;
} }

View File

@ -28,6 +28,7 @@ export default function ({ udid, firstEnter, onChange, agreeAgreement, onAgreeCh
const onClick = (event) => { const onClick = (event) => {
event.preventDefault(); event.preventDefault();
if (!validatePhoneNumber(account)) return;
code.current.disabled = true; code.current.disabled = true;
yzs.send_phone_code(udid, account) yzs.send_phone_code(udid, account)
setSeconds(60); setSeconds(60);