3
0

62 Commits d915a801d5 ... c586e121d8

Autor SHA1 Nachricht Datum
  zhanghe c586e121d8 init kid-winapp vor 6 Jahren
  sophieChenyx 90dc4870fa 测试jenkins vor 6 Jahren
  sophieChenyx b3ebadb0eb 调整下载页面的样式 vor 6 Jahren
  sophieChenyx ea7774047a 修改师训滚动条设置 vor 6 Jahren
  sophieChenyx c87edc1d28 修改scroll显示 vor 6 Jahren
  sophieChenyx dc245bed86 修改scroll滚动条 vor 6 Jahren
  sophieChenyx ea48ccdbcf 修改scroll滚动条 vor 6 Jahren
  sophieChenyx 51f693d3d4 上线前的修改合并 vor 6 Jahren
  sophieChenyx 3fd9c341c8 修改终端样式 vor 6 Jahren
  sophieChenyx 4b09cb5404 修改UI样式,文案提示,下载失败提醒 vor 6 Jahren
  sophieChenyx 39f3c8cc23 修改下载页面内容滚轮 vor 6 Jahren
  sophieChenyx 4c8b02d07b 增加时间戳到请求头 vor 6 Jahren
  sophieChenyx abd046f920 下载页面更新时间状态,进度状态 弹出框增加进度状态 vor 6 Jahren
  sophieChenyx dbf8251c8d 下载中添加提示框 vor 6 Jahren
  sophieChenyx abb72fee3a 增加mac地址验证 vor 6 Jahren
  sophieChenyx 521e5e8242 增加mac认证地址 vor 6 Jahren
  sophieChenyx 85643858ec 修改冗余代码 vor 6 Jahren
  sophieChenyx 1e1e6b2c9a 弹窗修改 vor 6 Jahren
  sophieChenyx 6144471c3e 添加点击提示框 增加返回字段 vor 6 Jahren
  sophieChenyx 64aa00274c 修改dev_winpc基本分支 vor 6 Jahren
  sophieChenyx 016106d538 增加正在下载提示框 vor 6 Jahren
  zhanghe 92d36bdbf9 Merge branch 'dev_audio' into dev_winpc_touch vor 6 Jahren
  zhanghe d0557a4631 支持本地下载及播放功能 vor 6 Jahren
  zhanghe 3ff887b4fe 右侧面板宽度调整 vor 6 Jahren
  zhanghe ef51c91513 导航栏位置调整 vor 6 Jahren
  zhanghe b93fa23200 首页版权信息内容修改 vor 6 Jahren
  zhanghe 137b7737c8 ckplayer close debug mode vor 6 Jahren
  zhanghe 3f116af720 首页样式调整 vor 6 Jahren
  zhanghe ce65a31a76 Merge branch 'dev_winpc_touch' of http://gogs.efunbox.cn:3000/Rankin/2BTV-Web into dev_winpc_touch vor 6 Jahren
  zhanghe 7e98ab3f2a 调整视频与图片的全屏播放逻辑 vor 6 Jahren
  zhanghe 9473bf2bf5 接入ckplayer播放器 vor 6 Jahren
  sophieChenyx 7fd3b0b5a7 TerminalScene.tpl 增加返回按钮 vor 6 Jahren
  zhanghe 052aee87e8 Merge branch 'dev_base' into dev_winpc_touch vor 6 Jahren
  zhanghe 262aa738bc 样式调整 vor 6 Jahren
  zhanghe af97c47b9e Revert "Merge branch 'dev_layout_adjust' into dev_winpc_touch" vor 6 Jahren
  zhanghe 4dba77078c 去掉未引用的插件 vor 6 Jahren
  sophieChenyx b264f7838d 修改 触摸反馈 vor 6 Jahren
  sophieChenyx e614e1a651 修改 触摸反馈 vor 6 Jahren
  sophieChenyx 80cf60790c unless commit vor 6 Jahren
  sophieChenyx a49188bf2b unless commit vor 6 Jahren
  sophieChenyx 18533a8d7a unless modyfy vor 6 Jahren
  zhanghe 1713e45458 :bug: webview默认字体影响rem大小导致页面布局错乱问题 vor 6 Jahren
  zhanghe 33c5c62528 :art: 标签组改为标签类型 vor 6 Jahren
  zhanghe c3ec59b7f5 :bug: 修复无数据显示正在突击图片闪屏问题 vor 6 Jahren
  zhanghe ca0f420d0d :bug: fix cousescene dont show cart number vor 6 Jahren
  zhanghe 68e547ea6b :bug: 修复课程场景名称错误问题 vor 6 Jahren
  zhanghe 891227b7c2 :bug: 修复全屏图片展现问题 vor 6 Jahren
  zhanghe e51f3945ed :bug: fix ImageFullScreenScene.js vor 6 Jahren
  zhanghe 73f3c1a911 :bug: rewrite `startsWith`、`endsWith` methods vor 6 Jahren
  zhanghe f8239ee4d9 :bug: 图片路径错误问题 vor 6 Jahren
  zhanghe eb403f35e1 :bug: fix picture resource repository vor 6 Jahren
  zhanghe 53f9ed2b17 :bug: fix bug vor 6 Jahren
  zhanghe 446f69ccec :art: call method: Utils.videoUrlFormat vor 6 Jahren
  zhanghe be258fab46 :art: http -> https vor 6 Jahren
  zhanghe 67b0ee6284 :bug: 修改重复登录提醒资源图片路径错误 vor 6 Jahren
  zhanghe 395b10373e :bug: fix bug vor 6 Jahren
  zhanghe e77845bc87 :bug: add api.json vor 6 Jahren
  zhanghe 88477ff871 :bug: add package.json vor 6 Jahren
  zhanghe 6117194a39 :zap: 优化下载页按钮样式 vor 6 Jahren
  zhanghe 01a3110fa2 :lipstick: 未购买课程的第一课增加免费标识 vor 6 Jahren
  zhanghe 4c9467d719 :bug: fixbugs vor 6 Jahren
  zhanghe 4b42709ce0 :tada: 项目搭建 vor 6 Jahren
46 geänderte Dateien mit 813 neuen und 1096 gelöschten Zeilen
  1. 0 1
      .gitignore
  2. 0 24
      src/component/TrainingItem.js
  3. 1 1
      src/res/tpl/CourseScene.tpl
  4. 11 12
      src/res/tpl/DownloadScene.tpl
  5. 8 0
      src/res/tpl/DownloadTipScene.tpl
  6. 2 2
      src/res/tpl/LoginScene.tpl
  7. 0 3
      src/res/tpl/TrainingScene.tpl
  8. 1 1
      src/res/values/api.json
  9. BIN
      src/stage/index/assets/img/CourseScene/download_btn_list_failed.png
  10. BIN
      src/stage/index/assets/img/DownloadScene/download_del_disable_btn.png
  11. BIN
      src/stage/index/assets/img/IndexScene/background.jpg
  12. BIN
      src/stage/index/assets/img/IndexScene/background.png
  13. BIN
      src/stage/index/assets/img/IndexScene/index_bg.png
  14. BIN
      src/stage/index/assets/img/IndexScene/logo.png
  15. BIN
      src/stage/index/assets/img/building.png
  16. BIN
      src/stage/index/assets/img/new.png
  17. 2 2
      src/stage/index/index.html
  18. 1 1
      src/stage/index/index.less
  19. 132 113
      src/stage/index/scene/AudioWareFullScreenScene.js
  20. 29 11
      src/stage/index/scene/CourseScene.js
  21. 1 1
      src/stage/index/scene/DataBuildingScene.js
  22. 15 10
      src/stage/index/scene/DelConfirmScene.js
  23. 18 17
      src/stage/index/scene/DownloadManagerScene.js
  24. 59 0
      src/stage/index/scene/DownloadTipScene.js
  25. 12 12
      src/stage/index/scene/ImageWareFullScreenScene.js
  26. 8 5
      src/stage/index/scene/IndexScene.js
  27. 234 520
      src/stage/index/scene/LessonScene.js
  28. 74 76
      src/stage/index/scene/LoginScene.js
  29. 0 2
      src/stage/index/scene/RepeatLoginScene.js
  30. 0 113
      src/stage/index/scene/TrainingScene.js
  31. 1 1
      src/stage/index/style/AudioWareFullScreen.less
  32. 4 15
      src/stage/index/style/CLScene.less
  33. 9 0
      src/stage/index/style/CourseScene.less
  34. 38 42
      src/stage/index/style/DownloadScene.less
  35. 74 0
      src/stage/index/style/DownloadTipScene.less
  36. 3 3
      src/stage/index/style/IndexScene.less
  37. 1 1
      src/stage/index/style/LessonScene.less
  38. 1 8
      src/stage/index/style/LoginScene.less
  39. 0 11
      src/stage/index/style/TrainingScene.less
  40. 0 50
      src/stage/index/style/component/TrainingItem.less
  41. 5 4
      src/util/API/AJAXHelper.js
  42. 50 14
      src/util/API/APIClient.js
  43. 3 3
      src/util/Consts.js
  44. 0 7
      src/util/EfunVideoPlayer.js
  45. 14 9
      src/util/WinBoxAPI.js
  46. 2 1
      src/util/course.js

+ 0 - 1
.gitignore

@@ -22,4 +22,3 @@ src/models/*
 *.jade
 **/pug
 *.tar
-*.iml

+ 0 - 24
src/component/TrainingItem.js

@@ -1,24 +0,0 @@
-class TrainingItem {
-	constructor () {}
-
-	static createElement(data){
-		let d = document.createElement('div');
-		d.innerHTML = Training.createHTMLString(data);
-		return d.childNodes[0];
-	}
-
-	static createHTMLString(data){
-		return `
-            <div class="training-item-frame">
-                <img src="${data.img}" alt="" />
-                <div class="training-new" style="display:${data.isNew ? 'block' : 'none'};"></div>
-                <div class="training-desc">
-                    <p class="subject">${data.subject}</p>
-                    <p class="subject-sub">${data.subjectSub}</p>
-                </div>
-            </div>
-        `;
-	}
-}
-
-module.exports = TrainingItem;

+ 1 - 1
src/res/tpl/CourseScene.tpl

@@ -5,7 +5,7 @@
 	<div class="header">
 		<div class="course-name" id="course-name"></div>
 		<div class="nav" fe-role="Switch" id="course-nav">
-			<div fe-role="Widget" id="course-tab-list" class="nav-item list"></div>
+			<div fe-role="Widget" id="course-tab-list" class="nav-item list selected"></div>
 			<div fe-role="Widget" id="course-tab-detail" class="nav-item detail"></div>
 			<div fe-role="Widget" id="course-tab-periphery" class="nav-item periphery"></div>
 			<div fe-role="Widget" id="course-tab-collect" class="nav-item collect"></div>

+ 11 - 12
src/res/tpl/DownloadScene.tpl

@@ -12,11 +12,11 @@
 					<div class="one right-border">下载日期</div>
 					<div class="two right-border">课程名称</div>
 					<div class="three right-border">课名称</div>
-					<div class="four right-border">容量</div>
-					<div class="five right-border">下载状态</div>
-					<div class="six">操作</div>
+					<div class="four right-border">下载状态</div>
+					<div class="five">操作</div>
 	    		</div>
 			</div>
+
 			<div class="horizon-line first-line"></div>
 			<div class="horizon-line"></div>
 			<div class="horizon-line"></div>
@@ -27,53 +27,54 @@
 			<div class="horizon-line"></div>
 			<div class="horizon-line"></div>
     	</div>
+
+
 		<div class="back-row">
 			<div class="one"></div>
 			<div class="two"></div>
 			<div class="three"></div>
 			<div class="four"></div>
 			<div class="five"></div>
-			<div class="six"></div>
     	</div>
+
 		<div class="back-row">
 			<div class="one"></div>
 			<div class="two"></div>
 			<div class="three"></div>
 			<div class="four"></div>
 			<div class="five"></div>
-			<div class="six"></div>
 	    </div>
+
 		<div class="back-row">
 			<div class="one"></div>
 			<div class="two"></div>
 			<div class="three"></div>
 			<div class="four"></div>
 			<div class="five"></div>
-			<div class="six"></div>
 	    </div>
+
 		<div class="back-row">
 			<div class="one"></div>
 			<div class="two"></div>
 			<div class="three"></div>
 			<div class="four"></div>
 			<div class="five"></div>
-			<div class="six"></div>
 		</div>
+
 		<div class="back-row">
 			<div class="one"></div>
 			<div class="two"></div>
 			<div class="three"></div>
 			<div class="four"></div>
 			<div class="five"></div>
-			<div class="six"></div>
 	  	</div>
+
 		<div class="back-row">
 			<div class="one"></div>
 			<div class="two"></div>
 			<div class="three"></div>
 			<div class="four"></div>
 			<div class="five"></div>
-			<div class="six"></div>
     	</div>
 		<div class="back-row">
 			<div class="one"></div>
@@ -81,7 +82,6 @@
 			<div class="three"></div>
 			<div class="four"></div>
 			<div class="five"></div>
-			<div class="six"></div>
     	</div>
 		<div class="back-row">
 			<div class="one"></div>
@@ -89,7 +89,6 @@
 			<div class="three"></div>
 			<div class="four"></div>
 			<div class="five"></div>
-			<div class="six"></div>
 	  	</div>
 		<div class="back-row">
 			<div class="one"></div>
@@ -97,8 +96,8 @@
 			<div class="three"></div>
 			<div class="four"></div>
 			<div class="five"></div>
-			<div class="six"></div>
     	</div>
+
     	<div fe-role="Scroll" fe-cfg="scroll_dir:v,scroll_center:con,scroll_duration:0.2,scroll_easing:linear" class="content-wrapper" >
 			<div class="scroll-list scroll-lines-wrapper clearfix" id="download-status-table-wrapper"></div>
 		</div>

+ 8 - 0
src/res/tpl/DownloadTipScene.tpl

