Commit e0502f71 authored by limingzhe's avatar limingzhe
parents 468bfa95 98bcba55
...@@ -40,15 +40,19 @@ export default class NewClass extends middleLayerBase { ...@@ -40,15 +40,19 @@ export default class NewClass extends middleLayerBase {
(<any>window).air = {}; (<any>window).air = {};
} }
(<any>window).air.hideAirClassLoading = () => { (<any>window).air.hideAirClassLoading = () => {
console.log('汪汪汪'); if ((<any>window).air.onCourseInScreen) {
(<any>window).air.onCourseInScreen && (<any>window).air.onCourseInScreen(() => { (<any>window).air.onCourseInScreen(() => {
console.log("***成功调用onCourseInScreen***"); console.log("***成功调用onCourseInScreen***");
(<any>window).air.onCourseInScreen = null; (<any>window).air.onCourseInScreen = null;
this.hideWaitingLetters();
this.hideMask();
}); });
} else {
this.hideWaitingLetters(); this.hideWaitingLetters();
this.hideMask(); this.hideMask();
} }
} }
}
async showTips(str: string) { async showTips(str: string) {
const tipsLayer = cc.find('middleLayer/tipsLayer'); const tipsLayer = cc.find('middleLayer/tipsLayer');
const label = cc.find('middleLayer/tipsLayer/tips/label'); const label = cc.find('middleLayer/tipsLayer/tips/label');
...@@ -101,7 +105,7 @@ export default class NewClass extends middleLayerBase { ...@@ -101,7 +105,7 @@ export default class NewClass extends middleLayerBase {
const { versionName: onlineVersion, storeList } = await this.getOnlineVersion(); const { versionName: onlineVersion, storeList } = await this.getOnlineVersion();
const nativeVersion = await this.getNativeVersion(); const nativeVersion = await this.getNativeVersion();
this.version = nativeVersion; this.version = nativeVersion;
if (onlineVersion != '' && onlineVersion != nativeVersion) { if (onlineVersion != '' && onlineVersion != nativeVersion && this.type!='aixuebao') {
console.log('onlineVersion = ' + onlineVersion); console.log('onlineVersion = ' + onlineVersion);
console.log('nativeVersion = ' + nativeVersion); console.log('nativeVersion = ' + nativeVersion);
...@@ -110,11 +114,11 @@ export default class NewClass extends middleLayerBase { ...@@ -110,11 +114,11 @@ export default class NewClass extends middleLayerBase {
} }
async getNativeVersion() { async getNativeVersion() {
const engineInfo = await this.getEngineInfo(); const engineInfo = await this.getEngineInfo();
const { version, isDev, type, uuid } = JSON.parse(engineInfo); const { version, isDev, type, uuid, mac } = JSON.parse(engineInfo);
this.version = version; this.version = version;
this.isDev = isDev; this.isDev = isDev;
this.type = type; this.type = type;
this.engine_uuid = uuid; this.engine_uuid = mac || uuid;
return this.version; return this.version;
} }
...@@ -281,6 +285,7 @@ export default class NewClass extends middleLayerBase { ...@@ -281,6 +285,7 @@ export default class NewClass extends middleLayerBase {
score: data ? data.score : 0, score: data ? data.score : 0,
result: JSON.stringify(data), result: JSON.stringify(data),
study_duration: Date.now() - this.courseOpenTimeStamp, study_duration: Date.now() - this.courseOpenTimeStamp,
is_folder_end: (this.courseIndex == this.courses.length - 1) ? 1 : 0
}); });
callback && callback(res); callback && callback(res);
} }
...@@ -660,7 +665,9 @@ export default class NewClass extends middleLayerBase { ...@@ -660,7 +665,9 @@ export default class NewClass extends middleLayerBase {
return; return;
} }
// this.showConfirm("确定跳过吗?", () => { // this.showConfirm("确定跳过吗?", () => {
if (!this.isShowWaiting) {
this.goNextPage(); this.goNextPage();
}
// }); // });
}); });
buttonOnClick(cc.find('middleLayer/BtnLeft'), () => { buttonOnClick(cc.find('middleLayer/BtnLeft'), () => {
......
...@@ -198,7 +198,7 @@ export abstract class middleLayerBase extends cc.Component { ...@@ -198,7 +198,7 @@ export abstract class middleLayerBase extends cc.Component {
this.currentBundleInfo = { sceneName, version, bondleUrl }; this.currentBundleInfo = { sceneName, version, bondleUrl };
console.log("[middleLayer_for_NJ_lite]-[loadBundle] currentBundleInfo=", JSON.stringify(this.currentBundleInfo)) console.log("[middleLayer_for_NJ_lite]-[loadBundle] currentBundleInfo=", JSON.stringify(this.currentBundleInfo))
this.showWaitingLetters(); this.showWaitingLetters();
cc.audioEngine.stopAll();
const oldSceneName = this.currentBundleInfo?.sceneName; const oldSceneName = this.currentBundleInfo?.sceneName;
const engineInfo = await this.getEngineInfo(); const engineInfo = await this.getEngineInfo();
const { isChanged } = JSON.parse(engineInfo); const { isChanged } = JSON.parse(engineInfo);
...@@ -208,7 +208,6 @@ export abstract class middleLayerBase extends cc.Component { ...@@ -208,7 +208,6 @@ export abstract class middleLayerBase extends cc.Component {
cc.assetManager.loadBundle(bondleUrl, { version: version }, async (err, bundle) => { cc.assetManager.loadBundle(bondleUrl, { version: version }, async (err, bundle) => {
bundle.loadScene(sceneName, null, null, (err, scene) => { bundle.loadScene(sceneName, null, null, (err, scene) => {
cc.audioEngine.stopAll();
this.loadBundleLock = false; // 加载完成 解锁 this.loadBundleLock = false; // 加载完成 解锁
let bufferedLoadBundle = this.getLoadBundleFromBuffer(); let bufferedLoadBundle = this.getLoadBundleFromBuffer();
if(bufferedLoadBundle) { if(bufferedLoadBundle) {
...@@ -350,12 +349,14 @@ export abstract class middleLayerBase extends cc.Component { ...@@ -350,12 +349,14 @@ export abstract class middleLayerBase extends cc.Component {
this.goTarIndexPage(this.courseIndex - 1); this.goTarIndexPage(this.courseIndex - 1);
} }
goNextPage() { goNextPage() {
console.log("====goNextPage====");
this.goTarIndexPage(this.courseIndex + 1); this.goTarIndexPage(this.courseIndex + 1);
} }
goTarIndexPage(index) { goTarIndexPage(index) {
if (!this.courses || index == this.courseIndex || index < 0 || index > this.courses.length - 1) { if (!this.courses || index == this.courseIndex || index < 0 || index > this.courses.length - 1) {
return; return;
} }
this.showWaitingLetters(); this.showWaitingLetters();
(<any>window).courseware.freeAllOcMethod(); (<any>window).courseware.freeAllOcMethod();
...@@ -372,7 +373,7 @@ export abstract class middleLayerBase extends cc.Component { ...@@ -372,7 +373,7 @@ export abstract class middleLayerBase extends cc.Component {
} }
log(str: string) { log(str: string) {
cc.log(str); console.log(str);
} }
showTips(str: string) { showTips(str: string) {
......
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