Commit 7756cba8 authored by wangxin's avatar wangxin

test

parent dfc29d4a
No preview for this file type
...@@ -78,12 +78,23 @@ cc.Class({ ...@@ -78,12 +78,23 @@ cc.Class({
getData((data) => { getData((data) => {
console.log("data:", data); console.log("data:", data);
this.data = data; this.data = data || this.getDefaultData();
this.data = JSON.parse(JSON.stringify(this.data)); this.data = JSON.parse(JSON.stringify(this.data));
this.preloadItem(); this.preloadItem();
}); });
}, },
getData(cb) {
cb(this.getDefaultData());
},
getDefaultData() {
const dataJson =
'{"pic_url":"http://staging-teach.cdn.ireadabc.com/ed94332a503c31e0908bd4c6923a2665.png","pic_url_2":"http://staging-teach.cdn.ireadabc.com/5fb60317ade0195d35ad8034d5370a7f.png","text":"This is a test label.","audio_url":"http://staging-teach.cdn.ireadabc.com/f47f1d7b5c160fe1c59500d180346240.mp3"}';
const data = JSON.parse(dataJson);
return data;
},
preloadItem() { preloadItem() {
// this.addPreloadImage(); // this.addPreloadImage();
// this.addPreloadAudio(); // this.addPreloadAudio();
......
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