Files
PC-official/index.html
DESKTOP-RQ919RC\Pc 35e3a11427 refactor(播放器): 优化音频播放逻辑和学生切换功能
- 重构音频播放管理逻辑,简化播放状态控制
- 改进学生切换功能,使用索引代替顺序号
- 移除冗余代码,优化音量控制实现
- 调整CSS布局样式,增强页面展示效果
2025-09-12 18:59:47 +08:00

263 lines
17 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>朴见潮音官网</title>
<script src="./static/js/vue.global.js"></script>
<script src="./static/js/artplayer.js"></script>
<script src="./static/js/axios.min.js"></script>
<link rel="stylesheet" href="./static/css/index.css" />
<link rel="icon" href="./static/img/favicon.ico" type="image/x-icon" />
<style>
[v-cloak] {
display: none;
}
</style>
</head>
<body>
<div class="content" id="appIndex" v-cloak>
<!-- 原生audio标签隐藏 -->
<audio ref="audioPlayer" preload="none" loop></audio>
<div class="introduce" ref="introduceRef">
<div class="sidebar flexflex" @mouseover="changeInterval(true)" @mouseleave="changeInterval(false)">
<div class="pointer">
<div class="item" v-for="(item,index) in bannerList" :class="{'active': pointerIndex === index}" :data-index="`0${ index + 1 }`" @click="changePointer(index)"></div>
</div>
<div class="arrow">
<img v-if="pointerIndex != 0" class="item top orange" src="./static/img/arrow-orange.svg" @click="scrollToPrevious" />
<img v-else class="item top" src="./static/img/arrow-white.svg" />
<img v-if="pointerIndex != bannerList.length - 1" class="item bottom orange" src="./static/img/arrow-orange.svg" @click="scrollToNext" />
<img v-else class="item bottom white" src="./static/img/arrow-white.svg" />
</div>
</div>
<div class="head flexacenter">
<div class="logo mar1200">
<img class="icon" src="./static/img/logo.png" />
</div>
</div>
<div class="box flexflex mar1200">
<div class="info">
<div class="brand flexacenter">
<div class="fill"></div>
<div class="text flexflex">
<span>AI music</span>
<span>Pioneering brand</span>
</div>
</div>
<div class="award flexflex">
<img class="title" src="./static/img/award-winning-works.png" />
<img class="name" v-if="bannerList[pointerIndex]?.title_pic" :src="bannerList[pointerIndex]?.title_pic" />
<div class="explain">{{ bannerList[pointerIndex]?.desc }}</div>
</div>
</div>
<div class="album" @mouseover="changeInterval(true)" @mouseleave="changeInterval(false)">
<img class="bj bj1" src="./static/img/album-bj1.svg" />
<img class="bj bj2" src="./static/img/album-bj2.svg" />
<div class="album-box" ref="albumBoxRef">
<div class="item" v-for="(item, index) in bannerList" :key="index" @click="openPreview(item.id)">
<img class="img" :src="item.img" />
<img class="bj bj3" src="./static/img/album-bj3.svg" />
<img class="bj bj4" src="./static/img/album-bj4.png" />
<img class="bj bj5" src="./static/img/album-bj5.svg" />
<img class="play" src="./static/img/play-white-icon.svg" />
</div>
</div>
</div>
</div>
<div class="trait flexflex mar1200">
<div class="item flexflex" v-for="(item, index) in trait" :key="index">
<img class="icon" :src="item.icon" />
<div class="title">{{ item.title }}</div>
<div class="text">{{ item.text }}</div>
</div>
</div>
</div>
<div class="works flexacenter" ref="worksRef">
<img class="bj1" src="./static/img/works-bj1.png" />
<div class="name-box">
<img class="bj" src="./static/img/works-title-bj.svg" />
<img class="title" src="./static/img/works-title.png" />
<img class="line line-1" src="./static/img/works-line-1.svg" />
<img class="line line-2" src="./static/img/works-line-2.svg" />
<img class="line line-3" src="./static/img/works-line-3.svg" />
<img class="line line-4" src="./static/img/works-line-4.svg" />
<img class="line line-5" src="./static/img/works-line-5.svg" />
<img class="line line-6" src="./static/img/works-line-6.svg" />
</div>
<div class="mv-box mar1200">
<div class="item flexflex" v-for="(item, index) in awardMVList" :key="index">
<img class="serial-icon" src="./static/img/serial-icon.png" />
<div class="serial">{{ (index + 1 + '').padStart(2, '0') }}</div>
<div class="title">{{ item.title }}</div>
<div class="text-box">
<div class="text">{{ item.desc }}</div>
<div class="time">{{ item.date }}</div>
</div>
<div class="media" @click="openPreview(item.id)">
<img class="img" :src="item.img" />
<img class="play" src="./static/img/play-white-icon.svg" />
</div>
</div>
</div>
<div class="audio-box mar1200 flexflex">
<div class="item" v-for="(item, index) in awardAudioList" :key="index">
<img class="serial-icon" src="./static/img/serial-icon.png" />
<div class="serial">{{ (index + 1 + '').padStart(2, '0') }}</div>
<div class="content flexflex">
<div class="album">
<img class="img" :src="item.img" />
<img class="icon" src="./static/img/record-icon.png" />
</div>
<div class="info flexflex">
<div class="name">{{ item.title }}</div>
<div class="subtitle">{{ item.desc }}</div>
<div class="time">{{ item.date }}</div>
<div class="progress-bar flexacenter" @click="handleBarDragBottomClick">
<div class="bar white" :style="{ width: item.progress + '%' }"></div>
<div class="bar black flex1"></div>
</div>
<div class="operate flexcenter">
<img class="speed left" src="./static/img/speed-left.png" @click="fastForward('slow')" />
<img v-if="item.state" class="play" @click="closeAll()" src="./static/img/pause-black-icon.svg" />
<img v-else class="play" @click="manageAudio(item.playurl, 'works')" src="./static/img/play-black-icon.svg" />
<img class="speed right" src="./static/img/speed-right.png" @click="fastForward('fast')" />
</div>
</div>
</div>
</div>
</div>
<img class="bj2" src="./static/img/works-bj2.png" />
</div>
<div class="custom" ref="customRef">
<div class="custom-box mar1200 flexflex">
<img class="title" src="./static/img/custom-title.png" />
<div class="subtitle">往事可成追忆,把你的故事谱成歌</div>
<div class="list flexflex mar1200">
<div class="item flexacenter" v-for="(item, index) in customList" :key="index">
<div class="info flexflex">
<div class="name">{{ item.title }}</div>
<div class="lyric">{{ item.desc }}</div>
<div class="progress-bar flexacenter" @click="handleBarDragBottomClick">
<div class="bar white" :style="{ width: item.progress + '%' }"></div>
<div class="bar black flex1"></div>
</div>
<div class="operate flexcenter">
<img class="speed left" @click="fastForward('slow')" src="./static/img/speed-left.png" />
<img v-if="item.state" class="play" @click="closeAll()" src="./static/img/pause-black-icon.svg" />
<img v-else class="play" @click="manageAudio(item.playurl, 'custom')" src="./static/img/play-black-icon.svg" />
<img class="speed right" @click="fastForward('fast')" src="./static/img/speed-right.png" />
</div>
</div>
<img class="info-img" :src="item.img" />
</div>
</div>
<div class="bottom flexcenter">
<img class="bj" src="./static/img/custom-bj-1.svg" />
<img class="bj" src="./static/img/custom-bj-2.svg" />
<img class="bj" src="./static/img/custom-bj-1.svg" />
</div>
</div>
</div>
<div class="student" ref="studentRef">
<div class="student-box flexflex">
<img class="title" src="./static/img/student-title.png" alt="" />
<div class="list flexacenter">
<img class="img" :class="[`img${ item.order }`]" v-for="(item, index) in studentList" :src="item.img" :key="index" @click="cutStudent(index, item.order)" />
</div>
<div class="name">《{{ zeroOrderStudents.title }}》</div>
<div class="info flexacenter">
<img class="icon" src="./static/img/student-icon.svg" />
{{ zeroOrderStudents.name }} | {{ zeroOrderStudents.age }}岁 | {{ zeroOrderStudents.city }}
</div>
<div class="progress-bar flexacenter" @click="handleBarDragBottomClick">
<div class="bar white" :style="{ width: zeroOrderStudents.progress + '%' }"></div>
<div class="bar black flex1"></div>
</div>
<div class="operate flexcenter">
<img class="cut left" src="./static/img/cut-left.svg" @click="cutSong('up', zeroOrderStudents.order)" />
<img class="speed left" src="./static/img/speed-white-left.png" @click="fastForward('slow')" />
<img v-if="zeroOrderStudents.state" class="play" @click="closeAll()" src="./static/img/pause-white-icon.svg" />
<img v-else class="play" @click="zeroOrderStudents.playurl ? manageAudio(zeroOrderStudents.playurl, 'student') : getPlayUrl(index, 'student')" src="./static/img/play-white-icon.svg" />
<img class="speed right" src="./static/img/speed-white-right.png" @click="fastForward('fast')" />
<img class="cut right" src="./static/img/cut-right.svg" @click="cutSong('down', zeroOrderStudents.order)" />
</div>
</div>
<div class="contact flexflex mar1200">
<img class="title" src="./static/img/contact-title.png" />
<div class="hint">我们可以为你提供AI音乐定制服务谱写你独有的人生歌曲</div>
<div class="hint">我们可以为你提供AI音乐教学培训服务让你拥有独立完成音乐作品的能力</div>
<img class="arrows" src="./static/img/arrows-yellow.svg" />
<img class="WeChat" src="./static/img/WeChat-img.jpg" />
<img class="logo" src="./static/img/logo-black.png" />
</div>
</div>
<div class="footer flexcenter" :style="{ marginBottom: playData ? '76px' : '' }">
<img class="logo" src="./static/img/ai-title.png" />
<div class="text">广州九微科技有限公司 | Copyright 2001-2025 GTER All Rights Reserved | 粤ICP备14050432号</div>
</div>
<div v-if="previewState" class="preview flexcenter">
<img class="close" @click="closePreview()" src="./static/img/close.svg" />
<div class="artplayer-app"></div>
</div>
<div class="bottom-play flexacenter" v-if="playData">
<div class="bottom-left flex1 flexacenter">
<img class="img" :src="playData?.img" />
<div class="name">{{ playData?.title }}</div>
</div>
<div class="bottom-middle flexcenter">
<div class="operate flexcenter">
<img class="speed left" src="./static/img/speed-white-left.png" @click="fastForward('slow')" />
<img v-if="playData.state" class="play" @click="closeAll()" src="./static/img/pause-white-icon.svg" />
<img v-else class="play" @click="rePlay()" src="./static/img/play-white-icon.svg" />
<img class="speed right" src="./static/img/speed-white-right.png" @click="fastForward('fast')" />
</div>
<div class="flexacenter">
<div class="time-display">{{ currentTimeFormatted }}</div>
<div class="progress-bar flexacenter" @click="handleBarDragBottomClick">
<div class="bar white" :style="{ width: progress + '%' }" @mousedown="startBarDragBottom"></div>
<div class="bar black flex1"></div>
</div>
<div class="time-display">{{ durationFormatted }}</div>
</div>
</div>
<div class="bottom-right flex1 flexcenter">
<div class="item" @mouseenter="handleVolumeShow" @mouseleave="handleVolumeHide">
<svg v-if="volume == 0" class="svg" xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="none" viewBox="0 0 16 16"><path fill="#FCFCFC" d="M1 6.334a1 1 0 0 1 1-1h1.385a.667.667 0 0 0 .505-.231l2.938-3.41A.667.667 0 0 1 8 2.13v11.85c0 .604-.74.896-1.154.454l-2.958-3.165a.667.667 0 0 0-.487-.211H2a1 1 0 0 1-1-1zm3.9-.36a2 2 0 0 1-1.515.694H2.333v3.055h1.068a2 2 0 0 1 1.461.635l1.805 1.93V3.924zM9.764 6.04 11.724 8l-1.96 1.96a.333.333 0 0 0 0 .471l.472.471c.13.13.341.13.471 0l1.96-1.96 1.96 1.96c.13.13.34.13.47 0l.472-.471a.333.333 0 0 0 0-.471L13.61 8l1.96-1.96a.333.333 0 0 0 0-.47l-.471-.472a.333.333 0 0 0-.472 0l-1.96 1.96-1.959-1.96a.333.333 0 0 0-.471 0l-.472.471a.333.333 0 0 0 0 .471"></path></svg>
<svg v-else class="svg" xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="none" viewBox="0 0 16 16">
<path fill="#fff" d="M1.334 6.334a1 1 0 0 1 1-1h1.385a.667.667 0 0 0 .505-.231l2.938-3.41a.667.667 0 0 1 1.172.436v11.85c0 .604-.74.896-1.154.454l-2.958-3.165a.667.667 0 0 0-.487-.211H2.334a1 1 0 0 1-1-1zm3.9-.36a2 2 0 0 1-1.515.694H2.667v3.055h1.068a2 2 0 0 1 1.461.635L7 12.288V3.924zM10.344 6.127a.364.364 0 0 1 .013-.483l.472-.472a.314.314 0 0 1 .462.009c1.374 1.601 1.374 4.038 0 5.64a.314.314 0 0 1-.462.008l-.472-.471a.364.364 0 0 1-.013-.484 3.028 3.028 0 0 0 0-3.747"></path>
<path fill="#fff" d="M12.479 12.479a.348.348 0 0 1-.007-.478c2.013-2.248 2.013-5.753 0-8.001a.348.348 0 0 1 .007-.478l.471-.471c.13-.13.342-.13.466.005 2.525 2.764 2.525 7.126 0 9.89a.322.322 0 0 1-.466.004z"></path>
</svg>
<div class="sound-control flexflex" v-if="volumeShow">
<div class="value">{{ volume }}</div>
<div class="progress flexflex" @click="handleVolumeClick">
<div class="bar" :style="{ height: volume + '%' }" @mousedown="startDrag"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="./static/js/index.js"></script>
</body>
</html>