Commit 512734ce authored by huoshizhe's avatar huoshizhe

feat: getData

parent 73ef6105
......@@ -4,7 +4,13 @@ cc.Class({
getData(callBack) {
const uri = 'courseware/v1/getdata';
const syllabus_id = this.bundleInfoList[this.currentBundleIndex].syllabus_id;
let syllabus_id;
if (this.bundleType == 'StoryBox') {
syllabus_id = this.syllabus_id;
} else if (this.bundleType == 'WW') {
syllabus_id = this.bundleInfoList[this.currentBundleIndex].syllabus_id;
}
const data = {
courseid: syllabus_id
};
......@@ -91,11 +97,11 @@ cc.Class({
// })
// }, 20000);
// this.baseUrl = 'http://staging-teach.ireadabc.com/api/';
// this.initStoryBoxView({
// coursewareId: 18307
// });
// this.bundleType = 'StoryBox';
this.baseUrl = 'http://staging-teach.ireadabc.com/api/';
this.initStoryBoxView({
coursewareId: 18307
});
this.bundleType = 'StoryBox';
this.log('汪汪汪');
},
......@@ -163,6 +169,7 @@ cc.Class({
return;
}
this.syllabus_id = defaultBondle.children[0].id;
this.loadBundleByConf(defaultBondle.children[0].conf, () => {
const ExitBtn = cc.find('middleLayer/storyBox/ExitBtn');
ExitBtn.active = true;
......@@ -263,14 +270,8 @@ cc.Class({
btnSelected.on('click', () => {
this.hideMenu();
if (cc.sys.isNative && cc.sys.os == cc.sys.OS_IOS) {
this.loadBundle(data.children[0].conf.ios);
} else if (cc.sys.isNative && cc.sys.os == cc.sys.OS_ANDROID) {
this.loadBundle(data.children[0].conf.android);
} else {
this.loadBundle(data.children[0].conf.web_desktop);
console.error('非源生环境');
}
this.syllabus_id = data.children[0].id;
this.loadBundleByConf(data.children[0].conf);
});
if (data.has_child == '1') {
......@@ -290,6 +291,7 @@ cc.Class({
.to(0.1, { scale: 1.00 })
.call(() => {
this.hideMenu();
this.syllabus_id = menuData.children[0].id;
this.loadBundleByConf(menuData.children[0].conf);
})
.start();
......
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