<template>
  <div class="audio-page">
    <div class="content" v-if="showObj.audio">
      <audio ref="audio" @durationchange="canPlay" @play="playing()" :src="showObj.audio[index].url"></audio>
      <div class="hp-left">
        <div class="hp-top">
          <div class="image-block" @click="imgPop=true">
            <img :src="showObj.audio[index].image">
          </div>
          <div>
            <div class="title-block">
              <div class="title">
                {{showObj.audio[index].title}}
              </div>
              <div class="tips">
                {{showObj.audio[index].tips}}
              </div>
            </div>
            <div class="btn-group hp">
              <i class="playImage list" @click="popupVisible=!popupVisible"></i>
              <i class="playImage last" @click="lastOne()"></i>
              <i class="playImage play" v-if="!playFlag" @click="onPlay"></i>
              <i class="playImage stop" v-if="playFlag" @click="onStop"></i>
              <i class="playImage next" @click="nextOne()"></i>
              <i :class="{playImage:true,replay:playType===1,replayAll:playType===0,listPlay:playType==2}" @click="changeType()"></i>
            </div>
          </div>
        </div>
        <div class="range-block">
          <div class="time-block">
            <div class="left-time">{{startTime}}</div>
            <div class="right-time">{{overTime}}</div>
          </div>
          <input type="range" min="0" :max="offset" v-model="range" :style="{backgroundSize:`${offset?range/offset*100:0}% 100%`}"/>
        </div>
      </div>
      <div class="btn-group">
        <i class="playImage toBig" @click="imgPop=true"></i>
        <i class="playImage list" @click="popupVisible=!popupVisible"></i>
        <i class="playImage last" @click="lastOne()"></i>
        <i class="playImage play" v-if="!playFlag" @click="onPlay(true)"></i>
        <i class="playImage stop" v-if="playFlag" @click="onStop(true)"></i>
        <i class="playImage next" @click="nextOne(true)"></i>
        <i :class="{playImage:true,replay:playType===1,replayAll:playType===0,listPlay:playType==2}" @click="changeType()"></i>
        <i :class="{playImage:true,collectDefault:!hasCollect,collect:!!hasCollect}" @click="changeCollect"></i>
      </div>
      <div class="btn-block">
        <div v-if="contentData.content.age" class="age-block" @click="ageShow = !ageShow">
          <div v-if="contentData.age === 1">0-3岁<i class="playImage _154722344142123489"></i></div>
          <div v-if="contentData.age === 2">4-6岁<i class="playImage _154722344142123489"></i></div>
        </div>
        <div class="age-change-block" v-show="ageShow" v-if="contentData.content.age">
          <div @click="contentData.age = 1">0-3岁<i class="playImage _282918034425091245" v-if="contentData.age === 1"></i></div>
          <div @click="contentData.age = 2">4-6岁<i class="playImage _282918034425091245" v-if="contentData.age === 2"></i></div>
        </div>
        <div v-if="showObj.change" class="change-block-HP" @click="contentData.type = 'video'">
          <div class="">
            <img :src="tapToVideo"/>
          </div>
        </div>
        <div v-if="showObj.change" class="change-block">
          <div @click="contentData.type = 'video'">视频教学</div>
          <div class="active" >音频教学</div>
        </div>
      </div>
      <div class="parent-finish">
        <div class="finish-block" v-if="contentData.title === 3">
          <img :src="finishStuat" @click="finishStudy">
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  import tapToVideo from '../../assets/tapToVideo.png'
  import finishStuat from '../../assets/newLesson/finishStudy.png'
  import noFinishDia from './nofinishdia'
  export default {
    name: "fun",
    props:[
      'contentData'
    ],
    components:{
      noFinishDia,
    },
    data(){
      return{
        finishStuat:finishStuat,
        popupVisible:false,
        collectPop:false,
        index:0,
        star:false,
        popupVisible2:false,
        hasCollect:false,
        ageShow:false,
        imgPop:false,
        startTime:'00:00',
        overTime:'00:00',
        range:0,
        showObj:{
          audio:null,
          change:false
        },
        share_show:false,
        tapToVideo:tapToVideo,
        playFlag:false,
        offset:0,
        timer:null,
        playType:Number(localStorage.getItem('playType'))|0
      }
    },
    mounted(){
      this.changeAge(this.contentData.age);
      this.checkCollect();
    },
    methods:{
      changeStar(data){
        this.star = data
      },
      backList(){
        this.$emit('backList')
      },
      closeShare(){
        this.share_show=false
      },
      // 改变收藏状态
      changeCollect(){
        this.$message({
          message: '预览无该功能',
          type: 'error'
        });
      },
      // 获取收藏状态
      checkCollect(){
      },
      // 播放音频
      onPlay(flag){
        this.$refs.audio.play();
      },
      lastOne(){
        if(this.index > 0){
          this.index --;
          this.keepPlay()
        }else if(this.playType === 0 && this.showObj.audio.length > 1){
          this.index = this.showObj.audio.length-1;
          this.keepPlay()
        }else{
          this.$message({
            message: '已经是第一首',
            type: 'warning'
          });
        }
      },
      changeIndex(i){
        this.index = i;
        this.popupVisible = false;
        this.keepPlay()
      },
      keepPlay(){
        if(this.playFlag){
          this.$nextTick(()=>{
            this.onPlay()
          })
        }else{
          this.$nextTick(()=>{
            this.onStop()
          })
        }
      },
      nextOne(flag){
        if(this.index < this.showObj.audio.length-1){
          this.index ++;
          this.keepPlay()
        }else if(this.playType === 0 && this.showObj.audio.length > 1){
          this.index = 0;
          this.keepPlay()
        }else{
          this.$message({
            message: '已经是最后一首',
            type: 'warning'
          });
        }
      },
      // 音频准备就绪
      canPlay(){
        let audio = this.$refs.audio;
        this.offset = Math.ceil(parseInt(audio.duration)|0);
        this.$nextTick(()=>{
          this.getDuration()
        })
      },
      // 播放中方法
      playing(){
        let audio = this.$refs.audio;
        this.playFlag = true;
        this.timer = setInterval(() => {
          let min = null;
          if(parseInt(audio.currentTime / 60)<10){
            min = '0' + parseInt(audio.currentTime / 60)
          }else{
            min = parseInt(audio.currentTime / 60)
          }
          let sec = parseInt(audio.currentTime % 60);
          if (sec < 10) {
            sec = "0" + sec;
          }
          this.startTime = min + ':' + sec;   /*  00:00  */
          this.range = parseInt(audio.currentTime);
          if(this.range === this.offset && this.offset !== 0) {
            this.range=0;/*播放结束后进度条归零*/
            this.startTime='00:00'; /*播放结束后时间归零*/
            this.onOver();
            clearInterval(this.timer)
          }
        }, 1000)
      },
      // 暂停计时器
      stopTime(){
        clearInterval(this.timer);
      },
      // 获取音频总长度
      getDuration(){
        let min = null;
        if(this.offset === 0 ){
          this.overTime = '正在加载中...'
        }else{
          if(parseInt(this.offset / 60)<10){
            min = '0' + parseInt(this.offset / 60)
          }else{
            min = parseInt(this.offset / 60)
          }
          let sec = parseInt(this.offset % 60);
          if (sec < 10) {
            sec = "0" + sec;
          }
          this.overTime = min + ':' + sec;   /*  00:00  */
        }

      },
      // 播放暂停
      onStop(flag){
        this.$refs.audio.pause();
        this.playFlag = false
      },
      // 播放完毕
      onOver(){
        switch (this.playType) {
          case 0:
            if(this.index < this.showObj.audio.length-1){
              this.index++
            }else{
              this.index=0
            }
            this.$nextTick(()=>{
              this.onPlay()
            });
            break;
          case 1:
            this.range = 0;
            this.$nextTick(()=>{
              this.onPlay()
            });
            break;
          case 2:
            if(this.index < this.showObj.audio.length-1){
              this.index++;
              this.$nextTick(()=>{
                this.onPlay()
              });
            }else{
              this.index=0;
              this.$nextTick(()=>{
                this.onStop()
              });
            }
        }
      },
      // 改变循环状态
      changeType(){
        this.playType < 2 ? this.playType++ :this.playType =0;
        window.localStorage.setItem('playType',this.playType);
        switch (this.playType) {
          case 1:
            this.$message({
              message: '单曲循环',
              type: 'success'
            });
            break;
          case 2:
            this.$message({
              message: '顺序播放',
              type: 'success'
            });
            break;
          case 0:
            this.$message({
              message: '列表循环',
              type: 'success'
            });
            break
        }
      },
      changeAge(value){
        if(this.contentData.content.age && value === 2){
          this.showObj = {
            audio:this.contentData.content.audio2,
            change:this.contentData.content.change2
          }
        }else{
          this.showObj = {
            audio:this.contentData.content.audio,
            change:this.contentData.content.change
          }
        }
        this.playFlag = false;
        this.startTime='00:00';
        this.overTime='00:00'
      },

      finishStudy(){
        let lessonDetail = JSON.parse(localStorage.getItem('lessonDetail'));
        let nowTime = Date.parse(new Date());
        let lookTime = (nowTime- lessonDetail.nowTime)/1000;
        let json = {
          page_type:0,
          page_id:5,
          stay_time:lookTime,
        };
        subUserLessonApi(this.$route.query.elementId,this.$route.query.category_id,this.$route.query.periods_id,json).then(res=>{
          lessonDetail.total_watch_time = res.total_watch_time;
          lessonDetail.nowTime = nowTime;
          lessonDetail.star_num = res.total_star_num;
          localStorage.setItem('lessonDetail',JSON.stringify(lessonDetail));
        });
        if((Number(lookTime) + Number(lessonDetail.total_watch_time))/60 < 7){
          this.popupVisible2 = true
        }else{
          this.share_show = true
        }
      },
    },
    watch:{
      'contentData':{
        handler:function() {   //特别注意，不能用箭头函数，箭头函数，this指向全局
          this.changeAge(this.contentData.age);
          this.index = 0;
          this.checkCollect()
        },
        deep: true
      },
      'index'(value){
        this.checkCollect();
      },
      'range'(value,value2){
        let audio = this.$refs.audio;
        if(Math.abs(value - value2) > 2){
          this.timer = setInterval(() => {
            let min = null;
            if(parseInt(audio.currentTime / 60)<10){
              min = '0' + parseInt(audio.currentTime / 60)
            }else{
              min = parseInt(audio.currentTime / 60)
            }
            let sec = parseInt(audio.currentTime % 60);
            if (sec < 10) {
              sec = "0" + sec;
            }
            this.startTime = min + ':' + sec;   /*  00:00  */
            this.range = parseInt(audio.currentTime);
            if(this.range == this.offset && this.offset !== 0) {
              this.range=0;/*播放结束后进度条归零*/
              this.startTime='00:00'; /*播放结束后时间归零*/
              this.onOver();
              clearInterval(this.timer)
            }
          }, 1000);
          audio.currentTime = value;
        }
      }
    },
  }