@@ -0,0 +1,8 @@
+<div id="DownloadTipScene" class="course-download-wrapper" fe-role="Switch">
+    <div class="toast">
+        <img src="./../../stage/index/assets/img/CourseScene/download_btn_list_undownload.png" alt="">
+        <p>已下载<span id="downloadProcess"></span>个文件</p>
+        <p>请等待下载结束</p>
+        <div class="ok-btn" fe-role="Widget" id="ok-btn">确认</div>
+    </div>
+</div>

+ 2 - 2
src/res/tpl/LoginScene.tpl

@@ -5,7 +5,7 @@
 
 		<div class="form-sid">
 			<div class="form-sid-label">
-				学&nbsp;&nbsp;号
+				学&nbsp;&nbsp;号:
 			</div>
 			<div class="form-sid-input">
 				<input id="sid-input" class="form-item" name="sid" type="text" readonly fe-role="Widget"/>
@@ -14,7 +14,7 @@
 
 		<div class="form-password">
 			<div class="form-password-label">
-				密&nbsp;&nbsp;码
+				密&nbsp;&nbsp;码:
 			</div>
 			<div class="form-password-input">
 				<input id="password-input" class="form-item" name="password" type="text" readonly fe-role="Widget"/>

+ 0 - 3
src/res/tpl/TrainingScene.tpl

@@ -1,3 +0,0 @@
-<div id="TrainingScene" fe-role="Switch">
-  <img id="trainingImg" src="./assets/img/default_bg.jpg" />
-</div>

+ 1 - 1
src/res/values/api.json

@@ -1,4 +1,4 @@
 {
-    "api_url": "https://kid-winapp.lingjiao.cn",
+    "api_url": "http://kid-app.lingjiao.cn",
     "api_url_test": "http://tt-web.api.ai160.com"
 }

BIN
src/stage/index/assets/img/CourseScene/download_btn_list_failed.png


BIN
src/stage/index/assets/img/DownloadScene/download_del_disable_btn.png


BIN
src/stage/index/assets/img/IndexScene/background.jpg


BIN
src/stage/index/assets/img/IndexScene/background.png


BIN
src/stage/index/assets/img/IndexScene/index_bg.png


BIN
src/stage/index/assets/img/IndexScene/logo.png


BIN
src/stage/index/assets/img/building.png


BIN
src/stage/index/assets/img/new.png


+ 2 - 2
src/stage/index/index.html

@@ -58,7 +58,7 @@
 	<script src="../../lib/js/ckplayer/hls.min.js"></script>
 	<script src="../../lib/js/ckplayer/ckplayer.js"></script>
 	<script>
-		var ts = '201806211727';
+		var ts = '201807251125';
 
 		var appCss = document.createElement('link');
 		appCss.rel = 'stylesheet';
@@ -66,7 +66,7 @@
 		document.head.appendChild(appCss);
 
 		var appScript = document.createElement('script');
-		appScript.src = './index.min.js?t=' + ts;
+		appScript.src = './index.js?t=' + ts;
 		document.body.appendChild(appScript);
 	</script>
 	<script>

+ 1 - 1
src/stage/index/index.less

