Commit 3d1d1e94 authored by huoshizhe's avatar huoshizhe

feat:

parent c19c6119
......@@ -10,7 +10,6 @@ cc.Class({
}
callBack(this.saveData);
} else {
console.log('汪汪汪_3')
callBack(JSON.parse(this.courseItem.data));
}
return;
......@@ -28,13 +27,13 @@ cc.Class({
onHomeworkFinish(callBack) {
if (!this.saveData) {
console.log('汪汪汪1')
this.saveData = { step: 1 };
} else {
console.log('汪汪汪2: ' + this.saveData.step)
this.saveData.step++;
}
cc.audioEngine.stopAll();
console.log(`this.loadOnlineBundle('PS_000');`);
this.loadOnlineBundle('PS_000');
// this.loadLocalBundle('192.168.1.102', '8081');
......@@ -206,11 +205,14 @@ cc.Class({
loadOnlineBundle(bundleName, onSuccess = null) {
this.showWaitingLetters();
if (!this.saveBundleNameMap) {
this.saveBundleNameMap = {};
}
if (this.saveBundleNameMap[bundleName]) {
cc.director.loadScene(this.saveBundleNameMap[bundleName]);
cc.director.loadScene(this.saveBundleNameMap[bundleName], () => {
this.hideWaitingLetters();
});
return;
}
this.callNetworkApiGet(`http://staging-teach.ireadabc.com`, `/api/template/v1/${bundleName}`, {}, (datastr) => {
......@@ -233,7 +235,8 @@ cc.Class({
},
loadOnlineBundleByCourseId(courseId) {
this.showWaitingLetters();
// this.showWaitingLetters();
const baseUrl = `http://staging-teach.ireadabc.com/api/`;
let api = `courseware/v1/${courseId}/list`;
// if (linkFlag === true) {
......@@ -282,6 +285,7 @@ cc.Class({
loadBundle(sceneName, version, bondleUrl, onSuccess = null) {
cc.assetManager.loadBundle(bondleUrl, { version: version }, async (err, bundle) => {
if (err) {
this.hideWaitingLetters();
return this.asyncDelayLog(err);
}
if (!onSuccess) {
......@@ -293,6 +297,7 @@ cc.Class({
cc.director.runScene(scene);
});
} else {
this.hideWaitingLetters();
await onSuccess(bundle);
}
});
......@@ -305,7 +310,6 @@ cc.Class({
} else if (cc.sys.isNative && cc.sys.os == cc.sys.OS_ANDROID) {
return jsb.reflection.callStaticMethod('com/iplayabc/cocos/AppActivity', 'cocosWithNativeProtocol', '(Ljava/lang/String;)Ljava/lang/String;', paramStr);
} else if (cc.sys.isNative && cc.sys.os == cc.sys.OS_WINDOWS) {
console.log('汪汪汪')
} else {
throw ('非源生环境');
}
......@@ -314,7 +318,8 @@ cc.Class({
showWaitingLetters() {
const colorList = this.getRainbowColorList();
const layout = cc.find('middleLayer/layout');
// layout.active = true;
layout.active = true;
layout.removeAllChildren();
const str = 'Now Loading...';
str.split('').forEach((word, idx) => {
const node = new cc.Node();
......@@ -384,23 +389,20 @@ cc.Class({
getRainbowColorList() {
return [
cc.color(255, 255, 0),
cc.color(128, 255, 0),
cc.color(0, 255, 0),
cc.color(0, 0, 0),
cc.color(0, 255, 128),
cc.color(0, 255, 255),
cc.color(0, 128, 255),
cc.color(0, 0, 255),
cc.color(128, 0, 255),
cc.color(255, 0, 255),
cc.color(255, 0, 128),
cc.color(255, 0, 0),
cc.color(255, 128, 0),
cc.color(255, 255, 0),
cc.color(128, 255, 0),
cc.color(0, 255, 0),
cc.color(0, 255, 0),
];
}
});
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