</script>

<style scoped lang="less">
  *{
    margin: auto;
  }
  @import "../../util/public";
  .playImage{background:url('https://static-cdn.changchangenglish.com/new-sing/static/images/imgPlayAudio.png')  no-repeat;background-size:40*@toVw 290*@toVw;display: inline-block}
  ._282918034425091245{height:8*@toVw;width:9*@toVw;background-position:0 0;}
  ._154722344142123489{height:5*@toVw;width:9*@toVw;background-position:0 -8*@toVw;vertical-align: bottom}
  .next{height:16*@toVw;width:16*@toVw;background-position:0 -13*@toVw;}
  .listPlay{height:16*@toVw;width:16*@toVw;background-position:0 -29*@toVw;}
  .replay{height:16*@toVw;width:16*@toVw;background-position:0 -45*@toVw;}
  .toBig{height:16*@toVw;width:16*@toVw;background-position:0 -61*@toVw;}
  .replayAll{height:16*@toVw;width:16*@toVw;background-position:0 -77*@toVw;}
  .collectDefault{height:16*@toVw;width:16*@toVw;background-position:0 -93*@toVw;}
  .collect{height:16*@toVw;width:16*@toVw;background-position:0 -109*@toVw;}
  .last{height:16*@toVw;width:16*@toVw;background-position:0 -125*@toVw;}
  .list{height:16*@toVw;width:16*@toVw;background-position:0 -141*@toVw;}
  .close{height:17*@toVw;width:17*@toVw;background-position:0 -157*@toVw;}
  .zDefaultIcon{height:18*@toVw;width:18*@toVw;background-position:0 -174*@toVw;float: right}
  .zIcon{height:18*@toVw;width:18*@toVw;background-position:0 -192*@toVw;float: right;}
  .play{height:40*@toVw;width:40*@toVw;background-position:0 -210*@toVw;}
  .stop{height:40*@toVw;width:40*@toVw;background-position:0 -250*@toVw;}
  .collect-block{
    padding: 10*@toVw;
    border-radius: 4*@toVw;
    background: white;
  }
  .content{
    background: white;
    width: 315*@toVw;
    position: absolute;
    top: 80*@toVw;
    left: 20*@toVw;
    right: 20*@toVw;
    bottom: 20*@toVw;
    overflow: auto;
    margin: auto;
    display: block;
    border-radius: 8*@toVw;
    text-align: center;
    padding: 10*@toVw;
    .image-block{
      width: 188*@toVw;
      height: 188*@toVw;
      margin-top: 5*@toVw;
      box-shadow: 0 0 30*@toVw 5*@toVw #ddd;
      overflow: hidden;
      border-radius: 8*@toVw;
      img{
        width: 100%;
      }
    }
    .title-block{
      margin-top: 10*@toVw;
      .title{
        font-size:16*@toVw;
        font-family:PingFang-SC-Medium;
        font-weight:500;
        color:rgba(102,102,102,1);
      }
      .tips{
        font-size:14*@toVw;
        margin-top: 6*@toVw;
        font-family:PingFang-SC-Medium;
        font-weight:500;
        color:rgba(153,153,153,1);
      }
    }
    .range-block{
      width: 250 * @toVw;
      margin-top: 10*@toVw;
      .time-block{
        font-size:12*@toVw;
        font-family:PingFang-SC-Medium;
        font-weight:500;
        color:rgba(102,102,102,1);
        text-align: left;
        &:after{
          content: '';
          display: block;

          clear: both;
        }
        .left-time{
          float: left;
        }
        .right-time{
          float: right;
        }
      }
      input[type=range] {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-appearance: none;
        background: -webkit-linear-gradient(#49E2A5, #49E2A5) no-repeat,#D8D8D8;
        background-size: 75% 100%;/*设置左右宽度比例*/
        width: 100%;
        border-radius: 10*@toVw; /*这个属性设置使填充进度条时的图形为圆角*/
      }
      input[type=range]::-webkit-slider-thumb {
        -webkit-appearance: none;
      }
      input[type=range]::-webkit-slider-runnable-track {
        height: 4*@toVw;
        border-radius: 2*@toVw ;
      }
      input[type=range]:focus {
        outline: none;
      }
      input[type=range]::-webkit-slider-thumb {
        -webkit-appearance: none;
        border-radius: 50%; /*外观设置为圆形*/
        height: 16*@toVw;
        width:  16*@toVw;
        margin-top: -6*@toVw; /*使滑块超出轨道部分的偏移量相等*/
        background: #49E2A5;
      }
    }
    .btn-group{
      margin-top: 15*@toVw;
      width: 280*@toVw;
      display: flex;
      &.hp{
        display: none;
      }
    }
  }
  .list-popup{
    width: 375*@toVw;
    max-height: 345*@toVw;
    overflow: auto;
    border-radius: 8*@toVw 8*@toVw 0 0;
    background: white;
    padding-top: 20*@toVw;
    .list-block{
      display: block;
      width: auto;
      margin: 0 20*@toVw;
      padding:12*@toVw 36*@toVw;
      border-bottom: 1*@toVw solid #dddddd;
      &.active{
        color: #49E2A5;
      }
    }
    .close-btn{
      text-align: center;
      padding: 20*@toVw;
    }
  }
  .imgPop-block{
    max-height: 500*@toVw;
    overflow: auto;
    img{
      max-width: 300*@toVw;
    }
  }
  .btn-block{
    position: relative;
    margin-top: 15*@toVw;
    text-align: center;
    .age-block{
      height: 28*@toVw;
      line-height: 28*@toVw;
      border: 1*@toVw solid #666;
      position: absolute;
      padding: 0 13*@toVw;
      border-radius: 100*@toVw;
      font-size:12*@toVw;
      font-family:PingFang-SC-Medium;
      font-weight:500;
      color:rgba(102,102,102,1);
    }
    .age-change-block{
      position: absolute;
      top: 37*@toVw;
      left: 0;
      width: 66*@toVw;
      border-radius: 8*@toVw;
      border: 1*@toVw solid #666666;
      font-size:12*@toVw;
      font-family:PingFang-SC-Medium;
      font-weight:500;
      color:rgba(102,102,102,1);
      &>div{
        padding: 6*@toVw 11*@toVw;
        text-align: left;
        &:first-child{
          border-bottom: 1*@toVw solid #eee;
        }
      }
    }
    .change-block{
      border-radius: 1000*@toVw;
      width: 144*@toVw;
      border:1*@toVw solid #40A9FF;
      &:after{
        content: '';
        display: block;
        clear: both;
      }
      div{
        float: left;
        width: 50%;
        border-radius: 100*@toVw;
        font-size:12*@toVw;
        height: 28*@toVw;
        line-height: 28*@toVw;
        font-family:PingFang-SC-Medium;
        font-weight:500;
        color:rgba(204,204,204,1);
        &.active{
          background: #40A9FF;
          color: white;
        }
      }
    }
  }
  .change-block-HP{
    display: none;
  }
  .parent-finish{
    position: absolute;
    bottom: 10 * @toVw;
    width: 100%;
    left: 0;
    top: 430*@toVw;
    .finish-block{
      position: absolute;
      width: 100%;
      left: 0;
      padding: 0;
      margin: 0;
      text-align: center;
      bottom: 0;
      img{
        width: 202*@toVw;
      }
    }
  }
  @media screen and (orientation: landscape) {
    @toVw:100/667vw;
    .finish-block{display: none}
    .playImage{background:url('https://static-cdn.changchangenglish.com/new-sing/static/images/playImage.png?v=2')  no-repeat;background-size:40*@toVw 225*@toVw;display: inline-block}
    ._154722344142123489{height:5*@toVw;width:9*@toVw;background-position:0 0;}
    ._282918034425091245{height:8*@toVw;width:9*@toVw;background-position:0 -4*@toVw;vertical-align: bottom}
    .last{height:16*@toVw;width:16*@toVw;background-position:0 -13*@toVw;}
    .listPlay{height:16*@toVw;width:16*@toVw;background-position:0 -29*@toVw;}
    .replay{height:16*@toVw;width:16*@toVw;background-position:0 -45*@toVw;}
    .next{height:16*@toVw;width:16*@toVw;background-position:0 -61*@toVw;}
    .replayAll{height:16*@toVw;width:16*@toVw;background-position:0 -77*@toVw;}
    .list{height:16*@toVw;width:16*@toVw;background-position:0 -93*@toVw;}
    .zDefaultIcon{height:18*@toVw;width:18*@toVw;background-position:0 -109*@toVw; float: right}
    .zIcon{height:18*@toVw;width:18*@toVw;background-position:0 -127*@toVw;; float: right}
    .play{height:40*@toVw;width:40*@toVw;background-position:0 -145*@toVw;}
    .stop{height:40*@toVw;width:40*@toVw;background-position:0 -185*@toVw;}

    .audio-page{
      position: absolute;
      top: 5*@toVw;
      bottom: 5*@toVw;
      left: 5*@toVw;
      right: 5*@toVw;
      overflow: auto;
      border-radius:8*@toVw;
      .content{
        position: static;
        height: 100%;
        width: 100%;
        display: flex;
        border-radius: 8*@toVw;
        padding: 0;
        .hp-left{
          flex: 1;
          margin-right: 20*@toVw;
          .hp-top{
            display: flex;
            width: 100%;
          }
        }
        .image-block{
          width: 150*@toVw;
          height: 150*@toVw;
          box-shadow: 0 0 30*@toVw 5*@toVw #ddd;
          overflow: hidden;
          display: block;
          margin: auto;
          border-radius: 8*@toVw;
          img{
            width: 100%;
          }
        }
        .title-block{
          margin-top: 24*@toVw;
          .title{
            font-size:16*@toVw;
            font-family:PingFang-SC-Medium;
            font-weight:500;
            color:rgba(102,102,102,1);
          }
          .tips{
            font-size:14*@toVw;
            margin-top: 6*@toVw;
            font-family:PingFang-SC-Medium;
            font-weight:500;
            color:rgba(153,153,153,1);
          }
        }
        .range-block{
          width: auto;
          margin-top: 16*@toVw;
          .time-block{
            font-size:12*@toVw;
            font-family:PingFang-SC-Medium;
            font-weight:500;
            color:rgba(102,102,102,1);
            text-align: left;
            &:after{
              content: '';
              display: block;
              clear: both;
            }
            .left-time{
              float: left;
            }
            .right-time{
              float: right;
            }
          }
          input[type=range] {
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
            -webkit-appearance: none;
            background: -webkit-linear-gradient(#49E2A5, #49E2A5) no-repeat,#D8D8D8;
            background-size: 75% 100%;/*设置左右宽度比例*/
            width: 100%;
            border-radius: 10*@toVw; /*这个属性设置使填充进度条时的图形为圆角*/
          }
          input[type=range]::-webkit-slider-thumb {
            -webkit-appearance: none;
          }
          input[type=range]::-webkit-slider-runnable-track {
            height: 4*@toVw;
            border-radius: 2*@toVw ;
          }
          input[type=range]:focus {
            outline: none;
          }
          input[type=range]::-webkit-slider-thumb {
            -webkit-appearance: none;
            border-radius: 50%; /*外观设置为圆形*/
            height: 16*@toVw;
            width:  16*@toVw;
            margin-top: -6*@toVw; /*使滑块超出轨道部分的偏移量相等*/
            background: #49E2A5;
          }
        }
        .btn-group{
          margin-top: 15vh;
          display: none;
          width: 200*@toVw;
          &.hp{
            display: flex;
          }
        }
      }
      .list-popup{
        width: 375*@toVw;
        max-height: 345*@toVw;
        overflow: auto;
        border-radius: 8*@toVw 8*@toVw 0 0;
        background: white;
        padding-top: 20*@toVw;
        .list-block{
          display: block;
          width: auto;
          margin: 0 20*@toVw;
          padding:12*@toVw 36*@toVw;
          border-bottom: 1*@toVw solid #dddddd;
          &.active{
            color: #49E2A5;
          }
        }
        .close-btn{
          text-align: center;
          padding: 20*@toVw;
        }
      }
      .imgPop-block{
        max-height: 500*@toVw;
        overflow: auto;
        img{
          max-width: 300*@toVw;
        }
      }
      .btn-block{
        position:relative;
        min-width:90*@toVw ;
        margin-top: 0;
        display: block;
        height: 100%;
        .age-block{
          display: block;
          position: static;
          padding: 0;
          height: 28*@toVw;
          width: 88*@toVw;
          line-height: 28*@toVw;
          border: 1*@toVw solid #666;
          border-radius: 100*@toVw;
          font-size:12*@toVw;
          font-family:PingFang-SC-Medium;
          font-weight:500;
          color:rgba(102,102,102,1);
        }
        .age-change-block{
          position: static;
          width: 80*@toVw;
          margin-top: 10*@toVw;
          border-radius: 8*@toVw;
          border: 1*@toVw solid #666666;
          font-size:12*@toVw;
          font-family:PingFang-SC-Medium;
          font-weight:500;
          color:rgba(102,102,102,1);
          &>div{
            padding: 6*@toVw 11*@toVw;
            text-align: left;
            &:first-child{
              border-bottom: 1*@toVw solid #eee;
            }
          }
        }
        .change-block-HP{
          position: absolute;
          top: ~"calc(100vh - 12.5vw)";
          display: block;
          width: 78*@toVw;
          img{
            width: 100%;
          }
        }
        .change-block{
          display: none;
        }
      }
    }
  }
  @media screen and (min-aspect-ratio: ~"20/8"){
    @toVw:100/900vw;
    .playImage{background:url('https://static-cdn.changchangenglish.com/new-sing/static/images/playImage.png?v=2')  no-repeat;background-size:40*@toVw 225*@toVw;display: inline-block}
    ._154722344142123489{height:5*@toVw;width:9*@toVw;background-position:0 0;}
    ._282918034425091245{height:8*@toVw;width:9*@toVw;background-position:0 -4*@toVw;vertical-align: bottom}
    .last{height:16*@toVw;width:16*@toVw;background-position:0 -13*@toVw;}
    .listPlay{height:16*@toVw;width:16*@toVw;background-position:0 -29*@toVw;}
    .replay{height:16*@toVw;width:16*@toVw;background-position:0 -45*@toVw;}
    .next{height:16*@toVw;width:16*@toVw;background-position:0 -61*@toVw;}
    .replayAll{height:16*@toVw;width:16*@toVw;background-position:0 -77*@toVw;}
    .list{height:16*@toVw;width:16*@toVw;background-position:0 -93*@toVw;}
    .zDefaultIcon{height:18*@toVw;width:18*@toVw;background-position:0 -109*@toVw; float: right}
    .zIcon{height:18*@toVw;width:18*@toVw;background-position:0 -127*@toVw;; float: right}
    .play{height:40*@toVw;width:40*@toVw;background-position:0 -145*@toVw;}
    .stop{height:40*@toVw;width:40*@toVw;background-position:0 -185*@toVw;}

    .audio-page{
      position: absolute;
      top: 5*@toVw;
      bottom: 5*@toVw;
      left: 5*@toVw;
      right: 5*@toVw;
      overflow: auto;
      border-radius:8*@toVw;
      .content{
        position:static;
        height: 100%;
        width: 100%;
        display: flex;
        border-radius: 8*@toVw;
        padding: 0;
        .hp-left{
          flex: 1;
          margin-right: 20*@toVw;
          .hp-top{
            display: flex;
            width: 100%;
          }
        }
        .image-block{
          width: 150*@toVw;
          height: 150*@toVw;
          box-shadow: 0 0 30*@toVw 5*@toVw #ddd;
          overflow: hidden;
          display: block;
          margin: auto;
          border-radius: 8*@toVw;
          img{
            width: 100%;
          }
        }
        .title-block{
          margin-top: 24*@toVw;
          .title{
            font-size:16*@toVw;
            font-family:PingFang-SC-Medium;
            font-weight:500;
            color:rgba(102,102,102,1);
          }
          .tips{
            font-size:14*@toVw;
            margin-top: 6*@toVw;
            font-family:PingFang-SC-Medium;
            font-weight:500;
            color:rgba(153,153,153,1);
          }
        }
        .range-block{
          width: auto;
          margin-top: 16*@toVw;
          .time-block{
            font-size:12*@toVw;
            font-family:PingFang-SC-Medium;
            font-weight:500;
            color:rgba(102,102,102,1);
            text-align: left;
            &:after{
              content: '';
              display: block;
              clear: both;
            }
            .left-time{
              float: left;
            }
            .right-time{
              float: right;
            }
          }
          input[type=range] {
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
            -webkit-appearance: none;
            background: -webkit-linear-gradient(#49E2A5, #49E2A5) no-repeat,#D8D8D8;
            background-size: 75% 100%;/*设置左右宽度比例*/
            width: 100%;
            border-radius: 10*@toVw; /*这个属性设置使填充进度条时的图形为圆角*/
          }
          input[type=range]::-webkit-slider-thumb {
            -webkit-appearance: none;
          }
          input[type=range]::-webkit-slider-runnable-track {
            height: 4*@toVw;
            border-radius: 2*@toVw ;
          }
          input[type=range]:focus {
            outline: none;
          }
          input[type=range]::-webkit-slider-thumb {
            -webkit-appearance: none;
            border-radius: 50%; /*外观设置为圆形*/
            height: 16*@toVw;
            width:  16*@toVw;
            margin-top: -6*@toVw; /*使滑块超出轨道部分的偏移量相等*/
            background: #49E2A5;
          }
        }
        .btn-group{
          margin-top: 15vh;
          display: none;
          width: 200*@toVw;
          &.hp{
            display: flex;
          }
        }
      }
      .list-popup{
        width: 375*@toVw;
        max-height: 345*@toVw;
        overflow: auto;
        border-radius: 8*@toVw 8*@toVw 0 0;
        background: white;
        padding-top: 20*@toVw;
        .list-block{
          display: block;
          width: auto;
          margin: 0 20*@toVw;
          padding:12*@toVw 36*@toVw;
          border-bottom: 1*@toVw solid #dddddd;
          &.active{
            color: #49E2A5;
          }
        }
        .close-btn{
          text-align: center;
          padding: 20*@toVw;
        }
      }
      .imgPop-block{
        max-height: 500*@toVw;
        overflow: auto;
        img{
          max-width: 300*@toVw;
        }
      }
      .btn-block{
        position:relative;
        min-width:90*@toVw ;
        margin-top: 0;
        display: block;
        height: 100%;
        .age-block{
          display: block;
          position: static;
          padding: 0;
          height: 28*@toVw;
          width: 88*@toVw;
          line-height: 28*@toVw;
          border: 1*@toVw solid #666;
          border-radius: 100*@toVw;
          font-size:12*@toVw;
          font-family:PingFang-SC-Medium;
          font-weight:500;
          color:rgba(102,102,102,1);
        }
        .age-change-block{
          position: static;
          width: 80*@toVw;
          margin-top: 10*@toVw;
          border-radius: 8*@toVw;
          border: 1*@toVw solid #666666;
          font-size:12*@toVw;
          font-family:PingFang-SC-Medium;
          font-weight:500;
          color:rgba(102,102,102,1);
          &>div{
            padding: 6*@toVw 11*@toVw;
            text-align: left;
            &:first-child{
              border-bottom: 1*@toVw solid #eee;
            }
          }
        }
        .change-block-HP{
          position: absolute;
          top: ~"calc(100vh - 12.5vw)";
          display: block;
          width: 78*@toVw;
          img{
            width: 100%;
          }
        }
        .change-block{
          display: none;
        }
      }
    }
  }
</style>