@@ -17,8 +17,8 @@ body {
 @import './style/LoginScene.less';
 @import './style/IndexScene.less';
 @import './style/TerminalScene.less';
-@import './style/TrainingScene.less';
 @import './style/DownloadScene.less';
+@import './style/DownloadTipScene.less';
 @import './style/RepeatLoginScene.less';
 @import './style/BuyConfirmScene.less';
 @import './style/DelConfirmScene.less';

+ 132 - 113
src/stage/index/scene/AudioWareFullScreenScene.js

@@ -1,8 +1,15 @@
 import Consts from '../../../util/Consts';
 
+function getLocalResourceUrl(absoluteUrl) {
+  if (!absoluteUrl) return;
+  const segments = absoluteUrl.split('/') || [];
+  return `${Consts.NODE_SERVER}/lesson/readFile?n=${segments.slice(3).join('*')}`;
+}
+
 class AudioWareFullScreenScene extends scene {
 	constructor(scope) {
 		super(scope);
+		this.isDownload = false;
 		this.wareList = [];
 		this.curWareIndex = 0;
 		this.curWareType = null;
@@ -10,103 +17,110 @@ class AudioWareFullScreenScene extends scene {
 		this.curAudioIndex = 0;
 	}
 
-    /**
-     * 音频播放控制
-     */
-    audioPlayControl(eventId) {
-        let targetAudio = document.getElementById('courseware-audio');
-        if (!targetAudio) { return; }
-        switch (eventId) {
-            case 'audio-play':
-                let playBtn = document.querySelector('#audio-play');
-                if (targetAudio.paused) {
-                    targetAudio.play();
-                    playBtn.classList.remove('paused');
-                } else {
-                    targetAudio.pause();
-                    playBtn.classList.add('paused');
-                }
-                break;
-            case 'audio-mute':
-                let muteBtn = document.querySelector('#audio-mute');
-                if (targetAudio.muted) {
-                    targetAudio.muted = false;
-                    muteBtn.classList.remove('muted');
-                } else {
-                    targetAudio.muted = true;
-                    muteBtn.classList.add('muted');
-                }
-                break;
-            case 'audio-next':
-                if (this.curAudioIndex < this.curAudioList.length -1) {
-                    this.curAudioIndex += 1;
-                    this.renderAudioView('audio-next');
-                } else {
-                    this.keyRightHandler();
-                }
-                break;
-            case 'audio-last':
-                if (this.curAudioIndex > 0) {
-                    this.curAudioIndex -= 1;
-                    this.renderAudioView('audio-last');
-                } else {
-                    this.keyLeftHandler();
-                }
-                break;
-            default:
-                break;
-        }
-    }
-
-    /**
-     * 音频渲染
-     */
-	renderAudioView(focusTarget) {
-        const curAudio = this.curAudioList[this.curAudioIndex];
-        const { type, img, audio } = curAudio;
-        let imgPath = (img || {}).path || '';
-        let audioUrl = (audio || {}).url || '';
-        let content = document.getElementById('AudioWareFullScreen');
-        // 1.更换背景图片
-        let imgHTML = `<img src="${Consts.IMG_PATH}/${imgPath}" />`;
-        content.innerHTML = imgHTML;
-        // 2.根据是否有无audioURL来控制面板及audio的展现
-        if (type === Consts.TYPE_AUDIOBOOK && audioUrl) {
-            let audioElement = document.createElement('audio');
-            audioElement.setAttribute('id', 'courseware-audio');
-            audioElement.setAttribute('src', audioUrl);
-            audioElement.setAttribute('autoplay', 'autoplay');
-            let controlsElement = document.createElement('div');
-            controlsElement.setAttribute('autoplay', 'autoplay');
-            controlsElement.setAttribute('class', 'audio-controls');
-            let controlsBtns = `
-                <!-- 播放/暂停 -->
-                <div id="audio-play" class="audio-controls-item btn-play" fe-role="Widget"></div>
-                <!-- 有声/静音 -->
-                <div id="audio-mute" class="audio-controls-item btn-mute" fe-role="Widget"></div>
-                <!-- 下一个音频 -->
-                <div id="audio-next" class="audio-controls-item btn-next" fe-role="Widget"></div>
-                <!-- 上一个音频 -->
-                <div id="audio-last" class="audio-controls-item btn-last" fe-role="Widget"></div>
-            `;
-            controlsElement.innerHTML = controlsBtns;
-            content.appendChild(audioElement);
-            content.appendChild(controlsElement);
-            this.moye.root.reRender();
-            // 监听onended事件
-            let audioDom = document.getElementById('courseware-audio');
-            if (audioDom) {
-                audioDom.addEventListener('ended', function () {
-                    TVUtil.Toast.show('播放结束', 1500);
-                    document.getElementById('audio-play').classList.add('paused');
-                    audioDom.currentTime = 0;
-                }, false);
+  /**
+   * 音频播放控制
+   */
+  audioPlayControl(eventId) {
+    let targetAudio = document.getElementById('courseware-audio');
+    if (!targetAudio) { return; }
+    switch (eventId) {
+        case 'audio-play':
+            let playBtn = document.querySelector('#audio-play');
+            if (targetAudio.paused) {
+                targetAudio.play();
+                playBtn.classList.remove('paused');
+            } else {
+                targetAudio.pause();
+                playBtn.classList.add('paused');
             }
-            // 指定光标位置
-            if (focusTarget && this.moye.root.getWidgetById(focusTarget)) {
-                this.moye.root.getWidgetById(focusTarget).focus();
+            break;
+        case 'audio-mute':
+            let muteBtn = document.querySelector('#audio-mute');
+            if (targetAudio.muted) {
+                targetAudio.muted = false;
+                muteBtn.classList.remove('muted');
+            } else {
+                targetAudio.muted = true;
+                muteBtn.classList.add('muted');
             }
-        }
+            break;
+        case 'audio-next':
+            if (this.curAudioIndex < this.curAudioList.length -1) {
+                this.curAudioIndex += 1;
+                this.renderAudioView('audio-next');
+            } else {
+                this.keyRightHandler();
+            }
+            break;
+        case 'audio-last':
+            if (this.curAudioIndex > 0) {
+                this.curAudioIndex -= 1;
+                this.renderAudioView('audio-last');
+            } else {
+                this.keyLeftHandler();
+            }
+            break;
+        default:
+            break;
+      }
+  }
+
+  /**
+   * 音频渲染
+   */
+	renderAudioView(focusTarget) {
+    const curAudio = this.curAudioList[this.curAudioIndex];
+    const { type, img, audio } = curAudio;
+    let imgPath = (img || {}).path || '';
+    let audioUrl = (audio || {}).url || '';
+    let content = document.getElementById('AudioWareFullScreen');
+    // 1.更换背景图片
+    let imgUrl = `${Consts.IMG_PATH}/${imgPath}`;
+		let imgHTML = `<img src="${imgUrl}" />`;
+		if (this.isDownload) {
+    	imgHTML = `<img src="${getLocalResourceUrl(imgUrl)}" />`;
+		}
+    content.innerHTML = imgHTML;
+    // 2.根据是否有无audioURL来控制面板及audio的展现
+    if (type === Consts.TYPE_AUDIOBOOK && audioUrl) {
+      if (this.isDownload) {
+        audioUrl = getLocalResourceUrl(audioUrl)
+      }
+      let audioElement = document.createElement('audio');
+      audioElement.setAttribute('id', 'courseware-audio');
+      audioElement.setAttribute('src', audioUrl);
+      audioElement.setAttribute('autoplay', 'autoplay');
+      let controlsElement = document.createElement('div');
+      controlsElement.setAttribute('autoplay', 'autoplay');
+      controlsElement.setAttribute('class', 'audio-controls');
+      let controlsBtns = `
+          <!-- 播放/暂停 -->
+          <div id="audio-play" class="audio-controls-item btn-play" fe-role="Widget"></div>
+          <!-- 有声/静音 -->
+          <div id="audio-mute" class="audio-controls-item btn-mute" fe-role="Widget"></div>
+          <!-- 下一个音频 -->
+          <div id="audio-next" class="audio-controls-item btn-next" fe-role="Widget"></div>
+          <!-- 上一个音频 -->
+          <div id="audio-last" class="audio-controls-item btn-last" fe-role="Widget"></div>
+      `;
+      controlsElement.innerHTML = controlsBtns;
+      content.appendChild(audioElement);
+      content.appendChild(controlsElement);
+      this.moye.root.reRender();
+      // 监听onended事件
+      let audioDom = document.getElementById('courseware-audio');
+      if (audioDom) {
+        audioDom.addEventListener('ended', function () {
+        TVUtil.Toast.show('播放结束', 1500);
+        document.getElementById('audio-play').classList.add('paused');
+        audioDom.currentTime = 0;
+        }, false);
+      }
+      // 指定光标位置
+      if (focusTarget && this.moye.root.getWidgetById(focusTarget)) {
+        this.moye.root.getWidgetById(focusTarget).focus();
+      }
+    }
 	}
 
 	dynamicChangeWare(wareIndex, type) {
@@ -157,27 +171,31 @@ class AudioWareFullScreenScene extends scene {
 		const hasNextWare = this.curWareIndex < this.wareList.length - 1 ? true : false;
 		//当前图片是该图片课件最后一张图片,且后边还有课件则切换课件
 		if (this.curAudioIndex === this.curAudioList.length - 1 && hasNextWare) {
-			const nextWareIndex = this.curWareIndex + 1;
-			this.dynamicChangeWare(nextWareIndex, 'NEXT')
+			return;
+			// const nextWareIndex = this.curWareIndex + 1;
+			// this.dynamicChangeWare(nextWareIndex, 'NEXT')
 		//当前图片是该图片课件最后一张图片,且后边没有课件,给出提示
 		} else if (this.curAudioIndex === this.curAudioList.length - 1 && !hasNextWare) {
-			TVUtil.Toast.show('已经是最后一个课件了', 2000);
+			return;
+			// TVUtil.Toast.show('已经是最后一个课件了', 2000);
 		//当前图片不是该图片课件的最后一张图片
-    	} else {
+    } else {
 			this.curAudioIndex += 1;
 			this.renderAudioView();
-    	}
+    }
 	}
 
 	keyLeftHandler() {
 		const hasPreviousWare = this.curWareIndex === 0 ? false : true;
 		//当前图片是该图片课件的第一张图片,且前边还有课件
-	    if (this.curAudioIndex == 0 && hasPreviousWare) {
-			const previousWareIndex = this.curWareIndex - 1;
-			this.dynamicChangeWare(previousWareIndex, 'BACK');
+	  if (this.curAudioIndex == 0 && hasPreviousWare) {
+			return;
+			// const previousWareIndex = this.curWareIndex - 1;
+			// this.dynamicChangeWare(previousWareIndex, 'BACK');
 		//当前图片是该图片课件的第一张图片,且前边没有课件,则给出提示
 		} else if (this.curAudioIndex === 0 && !hasPreviousWare) {
-			TVUtil.Toast.show('已经是第一个课件了', 2000);
+			return;
+			// TVUtil.Toast.show('已经是第一个课件了', 2000);
 		//当前图片不是该图片课件的第一张图片
 		} else {
 			this.curAudioIndex -= 1;
@@ -188,11 +206,12 @@ class AudioWareFullScreenScene extends scene {
 	onCreate(data) {
 	    this.wareList = data.wareList;
 	    this.curWareIndex = data.curWareIndex;
+			this.isDownload = data.isDownload;
 	    if (data.curAudioList) {
-			this.curAudioList = data.curAudioList;
+				this.curAudioList = data.curAudioList;
 	    }
 	    if (data.curAudioIndex) {
-			this.curAudioIndex = data.curAudioIndex;
+				this.curAudioIndex = data.curAudioIndex;
 	    }
 	    this.curWareType = this.wareList[this.curWareIndex].type;
 		this.setContentView(require('../../../res/tpl/AudioWareFullScreen.tpl'), {}, 'AudioWareFullScreen', {}, () => {
@@ -238,19 +257,19 @@ class AudioWareFullScreenScene extends scene {
 	}
 
 	onKeydown(e) {
-        let curFocusedLeaf = FocusEngine.getFocusedLeaf();
+    let curFocusedLeaf = FocusEngine.getFocusedLeaf();
 		switch (e.keyCode) {
 			//左键
 			case 37:
-                if (!curFocusedLeaf || !curFocusedLeaf.id.startsWith('audio')) {
-                    this.keyLeftHandler();
-                }
+        if (!curFocusedLeaf || !curFocusedLeaf.id.startsWith('audio')) {
+          this.keyLeftHandler();
+        }
 				break;
 			//右键
 			case 39:
-                if (!curFocusedLeaf || !curFocusedLeaf.id.startsWith('audio')) {
-                    this.keyRightHandler();
-                }
+        if (!curFocusedLeaf || !curFocusedLeaf.id.startsWith('audio')) {
+          this.keyRightHandler();
+        }
 				break;
 			//触屏设备向左滑动
 			case Consts.KEYCODE_CLICK_LEFT_SCREEN:

+ 29 - 11
src/stage/index/scene/CourseScene.js

@@ -250,6 +250,11 @@ class CourseScene extends scene {
 				TVUtil.Toast.show('本地服务请求失败...', 3000);
 				return;
 			}
+			if (event.target.con.classList.contains('download-btn-lesson-list-failed')) {
+				event.target.con.classList.add('download-btn-lesson-list-ongoing');
+				event.target.con.classList.remove('download-btn-lesson-list-failed');
+				return;
+			}
 			if (event.target.con.classList.contains('download-btn-lesson-list-ready')) {
   			event.target.con.classList.add('download-btn-lesson-list-ongoing');
   			event.target.con.classList.remove('download-btn-lesson-list-ready');
@@ -273,6 +278,7 @@ class CourseScene extends scene {
 	onResume(data) {
 		if (!data) { return }
 		if ('BuyConfirmScene' === data.backScene) {
+
 			if ('goBuy' === data.mode) {
 				//TODO:需降低耦合,统一管理路由,暂时先造个对象
 				this.navSwitch({ target: { id: 'course-tab-detail' } });
@@ -282,6 +288,9 @@ class CourseScene extends scene {
 			} else {
 				return;
 			}
+
+		} else if ('DownloadTipScene' === data.backScene) {
+				return;
 		} else {
 			this.renderCourse(this.id);
 		}
@@ -337,16 +346,25 @@ class CourseScene extends scene {
             return;
         }
 
-		// 点击某一课
+		// 点击正在下载的某一课
+		if (e.target.con.classList.contains('download-btn-lesson-list-ongoing') || e.target.con.classList.contains('download-btn-lesson-icon-ready')) {
+      	let id = (e.target.id).split("download-btn-")[1];
+      	APIClient.getDownloadProcess( id, ( isTrue, res)=> {
+        	let storageUsageStr = res.data.resSize + '/' + res.data.resTotal;
+        	let downloadProcess = document.getElementById('downloadProcess');
+        	downloadProcess.innerText = storageUsageStr;
+      	})
+      	this.showScene(require('./DownloadTipScene.js'), {});
+      	return;
+		}
+
 		if (e.target.con.classList.contains('img-wrapper') || e.target.con.classList.contains('text-wrapper')) {
 			// 课件模版 COURSE_WARE_VIDEO(课视频模版)  COURSE_WARE_LIST(课列表)
-			let id = e.target.con.dataset.id;
-
-			//检查课的权限
+      		let id = e.target.con.dataset.id;
+      //检查课的权限
 			//首先获取课的序号
 			let lessonSeq = parseInt(e.target.con.dataset.seq);
 			if (!this.isAuthorized(lessonSeq)) {
-				//新添需求,如果该课程未购买,出现确认购买弹框
 				this.showScene(require('./BuyConfirmScene.js'), {});
 				return;
 			}
@@ -356,6 +374,7 @@ class CourseScene extends scene {
 			return;
 		}
 
+
     	//点击课程配套列表中的某个配套
 		if (e.target.con.classList.contains('periphery-wrapper')) {
 			document.querySelector('.periphery-container').style.opacity = '0';
@@ -399,19 +418,19 @@ class CourseScene extends scene {
 
     //点击课的下载按钮
     if (e.target.con.classList.contains('download-btn-lesson-list-ready')
-		|| e.target.con.classList.contains('download-btn-lesson-icon-ready')) {
-			let courseID = this.id;
+		|| e.target.con.classList.contains('download-btn-lesson-icon-ready') 
+		|| e.target.con.classList.contains('download-btn-lesson-icon-failed')
+		|| e.target.con.classList.contains('download-btn-lesson-list-failed')) {
+      		let courseID = this.id;
 			let courseName = this.title;
-
 			let lessonID = e.target.con.dataset.id;
 			let lessonName = e.target.con.dataset.name;
 
-			/*调试不启用
 			let lessonSeq = parseInt(e.target.con.dataset.seq);
 			if (!this.isAuthorized(lessonSeq)) {
 				TVUtil.Toast.show('购买后方可下载!', 3000);
 				return;
-			}*/
+			}
 
 			/* windows不提供此方法
 			if (this.getAvailableBlocks() < 200*1024){
@@ -420,7 +439,6 @@ class CourseScene extends scene {
 				return;
 			}
 			*/
-
 			this.addLessonDownloadTask({ lessonID, courseID, event: e });
 		}
 	}

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

@@ -10,7 +10,7 @@ class DataBuildingScene extends scene {
         if (data && data.bgUrl) {
             document.getElementById('building-pic-bg').setAttribute('src', Consts.IMG_PATH + '/' + data.bgUrl);
         } else {
-            document.getElementById('building-pic-bg').setAttribute('src', 'asstes/img/building.png');
+            document.getElementById('building-pic-bg').setAttribute('src', Consts.DATA_BUILDING);
         }
       });
     }

+ 15 - 10
src/stage/index/scene/DelConfirmScene.js

@@ -9,6 +9,7 @@ class DelConfirmScene extends scene {
 			'isParentShow': true
 		}, () => {
 			let delName = document.querySelector('#del-name');
+
 			if ('ShopCartScene' == data.parentScene) {
 				delName.innerHTML = `确认删除“${data.title}”吗?`;
 				this.moye.root.reRender();
@@ -21,15 +22,19 @@ class DelConfirmScene extends scene {
 				};
 				return;
 			}
-			delName.innerHTML = `确认删除“${data.title}”吗?`;
-			this.moye.root.reRender();
-			// 默认光标指向取消按钮
-			this.moye.root.getWidgetById('cancle-btn').focus();
-			// 记录下课id
-			this.store = {
-				lessonId: data.lessonId,
-				parentScene: data.parentScene,
-			};
+			if ('DownloadManagerScene' == data.parentScene) {
+        delName.innerHTML = `确认删除“${data.title}”吗?`;
+        this.moye.root.reRender();
+        // 默认光标指向取消按钮
+        this.moye.root.getWidgetById('cancle-btn').focus();
+        // 记录下课id
+        this.store = {
+          lessonId: data.lessonId,
+          parentScene: data.parentScene,
+        };
+        return;
+			}
+
 		});
 	}
 
@@ -56,7 +61,7 @@ class DelConfirmScene extends scene {
 	// 在使用Atv时Id对应:e.target.id
 	// 非使用Atv是Id对应:e.target.id
 	onOK(e) {
-		let parentScene = this.store['parentScene'];
+    let parentScene = this.store['parentScene'];
 		delete this.store.parentScene;
 		if (e.target.con.id == 'del-btn') {
 			this.store.isDelete = true;

+ 18 - 17
src/stage/index/scene/DownloadManagerScene.js

@@ -82,19 +82,19 @@ class DownloadManagerScene extends scene {
 
             //downloadDate
             let downloadDateStr = '2017-09-10';
-            if (rec.gmtCreated) {
+             if (rec.gmtModified) {
                 let createDate = new Date();
-                createDate.setTime(rec.gmtCreated);
+                createDate.setTime(rec.gmtModified);
                 downloadDateStr = Utils.dateFormat(createDate, 'yyyy-MM-dd');
             }
             let downloadStatus = rec['downloadStatus'];
             let downloadDesc = '';
 
             //storageUsage
-            let storageUsageStr = '';
-            if (rec.storageUsage || 0){
-                storageUsageStr = '' + parseInt((rec.storageUsage || 0)/1000) + 'M';
-            }
+            let storageUsageStr =  rec['resSize'] + '/' + rec['resTotal'];
+            // if (rec.storageUsage || 0){
+            //     storageUsageStr = '' + parseInt((rec.storageUsage || 0)/1000) + 'M';
+            // }
 
             //downloadStatus
             switch (downloadStatus) {
@@ -113,6 +113,12 @@ class DownloadManagerScene extends scene {
             default:
                 downloadDesc = '未下载';
             }
+            // 删除按钮是否可点击
+            let delDisable = downloadStatus === Consts.DOWNLOAD_STATUS_ONGOING ? true : false;
+            let feRole = delDisable ? '' : 'fe-role="Widget"';
+            let delImg = delDisable ? '<img src="./assets/img/DownloadScene/download_del_disable_btn.png" class="img-btn"/> '
+                          : '<img src="./assets/img/DownloadScene/download_del_btn.png" class="img-btn"/>'
+
             if (!rec['lessonName']) {
                 rec['lessonName'] = rec['courseName'];
             }
@@ -121,16 +127,13 @@ class DownloadManagerScene extends scene {
             <div class="one">${downloadDateStr}</div>
             <div class="two">${rec['courseName']}</div>
             <div class="three">${rec['lessonName']}</div>
-            <div class="four">${storageUsageStr}</div>
-            <div class="five">${downloadDesc}</div>
-            <div class="six" >
+            <div class="four">${downloadDesc}(${storageUsageStr})</div>
+            <div class="five" >
               <div id="download-btn-wrapper" fe-fole="Switch">
                 <div id="enter-btn-lesson-${rec['lessonId']}" class="download-enter-btn" fe-role="Widget" data-id="${rec['lessonId']}">
                   <img src="./assets/img/DownloadScene/download_enter_btn.png" class="img-btn"/>
                 </div>
-                <div id="del-btn-lesson-${rec['lessonId']}" class="download-del-btn" fe-role="Widget" data-id="${rec['lessonId']}" >
-                  <img src="./assets/img/DownloadScene/download_del_btn.png" class="img-btn"/>
-                </div>
+                <div id="del-btn-lesson-${rec['lessonId']}" class="download-del-btn" ${feRole} data-id="${rec['lessonId']}" >${delImg}</div>
               </div>
             </div>
             </div>`
@@ -139,9 +142,8 @@ class DownloadManagerScene extends scene {
           <div class="one">下载日期</div>
           <div class="two">课程名称</div>
           <div class="three">课名称</div>
-          <div class="four">容量</div>
-          <div class="five">下载状态</div>
-          <div class="six">操作</div>
+          <div class="four">下载状态</div>
+          <div class="five">操作</div>
           </div>`
         return `${trAcc}`;
     }
@@ -168,7 +170,7 @@ class DownloadManagerScene extends scene {
     }
 
     onResume(retData) {
-      if (!retData) return;
+      if (!retData || !retData.isDelete) return;
       //send delete cmd
       let lessonId = retData.lessonId;
       let courseId = this.lessonItems[lessonId]['courseId']
@@ -207,7 +209,6 @@ class DownloadManagerScene extends scene {
             let courseId = this.lessonItems[lessonId].courseId;
             let lessonName = this.lessonItems[lessonId].lessonName;
             let downloadStatus = this.lessonItems[lessonId].downloadStatus;
-            // enter relative lesson scene
             this.showScene(require('./LessonScene.js'), {courseId, downloadStatus, id:lessonId, title:lessonName});
         }
     }

+ 59 - 0
src/stage/index/scene/DownloadTipScene.js

@@ -0,0 +1,59 @@
+class DownloadTipScene extends scene {
+  constructor(scope) {
+    super(scope);
+  }
+
+  onCreate() {
+    this.setContentView(require('../../../res/tpl/DownloadTipScene.tpl'), {}, 'DownloadTipScene', {
+      'isParentShow': true
+    }, () => {
+      this.moye.root.getWidgetById('ok-btn').focus();
+    });
+  }
+
+  onResume() {
+
+  }
+
+  onPause() {
+
+  }
+
+  onDestroy() {
+
+  }
+
+  onActive() {
+
+  }
+
+  onInactive() {
+
+  }
+
+  // 所有事件类函数默认触发时会传递过来一个Event,其中包含着事件响应节点以及其他相关信息
+  // 查看信息:console.log(e)
+  // 获取Event节点Id的方法(前提是触发事件的节点存在Id)
+  // 在使用Atv时Id对应:e.target.id
+  // 非使用Atv是Id对应:e.target.id
+  onOK(e) {
+    let backScene = 'DownloadTipScene';
+    if (e.target.con.id == 'ok-btn') {
+      this.hideScene( { backScene } , 'CourseScene');
+    }
+  }
+
+  onBack() {
+
+  }
+
+  onKeydown() {
+
+  }
+
+  onKeyup() {
+
+  }
+}
+
+module.exports = DownloadTipScene;

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

@@ -44,18 +44,18 @@ class ImageWareFullScreenScene extends scene {
 				});
             //下一个或前一个课件是音频课件
 			} else if (this.curWareType === Consts.TYPE_AUDIOBOOK) {
-                let imgList = this.wareList[this.curWareIndex].list;
-                let imgIndex = 0;
-                if (type === 'BACK' && imgList.length) {
-                    imgIndex = imgList.length - 1;
-                }
-                this.hideScene();
-                this.showScene(require('./AudioWareFullScreenScene.js'), {
-                    wareList: this.wareList,
-                    curWareIndex: this.curWareIndex,
-                    curAudioList: imgList,
-                    curAudioIndex: imgIndex,
-                });
+        let imgList = this.wareList[this.curWareIndex].list;
+        let imgIndex = 0;
+        if (type === 'BACK' && imgList.length) {
+            imgIndex = imgList.length - 1;
+        }
+        this.hideScene();
+        this.showScene(require('./AudioWareFullScreenScene.js'), {
+            wareList: this.wareList,
+            curWareIndex: this.curWareIndex,
+            curAudioList: imgList,
+            curAudioIndex: imgIndex,
+        });
 			//下一个或前一个课件是图片课件
 			} else {
 				this.curImageList = this.wareList[wareIndex].list;

+ 8 - 5
src/stage/index/scene/IndexScene.js

@@ -29,11 +29,11 @@ class IndexScene extends scene {
 			if (res.success) {
 				userDataStorage.setData(res.data);
 
-				//必须获取Token后才可以正常调用以下接口
-				this.loadHistoryList();
-				this.loadTerminal();
+        //必须获取Token后才可以正常调用以下接口
+        this.loadHistoryList();
+        this.loadTerminal();
+        this.loadDownloadList();
 				ShopCartState.updateCount();
-
 				//记录用户登录行为
 				let {status, data} = CommandBus.execute({
 					type: CMD_TYPE.APP_BHV_USER_LOGIN,
@@ -101,6 +101,10 @@ class IndexScene extends scene {
 		terminal_id.innerHTML = 'ID:' + userData.eid.replace(/(\d{4})/g, '$1 ');
 	}
 
+  loadDownloadList() {
+    APIClient.getDownloadList( ( isTrue,res) => {})
+	}
+
 	onCreate() {
 		this.setContentView(require('../../../res/tpl/IndexScene.tpl'), {
 			'title': '2B双师教学标准平台'
@@ -160,7 +164,6 @@ class IndexScene extends scene {
 	}
 
 	onBack() {
-		this.showScene(require('./QuitConfirmScene.js'), {});
 		return true;
 	}
 

+ 234 - 520
src/stage/index/scene/LessonScene.js

@@ -24,37 +24,14 @@ function checkDownloadStatus(status) {
   }
 }
 
-function getLocalResourceUrl(absoluteUrl) {
-  if (!absoluteUrl) return;
-  const segments = absoluteUrl.split('/') || [];
-  return `${Consts.NODE_SERVER}/lesson/readFile?n=${segments.slice(3).join('*')}`;
+function getLocalResourceUrl(onlineURL) {
+  if (!onlineURL) return;
+  const segments = onlineURL.split('/') || [];
+  const localURL = `${Consts.NODE_SERVER}/lesson/readFile?n=${segments.slice(3).join('*')}`;
+  return localURL;
 }
 
 class LessonScene extends scene {
-<<<<<<< HEAD
-    constructor(scope) {
-        super(scope);
-        this.timer = null;        //记录定时器
-        this.isBack = false;      //是否返回上个场景
-        this.videoPlayer = null;  //视频播放器
-        this.courseId = null;     //记录课程ID
-        this.lessonId = null;     //记录课ID
-        this.wareList = null;     //记录课件列表
-        this.curWareId = null;    //当前课件的id
-        this.curWareType = null;  //当前课件的类型
-        this.curWareIndex = 0;    //当前课件在课件列表中的索引
-        this.curImageList = null; //当前图片课件的图片列表
-        this.curImageIndex = null;//当前图片在列表中的索引
-        this.curAudioList = null; //当前音频课件的音频列表
-        this.curAudioIndex = 0;   //当前音频在列表中的索引
-        this.videoPosition = {
-        	top: 270,
-        	left: 790,
-        	width: 1072,
-        	height: 603,
-        };
-    }
-=======
   constructor(scope) {
     super(scope);
     this.timer = null;        //记录定时器
@@ -69,6 +46,8 @@ class LessonScene extends scene {
     this.curWareIndex = 0;    //当前课件在课件列表中的索引
     this.curImageList = null; //当前图片课件的图片列表
     this.curImageIndex = null;//当前图片在列表中的索引
+    this.curAudioList = null; //当前音频课件的音频列表
+    this.curAudioIndex = 0;   //当前音频在列表中的索引
     this.videoPosition = {
     	top: 270,
     	left: 790,
@@ -76,7 +55,6 @@ class LessonScene extends scene {
     	height: 603,
     };
   }
->>>>>>> remotes/origin/dev_winpc_touch
 
   /**
   * 根据课程id及课id请求课件列表
@@ -129,40 +107,12 @@ class LessonScene extends scene {
   		this.curWareIndex = parseInt(e.target.id.split('-')[3]);
       let curWare = matchWare(this.wareList, this.curWareId);
       if (curWare) {
-          this.createRightView(curWare);
+        this.createRightView(curWare);
       }
   	});
   	this.moye.root.reRender();
   }
 
-<<<<<<< HEAD
-    /**
-    * 创建左侧列表项内容
-    */
-    createHTMLString(data) {
-    	let item = {
-    		text: data.category || '',
-    		icon: '',
-    	}
-    	switch (data.type) {
-    		case Consts.TYPE_IMAGE:
-    			item.icon = 'assets/img/LessonScene/img.png';
-    			break;
-    		case Consts.TYPE_VIDEO:
-    			item.icon = 'assets/img/LessonScene/video.png';
-    			break;
-            case Consts.TYPE_AUDIOBOOK:
-                item.icon = 'assets/img/LessonScene/audio.png';
-    	}
-    	return `<div class="ware-item-frame">
-              <div class="ware-type">${item.text}</div>
-              <div class="ware-desc">
-                <div class="ware-names">${data.title}</div>
-                <div class="ware-icon">
-                	<img class="ware-icon-content" src="${item.icon}">
-                </div>
-              </div>
-=======
   /**
   * 创建左侧列表项内容
   */
@@ -178,6 +128,9 @@ class LessonScene extends scene {
   		case Consts.TYPE_VIDEO:
   			item.icon = 'assets/img/LessonScene/video.png';
   			break;
+      case Consts.TYPE_AUDIOBOOK:
+        item.icon = 'assets/img/LessonScene/audio.png';
+        break;
   	}
   	return `
       <div class="ware-item-frame">
@@ -203,27 +156,12 @@ class LessonScene extends scene {
     const { title, type, list } = item;
     //设定视窗的标题
     document.getElementById('view-top').innerHTML = title;
-    //关闭安卓播放器
-  	if (window.efunbox) {
-  		window.efunbox.closePlayer();
-  	}
   	switch (type) {
   		case Consts.TYPE_VIDEO:
   			let playUrl = '';
   			if (list && list.length >= 1) {
   				playUrl = Utils.videoUrlFormat(list[0].url);
   			}
-        /*
-  			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">播放</div>
->>>>>>> remotes/origin/dev_winpc_touch
-            </div>
-          `;
-        */
         let videoViewDom = '';
   			document.getElementById('view-bottom').innerHTML = videoViewDom;
   			this.moye.root.reRender();
@@ -248,134 +186,59 @@ class LessonScene extends scene {
   				this.curImageIndex = 0;
   				this.renderImageView();
   			}
-  			break;
-          default:
-              break;
-  	}
-  }
-
-<<<<<<< HEAD
-        const { title, type, list } = item;
-        //设定视窗的标题
-        document.getElementById('view-top').innerHTML = title;
-        //关闭安卓播放器
-    	if (window.efunbox) {
-    		window.efunbox.closePlayer();
-    	}
-    	switch (type) {
-    		case Consts.TYPE_VIDEO:
-    			let playUrl = '';
-    			if (list && list.length >= 1) {
-    				playUrl = Utils.videoUrlFormat(list[0].url);
-    			}
-    			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">暂停</div>
-                  </div>
-                `;
-    			document.getElementById('view-bottom').innerHTML = videoViewDom;
-    			this.moye.root.reRender();
-    			this.renderVideoView(title, playUrl, type);
-    			break;
-    		case Consts.TYPE_IMAGE:
-    			let imageViewDom =
-    			`
-    				<div id="view-full-screen" fe-role="Widget" class="view-full-screen-img"></div>
-    				<div id="view-previous" fe-role="Widget">
-                        <div class="transparent-btn">上一页</div>
-                    </div>
-    				<div id="view-page">1/1</div>
-                        <div id="view-next" fe-role="Widget">
-                        <div class="transparent-btn">下一页</div>
-                    </div>
-    			`;
-    			document.getElementById('view-bottom').innerHTML = imageViewDom;
-    			this.moye.root.reRender();
-    			this.curImageList = list;
-    			if (this.curImageList.length > 0) {
-    				this.curImageIndex = 0;
-    				this.renderImageView();
-    			}
-    			break;
-            case Consts.TYPE_AUDIOBOOK:
-    			let audioViewDom =
+        break;
+      case Consts.TYPE_AUDIOBOOK:
+    		let audioViewDom =
     			`
     				<div id="view-full-screen" fe-role="Widget" class="view-full-screen-img"></div>
     				<div id="view-previous" fe-role="Widget">
-                        <div class="transparent-btn">上一页</div>
-                    </div>
+              <div class="transparent-btn">上一页</div>
+            </div>
     				<div id="view-page">1/1</div>
-                        <div id="view-next" fe-role="Widget">
-                        <div class="transparent-btn">下一页</div>
-                    </div>
+              <div id="view-next" fe-role="Widget">
+              <div class="transparent-btn">下一页</div>
+            </div>
     			`;
-    			document.getElementById('view-bottom').innerHTML = audioViewDom;
-    			this.moye.root.reRender();
-    			this.curAudioList = list;
-    			if (this.curAudioList.length > 0) {
-    				this.curAudioIndex = 0;
-    				this.renderAudioView();
-    			}
-                break;
-            default:
-                break;
-    	}
-=======
+  			document.getElementById('view-bottom').innerHTML = audioViewDom;
+  			this.moye.root.reRender();
+  			this.curAudioList = list;
+  			if (this.curAudioList.length > 0) {
+  				this.curAudioIndex = 0;
+  				this.renderAudioView();
+  			}
+  			break;
+      default:
+        break;
+  	}
+  }
+
   /**
   * 渲染图片视图
   */
   renderImageView() {
   	const curImage = this.curImageList[this.curImageIndex];
   	document.getElementById('view-page').innerHTML = (this.curImageIndex + 1) + '/' + this.curImageList.length;
-    let imageDom = `<img src=${curImage.url} />`
+    let imageDom = `<img src="${curImage.url}" />`
     if (this.isDownload) {
-      imageDom = `<img src=${getLocalResourceUrl(curImage.url)} />`
->>>>>>> remotes/origin/dev_winpc_touch
+      imageDom = `<img src="${getLocalResourceUrl(curImage.url)}" />`
     }
   	document.getElementById('view-content').innerHTML = imageDom;
   }
 
-<<<<<<< HEAD
-    /**
-    * 渲染图片视图
-    */
-    renderImageView() {
-    	const curImage = this.curImageList[this.curImageIndex];
-    	document.getElementById('view-page').innerHTML = (this.curImageIndex + 1) + '/' + this.curImageList.length;
-        const imageDom = `<img src=${curImage.url} />`
-    	document.getElementById('view-content').innerHTML = imageDom;
-=======
   /**
   * 渲染视频视图
   */
   renderVideoView(name, url, type) {
+    // 处理视频链接,是读本地还是读线上
     let localUrl = url;
     if (this.isDownload) {
       localUrl = getLocalResourceUrl(url)
->>>>>>> remotes/origin/dev_winpc_touch
-    }
-    if (window.efunbox) {
-        window.efunbox.initAndroidPlayer(
-        	name,
-        	localUrl,
-        	1, //与android里的音视频类型定义有关,这里写死为type=1
-        	this.videoPosition.top,
-        	this.videoPosition.left,
-        	this.videoPosition.width,
-        	this.videoPosition.height,
-        	false
-        );
-        window.efunbox.start();
-        this.videoPlayer = window.efunbox;
-    } else {
-        const videoDom = `<div id="hls-video"></div>`;
-        document.getElementById('view-content').innerHTML = videoDom;
-        this.videoPlayer = new EfunVideoPlayer();
-        this.videoPlayer.initPlayer(localUrl, 'hls-video');
     }
+    // 初始化视频播放器
+    const videoDom = `<div id="hls-video"></div>`;
+    document.getElementById('view-content').innerHTML = videoDom;
+    this.videoPlayer = new EfunVideoPlayer();
+    this.videoPlayer.initPlayer(url, 'hls-video');
   	// 监控到初始化视频成功后暂停画面
   	this.timer = window.setInterval(() => {
   		if (this.videoPlayer.playStatus()) {
@@ -389,66 +252,105 @@ class LessonScene extends scene {
   	}, 500);
   }
 
-<<<<<<< HEAD
-    /**
-     * 渲染音频视图
-     */
-    renderAudioView(focusTarget) {
-        const curAudio = this.curAudioList[this.curAudioIndex];
-        const { img, audio, type } = curAudio;
-        let imgPath = (img || {}).path || '';
-        let audioUrl = (audio || {}).url;
-    	let footer = document.getElementById('view-page');
-        if (footer) {
-            footer.innerHTML = (this.curAudioIndex + 1) + '/' + this.curAudioList.length;
-        }
-        let content = document.getElementById('view-content');
-        // 1.更换背景图片
-        let imgHTML = `<img src="${Consts.IMG_PATH}/${imgPath}" />`;
-        content.innerHTML = imgHTML;
-        // 2.根据是否有无audioURL来控制面板及audio的展现
-        if (type === Consts.TYPE_AUDIOBOOK && audioUrl) {
-            let audioElement = document.createElement('audio');
-            audioElement.setAttribute('id', 'courseware-audio');
-            audioElement.setAttribute('src', audioUrl);
-            audioElement.setAttribute('autoplay', 'autoplay');
-            let controlsElement = document.createElement('div');
-            controlsElement.setAttribute('class', 'audio-controls');
-            let controlsBtns = `
-                <!-- 播放/暂停 -->
-                <div id="audio-play" class="audio-controls-item btn-play" fe-role="Widget"></div>
-                <!-- 有声/静音 -->
-                <div id="audio-mute" class="audio-controls-item btn-mute" fe-role="Widget"></div>
-                <!-- 下一个音频 -->
-                <div id="audio-next" class="audio-controls-item btn-next" fe-role="Widget"></div>
-                <!-- 上一个音频 -->
-                <div id="audio-last" class="audio-controls-item btn-last" fe-role="Widget"></div>
-            `;
-            controlsElement.innerHTML = controlsBtns;
-            content.appendChild(audioElement);
-            content.appendChild(controlsElement);
-            this.moye.root.reRender();
-            // 监听onended事件
-            let audioDom = document.getElementById('courseware-audio');
-            if (audioDom) {
-                audioDom.addEventListener('ended', function () {
-                    TVUtil.Toast.show('播放结束', 1500);
-                    document.getElementById('audio-play').classList.add('paused');
-                    audioDom.currentTime = 0;
-                }, false);
-            }
-            // 指定光标位置
-            if (focusTarget && this.moye.root.getWidgetById(focusTarget)) {
-                this.moye.root.getWidgetById(focusTarget).focus();
-            }
-        }
+  /**
+   * 渲染音频视图
+   */
+  renderAudioView(focusTarget) {
+    const curAudio = this.curAudioList[this.curAudioIndex];
+    const { img, audio, type } = curAudio;
+    let imgPath = (img || {}).path || '';
+    let audioUrl = (audio || {}).url;
+	  let footer = document.getElementById('view-page');
+    if (footer) {
+      footer.innerHTML = (this.curAudioIndex + 1) + '/' + this.curAudioList.length;
+    }
+    let content = document.getElementById('view-content');
+    // 1.更换背景图片
+    const imgUrl = `${Consts.IMG_PATH}/${imgPath}`;
+    let imgHTML = `<img src="${imgUrl}" />`;
+    if (this.isDownload) {
+      imgHTML = `<img src="${getLocalResourceUrl(imgUrl)}" />`
+    }
+    content.innerHTML = imgHTML;
+    // 2.根据是否有无audioURL来控制面板及audio的展现
+    if (type === Consts.TYPE_AUDIOBOOK && audioUrl) {
+      let audioElement = document.createElement('audio');
+      audioElement.setAttribute('id', 'courseware-audio');
+      audioElement.setAttribute('src', this.isDownload ? getLocalResourceUrl(audioUrl) : audioUrl);
+      audioElement.setAttribute('autoplay', 'autoplay');
+      let controlsElement = document.createElement('div');
+      controlsElement.setAttribute('class', 'audio-controls');
+      let controlsBtns = `
+        <!-- 播放/暂停 -->
+        <div id="audio-play" class="audio-controls-item btn-play" fe-role="Widget"></div>
+        <!-- 有声/静音 -->
+        <div id="audio-mute" class="audio-controls-item btn-mute" fe-role="Widget"></div>
+        <!-- 下一个音频 -->
+        <div id="audio-next" class="audio-controls-item btn-next" fe-role="Widget"></div>
+        <!-- 上一个音频 -->
+        <div id="audio-last" class="audio-controls-item btn-last" fe-role="Widget"></div>
+      `;
+      controlsElement.innerHTML = controlsBtns;
+      content.appendChild(audioElement);
+      content.appendChild(controlsElement);
+      this.moye.root.reRender();
+      // 监听onended事件
+      let audioDom = document.getElementById('courseware-audio');
+      if (audioDom) {
+        audioDom.addEventListener('ended', function () {
+        document.getElementById('audio-play').classList.add('paused');
+        audioDom.currentTime = 0;
+        }, false);
+      }
+      // 指定光标位置
+      if (focusTarget && this.moye.root.getWidgetById(focusTarget)) {
+        this.moye.root.getWidgetById(focusTarget).focus();
+      }
     }
+  }
+
+  /* 音频播放控制 */
+  audioPlayControl(eventId) {
+      let targetAudio = document.getElementById('courseware-audio');
+      if (!targetAudio) { return; }
+      switch (eventId) {
+          case 'audio-play':
+              let playBtn = document.querySelector('#audio-play');
+              if (targetAudio.paused) {
+                  targetAudio.play();
+                  playBtn.classList.remove('paused');
+              } else {
+                  targetAudio.pause();
+                  playBtn.classList.add('paused');
+              }
+              break;
+          case 'audio-mute':
+              let muteBtn = document.querySelector('#audio-mute');
+              if (targetAudio.muted) {
+                  targetAudio.muted = false;
+                  muteBtn.classList.remove('muted');
+              } else {
+                  targetAudio.muted = true;
+                  muteBtn.classList.add('muted');
+              }
+              break;
+          case 'audio-next':
+              if (this.curAudioIndex < this.curAudioList.length -1) {
+                  this.curAudioIndex += 1;
+                  this.renderAudioView('audio-next');
+              }
+              break;
+          case 'audio-last':
+              if (this.curAudioIndex > 0) {
+                  this.curAudioIndex -= 1;
+                  this.renderAudioView('audio-last');
+              }
+              break;
+          default:
+              break;
+      }
+  }
 
-    /**
-    * 渲染视频视图
-    */
-    renderVideoView(name, url, type) {
-=======
   updateRightView(item) {
   	const { title, type, list } = item;
   	document.getElementById('view-top').innerHTML = title;
@@ -458,31 +360,16 @@ class LessonScene extends scene {
   			if (list && list.length >= 1) {
   				playUrl = Utils.videoUrlFormat(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">${playText}</div>
-            </div>
-          `;
-        */
   			document.getElementById('view-bottom').innerHTML = '';
   			this.moye.root.reRender();
         //如果是H5播放器,则重新创建video标签
->>>>>>> remotes/origin/dev_winpc_touch
         if (window.efunbox) {
             window.efunbox.customScreen(270, 790, 1072, 603);
         } else {
           const videoDom = `<div id="hls-video"></div>`;
           document.getElementById('view-content').innerHTML = videoDom;
           this.videoPlayer = new EfunVideoPlayer();
-          this.videoPlayer.initPlayer(playUrl, 'hls-video');
+          this.videoPlayer.initPlayer(playUrl, 'hls-video', url);
         }
   			break;
   		case Consts.TYPE_IMAGE:
@@ -490,120 +377,12 @@ class LessonScene extends scene {
   			`
   				<div id="view-full-screen" fe-role="Widget" class="view-full-screen-img"></div>
   				<div id="view-previous" fe-role="Widget">
-                      <div class="transparent-btn">上一页</div>
-                  </div>
+            <div class="transparent-btn">上一页</div>
+          </div>
   				<div id="view-page">1/1</div>
   				<div id="view-next" fe-role="Widget">
-                      <div class="transparent-btn">下一页</div>
-                  </div>
-<<<<<<< HEAD
-                `;
-    			document.getElementById('view-bottom').innerHTML = videoViewDom;
-    			this.moye.root.reRender();
-                //如果是H5播放器,则重新创建video标签
-                if (window.efunbox) {
-                    window.efunbox.customScreen(270, 790, 1072, 603);
-                } else {
-                    const videoDom = `<video id="hls-video" controls>你的浏览器不支持视频播放</video>`;
-                    document.getElementById('view-content').innerHTML = videoDom;
-                    this.videoPlayer = new HlsVideoPlugin();
-                    this.videoPlayer.initH5Player(playUrl, 'hls-video');
-                }
-    			break;
-    		case Consts.TYPE_IMAGE:
-    			let imageViewDom =
-    			`
-    				<div id="view-full-screen" fe-role="Widget" class="view-full-screen-img"></div>
-    				<div id="view-previous" fe-role="Widget">
-                        <div class="transparent-btn">上一页</div>
-                    </div>
-    				<div id="view-page">1/1</div>
-    				<div id="view-next" fe-role="Widget">
-                        <div class="transparent-btn">下一页</div>
-                    </div>
-    			`;
-    			document.getElementById('view-bottom').innerHTML = imageViewDom;
-    			this.moye.root.reRender();
-    			this.renderImageView();
-    			break;
-    		case Consts.TYPE_AUDIOBOOK:
-    			let audioViewDom =
-    			`
-    				<div id="view-full-screen" fe-role="Widget" class="view-full-screen-img"></div>
-    				<div id="view-previous" fe-role="Widget">
-                        <div class="transparent-btn">上一页</div>
-                    </div>
-    				<div id="view-page">1/1</div>
-    				<div id="view-next" fe-role="Widget">
-                        <div class="transparent-btn">下一页</div>
-                    </div>
-    			`;
-    			document.getElementById('view-bottom').innerHTML = audioViewDom;
-    			this.moye.root.reRender();
-    			this.renderAudioView();
-    			break;
-            default:
-                break;
-    	}
-    }
-
-    /**
-     * 音频播放控制
-     */
-    audioPlayControl(eventId) {
-        let targetAudio = document.getElementById('courseware-audio');
-        if (!targetAudio) { return; }
-        switch (eventId) {
-            case 'audio-play':
-                let playBtn = document.querySelector('#audio-play');
-                if (targetAudio.paused) {
-                    targetAudio.play();
-                    playBtn.classList.remove('paused');
-                } else {
-                    targetAudio.pause();
-                    playBtn.classList.add('paused');
-                }
-                break;
-            case 'audio-mute':
-                let muteBtn = document.querySelector('#audio-mute');
-                if (targetAudio.muted) {
-                    targetAudio.muted = false;
-                    muteBtn.classList.remove('muted');
-                } else {
-                    targetAudio.muted = true;
-                    muteBtn.classList.add('muted');
-                }
-                break;
-            case 'audio-next':
-                if (this.curAudioIndex < this.curAudioList.length -1) {
-                    this.curAudioIndex += 1;
-                    this.renderAudioView('audio-next');
-                }
-                break;
-            case 'audio-last':
-                if (this.curAudioIndex > 0) {
-                    this.curAudioIndex -= 1;
-                    this.renderAudioView('audio-last');
-                }
-                break;
-            default:
-                break;
-        }
-    }
-
-    /**
-    * 记录播放行为事件
-    */
-    postPlayRecord(lessonId, courseId, playStopTime=1){
-    	APIClient.putUserAction(
-    		Consts.USER_ACTION_WATCH,
-    		Consts.USER_ACTION_WATCH_NAME,
-    		`${courseId}_${lessonId}`,
-    		playStopTime,
-    		(isTrue, res) => {},
-    	);
-    }
-=======
+            <div class="transparent-btn">下一页</div>
+          </div>
   			`;
   			document.getElementById('view-bottom').innerHTML = imageViewDom;
   			this.moye.root.reRender();
@@ -626,7 +405,6 @@ class LessonScene extends scene {
   		(isTrue, res) => {},
   	);
   }
->>>>>>> remotes/origin/dev_winpc_touch
 
   onCreate(data) {
     //是否已下载
@@ -639,45 +417,24 @@ class LessonScene extends scene {
     });
   }
 
-<<<<<<< HEAD
-    onResume(data) {
-        if (!data) { return; }
-        //更新下当前的课件信息
-        const { curWareIndex, curImageList, curImageIndex, curAudioList, curAudioIndex } = data;
-        this.curWareIndex = curWareIndex;
-        this.curWareId = this.wareList[curWareIndex].id;
-        this.curWareType = this.wareList[curWareIndex].type;
-        if (curImageList) {
-            this.curImageList = curImageList;
-        }
-        if (curImageIndex) {
-            this.curImageIndex = curImageIndex;
-        }
-        if (curAudioList) {
-            this.curAudioList = curAudioList;
-        }
-        if (curAudioIndex) {
-            this.curAudioIndex = curAudioIndex;
-        }
-        //更新左侧焦点位置
-        this.moye.root.getWidgetById(`item-${this.curWareType}-${this.curWareId}-${this.curWareIndex}`).focus();
-        //更新右侧视图
-        this.updateRightView(this.wareList[curWareIndex]);
-        this.isBack = true;
-=======
   onResume(data) {
     if (!data) { return; }
     //更新下当前的课件信息
-    const { curWareIndex, curImageList, curImageIndex } = data;
+    const { curWareIndex, curImageList, curImageIndex, curAudioList, curAudioIndex } = data;
     this.curWareIndex = curWareIndex;
     this.curWareId = this.wareList[curWareIndex].id;
     this.curWareType = this.wareList[curWareIndex].type;
     if (curImageList) {
-        this.curImageList = curImageList;
+      this.curImageList = curImageList;
     }
     if (curImageIndex) {
-        this.curImageIndex = curImageIndex;
->>>>>>> remotes/origin/dev_winpc_touch
+      this.curImageIndex = curImageIndex;
+    }
+    if (curAudioList) {
+      this.curAudioList = curAudioList;
+    }
+    if (curAudioIndex) {
+      this.curAudioIndex = curAudioIndex;
     }
     //更新左侧焦点位置
     this.moye.root.getWidgetById(`item-${this.curWareType}-${this.curWareId}-${this.curWareIndex}`).focus();
@@ -686,139 +443,96 @@ class LessonScene extends scene {
     this.isBack = true;
   }
 
-<<<<<<< HEAD
-    onOK() {
-    	const leaf = FocusEngine.getFocusedLeaf();
-        // 拦截音频控制相关事件单独处理
-        if (leaf.id && leaf.id.startsWith('audio')) {
-            this.audioPlayControl(leaf.id);
-            return;
-        }
-    	switch (leaf.id) {
-    		case 'view-video-start':
-    			if (this.curWareType == Consts.TYPE_VIDEO) {
-    				if (this.videoPlayer.playStatus()) {
-    					this.videoPlayer.pause();
-    					document.getElementById('view-video-start').innerHTML = '播放';
-    				} else {
-    					this.videoPlayer.start();
-    					document.getElementById('view-video-start').innerHTML = '暂停';
-    				}
-    			}
-    			//添加播放记录
-    			this.postPlayRecord(this.curWareId, this.courseId);
-    			break;
-    		case 'view-full-screen':
-                if (this.curWareType === Consts.TYPE_IMAGE) {
-            		this.showScene(require('./ImageWareFullScreenScene.js'), {
-            			wareList: this.wareList,
-            			curWareIndex: this.curWareIndex,
-            			curImageList: this.curImageList,
-            			curImageIndex: this.curImageIndex,
-            		});
-                } else if (this.curWareType === Consts.TYPE_VIDEO) {
-                    let video = document.getElementById('hls-video');
-                    if (video) {
-                        document.getElementById('view-content').removeChild(video);
-                    }
-                    this.showScene(require('./VideoWareFullScreenScene.js'), {
-                        isFull: true,
-                        wareList: this.wareList,
-                        curWareIndex: this.curWareIndex,
-                    });
-                } else if (this.curWareType === Consts.TYPE_AUDIOBOOK) {
-                    // 全屏前移除audio标签
-                    let audio = document.getElementById('courseware-audio');
-                    let controls = document.querySelector('.audio-controls');
-                    if (audio) {
-                        document.getElementById('view-content').removeChild(audio);
-                    }
-                    if (controls) {
-                        document.getElementById('view-content').removeChild(controls);
-                    }
-                    this.showScene(require('./AudioWareFullScreenScene.js'), {
-            			wareList: this.wareList,
-            			curWareIndex: this.curWareIndex,
-            			curAudioList: this.curAudioList,
-            			curAudioIndex: this.curAudioIndex,
-                    });
-                }
-    			this.postPlayRecord(this.cur_item_id, this.courseId);
-    			break;
-    		case 'view-previous':
-    			if (this.curWareType === Consts.TYPE_IMAGE && this.curImageIndex - 1 >= 0) {
-    				this.curImageIndex -= 1;
-    				this.renderImageView();
-    			}
-                if (this.curWareType === Consts.TYPE_AUDIOBOOK && this.curAudioIndex - 1 >= 0) {
-                    this.curAudioIndex -= 1;
-                    this.renderAudioView();
-                }
-    			this.postPlayRecord(this.curWareId, this.courseId);
-    			break;
-    		case 'view-next':
-    			if (this.curWareType === Consts.TYPE_IMAGE && this.curImageIndex + 1 < this.curImageList.length) {
-    				this.curImageIndex += 1;
-    				this.renderImageView();
-    			}
-                if (this.curWareType === Consts.TYPE_AUDIOBOOK && this.curAudioIndex + 1 < this.curAudioList.length) {
-                    this.curAudioIndex += 1;
-                    this.renderAudioView();
-                }
-    			this.postPlayRecord(this.curWareId, this.courseId);
-    			break;
-            default:
-                break;
-    	}
-=======
   onOK(e) {
-    // 后退
+    // 点击后退按钮
     if (e.target.con.classList.contains('goback')) {
-      this.hideScene({id: this.courseId}, 'CourseScene');
-      return;
->>>>>>> remotes/origin/dev_winpc_touch
+			if ( -1 != this.moye.focusList.indexOf('CourseScene')) {
+        this.hideScene({id: this.courseId}, 'CourseScene');
+        return;
+      } else {
+        this.hideScene();
+      }
     }
+    // 拦截音频控制相关事件单独处理
   	const leaf = FocusEngine.getFocusedLeaf();
-  	switch (leaf.id) {
-  		case 'view-video-start':
-  			if (this.curWareType == Consts.TYPE_VIDEO) {
-  				if (this.videoPlayer.playStatus()) {
-  					this.videoPlayer.pause();
-  					document.getElementById('view-video-start').innerHTML = '播放';
-  				} else {
-  					this.videoPlayer.start();
-  					document.getElementById('view-video-start').innerHTML = '暂停';
-  				}
-  			}
-  			//添加播放记录
-  			this.postPlayRecord(this.curWareId, this.courseId);
-  			break;
-  		case 'view-full-screen':
+    if (leaf.id && leaf.id.startsWith('audio')) {
+      this.audioPlayControl(leaf.id);
+      return;
+    }
+    switch (leaf.id) {
+      case 'view-video-start':
+        if (this.curWareType == Consts.TYPE_VIDEO) {
+          if (this.videoPlayer.playStatus()) {
+            this.videoPlayer.pause();
+            document.getElementById('view-video-start').innerHTML = '播放';
+          } else {
+            this.videoPlayer.start();
+            document.getElementById('view-video-start').innerHTML = '暂停';
+          }
+        }
+        //添加播放记录
+        this.postPlayRecord(this.curWareId, this.courseId);
+        break;
+      case 'view-full-screen':
         if (this.curWareType === Consts.TYPE_IMAGE) {
-      		this.showScene(require('./ImageWareFullScreenScene.js'), {
-      			wareList: this.wareList,
-      			curWareIndex: this.curWareIndex,
-      			curImageList: this.curImageList,
-      			curImageIndex: this.curImageIndex,
+          this.showScene(require('./ImageWareFullScreenScene.js'), {
+            wareList: this.wareList,
+            curWareIndex: this.curWareIndex,
+            curImageList: this.curImageList,
+            curImageIndex: this.curImageIndex,
+          });
+        } else if (this.curWareType === Consts.TYPE_VIDEO) {
+          let video = document.getElementById('hls-video');
+          if (video) {
+            document.getElementById('view-content').removeChild(video);
+          }
+          this.showScene(require('./VideoWareFullScreenScene.js'), {
+            isFull: true,
+            wareList: this.wareList,
+            curWareIndex: this.curWareIndex,
+          });
+        } else if (this.curWareType === Consts.TYPE_AUDIOBOOK) {
+          // 全屏前移除audio标签
+          let audio = document.getElementById('courseware-audio');
+          let controls = document.querySelector('.audio-controls');
+          if (audio) {
+            document.getElementById('view-content').removeChild(audio);
+          }
+          if (controls) {
+            document.getElementById('view-content').removeChild(controls);
+          }
+          this.showScene(require('./AudioWareFullScreenScene.js'), {
+            wareList: this.wareList,
+            curWareIndex: this.curWareIndex,
+            curAudioList: this.curAudioList,
+            curAudioIndex: this.curAudioIndex,
             isDownload: this.isDownload,
-      		});
+          });
         }
-  			this.postPlayRecord(this.cur_item_id, this.courseId);
-  			break;
-  		case 'view-previous':
-  			if (this.curWareType === Consts.TYPE_IMAGE && this.curImageIndex - 1 >= 0) {
-  				this.curImageIndex -= 1;
-  				this.renderImageView();
-  			}
-  			this.postPlayRecord(this.curWareId, this.courseId);
-  			break;
-  		case 'view-next':
-  			if (this.curWareType === Consts.TYPE_IMAGE && this.curImageIndex + 1 < this.curImageList.length) {
-  				this.curImageIndex += 1;
-  				this.renderImageView();
-  			}
-  			this.postPlayRecord(this.curWareId, this.courseId);
-  		  break;
+        this.postPlayRecord(this.cur_item_id, this.courseId);
+        break;
+      case 'view-previous':
+        if (this.curWareType === Consts.TYPE_IMAGE && this.curImageIndex - 1 >= 0) {
+          this.curImageIndex -= 1;
+          this.renderImageView();
+        }
+        if (this.curWareType === Consts.TYPE_AUDIOBOOK && this.curAudioIndex - 1 >= 0) {
+          this.curAudioIndex -= 1;
+          this.renderAudioView();
+        }
+        this.postPlayRecord(this.curWareId, this.courseId);
+        break;
+      case 'view-next':
+        if (this.curWareType === Consts.TYPE_IMAGE && this.curImageIndex + 1 < this.curImageList.length) {
+          this.curImageIndex += 1;
+          this.renderImageView();
+        }
+        if (this.curWareType === Consts.TYPE_AUDIOBOOK && this.curAudioIndex + 1 < this.curAudioList.length) {
+          this.curAudioIndex += 1;
+          this.renderAudioView();
+        }
+        this.postPlayRecord(this.curWareId, this.courseId);
+        break;
       default:
         break;
   	}

+ 74 - 76
src/stage/index/scene/LoginScene.js

@@ -15,6 +15,9 @@ class LoginScene extends scene {
 	 * @desc 将登录逻辑抽象为此函数,方便多处调用
 	 */
 	loginLogic() {
+		//触发登录逻辑后输入框置灰
+		document.querySelector('.form-sid').style.borderColor = '#d3d3d3';
+		document.querySelector('.form-password').style.borderColor = '#d3d3d3';
 		let stu_no = this.sidInput.value.replace(/\s|\|/g, '');
 		let password = this.passwordInput.value.replace(/\s|\|/g, '');
 		APIClient.userLoginAndBindDevice({
@@ -30,16 +33,18 @@ class LoginScene extends scene {
 				if ( -1 != this.moye.focusList.indexOf('IndexScene')){
 					this.hideScene({success: true}, 'IndexScene');
 				} else {
-      				this.showScene(require('./IndexScene.js'), {});
+      		this.showScene(require('./IndexScene.js'), {});
 				}
 			} else if (Consts.API_CODE_ISBOUND == res.code) {
+				//账号被登陆
 				this.showScene(require('./RepeatLoginScene.js'), {});
+        this.sidInput.value = '|';
+        this.passwordInput.value = '';
+        this.moye.root.getWidgetById('sid-input').focus();
+        this.onKeydown();
+
 			} else {
 				TVUtil.Toast.show('帐号或密码错误!', 3000);
-				this.sidInput.value = '|';
-				this.passwordInput.value = '';
-				this.moye.root.getWidgetById('sid-input').focus();
-				this.onKeydown();
 			}
 		});
 	}
@@ -51,12 +56,11 @@ class LoginScene extends scene {
 			this.submitInput = document.getElementById('submit-input');
 			this.sidInput.value = '|';
 			this.passwordInput.value = '';
-			this.moye.root.getWidgetById('key-5').focus();
 		});
 		document.querySelector('.form-sid').style.borderColor = '#4682B4';
 	}
 
-	onResume(data) { }
+	onResume() { }
 
 	onPause() { }
 
@@ -70,7 +74,43 @@ class LoginScene extends scene {
 
 	onKeyup(e) { }
 
+	onKeydown(e) { }
+
 	onOK(e) {
+		if (e.target.id !== this.currFocus) {
+			if (this.currFocus === 'sid-input' || this.currFocus === 'password-input') {
+				const currInput = document.getElementById(this.currFocus);
+				currInput.value = currInput.value.replace(/\|/g, '');
+				if (e.target.id !== 'submit-input') {
+					const nextInput = document.getElementById(e.target.id);
+					nextInput.value = nextInput.value + '|';
+				}
+			}
+		}
+		//左侧input控件切换逻辑
+		switch(e.target.id) {
+			case 'sid-input':
+				document.querySelector('.form-sid').style.borderColor = '#4682B4';
+				document.querySelector('.form-password').style.borderColor = '#d3d3d3';
+				this.currFocus = e.target.id;
+				return;
+			case 'password-input':
+				document.querySelector('.form-password').style.borderColor = '#4682B4';
+				document.querySelector('.form-sid').style.borderColor = '#d3d3d3';
+				this.currFocus = e.target.id;
+				return;
+			case 'submit-input':
+				const account = this.sidInput.value.replace(/\s|\|/g, '');
+				const password = this.passwordInput.value.replace(/\s|\|/g, '');
+				if (account && password) {
+					this.loginLogic();
+				}
+				return;
+			default:
+				break;
+		}
+
+		//右侧键盘点击处理逻辑
 		let key = null;
 		switch (e.target.id) {
 			case 'key-1':
@@ -111,80 +151,38 @@ class LoginScene extends scene {
 				break;
 		}
 
-		let currInput = document.getElementById(this.currFocus);
-		if (this.currFocus !== 'submit-input') {
-			if (typeof key === 'number') {
-				if (this.currFocus === 'sid-input') {
-					currInput.value = (currInput.value.replace(/\s|\|/g, '') + key.toString()).replace(/(\d{4})/g, '$1 ').trim() + '|';
-				}
-				if (this.currFocus === 'password-input') {
-					currInput.value = (currInput.value.replace(/\s|\|/g, '') + key.toString()).replace(/(\d{4})/g, '$1 ').trim() + '|';
-				}
-			} else if (key === 'backspace') {
-				currInput.value = currInput.value.indexOf('|') === -1 ? currInput.value.slice(0, -1) : currInput.value.slice(0, -2) + '|';
-			} else if (key === 'enter') {
-				if (this.currFocus === 'password-input') {
-					this.loginLogic();
-				}
-				let focusArr = ['sid-input', 'password-input', 'submit-input', 'submit-input'];
-				let nextInputIndex = focusArr.indexOf(this.currFocus);
-				// console.log(focusArr[nextInputIndex + 1]);
-				let nextInput = this.moye.root.getWidgetById(focusArr[nextInputIndex + 1]);
-				nextInput.focus();
-				this.onKeydown();
+		/* 动态改变input内的值 */
+		const currInput = document.getElementById(this.currFocus);
+		if (typeof key === 'number') {
+			if (this.currFocus === 'sid-input') {
+				currInput.value = (currInput.value.replace(/\s|\|/g, '') + key.toString()).replace(/(\d{4})/g, '$1 ').trim() + '|';
 			}
-		} else {
-			if (key !== null) {
-				this.moye.root.getWidgetById('submit-input').focus();
-			} else {
+			if (this.currFocus === 'password-input') {
+				currInput.value = (currInput.value.replace(/\s|\|/g, '') + key.toString()).replace(/(\d{4})/g, '$1 ').trim() + '|';
+			}
+		} else if (key === 'backspace') {
+			currInput.value = currInput.value.indexOf('|') === -1 ? currInput.value.slice(0, -1) : currInput.value.slice(0, -2) + '|';
+		} else if (key === 'enter') {
+			const account = this.sidInput.value.replace(/\s|\|/g, '');
+			const password = this.passwordInput.value.replace(/\s|\|/g, '');
+			if (this.currFocus === 'sid-input' && account) {
+				document.querySelector('.form-password').style.borderColor = '#4682B4';
+				document.querySelector('.form-sid').style.borderColor = '#d3d3d3';
+				document.querySelector('#submit-input').style.background = '#ccc';
+				this.currFocus = 'password-input';
+			}
+			else if (this.currFocus === 'password-input' && password) {
 				this.loginLogic();
 			}
 		}
-	}
 
-	onKeydown(e) {
-		const leaf = FocusEngine.getFocusedLeaf();
-		switch (leaf.id) {
-			case 'sid-input':
-				document.querySelector('.form-sid').style.borderColor = '#ff5a00';
-				document.querySelector('.form-password').style.borderColor = '#d3d3d3';
-				this.passwordInput.value = this.passwordInput.value.replace(/\|/g, '');
-				this.sidInput.value = this.sidInput.value.indexOf('|') === -1 ? this.sidInput.value + '|' : this.sidInput.value;
-				if (this.currFocus !== 'sid-input') {
-					this.moye.root.getWidgetById('key-5').focus();
-					this.currFocus = 'sid-input';
-					// 焦点离开 - 颜色变为输入状态颜色
-					document.querySelector('.form-sid').style.borderColor = '#4682B4';
-				}
-				break;
-			case 'password-input':
-				document.querySelector('.form-sid').style.borderColor = '#d3d3d3';
-				document.querySelector('.form-password').style.borderColor = '#ff5a00';
-				this.sidInput.value = this.sidInput.value.replace(/\|/g, '');
-				this.passwordInput.value = this.passwordInput.value.indexOf('|') === -1 ? this.passwordInput.value + '|' : this.passwordInput.value;
-				if (this.currFocus !== 'password-input') {
-					this.moye.root.getWidgetById('key-5').focus();
-					this.currFocus = 'password-input';
-					// 焦点离开 - 颜色变为输入状态颜色
-					document.querySelector('.form-password').style.borderColor = '#4682B4';
-				}
-				break;
-			case 'submit-input':
-				document.querySelector('.form-sid').style.borderColor = '#d3d3d3';
-				document.querySelector('.form-password').style.borderColor = '#d3d3d3';
-				this.passwordInput.value = this.passwordInput.value.replace(/\|/g, '');
-				this.sidInput.value = this.sidInput.value.replace(/\|/g, '');
-				this.currFocus = 'submit-input';
-				break;
-			default:
-				if (this.currFocus == 'sid-input') {
-					document.querySelector('.form-sid').style.borderColor = '#4682B4';
-					document.querySelector('.form-password').style.borderColor = '#d3d3d3';
-				} else if (this.currFocus == 'password-input') {
-					document.querySelector('.form-sid').style.borderColor = '#d3d3d3';
-					document.querySelector('.form-password').style.borderColor = '#4682B4';
-				}
-				break;
+		/* 根据sid-input与password-input是否有值动态更换submit-input颜色 */
+		const account = this.sidInput.value.replace(/\s|\|/g, '');
+		const password = this.passwordInput.value.replace(/\s|\|/g, '');
+		if (account && password) {
+			document.querySelector('#submit-input').style.background = '#2973d7';
+		} else {
+			document.querySelector('#submit-input').style.background = '#ccc';
 		}
 	}
 }

+ 0 - 2
src/stage/index/scene/RepeatLoginScene.js

@@ -5,7 +5,6 @@ class RepeatLoginScene extends scene {
 
 	onCreate() {
 		this.setContentView(require('../../../res/tpl/RepeatLoginScene.tpl'), {}, 'RepeatLoginScene', {'isParentShow': true}, () => {
-			// 默认光标指向"知道了"按钮
 			this.moye.root.getWidgetById('iknow-btn').focus();
 		});
 	}
@@ -40,7 +39,6 @@ class RepeatLoginScene extends scene {
 			this.hideScene({});
 		}
 	}
-
 	onBack() {
 
 	}

+ 0 - 113
src/stage/index/scene/TrainingScene.js

@@ -1,113 +0,0 @@
-import APIClient from '../../../util/API/APIClient';
-import Consts from '../../../util/Consts';
-
-class TrainingScene extends scene {
-	constructor(scope) {
-        super(scope);
-        this.imageList = [];
-        this.curImageIndex = 0;
-	}
-
-    loadTrainingContent(trainingId, index) {
-        APIClient.getTrainingDetail(trainingId, (isTrue, res) => {
-            if (!isTrue) { return; }
-            if (!res.success) {
-                TVUtil.Toast.show('获取师训详情失败!', 1500);
-                this.moye.root.reRender();
-                return;
-            }
-            const { imgList } = res.data || {};
-            this.imageList = imgList;
-            this.renderImageView();
-        });
-    }
-
-    renderImageView() {
-        const curImage = this.imageList[this.curImageIndex];
-        document.getElementById('trainingImg').setAttribute('src', Consts.IMG_PATH + '/' + curImage);
-    }
-
-	keyRightHandler() {
-        const hasNextImage = this.curImageIndex < this.imageList.length - 1 ? true : false;
-        if (hasNextImage) {
-            this.curImageIndex += 1;
-            this.renderImageView();
-        }
-	}
-
-	keyLeftHandler() {
-        const hasPreviousImage = this.curImageIndex === 0 ? false : true;
-        if (hasPreviousImage) {
-            this.curImageIndex -= 1;
-            this.renderImageView();
-        }
-	}
-
-	onCreate(data) {
-		if (data && data.imgList) {
-			this.imageList = data.imgList;
-		}
-		this.setContentView(require('../../../res/tpl/TrainingScene.tpl'), {}, 'TrainingScene', {}, () => {
-            /* TODO:详情大图从上个场景拿过来,这里不再单独去请求 */
-			// this.loadTrainingContent(data.id);
-			this.renderImageView();
-		});
-	}
-
-	onResume() {
-
-	}
-
-	onPause() {
-
-	}
-
-	onDestroy() {
-
-	}
-
-	onActive() {
-
-	}
-
-	onInactive() {
-
-	}
-
-	onOK() {
-
-	}
-
-	onBack() {
-
-	}
-
-	onKeyup() {
-
-	}
-
-	onKeydown(e) {
-        switch (e.keyCode) {
-            //左键
-            case 37:
-                this.keyLeftHandler();
-                break;
-            //右键
-            case 39:
-                this.keyRightHandler();
-                break;
-            //触屏设备向左滑动
-            case Consts.KEYCODE_CLICK_LEFT_SCREEN:
-                this.keyLeftHandler();
-                break;
-            //触屏设备向右滑动
-            case Consts.KEYCODE_CLICK_RIGHT_SCREEN:
-                this.keyRightHandler();
-                break;
-            default:
-                break;
-        }
-	}
-}
-
-module.exports = TrainingScene;

+ 1 - 1
src/stage/index/style/AudioWareFullScreen.less

@@ -58,7 +58,7 @@
 				background-image: url(assets/img/Audio/audio_next.png);
 			}
 			&.fe-focus {
-				.after-focus(@borderSize; #ffe100; .1rem; rgba(0,0,0,0.5));
+				// .after-focus(@borderSize; #ffe100; .1rem; rgba(0,0,0,0.5));
 			}
 		}
 	}

+ 4 - 15
src/stage/index/style/CLScene.less

@@ -1,7 +1,6 @@
 @import './Mixins.less';
 @import './component/GoodsItem.less';
 @import './component/CourseItem.less';
-@import './component/TrainingItem.less';
 
 #CLScene {
     position: absolute;
@@ -23,6 +22,7 @@
             color: #fff;
             font-size: 0.6rem;
             font-weight: bold;
+            // padding: 0.58rem 0 0.33rem 0.74rem;
             padding-top: 0.58rem;
             padding-bottom: 0.33rem;
             text-align: center;
@@ -32,13 +32,14 @@
         }
         #cl-left-tab-scroll{
             position: relative;
-            overflow: hidden;
+            overflow: auto;
             height: 8.55rem;
         }
         .item {
             color: white;
             font-size: 0.42rem;
             height: 1.05rem;
+            // padding-left: 1.16rem;
             text-align: center;
             span {
                 position: relative;
@@ -116,21 +117,9 @@
             overflow: hidden;
             padding-bottom: 0.18rem;
         }
-        .training-item {
-            float: left;
-            margin-bottom: 0.1rem;
-            width: 6.8rem;
-            height: 4.2rem;
-            .training-item-frame {
-                margin: 0.35rem 0.35rem 0 0.22rem;
-            }
-            &.fe-focus .training-item-frame {
-                .after-focus(@borderSize; #ffe100);
-            }
-        }
         .item {
             float: left;
-            margin-bottom: 0.1rem;
+	        margin-bottom: 0.1rem;
             width: 3.52rem;
             height: 4.84rem;
 

+ 9 - 0
src/stage/index/style/CourseScene.less

@@ -264,6 +264,11 @@
 					.download-btn-lesson-list-ready;
 					background-image:url('assets/img/CourseScene/download_btn_list_success.png');
 				}
+				.download-btn-lesson-list-failed {
+					.download-btn-lesson-list-ready;
+					background-image:url('assets/img/CourseScene/download_btn_list_failed.png');
+				}
+
 			}
 		}
 
@@ -328,6 +333,10 @@
 						.download-btn-lesson-icon-ready;
 						background-image:url('assets/img/CourseScene/download_btn_icon_success.png');
 					}
+					.download-btn-lesson-icon-failed {
+						.download-btn-lesson-icon-ready;
+						background-image:url('assets/img/CourseScene/download_btn_icon_success.png');
+					}
 		        }//lesson-wrapper
 			}
 		}

+ 38 - 42
src/stage/index/style/DownloadScene.less

@@ -85,23 +85,20 @@
 				text-align: center;
 			}
 			.two {
-				width:3.87rem;
+				width:2.87rem;
 				.right-border;
 			}
 			.three {
-				width:3.37rem;
+				width:4.37rem;
 				.right-border;
 			}
 			.four {
-				width:1.5rem;
+				width:2.6rem;
 				.right-border;
 			}
 			.five {
-				width:2rem;
-				.right-border;
-			}
-			.six {
 				width:2.9rem;
+				text-align: center;
 			}
 		}
 	}
@@ -111,15 +108,17 @@
 		position: absolute;
 		width: 100%;
 		margin-left: 0.38rem;
-		display:table;
+		display:block;
 		height: 7.39rem;
-    	overflow: hidden;
-
+    	overflow: auto;
 		.scroll-lines-wrapper{
 			z-index: 1;
 			position: absolute;
 			margin-top: 0;
 		}
+		&::-webkit-scrollbar {
+			display: none;
+		}
 	}//content-wrapper
 
 	.row {
@@ -143,49 +142,46 @@
 			text-align: center;
 		}
 		.two {
-			width:3.87rem;
+			width:2.87rem;
 		}
 		.three {
-			width:3.37rem;
+			width:4.37rem;
 		}
 		.four {
-			width:1.5rem;
+			width:2.6rem;
 		}
 		.five {
-			width:2rem;
-		}
-		.six {
-			width:2.9rem;
+			width:3.5rem;
 			text-align: center;
-
-			.download-enter-btn {
-				width: 1.7rem;
-				height: .6rem;
-				border: .05rem solid transparent;
-				.img-btn {
-					height: 100%;
-					width: 100%;
+			#download-btn-wrapper {
+				display: inline-block;
+				.download-enter-btn {
+					display: inline-block;
+					width: 1.7rem;
+					height: .6rem;
+					border: .05rem solid transparent;
+					.img-btn {
+						height: 100%;
+						width: 100%;
+					}
+					&.fe-focus {
+				//		border: .05rem solid #ffe100;
+				//		border-radius: .25rem;
+					}
 				}
-
-				&.fe-focus {
-			//		border: .05rem solid #ffe100;
-			//		border-radius: .25rem;
+				.download-del-btn {
+					display: inline-block;
+					width: 1rem;
+					height: .6rem;
+					border: .05rem solid transparent;
+					.img-btn{
+						height: 100%;
+						width: 100%;
+					}
 				}
 			}
 
-			.download-del-btn {
-				width: 1rem;
-				height: .6rem;
-				border: .05rem solid transparent;
-				.img-btn{
-					height: 100%;
-					width: 100%;
-				}
-				&.fe-focus {
-					//border: .05rem solid #ffe100;
-					//border-radius: .25rem;
-				}
-			}
+
 		}
 		&.row-header{
 			height: 0.9rem;

+ 74 - 0
src/stage/index/style/DownloadTipScene.less

@@ -0,0 +1,74 @@
+.course-download-wrapper {
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  background-color: rgba(0, 0, 0, .5);
+  z-index: 2;
+
+  .toast {
+    position: absolute;
+    width: 8.52rem;
+    height: 5.04rem;
+    top: 50%;
+    left: 50%;
+    transform: translate3d(-50%, -50%, 0);
+    -webkit-transform: translate3d(-50%, -50%, 0);
+    overflow: hidden;
+    padding: 0.33rem;
+    line-height: 1;
+    background-color: #ffffff;
+    text-align: center;
+    border-radius: 0.6rem;
+    font-size: 0.48rem;
+
+    img {
+      width: 1.3rem;
+      height: 1.3rem;
+      border-radius: 0.65rem;
+    }
+
+    p {
+      color: #515151;
+      font-size: 0.48rem;
+      margin: 0.4rem;
+    }
+
+    .ok-btn {
+      position: absolute;
+      bottom: .34rem;
+      left: 2.5rem;
+      width: 3.6rem;
+      height: 1.2rem;
+      padding: 0.3rem 0;
+      border-radius: .5rem;
+      color: #fff;
+      background-color: #fe84b2;
+      font-size: 0.48rem;
+
+      &.fe-focus {
+        //.after-focus(@borderSize; #ff5050);
+      }
+    }
+
+    /*
+    .cancle {
+        position: absolute;
+        bottom: .34rem;
+        right: .34rem;
+        width: 3.6rem;
+        height: 1.2rem;
+        line-height: 1.2rem;
+        border-radius: .5rem;
+        color: #fff;
+        background-color: #fe84b2;
+        font-size: 0.48rem;
+
+        &.fe-focus {
+            .after-focus(@borderSize; #ff5050);
+        }
+    }
+    */
+  }
+}

+ 3 - 3
src/stage/index/style/IndexScene.less

@@ -51,15 +51,15 @@
 	width: unit(@designWidth, rem);
 	height: unit(@designHeight, rem);
 	padding: 0.05rem 1.2rem .5rem;
-	background-image: url('assets/img/IndexScene/index_bg.png');
+	background-image: url('assets/img/IndexScene/background.png');
 	background-size: cover;
 	background-repeat: no-repeat;
 
 	.m-logo{
 		position: absolute;
 		top: 1rem;
-		width: 3.62rem;
-		height: 1.30rem;
+		width: 5.64rem;
+		height: 1.2rem;
 		background-image: url('assets/img/IndexScene/logo.png');
 		background-size: 100% 100%;
 		background-repeat: no-repeat;

+ 1 - 1
src/stage/index/style/LessonScene.less

@@ -167,7 +167,7 @@
 						background-image: url(assets/img/Audio/audio_next.png);
 					}
 					&.fe-focus {
-						.after-focus(@borderSize; #ffe100; .1rem; rgba(0,0,0,0.5));
+						// .after-focus(@borderSize; #ffe100; .1rem; rgba(0,0,0,0.5));
 					}
 				}
 			}

+ 1 - 8
src/stage/index/style/LoginScene.less

@@ -112,11 +112,7 @@
 				font-size: 0.45rem;
 				color: #fff;
 				background: #ccc;
-
-				&.fe-focus {
-					background: #2973d7;
-				//	.after-focus(@outLineSize; #ff5a00; 0; #ff5a00);
-				}
+				outline: none;
 			}
 		}
 	}
@@ -190,9 +186,6 @@
 					background-image: url('assets/img/LoginScene/enter.png');
 				}
 			}
-			&.fe-focus .key-icon {
-			//	.after-focus(@outLineSize; #ff5a00; 0; #ff5a00);
-			}
 		}
 	}
 }

+ 0 - 11
src/stage/index/style/TrainingScene.less

@@ -1,11 +0,0 @@
-#trainingImg {
-	position: absolute;
-	left: 0;
-	top: 0;
-	width: 100%;
-	height: 100%;
-	overflow: hidden;
-	background-image: url(assets/img/icon.png);
-	background-size: 100% 100%;
-	background-repeat: no-repeat;
-}

+ 0 - 50
src/stage/index/style/component/TrainingItem.less

@@ -1,50 +0,0 @@
-.training-item-frame {
-    width: 6.55rem;
-    height: 4rem;
-    border: solid unit(@borderSize, rem) transparent;
-    border-radius: unit(@borderRadius + 0.04 , rem);
-    position: relative;
-    img {
-        position: inherit;
-        width: 100%;
-        height: 100%;
-        border-radius: unit(@borderRadius, rem);
-    }
-    .training-new{
-        position: absolute;
-        background: url('./assets/img/new.png') no-repeat center;
-        background-size: 100% 100%;
-        width: 0.46rem;
-        height: 0.46rem;
-        border-radius: 0 unit(@borderRadius, rem) 0 0;
-        right: -0.18rem;
-        top: -0.18rem;
-    }
-    .training-desc {
-        position: absolute;
-        // margin-bottom: 0.32rem;
-        bottom: 0;
-        width: 100%;
-        height: 0.96rem;
-        background: #fff;
-        border-radius: 0 0 unit(@borderRadius, rem)  unit(@borderRadius, rem);
-        .subject{
-            width: 100%;
-            margin-top: 0.12rem;
-            margin-left: 0.32rem;
-            font-size: 0.28rem;
-            line-height: 0.28rem;
-            white-space: nowrap;
-			      overflow: hidden;
-        }
-        .subject-sub{
-            width: 100%;
-            margin-top: 0.16rem;
-            margin-left: 0.32rem;
-            font-size: 0.28rem;
-            line-height: 0.28rem;
-            white-space: nowrap;
-            overflow: hidden;
-        }
-    }
-}

+ 5 - 4
src/util/API/AJAXHelper.js

@@ -52,17 +52,18 @@ class AJAXHelper {
 		let platform = 'tv';
 		if (!window.efunbox) {
 			platform = 'web';
-		}
-		let url = AJAXHelper.genAPIUrl(path, method, { eid, uid, terminal: platform, ...data });
-
+    }
+    //添加时间戳
+    let timestamp = new Date().getTime();
+    let url = AJAXHelper.genAPIUrl(path, method, { eid, uid, t:timestamp, terminal: platform, ...data });
 		let xmlHttpReq = new XMLHttpRequest();
 		xmlHttpReq.open(method, url, true);
 		//构造请求头(每个请求都带的公共参数)
 		xmlHttpReq.setRequestHeader('eid', eid);
 		xmlHttpReq.setRequestHeader('uid', uid);
 		xmlHttpReq.setRequestHeader('sign', sign);
-		xmlHttpReq.setRequestHeader('terminal', platform);
 		xmlHttpReq.setRequestHeader('merchant', 'baby');
+		xmlHttpReq.setRequestHeader('terminal', platform);
 		xmlHttpReq.setRequestHeader('requestId', requestId);
 		xmlHttpReq.setRequestHeader('Authentication', sign); //header中增加Authentication以兼容老版本
 		xmlHttpReq.setRequestHeader('Content-Type', 'application/' + (method == 'POST' || method == 'PUT' ? 'json' : 'text'));

+ 50 - 14
src/util/API/APIClient.js

@@ -1,10 +1,11 @@
 import Consts from '../Consts';
 import AJAXHelper from './AJAXHelper';
 import userDataStorage from '../userDataStorage';
+import WinBoxAPI from '../WinBoxAPI';
 import Utils from '../Utils';
 
 class APIClient {
-	constructor() { }
+	constructor() {}
 
 	// 添加缓存参数,安卓截获带有此参数的请求
 	static addCacheParam(params, cacheKeySrc=null, cacheKey=null){
@@ -24,19 +25,28 @@ class APIClient {
 
 	// 账户登录,获取token,绑定设备
 	static userLoginAndBindDevice(data, callback) {
+		let deviceModel,deviceMfrs,deviceBrand = '';
 		let deviceCode = localStorage.getItem('deviceCode');
+    if(window.efunbox) {
+      deviceModel = window.efunbox.getModelForDevice();
+      deviceMfrs = window.efunbox.getMfrsForDevice();
+      deviceBrand = window.efunbox.getBrandForDevice();
+		}
 		if (!deviceCode) {
 			if (window.efunbox) {
-				deviceCode = window.efunbox.getUuidForDevice();
+        deviceCode = window.efunbox.getUuidForDevice();
 			} else {
-				deviceCode = Utils.getUuidForWeb();
+        deviceCode = Utils.getUuidForWeb();
 			}
 			localStorage.setItem('deviceCode', deviceCode);
 		}
 		let params = {
-			deviceCode,
+      deviceCode,
 			eid: data.usercode,
 			password: data.password,
+      deviceModel: deviceModel,
+      deviceMfrs: deviceMfrs,
+      deviceBrand: deviceBrand
 		};
 		AJAXHelper.post('/token', params, callback);
 	}
@@ -87,8 +97,14 @@ class APIClient {
 
 	// 根据课程获取课列表
 	static getLessonList(courseId, callback) {
-		let params = APIClient.addCacheParam({});
-		AJAXHelper.get(`/course/${courseId}/lessons`, params, callback);
+    APIClient.getUserMacUrl( ( mac ) => {
+      let params = APIClient.addCacheParam({});
+      params.mac = mac;
+      AJAXHelper.get(`/course/${courseId}/lessons`, params , callback);
+    });
+    // let params = APIClient.addCacheParam({});
+    // console.log('params',params)
+    // AJAXHelper.get(`/course/${courseId}/lessons`, { params }, callback);
 	}
 
 	// 获取课程详情
@@ -103,6 +119,13 @@ class APIClient {
 		params = APIClient.addCacheParam(params);
 		AJAXHelper.get(`/lesson/${lessonId}`, params, callback);
 	}
+  //在课件里面获取 具体课的下载进度
+  static getDownloadProcess( lessonId, callback) {
+    APIClient.getUserMacUrl( ( mac ) => {
+      let params = { lessonId, mac }
+      AJAXHelper.get(`/callback/download/find`, params, callback);
+    });
+  }
 
 	// 获取该课程相关配套列表
 	static getCourseAboutSupport(courseId, callback) {
@@ -116,12 +139,6 @@ class APIClient {
 		AJAXHelper.get(`/support/${supportId}`, params, callback);
 	}
 
-	// 获取师训详情
-	static getTrainingDetail(trainingId, callback) {
-		let params = APIClient.addCacheParam({});
-		AJAXHelper.get(`/training/${trainingId}`, params, callback);
-	}
-
 	// 获取购物车列表
 	static getShopCartList(callback) {
 		let params = { pageNo: 1, pageSize: 100 };
@@ -173,10 +190,29 @@ class APIClient {
 	  AJAXHelper.post('/callback/event', params, callback);
 	}
 
+	// 获取用户的mac地址
+	static getUserMacUrl(callback) {
+		let mac = '';
+		WinBoxAPI.getMacUrl((isTrue, res) => {
+			mac = res.data;
+			callback( mac );
+		})
+	}
+
 	// 获取用户的下载记录
 	static getUserDownloadList(callback) {
-		AJAXHelper.get('/callback/download/list', {}, callback);
-	}
+		APIClient.getUserMacUrl( ( mac ) => {
+			AJAXHelper.get('/callback/download/list', { mac: mac }, callback);
+		});
+	}
+
+	//refresh 处的查询下载记录
+	static getDownloadList(callback) {
+    APIClient.getUserMacUrl( ( mac ) => {
+		let params =  { mac: mac };
+      	AJAXHelper.get('/callback/download/fail', params, callback);
+    });
+  }
 }
 
 module.exports = APIClient;

+ 3 - 3
src/util/Consts.js

@@ -11,7 +11,7 @@ class Consts {
 }
 
 //node服务接口地址
-Consts.NODE_SERVER = 'http://127.0.0.1:8089';
+Consts.NODE_SERVER = 'http://127.0.0.1:9191';
 
 //图片/视频资源域名
 Consts.IMG_PATH = 'https://efunimgs.ai160.com';
@@ -49,8 +49,8 @@ Consts.DOWNLOAD_STATUS_SUCCESS = 1;
 Consts.DOWNLOAD_STATUS_ONGOING = 2;
 Consts.DOWNLOAD_STATUS_FAILED = 3;
 
-Consts.ANDROID_FORCE_VERSION = '3.2.0';
-Consts.ANDROID_APK_URL = Consts.IMG_PATH + '/2b/APK/kid3.3.0.apk';
+Consts.ANDROID_FORCE_VERSION = '2.2.2';
+Consts.ANDROID_APK_URL = Consts.IMG_PATH + '/2b/APK/angelbell2.2.2.apk';
 Consts.ANDROID_UPDATE_MSG = '发现新版本,请点击确定按钮更新!';
 
 Consts.KEYCODE_EXIT = 27;

+ 0 - 7
src/util/EfunVideoPlayer.js

@@ -4,12 +4,6 @@ class EfunVideoPlayer {
     this.metadata = null;
   }
 
-  loadedHandler() {
-    this.efunplayer.addListener('loadedmetadata', () => {
-      this.metadata = this.efunplayer.getMetaDate();
-    });
-  }
-
   initPlayer(url, domId) {
     let videoObject = {
       autoplay: true,
@@ -30,7 +24,6 @@ class EfunVideoPlayer {
   }
 
   pause() {
-    console.log('click pause btn...');
     this.efunplayer.videoPause();
   }
 

+ 14 - 9
src/util/WinBoxAPI.js

@@ -5,11 +5,16 @@ class WinBoxAPI {
   constructor() {}
 
   static whenAjaxResponse(httpRequest, callback) {
-		if (httpRequest.readyState != 4) {
+    if (httpRequest.readyState != 4) {
 			return;
 		}
-		let res = JSON.parse(httpRequest.responseText);
-		callback(httpRequest.status == 200, res);
+    try {
+		  let res = JSON.parse(httpRequest.responseText);
+		  callback(httpRequest.status == 200, res);
+    }
+    catch(err) {
+      callback(false, {});
+    }
   }
 
   static baseRequest(method, path, params, callback) {
@@ -47,18 +52,18 @@ class WinBoxAPI {
     WinBoxAPI.get(path, params, callback);
   }
 
+  //获取mac地址
+  static getMacUrl(callback) {
+    let path = '/lesson/getMac';
+    WinBoxAPI.get(path, {}, callback);
+  }
+
   static deleteDownloadFile(lessonId, courseId, callback) {
 		const { token = '', uid = '', eid = '' } = userDataStorage.getData() || {};
     let path = '/lesson/delFile';
     let params = { lessonId, courseId, uid, eid, token };
     WinBoxAPI.get(path, params, callback);
   }
-
-  static readDownloadedFile(lessonId, courseId, callback) {
-		const { token = '', uid = '', eid = '' } = userDataStorage.getData() || {};
-    let path = '/lesson/readFile';
-    let params = { lessonId, courseId, uid, eid, token };
-  }
 }
 
 module.exports = WinBoxAPI;

+ 2 - 1
src/util/course.js

@@ -15,7 +15,6 @@ class Course {
 		let item = data[idx];
 			recs.push(item.id);
 		}
-
 		// 现在只按文字模板进行渲染
 		main.innerHTML = this.textList(data, auth);
 	}
@@ -29,6 +28,8 @@ class Course {
 			}
 			else if (data.downloadStatus == Consts.DOWNLOAD_STATUS_SUCCESS) {
 				btnClass = 'download-btn-lesson-list-success';
+			} if ( data.downloadStatus == Consts.DOWNLOAD_STATUS_FAILED ) {
+				btnClass = 'download-btn-lesson-list-failed';
 			}
 			return `
 				<div data-seq="${seq}">