Commit e417d2cc authored by liujiangnan's avatar liujiangnan

feat: 完成

parent 2a7dd682
......@@ -25,6 +25,18 @@ export default class NewClass extends middleLayerBase {
})
.start();
}
onCourseWareLoaded() {
// 课件加载完成的钩子
const process = cc.find(`middleLayer/pageProgress`);
const bar = cc.find(`bar`, process);
const barWidth = process.width * 1 / this.courses.length;
cc.tween(bar).to(0.5, { width: barWidth }).start();
const page = cc.find(`page`, process);
page.getComponent(cc.Label).string = `${this.courseIndex+1}/${this.courses.length}`;
}
// 需要预加载的数量
preloadCount = null;
// 统计已加载的数量
......@@ -182,6 +194,15 @@ export default class NewClass extends middleLayerBase {
onHomeworkFinish(callBack, data = null) {
this.goNextPage();
const process = cc.find(`middleLayer/pageProgress`);
const bar = cc.find(`bar`, process);
let barWidth = process.width / this.courses.length * (this.courseIndex+1);
barWidth = barWidth>process.width?process.width:barWidth;
cc.tween(bar).to(0.5, { width: barWidth }).start();
const page = cc.find(`page`, process);
page.getComponent(cc.Label).string = `${this.courseIndex+1}/${this.courses.length}`;
}
localMode = false;
......
......@@ -6,6 +6,8 @@ export abstract class middleLayerBase extends cc.Component {
abstract hideWaitingLetters(): void;
abstract showWaitingLetters(): void;
onCourseWareLoaded() {}
callNetworkApiPost(uri, data, callBack) {
this.getBaseUrl((baseUrl) => {
const xhr = new XMLHttpRequest();
......@@ -192,6 +194,7 @@ export abstract class middleLayerBase extends cc.Component {
}
this.reWriteAir();
this.loadPageBundle();
this.onCourseWareLoaded();
});
}
......
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