Commit b074272e authored by liujiangnan's avatar liujiangnan

feat

parent 7369cd9a
...@@ -187,6 +187,12 @@ cc.Class({ ...@@ -187,6 +187,12 @@ cc.Class({
middleLayer.log("middleLayer.log('像这样在这里打log')"); middleLayer.log("middleLayer.log('像这样在这里打log')");
}, },
getHistoryLastCourse(callback) {
this.callNetworkApiGet(this.baseApiUrl, `v1/terminal/user/answers/1`, { user_code: this.userCode }, res => {
callback(res.data.rows[0]);
});
},
loadGame() { loadGame() {
this.callNetworkApiGet(this.baseApiUrl, `v1/preference/courseware`, { user_code: this.userCode }, res => { this.callNetworkApiGet(this.baseApiUrl, `v1/preference/courseware`, { user_code: this.userCode }, res => {
if (res.code !== 200) { if (res.code !== 200) {
...@@ -196,8 +202,10 @@ cc.Class({ ...@@ -196,8 +202,10 @@ cc.Class({
return; return;
} }
this.courseIds = res.data; this.courseIds = res.data;
this.currentIndex = 0; this.getHistoryLastCourse(item => {
this.loadOnlineCourseWare(this.courseIds[0], false); this.currentIndex = item?this.courseIds.indexOf(item.syllabus_id):0;
this.loadOnlineCourseWare(this.courseIds[this.currentIndex], false);
});
}); });
}, },
...@@ -234,8 +242,6 @@ cc.Class({ ...@@ -234,8 +242,6 @@ cc.Class({
}) })
}, },
preloadAll() { preloadAll() {
if (window.preloadBundleAndSourcesFlag) { if (window.preloadBundleAndSourcesFlag) {
// 只加载一次就行了 // 只加载一次就行了
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment