Commit 99bbdb88 authored by limingzhe's avatar limingzhe

fix: debug

parent 028fc7d2
...@@ -74,13 +74,13 @@ export default class NewClass extends middleLayerBase { ...@@ -74,13 +74,13 @@ export default class NewClass extends middleLayerBase {
//打开今日作业 //打开今日作业
if (this.course_id == this.JRZY_ID) { if (this.course_id == this.JRZY_ID) {
this.loadOnlineBundle("JJ_page_homework"); this.loadOnlineBundleNew("JJ_page_homework");
return; return;
} }
// 打开今日所学 // 打开今日所学
if (this.course_id == this.JRSX_ID) { if (this.course_id == this.JRSX_ID) {
this.loadOnlineBundle("JJ_page_learn"); this.loadOnlineBundleNew("JJ_page_learn");
return; return;
} }
} }
......
...@@ -129,6 +129,38 @@ export abstract class middleLayerBase extends cc.Component { ...@@ -129,6 +129,38 @@ export abstract class middleLayerBase extends cc.Component {
}); });
} }
loadOnlineBundleNew(bundleName, callback = null) {
if (this.IS_BUNDLE_LOADING) {
return;
}
this.IS_BUNDLE_LOADING = true;
console.log(' in loadOnlineBundleNew')
this.callNetworkApiGetNew(`api/template/v2/${bundleName}`, {}, (datastr) => {
// this.callNetworkApiGet(`api/template/v2/${bundleName}`, {}, (datastr) => {
const data = JSON.parse(datastr).data;
let sceneName, version, bondleUrl = "";
const templateBaseUrl = `${this.DOMAIN}h5template/${data.name}/v${data.last_version}`;
this.getConfigInfo(templateBaseUrl, (conf) => {
if (cc.sys.os == cc.sys.OS_IOS) {
sceneName = conf.ios.sceneName;
version = conf.ios.version;
bondleUrl = `${templateBaseUrl}/ios/${conf.ios.sceneName}`;
} else if (cc.sys.os == cc.sys.OS_ANDROID) {
sceneName = conf.android.sceneName;
version = conf.android.version;
bondleUrl = `${templateBaseUrl}/android/${conf.ios.sceneName}`;
} else {
sceneName = conf.android.sceneName;
version = "";
bondleUrl = `${templateBaseUrl}/web_desktop`;
}
this.loadBundle(sceneName, version, bondleUrl, callback);
});
});
}
loadOnlineBundle(bundleName, callback = null) { loadOnlineBundle(bundleName, callback = null) {
if (this.IS_BUNDLE_LOADING) { if (this.IS_BUNDLE_LOADING) {
return; return;
......
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