|
|
@ -126,6 +126,15 @@ export default function AudioPlayer({
|
|
|
|
setVolume(value);
|
|
|
|
setVolume(value);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 弹出 Card 时,禁止页面滚动
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
|
|
|
if (showCard) {
|
|
|
|
|
|
|
|
document.body.style.setProperty('overflow-y', 'hidden', 'important');
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
document.body.style.removeProperty('overflow-y');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, [showCard]);
|
|
|
|
|
|
|
|
|
|
|
|
// 播放/暂停事件
|
|
|
|
// 播放/暂停事件
|
|
|
|
useEffect(() => {
|
|
|
|
useEffect(() => {
|
|
|
|
audioRef.current.volume = volume / 100;
|
|
|
|
audioRef.current.volume = volume / 100;
|
|
|
|