feat: 重构音频播放功能并添加动态数据绑定
- 将硬编码的音频列表替换为从API获取的动态数据 - 添加播放进度同步功能,支持多个音频列表 - 实现底部播放器组件,显示当前播放曲目信息 - 优化学生列表切换逻辑,更新显示信息 - 移除冗余代码,简化音频管理逻辑
This commit is contained in:
44
index.html
44
index.html
@@ -21,7 +21,7 @@
|
||||
<audio ref="audioPlayer" preload="none" loop></audio>
|
||||
|
||||
<div class="introduce" ref="introduceRef">
|
||||
<div class="sidebar flexflex">
|
||||
<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>
|
||||
@@ -107,27 +107,27 @@
|
||||
</div>
|
||||
|
||||
<div class="audio-box mar1200 flexflex">
|
||||
<div class="item" v-for="(item, index) in audioList" :key="index">
|
||||
<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 }}</div>
|
||||
<div class="content flexflex">
|
||||
<div class="album">
|
||||
<img class="img" src="./static/img/audio-img.png" />
|
||||
<img class="img" :src="item.img" />
|
||||
<img class="icon" src="./static/img/record-icon.png" />
|
||||
</div>
|
||||
<div class="info flexflex">
|
||||
<div class="name">画Remix</div>
|
||||
<div class="subtitle">AI音乐榜冠军</div>
|
||||
<div class="time">2024.3</div>
|
||||
<div class="name">{{ item.title }}</div>
|
||||
<div class="subtitle">{{ item.desc }}</div>
|
||||
<div class="time">{{ item.date }}</div>
|
||||
<div class="progress-bar flexacenter">
|
||||
<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', item.url, 'works')" />
|
||||
<img class="speed left" src="./static/img/speed-left.png" @click="fastForward('slow', item.playurl, 'works')" />
|
||||
<img v-if="item.state" class="play" @click="closeAll()" src="./static/img/pause-black-icon.svg" />
|
||||
<img v-else class="play" @click="manageAudio(item.url, 'works')" src="./static/img/play-black-icon.svg" />
|
||||
<img class="speed right" src="./static/img/speed-right.png" @click="fastForward('fast', item.url, 'works')" />
|
||||
<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', item.playurl, 'works')" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -143,21 +143,21 @@
|
||||
<div class="list flexflex mar1200">
|
||||
<div class="item flexacenter" v-for="(item, index) in customList" :key="index">
|
||||
<div class="info flexflex">
|
||||
<div class="name">画Remix</div>
|
||||
<div class="lyric">走过的路汇成星河,脚下的路更辽阔</div>
|
||||
<div class="name">{{ item.title }}</div>
|
||||
<div class="lyric">{{ item.desc }}</div>
|
||||
<div class="progress-bar flexacenter">
|
||||
<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', item.src, 'custom')" src="./static/img/speed-left.png" />
|
||||
<img class="speed left" @click="fastForward('slow', item.playurl, 'custom')" 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.src, 'custom')" src="./static/img/play-black-icon.svg" />
|
||||
<img class="speed right" @click="fastForward('fast', item.src, 'custom')" src="./static/img/speed-right.png" />
|
||||
<img v-else class="play" @click="manageAudio(item.playurl, 'custom')" src="./static/img/play-black-icon.svg" />
|
||||
<img class="speed right" @click="fastForward('fast', item.playurl, 'custom')" src="./static/img/speed-right.png" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<img class="info-img" src="./static/img/custom-img.png" />
|
||||
<img class="info-img" :src="item.img" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom flexcenter">
|
||||
@@ -174,10 +174,10 @@
|
||||
<div class="list flexacenter">
|
||||
<img class="img" :class="[`img${ item.order }`]" v-for="(item, index) in studentList" :src="item.img" :key="index" @click="cutStudent(item.order)" />
|
||||
</div>
|
||||
<div class="name">《听风少年的梦幻之城》</div>
|
||||
<div class="name">《{{ zeroOrderStudents.title }}》</div>
|
||||
<div class="info flexacenter">
|
||||
<img class="icon" src="./static/img/student-icon.svg" />
|
||||
林林林 | 7岁 | 广州
|
||||
{{ zeroOrderStudents.name }} | {{ zeroOrderStudents.age }}岁 | {{ zeroOrderStudents.city }}
|
||||
</div>
|
||||
|
||||
<div class="progress-bar flexacenter">
|
||||
@@ -213,18 +213,18 @@
|
||||
<div class="artplayer-app"></div>
|
||||
</div>
|
||||
|
||||
<div class="bottom-play">
|
||||
<div class="bottom-play" v-if="playData">
|
||||
<div class="bottom-box mar1200 flexacenter">
|
||||
<div class="left flexacenter">
|
||||
<img class="img" src="./static/img/custom-img.png" />
|
||||
<div class="name">你好,我是林林林</div>
|
||||
<img class="img" :src="playData?.img" />
|
||||
<div class="name">{{ playData?.title }}</div>
|
||||
</div>
|
||||
|
||||
<div class="middle flex1 flexcenter">
|
||||
<div class="operate flexcenter">
|
||||
<img class="speed left" src="./static/img/speed-white-left.png" @click="fastForward('slow', url, 'works')" />
|
||||
<img v-if="false" class="play" @click="closeAll()" src="./static/img/pause-white-icon.svg" />
|
||||
<img v-else class="play" @click="manageAudio(url, 'works')" src="./static/img/play-white-icon.svg" />
|
||||
<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', url, 'works')" />
|
||||
</div>
|
||||
<div class="flexacenter">
|
||||
|
||||
Reference in New Issue
Block a user