|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <view class="pop-audio-box">
|
|
|
+ <!-- <view class="pop-audio-box">
|
|
|
<view class="name">{{title}}</view>
|
|
|
<view class="flex">
|
|
|
<text>{{currentTime|formatVoiceTime}}</text>
|
|
@@ -41,6 +41,70 @@
|
|
|
@click="handleAudioChange('next')"
|
|
|
/>
|
|
|
</view>
|
|
|
+ </view> -->
|
|
|
+ <view class="pop-audio-wrap">
|
|
|
+ <view class="flex small-box" @click="handleOpenBig">
|
|
|
+ <image class="bg-img" src="" mode="aspectFill" />
|
|
|
+ <view class="flex con">
|
|
|
+ <view style="flex:1;overflow: hidden;">
|
|
|
+ <view class="van-ellipsis name">{{title}}</view>
|
|
|
+ <view class="time">时长 {{audioTime|formatVoiceTime}}</view>
|
|
|
+ </view>
|
|
|
+ <image
|
|
|
+ class="pause-img"
|
|
|
+ :src="play?'../static/audio-play.png':'../static/audio-pause.png'"
|
|
|
+ mode="aspectFill"
|
|
|
+ @click.stop="handleChangePlayStatus"
|
|
|
+ />
|
|
|
+ <van-icon @click.stop="handleClosePopAudio" name="cross" size="18" color="#BBC3C9" />
|
|
|
+ </view>
|
|
|
+ <van-progress
|
|
|
+ color="#D4AC78"
|
|
|
+ track-color="#fff"
|
|
|
+ :show-pivot="false"
|
|
|
+ stroke-width="2px"
|
|
|
+ custom-class="bot-progress"
|
|
|
+ :percentage="percentage"
|
|
|
+ />
|
|
|
+ </view>
|
|
|
+ <view class="big-box" v-if="showBig">
|
|
|
+ <van-icon class="big-arrow-down" name="arrow-down" size="18" color="#BBC3C9" @click="showBig=false" />
|
|
|
+ <van-icon class="big-cross" @click.stop="handleClosePopAudio" name="cross" size="18" color="#BBC3C9"/>
|
|
|
+ <view class="name">{{title}}</view>
|
|
|
+ <view class="flex center-box">
|
|
|
+ <text>{{currentTime|formatVoiceTime}}</text>
|
|
|
+ <slider
|
|
|
+ activeColor="#e3b377"
|
|
|
+ :max="audioTime"
|
|
|
+ :value="currentTime"
|
|
|
+ @change="handleAudioSliderChange($event)"
|
|
|
+ block-size="16"
|
|
|
+ class="slider"
|
|
|
+ />
|
|
|
+ <text>{{audioTime|formatVoiceTime}}</text>
|
|
|
+ </view>
|
|
|
+ <view class="btn">
|
|
|
+ <image
|
|
|
+ :src="audioData.index==0?'../static/audio-change-grey.png':'../static/audio-change.png'"
|
|
|
+ mode="aspectFill"
|
|
|
+ class="aside"
|
|
|
+ @click="handleAudioChange('before')"
|
|
|
+ />
|
|
|
+ <image
|
|
|
+ :src="play?'../static/audio-play.png':'../static/audio-pause.png'"
|
|
|
+ mode="aspectFill"
|
|
|
+ class="center"
|
|
|
+ @click="handleChangePlayStatus"
|
|
|
+ />
|
|
|
+ <image
|
|
|
+ :src="audioData.index==audioData.list.length-1?'../static/audio-change-grey.png':'../static/audio-change.png'"
|
|
|
+ mode="aspectFill"
|
|
|
+ class="aside"
|
|
|
+ style="transform: rotate(180deg)"
|
|
|
+ @click="handleAudioChange('next')"
|
|
|
+ />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -49,13 +113,15 @@ export default {
|
|
|
computed: {
|
|
|
audioData(){
|
|
|
return this.$store.state.report.audioData
|
|
|
+ },
|
|
|
+ percentage(){
|
|
|
+ return parseInt((this.currentTime/this.audioTime)*100)
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
'audioData.list':{
|
|
|
handler(nval,old){
|
|
|
- console.log('watch',nval,old);
|
|
|
-
|
|
|
+ // console.log('watch',nval,old);
|
|
|
if(nval.length>0){
|
|
|
if(old){
|
|
|
this.init('change')
|
|
@@ -73,7 +139,9 @@ export default {
|
|
|
title:'',
|
|
|
audioTime:0,
|
|
|
currentTime:0,
|
|
|
- play:false
|
|
|
+ play:false,
|
|
|
+
|
|
|
+ showBig:false
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -81,12 +149,16 @@ export default {
|
|
|
console.log('init',this.$store.state.report.audioData);
|
|
|
let curAudio=this.$store.state.report.audioData.list[this.$store.state.report.audioData.index]
|
|
|
if(this.globalBgMusic.src){
|
|
|
- console.log(this.globalBgMusic);
|
|
|
- console.log(type);
|
|
|
+ // console.log(this.globalBgMusic);
|
|
|
+ console.log('type',type);
|
|
|
if(type==='change'){
|
|
|
this.globalBgMusic.src=curAudio.video_url
|
|
|
this.globalBgMusic.title=curAudio.video_name
|
|
|
}else{
|
|
|
+ if(!this.globalBgMusic.paused){
|
|
|
+ this.globalBgMusic.src=curAudio.video_url
|
|
|
+ this.globalBgMusic.title=curAudio.video_name
|
|
|
+ }
|
|
|
this.currentTime=parseInt(this.globalBgMusic.currentTime)
|
|
|
this.play=!this.globalBgMusic.paused
|
|
|
}
|
|
@@ -166,12 +238,133 @@ export default {
|
|
|
handleAudioSliderChange(e){
|
|
|
const value=e.detail.value
|
|
|
this.globalBgMusic.seek(value)
|
|
|
+ },
|
|
|
+
|
|
|
+ //关闭弹窗
|
|
|
+ handleClosePopAudio(){
|
|
|
+ this.$store.commit('closePopAudio')
|
|
|
+ },
|
|
|
+
|
|
|
+ //点击展开
|
|
|
+ handleOpenBig(){
|
|
|
+ this.showBig=true
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
+
|
|
|
+<style>
|
|
|
+.bot-progress{
|
|
|
+ position: absolute;
|
|
|
+ bottom: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+}
|
|
|
+.big-arrow-down{
|
|
|
+ position: absolute;
|
|
|
+ left: 25rpx;
|
|
|
+ top: 25rpx;
|
|
|
+}
|
|
|
+.big-cross{
|
|
|
+ position: absolute;
|
|
|
+ top: 25rpx;
|
|
|
+ right: 25rpx;
|
|
|
+}
|
|
|
+</style>
|
|
|
<style lang="scss" scoped>
|
|
|
+.pop-audio-wrap{
|
|
|
+ .small-box{
|
|
|
+ position: fixed;
|
|
|
+ z-index: 99;
|
|
|
+ height: 120rpx;
|
|
|
+ left: 50%;
|
|
|
+ width: calc(100vw - 40rpx);
|
|
|
+ bottom: 67rpx;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ background: #FFFFFF;
|
|
|
+ box-shadow: 0px 0px 40rpx 1px rgba(50,35,17,0.25);
|
|
|
+ border: 1px solid #E4E4E4;
|
|
|
+ overflow: hidden;
|
|
|
+ .bg-img{
|
|
|
+ width: 90rpx;
|
|
|
+ height: 100%;
|
|
|
+ background-color: #ccc;
|
|
|
+ flex-shrink: 0;
|
|
|
+ margin-right: 20rpx;
|
|
|
+ }
|
|
|
+ .con{
|
|
|
+ flex: 1;
|
|
|
+ padding-right: 40rpx;
|
|
|
+ overflow: hidden;
|
|
|
+ align-items: center;
|
|
|
+ .name{
|
|
|
+ font-size: 28rpx;
|
|
|
+ margin-bottom: 11rpx;
|
|
|
+ }
|
|
|
+ .time{
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #666;
|
|
|
+ }
|
|
|
+ .pause-img{
|
|
|
+ width: 60rpx;
|
|
|
+ height: 60rpx;
|
|
|
+ flex-shrink: 0;
|
|
|
+ margin-right: 44rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .big-box{
|
|
|
+ position: fixed;
|
|
|
+ z-index: 100;
|
|
|
+ left: 50%;
|
|
|
+ width: calc(100vw - 40rpx);
|
|
|
+ bottom: 67rpx;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ background: #FFFFFF;
|
|
|
+ box-shadow: 0px 0px 33rpx 1px rgba(50,35,17,0.25);
|
|
|
+ border: 1px solid #E4E4E4;
|
|
|
+ overflow: hidden;
|
|
|
+ padding: 25rpx;
|
|
|
+ .name{
|
|
|
+ padding: 0 35rpx;
|
|
|
+ font-size: 23rpx;
|
|
|
+ text-align: center;
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+ }
|
|
|
+ .center-box{
|
|
|
+ align-items: center;
|
|
|
+ text{
|
|
|
+ flex-shrink: 0;
|
|
|
+ font-size: 20rpx;
|
|
|
+ color: #666;
|
|
|
+ }
|
|
|
+ .slider{
|
|
|
+ flex: 1;
|
|
|
+ margin: 0 20rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .btn{
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ margin-top: 20rpx;
|
|
|
+ image{
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
+ .aside{
|
|
|
+ width: 49rpx;
|
|
|
+ height: 49rpx;
|
|
|
+ }
|
|
|
+ .center{
|
|
|
+ width: 49rpx;
|
|
|
+ height: 49rpx;
|
|
|
+ margin: 0 49rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
.pop-audio-box{
|
|
|
position: fixed;
|
|
|
width: 90vw;
|