|
@@ -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');
|
|
@@ -343,21 +348,19 @@ class CourseScene extends scene {
|
|
|
|
|
|
// 点击正在下载的某一课
|
|
|
if (e.target.con.classList.contains('download-btn-lesson-list-ongoing') || e.target.con.classList.contains('download-btn-lesson-icon-ready')) {
|
|
|
- console.log('e.target', e.target);
|
|
|
- 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;
|
|
|
+ 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);
|
|
@@ -415,8 +418,10 @@ 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;
|
|
@@ -434,7 +439,6 @@ class CourseScene extends scene {
|
|
|
return;
|
|
|
}
|
|
|
*/
|
|
|
-
|
|
|
this.addLessonDownloadTask({ lessonID, courseID, event: e });
|
|
|
}
|
|
|
}
|