natasha il y a 1 an
Parent
commit
62145c63a2

+ 2 - 1
package.json

@@ -66,7 +66,8 @@
         "serve-static": "1.13.2",
         "svg-sprite-loader": "4.1.3",
         "svgo": "1.2.2",
-        "vue-template-compiler": "2.7.14"
+        "vue-template-compiler": "2.7.14",
+        "vue-waterfall-easy": "^2.4.4"
     },
     "browserslist": [
         "> 1%",

+ 42 - 18
src/components/common/AudioLine.vue

@@ -1,5 +1,5 @@
 <template>
-  <div :class="['Audio']">
+  <div :class="['Audio', mp3Source && mp3Source == 'tts' ? 'Audio-tts' : '']">
     <div class="audioLine" :class="[]">
       <div
         class="play"
@@ -77,9 +77,18 @@ export default {
   components: {},
   props: [
     "mp3",
+    "mp3Source",
+    "getCurTime",
+    "stopAudio",
     "width",
+    "isRepeat",
+    "themeColor",
+    "hideSlider",
+    "ed",
+    "bg",
     "audioId",
-    "getCurTime"
+    "type",
+    "borderRadius"
   ],
   data() {
     // 这里存放数据
@@ -104,7 +113,6 @@ export default {
       isClick: false,
       playbackRateValue: '1x',
       sound: 100,
-      isRepeat: false
     };
   },
   // 计算属性 类似于data概念
@@ -168,6 +176,9 @@ export default {
     });
     _this.$refs[audioId].addEventListener("pause", function () {
       _this.audio.playing = false;
+      if (_this.hideSlider && _this.audio.currentTime * 1000 + 500 > _this.ed) {
+        _this.$emit("sentPause", true);
+      }
       _this.$emit("handleListenRead", false);
     });
     _this.$refs[audioId].addEventListener("ended", function () {
@@ -198,19 +209,23 @@ export default {
     PlayAudio() {
       let audioId = this.audioId;
       let audio = document.getElementsByTagName("audio");
-      audio.forEach((item) => {
-        if (item.src == this.mp3) {
+      if(audio&&audio.length>0&&window.location.href.indexOf('GCLS-Learn')==-1){
+        audio.forEach((item) => {
+            if (item.src == this.mp3) {
             if (item.id !== audioId) {
                 item.pause();
             }
             } else {
             item.pause();
-        }
-      });
+            }
+        });
+      }
       let video = document.getElementsByTagName("video");
-      video.forEach((vItem) => {
-        vItem.pause();
-      });
+      if(video&&video.length>0&&window.location.href.indexOf('GCLS-Learn')==-1){
+        video.forEach((vItem) => {
+            vItem.pause();
+        });
+      }
       if (this.audio.playing) {
         this.$refs[audioId].pause();
         this.audio.playing = false;
@@ -222,8 +237,14 @@ export default {
           this.audio.loading = true;
           this.count++;
         }
-        this.$refs[audioId].play();
         this.$emit("handleChangeStopAudio",true);
+        if (this.hideSlider) {
+          this.$refs[audioId].play();
+          this.onTimeupdateTime(this.bg / 1000);
+        } else {
+          this.$refs[audioId].play();
+        }
+        this.$emit("handleChangeStopAudio");
         this.$emit("handleListenRead", true);
         this.isClick = true;
       }
@@ -263,15 +284,18 @@ export default {
     onTimeupdate(res) {
       let audioId = this.audioId;
       this.audio.currentTime = res.target.currentTime;
-      if(this.getCurTime){
-        this.getCurTime(res.target.currentTime);
-      }
-      if(this.isRepeat){
-        if(this.audio.currentTime>=this.audio.maxTime || this.audio.currentTime<=0){
-            this.onTimeupdateTime(0,true)
+      this.getCurTime(res.target.currentTime);
+      this.playValue = (this.audio.currentTime / this.audio.maxTime) * 100;
+      if (this.type == "audioLine") {
+        if (!this.isClick && this.audio.currentTime * 1000 > this.ed) {
+          this.$refs[audioId].pause();
+          this.$emit("emptyEd");
+        }
+      } else {
+        if (this.audio.currentTime * 1000 > this.ed) {
+          this.$refs[audioId].pause();
         }
       }
-      this.playValue = (this.audio.currentTime / this.audio.maxTime) * 100;
     },
     onTimeupdateTime(res, playFlag) {
       if (!res&&res!=0) return;

+ 5 - 0
src/icons/svg/History.svg

@@ -0,0 +1,5 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g id="History (&#229;&#142;&#134;&#229;&#143;&#178;&#232;&#174;&#176;&#229;&#189;&#149;)">
+<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M2.9082 7.74964H3.30994C3.32847 7.75032 3.34698 7.75032 3.36544 7.74964H6.54457C6.95879 7.74964 7.29457 7.41385 7.29457 6.99964C7.29457 6.58542 6.95879 6.24964 6.54457 6.24964H4.75481C6.45012 4.11681 9.06589 2.75098 12 2.75098C17.1086 2.75098 21.25 6.89234 21.25 12.001C21.25 17.1096 17.1086 21.251 12 21.251C6.89136 21.251 2.75 17.1096 2.75 12.001C2.75 11.5868 2.41421 11.251 2 11.251C1.58579 11.251 1.25 11.5868 1.25 12.001C1.25 17.938 6.06294 22.751 12 22.751C17.9371 22.751 22.75 17.938 22.75 12.001C22.75 6.06391 17.9371 1.25098 12 1.25098C8.63322 1.25098 5.6286 2.799 3.6582 5.21995V3.36328C3.6582 2.94907 3.32242 2.61328 2.9082 2.61328C2.49399 2.61328 2.1582 2.94907 2.1582 3.36328V6.99964C2.1582 7.41385 2.49399 7.74964 2.9082 7.74964ZM12.7526 6.00007C12.7526 5.58586 12.4168 5.25004 12.0026 5.25C11.5884 5.24996 11.2526 5.58571 11.2526 5.99993L11.252 12.0043C11.2519 12.2033 11.331 12.3941 11.4716 12.5347L15.7113 16.7744C16.0042 17.0673 16.4791 17.0673 16.772 16.7744C17.0649 16.4815 17.0649 16.0067 16.772 15.7138L12.752 11.6938L12.7526 6.00007Z" fill="currentColor"/>
+</g>
+</svg>

+ 524 - 0
src/views/bookShelf/components/HistoryRecordList.vue

@@ -0,0 +1,524 @@
+<template>
+  <div class="history-record-list" v-if="list">
+    <template v-if="!showItem">
+        <div class="list-top">
+            <h4><svg-icon icon-class="History"></svg-icon>历史记录</h4>
+            <i class="el-icon-close" @click="closeHistory"></i>
+        </div>
+        <div class="list-center">
+            <p>共{{showList.length}}条记录</p>
+            <span v-if="rangeStr">{{rangeStr}}</span>
+        </div>
+        <ul>
+            <li v-for="(item,index) in showList" :key="index" :class="[index%2===1?'odd':'']">
+                <b>{{index+1}}.</b>
+                <span>{{item.create_time.substring(0,16)}}</span>
+                <i class="el-icon-delete" @click="deleteRecord(item.id,index)"></i>
+                <i class="el-icon-arrow-right" @click="recordDetail(index)"></i>
+            </li>
+        </ul>
+        <div class="nodata" v-if="showList.length===0">
+            <img src="../../../assets/nodata.png" />
+            <p>还没有记录</p>
+        </div>
+    </template>
+    <template v-else>
+        <div class="list-item">
+            <div class="item-top">
+                <h4><svg-icon icon-class="History"></svg-icon>历史记录 {{showList[activeIndex].create_time.substring(0,16)}}</h4>
+                <i class="el-icon-close" @click="showItem=false"></i>
+            </div>
+            <div class="item-center">
+                <div class="item-sent">
+                    <div class="nnpe-sentence-box">
+                        <div v-for="(pItem, pIndex) in sentData" :key="'wordsList' + pIndex">
+                            <template v-if="pItem.isShow">
+                                <div
+                                    :class="[
+                                    'NNPE-words',
+                                    ]"
+                                    @click="
+                                    handleChangeTime(
+                                        timeData &&
+                                        timeData &&
+                                        timeData.s
+                                    )
+                                    "
+                                >
+                                        <span
+                                            class="NNPE-chs"
+                                            :class="[
+                                                timeData &&
+                                                timeData &&
+                                                timeData.e &&
+                                                timeData.tokens &&
+                                                timeData.tokens[pItem.wIndex]&&
+                                                curTime >=
+                                                    timeData.tokens[pItem.wIndex].s &&
+                                                curTime <= timeData.e
+                                                    ? 'wordActive'
+                                                    : '',
+                                                pItem.tokens[9]===''?'marginRight':'',pItem.marginRight?'marginSingleRight':''
+                                            ]"
+                                            :style="{fontSize:wordFontsize + 'px'}"
+                                            >{{ pItem.tokens[2] }}</span
+                                        >
+                                        <span
+                                        class="NNPE-chs NNPE-chs-both"
+                                        v-if="sentData[pIndex + 1] &&
+                                        sentData[pIndex + 1].tokens[2] &&
+                                        enFhList.indexOf(sentData[pIndex + 1].tokens[2]) > -1"
+                                        :class="[
+                                                timeData &&
+                                                timeData &&
+                                                timeData.tokens[pItem.wIndex]&&
+                                                curTime >=
+                                                    timeData.tokens[pItem.wIndex].s &&
+                                                curTime <= timeData.e
+                                                    ? 'wordActive'
+                                                    : '',
+                                                sentData[pIndex + 1].tokens[8]===''?'marginLeft':'',sentData[pIndex + 1].marginRight?'marginSingleRight':''
+                                            ]"
+                                            :style="{fontSize:wordFontsize + 'px'}"
+                                        >{{ sentData[pIndex + 1].tokens[2] }}</span
+                                    >
+                                </div>
+                            </template>
+                        </div>
+                        </div>
+                </div>
+                <label>{{activeIndex+1}}/{{showList.length}}</label>
+            </div>
+            <div class="item-bottom">
+                <div class="operate-box-inner-content">
+                    <div class="operate-item" @click="changePlaySent('-')">
+                        <svg-icon icon-class="Go-start" :style="{color:colorObj.type==='white'||colorObj.type==='darkGreen'?'#000':'#fff'}"></svg-icon>
+                        <span :style="{color:colorObj.type==='armyGreen'?'#7C8983':''}">上一句</span>
+                    </div>
+                    <div class="operate-item">
+                        <svg-icon icon-class="Type-drive" :style="{color:colorObj.type==='white'||colorObj.type==='darkGreen'?'#000':'#fff'}"></svg-icon>
+                        <span :style="{color:colorObj.type==='armyGreen'?'#7C8983':''}">听对比</span>
+                    </div>
+                    <div class="operate-item">
+                        <b class="luyin-btn" @click="playSent">
+                            <svg-icon icon-class="voice" :style="{color:'#fff'}"></svg-icon>
+                        </b>
+                    </div>
+                    <div class="operate-item" @click="playmicrophone()">
+                        <svg-icon icon-class="Headphone-sound" :style="{color:colorObj.type==='white'||colorObj.type==='darkGreen'?'#000':'#fff'}"></svg-icon>
+                        <span :style="{color:colorObj.type==='armyGreen'?'#7C8983':''}">我读的</span>
+                    </div>
+                    <div class="operate-item" @click="changePlaySent('+')">
+                        <svg-icon icon-class="Go-end" :style="{color:colorObj.type==='white'||colorObj.type==='darkGreen'?'#000':'#fff'}"></svg-icon>
+                        <span :style="{color:colorObj.type==='armyGreen'?'#7C8983':''}">下一句</span>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </template>
+  </div>
+</template>
+
+<script>
+//这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+//例如:import 《组件名称》from ‘《组件路径》';
+import { getLogin } from "@/api/ajax";
+export default {
+  //import引入的组件需要注入到对象中才能使用
+  components: { },
+  props: ["list","sentData","timeData","mp3Url","colorObj","wordFontsize","parentCurtimt","parentPlay"],
+  data() {
+    //这里存放数据
+    return {
+      showItem: false,
+      rangeStr: '',
+      showList: JSON.parse(JSON.stringify(this.list)),
+      activeIndex: -1,
+      curTime: this.timeData.s,
+      enFhList: [
+        ",",
+        ".",
+        ";",
+        "?",
+        "!",
+        ":",
+        ">",
+        "<",
+        "'",
+        "’",
+        "n't",
+        "n’t",
+        "n’ts",
+        "n‘t",
+        "'t",
+        "’t",
+        "‘t",
+        "'s",
+        "’s",
+        "‘s",
+        "'m",
+        "’m",
+        "‘m",
+        "'re",
+        "’re",
+        "‘re",
+        "'d",
+        "’d",
+        "‘d",
+        "'ve",
+        "’ve",
+        "‘ve",
+        ")",
+        "'ll",
+        "’ll",
+        "‘ll",
+        "”",
+      ],
+      audio: new window.Audio(),
+      timeCur: null,
+      isPlay: false
+    }
+  },
+  //计算属性 类似于data概念
+  computed: {},
+  //监控data中数据变化
+  watch: {
+     list:{
+      handler(val, oldVal) {
+        const _this = this;
+        if (val) {
+          this.showList = JSON.parse(JSON.stringify(this.list))
+          this.handleData()
+        }
+      },
+      // 深度观察监听
+      deep: true,
+    },
+  },
+  //方法集合
+  methods: {
+    // 关闭
+    closeHistory(){
+        this.$emit('closeHistory')
+    },
+    handleData(){
+        if(this.showList.length>0){
+            this.rangeStr = this.showList[0].create_time.substring(0,10)+'~'+this.showList[this.showList.length-1].create_time.substring(0,10)
+        }
+    },
+    // 删除一条录音记录
+    deleteRecord(id,index){
+        let MethodName = "/PaperServer/Client/UserSentRec/DeleteById";
+        let data = {
+            id: id
+        }
+        getLogin(MethodName, data)
+        .then((res) => {
+            if(res.status===1){
+                this.showList.splice(index,1)
+            }
+        })
+    },
+    // 查看一条录音详情
+    recordDetail(index){
+        this.activeIndex = index
+        this.showItem = true
+    },
+    changePlaySent(type){
+        if(type==='-'){
+            if(this.activeIndex>0){
+                this.activeIndex--
+            }else{
+                this.activeIndex=0
+            }
+        }else{
+            if(this.activeIndex<this.showList.length-1){
+                this.activeIndex++
+            }else{
+                
+            }
+        }
+    },
+    playmicrophone() {
+      if (this.hasMicro) {
+        this.isPlayings = true;
+        if (this.selectIndex || this.selectIndex == 0) {
+          let _this = this;
+          if (!this.audio.paused) {
+            this.audio.pause();
+          } else if (this.audio.paused && _this.oldIndex == _this.selectIndex) {
+            _this.audio.play();
+            if (_this.recordtime == 0) {
+              _this.playtime = 0;
+            }
+          } else {
+            _this.audio.pause();
+            _this.audio.load();
+            _this.audio.src = _this.wavblob;
+            _this.oldIndex = _this.selectIndex;
+            _this.audio.play();
+          }
+        }
+      }
+    },
+    // 播放句子
+    playSent(){
+        let _this = this
+        if(_this.curTime>=_this.timeData.e){
+            _this.curTime = _this.timeData.s
+        }
+        if(_this.parentPlay){
+            _this.$emit("handleChangeTime",_this.curTime,_this.timeData.e,true)
+            clearInterval(_this.timeCur)
+        }else{
+            _this.$emit("handleChangeTime",_this.curTime,_this.timeData.e)
+            _this.timeCur = setInterval(() => {
+                _this.curTime = _this.parentCurtimt
+            }, 1000);
+        }
+    },
+    handleChangeTime(time){
+        if (time>=0) {
+            this.curTime = time;
+        }
+    }
+  },
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+    this.handleData()
+  },
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {
+    
+  },
+  //生命周期-创建之前
+  beforeCreated() { },
+  //生命周期-挂载之前
+  beforeMount() { 
+    clearInterval(this.timeCur)
+  },
+  //生命周期-更新之前
+  beforUpdate() { },
+  //生命周期-更新之后
+  updated() { },
+  //生命周期-销毁之前
+  beforeDestory() { },
+  //生命周期-销毁完成
+  destoryed() { },
+  //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() { }
+}
+</script>
+<style lang="scss" scoped>
+/* @import url(); 引入css类 */
+.history-record-list{
+    padding: 24px;
+    background: #FFF;
+}
+.list-top{
+    display: flex;
+    justify-content: space-between;
+    h4{
+        color: #2F3742;
+        font-size: 24px;
+        font-weight: 400;
+        line-height: 32px;
+        margin: 0;
+        .svg-icon{
+            margin-right: 8px;
+        }
+    }
+    .el-icon-close{
+        font-size: 24px;
+        cursor: pointer;
+    }
+}
+.list-center{
+    border-radius: 4px;
+    background:#F7F8FA;
+    padding: 8px 12px;
+    margin: 24px 0;
+    p{
+        color: #2F3742;
+        font-size: 16px;
+        font-weight: 500;
+        line-height: 24px;
+        margin: 0;
+    }
+    span{
+        color:#929CA8;
+        font-size: 12px;
+        font-weight: 400;
+        line-height: 20px;
+        margin-top: 4px;
+    }
+}
+ul{
+    margin: 0;
+    padding: 0;
+    li{
+        padding: 8px;
+        border-radius: 4px;
+        display: flex;
+        align-items: center;
+        font-size: 14px;
+        font-weight: 400;
+        line-height: 22px;
+        &.odd{
+            background: #F7F8FA;
+        }
+        b{
+            width: 28px;
+            color: #929CA8;
+        }
+        span{
+            flex: 1;
+            color: #2F3742;
+        }
+        .el-icon-delete,.el-icon-arrow-right{
+            cursor: pointer;
+            color: #929CA8;
+            font-size: 16px;
+            padding: 3px;
+        }
+    }
+}
+.list-item{
+    padding: 16px;
+    .item-top{
+        padding: 8px 16px;
+        border-radius: 4px;
+        border: 1px solid rgba(0, 0, 0, 0.08);
+        background: #0081F1;
+        box-shadow: 0px 8px 10px -5px rgba(0, 0, 0, 0.08), 0px 16px 24px 2px rgba(0, 0, 0, 0.04), 0px 6px 30px 5px rgba(0, 0, 0, 0.05);
+        display: flex;
+        justify-content: space-between;
+        h4{
+            color: #FFF;
+            font-size: 16px;
+            font-weight: 400;
+            line-height: 24px;
+            margin: 0;
+            .svg-icon{
+                margin-right: 8px;
+            }
+        }
+        .el-icon-close{
+            font-size: 16px;
+            padding: 4px;
+            cursor: pointer;
+            color: #FFF;
+        }
+    }
+    .item-center{
+        min-height: 300px;
+        padding: 40px 0;
+        position: relative;
+        display: flex;
+        align-items: center;
+        >label{
+            position: absolute;
+            bottom: 0px;
+            left: 50%;
+            margin-left: -27px;
+            padding: 1px 8px;
+            min-width: 54px;
+            border-radius: 2px;
+            background: #F2F3F5;
+            text-align: center;
+        }
+    }
+    .item-bottom{
+        border-top: 1px solid #EBEBEB;
+        padding-top: 40px;
+        .operate-box-inner-content{
+            width: 600px;
+            margin: 0 auto;
+            display: flex;
+            justify-content: space-between;
+        }
+        .operate-item{
+            text-align: center;
+            cursor: pointer;
+            .luyin-btn{
+                display: block;
+                width: 64px;
+                height: 64px;
+                padding: 10px;
+                border-radius: 60px;
+                background: #175DFF;
+                box-shadow: 0px 8px 10px -5px rgba(0, 0, 0, 0.08), 0px 16px 24px 2px rgba(0, 0, 0, 0.04), 0px 6px 30px 5px rgba(0, 0, 0, 0.05);
+            }
+            .luyin-gif{
+               display: block;
+                width: 64px;
+                height: 64px; 
+                border-radius: 60px;
+                box-shadow: 0px 8px 10px -5px rgba(0, 0, 0, 0.08), 0px 16px 24px 2px rgba(0, 0, 0, 0.04), 0px 6px 30px 5px rgba(0, 0, 0, 0.05);
+            }
+            .svg-icon{
+                display: block;
+                width: 44px;
+                height: 44px;
+                margin: 0 auto;
+                padding: 6px;
+            }
+            span{
+                color: #929CA8;
+                font-size: 12px;
+                font-weight: 400;
+                line-height: 20px;
+            }
+        }
+    }
+}
+.item-sent{
+    width: 100%;
+}
+.NNPE-words {
+    float: left;
+    padding: 0;
+    &.noPadding{
+        padding:0;
+    }
+    &.sentActive {
+        background: rgba(24, 144, 255, 0.1);
+    }
+    &.overActive {
+        background: rgba(0, 0, 0, 0.06);
+    }
+    &.textLeft {
+        text-align: left;
+    }
+    &.textCenter {
+        text-align: center;
+    }
+    > span {
+        float: left;
+        cursor: pointer;
+        &.NNPE-chs {
+            //   font-size: 24px;
+            font-family: 'Smartisan';
+            line-height: 150%;
+            color: #000000;
+            padding: 0 3px;
+            &.wordActive {
+            color: #175DFF;
+            }
+            &.marginRight{
+            padding-right: 0;
+            }
+            &.marginLeft{
+            padding-left: 0;
+            }
+            &.marginSingleRight{
+            padding-right: 3px;
+            }
+        }
+        &.padding {
+            padding: 0 3px;
+            cursor: pointer;
+        }
+    }
+}
+</style>

+ 98 - 7
src/views/bookShelf/components/PracticeModel.vue

@@ -46,6 +46,9 @@
                 :getCurTime="getCurTime"
                 ref="audioLine"
                 :mp3Source="'mp3'"
+                type="audioLine"
+                :ed="ed"
+                @emptyEd="emptyEd"
             />
             <svg-icon icon-class="icon-wrapper" class="wrapper"></svg-icon>
         </div>
@@ -57,7 +60,7 @@
           v-for="(item, index) in resArr.wordsList"
           :key="'detail' + index"
         >
-          <a class="history-btn" v-if="resArr.timeList[index] && resArr.timeList[index] && curTime >= resArr.timeList[index].s && curTime <= resArr.timeList[index].e" @click="lookHistory">历史记录</a>
+          <a class="history-btn" v-if="resArr.timeList[index] && resArr.timeList[index] && curTime >= resArr.timeList[index].s && curTime <= resArr.timeList[index].e" @click="lookHistory(index)">历史记录</a>
           <b class="para-index" :style="{fontSize:wordFontsize + 'px',color:resArr.timeList[index] && resArr.timeList[index] && curTime >= resArr.timeList[index].s && curTime <= resArr.timeList[index].e ? colorObj.type==='white'?'#2F3742':colorObj.type==='darkGreen'?'#299772':colorObj.type==='armyGreen'?'#30A47D':'#5373E7':colorObj.type==='white'?'#D0D3D9':colorObj.type==='darkGreen'?'#7A8983':colorObj.type==='armyGreen'?'#6B7C74':'#737781'}">{{index+1}}</b>
           <div class="wordsList-box">
             <div class="nnpe-sentence-box">
@@ -218,17 +221,30 @@
             </el-switch>
         </div>
     </div>
+    <el-dialog
+        :visible.sync="historyFlag"
+        :show-close="false"
+        :close-on-click-modal="false"
+        width="680px"
+        :modal="false"
+        class="login-dialog"
+        v-if="historyFlag">
+        <history-record-list :list="historySentRecordList" :sentData="resArr.wordsList[playSentIndex]" :timeData="resArr.timeList[playSentIndex]" :mp3Url="articleInfo.art_sound_url" @closeHistory="closeHistory" :colorObj="colorObj" :wordFontsize="wordFontsize" @handleChangeTime="handleChangeTime" @returnCurrentTime="returnCurrentTime" :parentCurtimt="curTime" :parentPlay="Playing" v-loading="historyLoading"></history-record-list>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 import AudioLine from "@/components/common/AudioLine.vue"
+import HistoryRecordList from "./HistoryRecordList.vue"
 import Recorder from "js-audio-recorder"; // 录音插件
+import { getLogin } from "@/api/ajax";
 export default {
   name: "ArticleView",
   props: [ "titleFontsize", "wordFontsize", "colorObj","articleType","articleInfo"],
   components: {
     AudioLine,
+    HistoryRecordList
   },
   data() {
     return {
@@ -297,6 +313,11 @@ export default {
       playtime: 0, // 播放时间
       isPlayings: false,
       playSentIndex: -1, // 播放的句子索引
+      historyFlag: false, // 历史记录弹窗
+      historySentRecordList: [], // 单句历史录音list
+      ed: undefined,
+      showEd: false, //是否看ed的值
+      historyLoading: false
     };
   },
   computed: {
@@ -307,6 +328,13 @@ export default {
       }
       return playing;
     },
+    Playing: function () {
+      let playing = false;
+      if (this.$refs.audioLine) {
+        playing = this.$refs.audioLine.audio.playing;
+      }
+      return playing;
+    },
   },
   watch: {},
   //方法集合
@@ -336,6 +364,9 @@ export default {
     getCurTime(curTime) {
       this.curTime = curTime * 1000;  
     },
+    returnCurrentTime(){
+        return this.curTime
+    },
     handleData() {
       let resArr = {
             wordsList: [],
@@ -361,12 +392,24 @@ export default {
         resArr.timeList.push(articleInfo.art_sound_srt_data.sents[index])
       });
       this.resArr = resArr;
+      console.log(this.resArr)
     },
-    handleChangeTime(time) {
-      if (time>=0) {
-        this.curTime = time;
-        this.$refs.audioLine.onTimeupdateTime(time / 1000, true);
+    handleChangeTime(time,ed,flag) {
+      if(flag){
+        this.$refs.audioLine.PlayAudio()
+      }else{
+        if (time>=0) {
+            this.curTime = time;
+            if(ed){
+                this.ed = ed;
+            }
+            this.$refs.audioLine.onTimeupdateTime(time / 1000, true);
+        }
       }
+      
+    },
+    emptyEd() {
+      this.ed = undefined;
     },
     //经过每个词,高亮句子
     handleMouseover(pItem) {
@@ -385,6 +428,10 @@ export default {
     // 开始录音
     microphone() {
       let _this = this;
+      if(_this.$refs.audioLine.audio.playing){
+            _this.$refs.audioLine.PlayAudio()
+            _this.showEd = false
+      }
       if (!this.microphoneStatus) {
         _this.hasMicro = "";
         // _this.$emit("getWavblob", null);
@@ -410,6 +457,12 @@ export default {
         _this.recordFile++;
         _this.selectIndex = _this.recordList.length - 1;
       } else {
+        for(let i=0; i<this.resArr.timeList.length;i++){
+            if(this.curTime>=this.resArr.timeList[i].s&&this.curTime<this.resArr.timeList[i].e){
+                this.playSentIndex = i
+                break
+            }
+        }
         this.hasMicro = "normal";
         this.recorder.stop();
         clearInterval(_this.timer);
@@ -439,6 +492,7 @@ export default {
               this.recordList[this.selectIndex].selectData
             );
           }
+          this.addRecord(reader.result)
         };
       }
       _this.$emit(
@@ -509,9 +563,46 @@ export default {
       return time;
     },
     // 点击历史记录按钮
-    lookHistory(){
-
+    lookHistory(index){
+        this.historyFlag = true
+        this.historyLoading = true
+        if(this.$refs.audioLine.audio.playing){
+            this.$refs.audioLine.PlayAudio()
+        }
+        this.playSentIndex = index
+        let MethodName = "/PaperServer/Client/UserSentRec/RecListInUserSent";
+        let data = {
+            sent_id: this.articleInfo.art_corpus_data.sentList[index].id,
+            got_rec_data_flag: true
+        }
+        getLogin(MethodName, data)
+        .then((res) => {
+            if(res.status===1){
+                this.historySentRecordList = res.data.all
+                this.historyLoading = false
+            }
+        }).catch(()=>{
+            this.historyLoading = false
+        })
+    },
+    closeHistory(){
+        this.historyFlag = false
     },
+    // 保存录音
+    addRecord(wav){
+        if(this.playSentIndex===-1){
+            return
+        }
+        let MethodName = "/PaperServer/Client/UserSentRec/AddUserSentRec";
+        let data = {
+            sent_id: this.articleInfo.art_corpus_data.sentList[this.playSentIndex].id,
+            rec_sound_data: wav
+        }
+        getLogin(MethodName, data)
+        .then((res) => {
+            
+        })
+    }
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {},

+ 106 - 142
src/views/reporter/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="bookShelf">
+  <div class="reporter">
     <Header
       :headerBg="'#1F1F1F'"
       :headerBorder="'#5C5C5C'"
@@ -11,6 +11,15 @@
             <span>{{itemo.label}}</span>
         </li>
     </ul>
+    <div class="waterfall">
+      <vue-waterfall-easy
+        ref="waterfall"
+        :imgsArr="imgsArr"
+        @scrollReachBottom="getData"
+      >
+        <div class="info" slot-scope="props">第{{ props.index + 1 }}张图片</div>
+      </vue-waterfall-easy>
+    </div>
   </div>
 </template>
 
@@ -18,10 +27,10 @@
 //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
 //例如:import 《组件名称》from ‘《组件路径》';
 import Header from "../../components/Header.vue";
-
+import vueWaterfallEasy from "vue-waterfall-easy";
 export default {
   //import引入的组件需要注入到对象中才能使用
-  components: { Header },
+  components: { Header, vueWaterfallEasy },
   props: {},
   data() {
     //这里存放数据
@@ -50,34 +59,14 @@ export default {
         // }
       ],
       typeValue: 0,
-      changeList: [
-        {
-          name: "按购买时间",
-          sort: "down",
-          sortName: "gmsj",
-        },
-        {
-          name: "按名称",
-          sort: "",
-          sortName: "fbsj",
-        },
-        {
-          name: "最近使用",
-          sort: "",
-          sortName: "zjsy",
-        },
-      ],
-      sortField: "gmsj",
-      searchNameValue: '', // 搜索名称值
       loading: false,
-      noMore: false
+      imgsArr: [],
+      page: 0,
     }
   },
   //计算属性 类似于data概念
   computed: {
-    disabled () {
-        return this.loading || this.noMore
-    }
+    
   },
   //监控data中数据变化
   watch: {},
@@ -85,99 +74,97 @@ export default {
   methods: {
     handleClick(value){
         this.typeValue = value
-        $(".list").animate({
-            scrollTop: 0
-        }, 200);
-    },
-    // 搜索查询
-    getSearch(){
-        $(".list").animate({
-            scrollTop: 0
-        }, 200);
-        this.getList()
+        
     },
-    SortEvent(type, name, sortName) {
-      let sort = "";
-      this.changeList.forEach((item) => {
-        if (item.name == name) {
-        //   if (!item.sort || item.sort == "up") {
-        //     item.sort = "down";
-        //     sort = "down";
-        //   } else if (item.sort == "down") {
-        //     item.sort = "up";
-        //     sort = "up";
-        //   }
-            item.sort = type;
-            sort = type;
-        } else {
-          item.sort = "";
+    getData() {
+      var list = [
+        {
+          src:
+            "https://file-kf.helxsoft.cn/CSFileStore/002/00201/D-SZE3JLEDEHCOEYLDKS/F-C0IWU6OZL84WHX1KRY.jpg",
+        },
+        {
+          src:
+            "http://cdn-chenxi.auoktalk.com/invite-share/749dcf7ae3a948ad9b99695800d2493f.jpg",
+        },
+        {
+          src:
+            "http://cdn-chenxi.auoktalk.com/invite-share/7e8f79358274441a85ac397fbd8a2253.jpg",
+        },
+        {
+          src:
+            "http://cdn-chenxi.auoktalk.com/invite-share/a39bca7b3e2446de9607547e7473d0d2.jpg",
+        },
+        {
+          src:
+            "https://file-kf.helxsoft.cn/CSFileStore/002/00201/D-SZE3JLEDEHCOEYLDKS/F-GEW2JO59G9Q2X1YHMF.png",
+        },
+        {
+          src:
+            "https://file-kf.helxsoft.cn/CSFileStore/001/00102/D-U2XDHVDGILVMLTPZI3/F-WEOZPDNMXU8L4YV7RG.png",
+        },
+        {
+          src:
+            "https://file-kf.helxsoft.cn/CSFileStore/002/00201/D-SZE3JLEDEHCOEYLDKS/F-C0IWU6OZL84WHX1KRY.jpg",
+        },
+        {
+          src:
+            "http://cdn-chenxi.auoktalk.com/invite-share/749dcf7ae3a948ad9b99695800d2493f.jpg",
+        },
+        {
+          src:
+            "http://cdn-chenxi.auoktalk.com/invite-share/7e8f79358274441a85ac397fbd8a2253.jpg",
+        },
+        {
+          src:
+            "http://cdn-chenxi.auoktalk.com/invite-share/a39bca7b3e2446de9607547e7473d0d2.jpg",
+        },
+        {
+          src:
+            "https://file-kf.helxsoft.cn/CSFileStore/002/00201/D-SZE3JLEDEHCOEYLDKS/F-GEW2JO59G9Q2X1YHMF.png",
+        },
+        {
+          src:
+            "https://file-kf.helxsoft.cn/CSFileStore/001/00102/D-U2XDHVDGILVMLTPZI3/F-WEOZPDNMXU8L4YV7RG.png",
+        },
+        {
+          src:
+            "https://file-kf.helxsoft.cn/CSFileStore/002/00201/D-SZE3JLEDEHCOEYLDKS/F-C0IWU6OZL84WHX1KRY.jpg",
+        },
+        {
+          src:
+            "http://cdn-chenxi.auoktalk.com/invite-share/749dcf7ae3a948ad9b99695800d2493f.jpg",
+        },
+        {
+          src:
+            "http://cdn-chenxi.auoktalk.com/invite-share/7e8f79358274441a85ac397fbd8a2253.jpg",
+        },
+        {
+          src:
+            "http://cdn-chenxi.auoktalk.com/invite-share/a39bca7b3e2446de9607547e7473d0d2.jpg",
+        },
+        {
+          src:
+            "https://file-kf.helxsoft.cn/CSFileStore/002/00201/D-SZE3JLEDEHCOEYLDKS/F-GEW2JO59G9Q2X1YHMF.png",
+        },
+        {
+          src:
+            "https://file-kf.helxsoft.cn/CSFileStore/001/00102/D-U2XDHVDGILVMLTPZI3/F-WEOZPDNMXU8L4YV7RG.png",
         }
-      });
-      if (sort == "down") {
-        this.sortType = 1;
+      ];
+      this.page += 1;
+      if (this.page == 6) {
+        this.$refs.waterfall.waterfallOver();
       } else {
-        this.sortType = 0;
-      }
-      this.sortField = sortName;
-      $(".list").animate({
-        scrollTop: 0
-      }, 200);
-      this.getList()
-    },
-    // 查询列表
-    getList(){
-        let arr = [{
-        src: require('../../assets/bookcard-image.png'),
-        name: "名称名称名称名称名称名称名称名称名称名称名称名称",
-        date: "2012-03-15",
-      },
-      {
-        src: require('../../assets/bookcard-image.png'),
-        name: "练习册练习册",
-        typeName: '初三提高级'
-      },
-      {
-        src: require('../../assets/bookcard-image.png'),
-        name: "课程课程",
-        classperiod: '45节'
-      },
-      {
-        src: require('../../assets/bookcard-image.png'),
-        name: "名称名称名称名称名称名称名称名称名称名称名称名称",
-        date: "2012-03-15",
-      },
-      {
-        src: require('../../assets/bookcard-image.png'),
-        name: "名称名称名称名称名称名称名称名称名称名称名称名称",
-        date: "2012-03-15",
-      },
-      {
-        src: require('../../assets/bookcard-image.png'),
-        name: "名称名称名称名称名称名称名称名称名称名称名称名称",
-        date: "2012-03-15",
+        this.imgsArr = this.imgsArr.concat(list);
       }
-      ]
-        if(this.BookList.length<100){
-            this.BookList = this.BookList.concat(arr)
-        }else{
-            this.noMore = true
-        }
     },
-    load () {
-      this.loading = true
-      setTimeout(() => {
-        this.getList()
-        this.loading = false
-      }, 2000)
-    }
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
-
   },
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
-
+    this.getData();
   },
   //生命周期-创建之前
   beforeCreated() { },
@@ -197,7 +184,7 @@ export default {
 </script>
 <style lang="scss" scoped>
 /* @import url(); 引入css类 */
-.bookShelf {
+.reporter {
   background: #F7F8FA;
   height: calc(100vh - 64px);
   .option{
@@ -343,39 +330,16 @@ export default {
         }
     }
   }
-  
-}
-</style>
-<style lang="scss">
-.bookShelf{
-    .searchChangebox{
-        .input-search{
-            .el-input__inner{
-                height: 32px;
-                color: #1D2129;
-                background: #F2F3F5;
-                border: none;
-                line-height: 32px;
-            }
-            .el-input-group__append{
-                border: none;
-                width: 32px;
-                height: 32px;
-                background: #165DFF;
-                text-align: center;
-                cursor: pointer;
-                &:hover{
-                    background: #4080FF;
-                }
-                &:focus{
-                    background: #0E42D2;
-                }
-            }
-            .el-button{
-                padding: 0;
-                color: #ffffff;
-            }
-        }
+  .waterfall {
+    position: absolute;
+  top: 116px;
+  bottom: 0;
+  left: 0;
+  width: 100%;
+    }
+
+    .info {
+    text-align: center;
     }
 }
 </style>