소스 검색

:bug: 完善代码

zhanghe 6 년 전
부모
커밋
bca8e33190

+ 7 - 12
src/stage/index/scene/AudioWareFullScreenScene.js

@@ -16,14 +16,6 @@ class AudioWareFullScreenScene extends scene {
     audioPlayControl(eventId) {
         let targetAudio = document.getElementById('courseware-audio');
         if (!targetAudio) { return; }
-        const changeContent = () => {
-            // 更换图片
-            let imgDom = document.getElementById('img-wrapper');
-            let curAudio = this.curAudioList[this.curAudioIndex];
-            const { bgUrl, playUrl } = curAudio;
-            let newImg = `<img src="${Consts.IMG_PATH}/${bgUrl}" />`
-            imgDom.innerHTML = newImg;
-        }
         switch (eventId) {
             case 'audio-play':
                 let playBtn = document.querySelector('#audio-play');
@@ -49,12 +41,16 @@ class AudioWareFullScreenScene extends scene {
                 if (this.curAudioIndex < this.curAudioList.length -1) {
                     this.curAudioIndex += 1;
                     this.renderAudioView();
+                } else {
+                    this.keyRightHandler();
                 }
                 break;
             case 'audio-last':
                 if (this.curAudioIndex > 0) {
                     this.curAudioIndex -= 1;
                     this.renderAudioView();
+                } else {
+                    this.keyLeftHandler();
                 }
                 break;
             default:
@@ -229,18 +225,17 @@ class AudioWareFullScreenScene extends scene {
 	}
 
 	onKeydown(e) {
+        let curFocusedLeaf = FocusEngine.getFocusedLeaf();
 		switch (e.keyCode) {
 			//左键
 			case 37:
-                // 如当前光标在控制按钮上,阻止向左
-                if (!FocusEngine.getFocusedLeaf().id.startsWith('audio')) {
+                if (!curFocusedLeaf.id.startsWith('audio')) {
                     this.keyLeftHandler();
                 }
 				break;
 			//右键
 			case 39:
-                // 如当前光标在控制按钮上,阻止向右
-                if (!FocusEngine.getFocusedLeaf().id.startsWith('audio')) {
+                if (!curFocusedLeaf.id.startsWith('audio')) {
                     this.keyRightHandler();
                 }
 				break;

+ 1 - 1
src/stage/index/scene/ImageWareFullScreenScene.js

@@ -32,7 +32,7 @@ class ImageWareFullScreenScene extends scene {
 					curWareIndex: this.curWareIndex,
 				});
             //下一个或前一个课件是音频课件
-			} else if (this.curWareType === Consts.TYPE_AUDIO) {
+			} else if (this.curWareType === Consts.TYPE_AUDIOBOOK) {
                 let imgList = this.wareList[this.curWareIndex].list;
                 let imgIndex = 0;
                 if (type === 'BACK' && imgList.length) {

+ 5 - 1
src/stage/index/scene/LessonScene.js

@@ -301,12 +301,16 @@ class LessonScene extends scene {
     			if (list && list.length >= 1) {
     				playUrl = list[0].url;
     			}
+                let playText = '播放';
+                if (this.videoPlayer && this.videoPlayer.playStatus()) {
+                    playText = '暂停';
+                }
     			let videoViewDom =
                 `
                   <div id="view-full-screen" fe-role="Widget" class="view-full-screen-video">
                   </div>
                   <div id="view-video-start" fe-role="Widget">
-                    <div class="transparent-btn">${this.videoPlayer.playStatus() ? "暂停" : "播放"}</div>
+                    <div class="transparent-btn">${playText}</div>
                   </div>
                 `;
     			document.getElementById('view-bottom').innerHTML = videoViewDom;

+ 1 - 1
src/stage/index/scene/VideoWareFullScreenScene.js

@@ -47,7 +47,7 @@ class VideoWareFullScreenScene extends scene {
                     curImageList: imgList,
                     curImageIndex: imgIndex,
                 });
-            } else if (this.curWareType === Consts.TYPE_AUDIO) {
+            } else if (this.curWareType === Consts.TYPE_AUDIOBOOK) {
                 //进入到音频全屏场景
                 let imgList = curWareItem.list;
                 let imgIndex = 0;