Commit 32810bad authored by huoshizhe's avatar huoshizhe

feat: getData

parent a22be096
......@@ -96,9 +96,22 @@ cc.Class({
cc.audioEngine.stopAll()
},
getData(cb) {
cb(this.getDefaultData());
},
getData(func) {
if (window && window.courseware) {
window.courseware.getData(func, 'scene');
return;
}
const middleLayer = cc.find('middleLayer');
if (middleLayer) {
const middleLayerComponent = middleLayer.getComponent('middleLayer');
middleLayerComponent.getData(func);
return;
}
func(this.getDefaultData());
},
getDefaultData() {
const dataJson = '{"contentObj":{"version":"1.0","key":"DataKey_Sbx_Pronunciation","theme":"D","border_image_url":"","video_image_url":"","text_image_url":"","dataArray":[{"video_url":"http://staging-teach.cdn.ireadabc.com/16eace86b47925cc644797cecd37b03b.mp4","textDragonBones":{"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/e74e4ffcb5c7b3321b448c93969541cd.png","name":"kkKoala_tex.png"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/fca011e0fe39287dc8dd2cd44c0ef7ed.json","name":"kkKoala_tex.json"},"skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/d825a8ed1199f157800e11ddb9954146.json","name":"kkKoala_ske.json"}},"rightDragonBones":{"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/aedca82ee5031ab43082c7a08a79b3d6.png","name":"蚂蚁骨骼_animation_tex.png"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/f86dd94a9d56eab7c5f257abc600a577.json","name":"蚂蚁骨骼_animation_tex.json"},"skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/5482364adfb24d2b0f627f2767167f4b.json","name":"蚂蚁骨骼_animation_ske.json"}},"rightType":"image","image_url":"http://staging-teach.cdn.ireadabc.com/863035154daca76366204c0d4dddee51.png"}]}}'
......
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