Commit ca83babf authored by 范雪寒's avatar 范雪寒

feat: 删除无用的注释

parent 60afbbe7
...@@ -3,7 +3,6 @@ cc.Class({ ...@@ -3,7 +3,6 @@ cc.Class({
properties: {}, properties: {},
getData(callBack) { getData(callBack) {
this.showLog('getData');
const uri = 'courseware/v1/getdata'; const uri = 'courseware/v1/getdata';
const syllabus_id = this.bundleInfoList[this.currentBundleIndex].syllabus_id; const syllabus_id = this.bundleInfoList[this.currentBundleIndex].syllabus_id;
const data = { const data = {
...@@ -61,19 +60,19 @@ cc.Class({ ...@@ -61,19 +60,19 @@ cc.Class({
xhr.send(JSON.stringify(data)); xhr.send(JSON.stringify(data));
}, },
async start() { start() {
await this.asyncDelayLog('汪汪汪');
this.node.zIndex = 9999; this.node.zIndex = 9999;
this.showWaitingLetters(); this.showWaitingLetters();
await this.asyncDelayLog('汪汪汪2');
cc.game.addPersistRootNode(this.node); cc.game.addPersistRootNode(this.node);
await this.asyncDelayLog('汪汪汪3');
this.initListener(); this.initListener();
await this.asyncDelayLog('汪汪汪4');
this.getBundleInfoList(); this.getBundleInfoList();
await this.asyncDelayLog('汪汪汪5');
}, },
asyncDelayLog(str) { asyncDelayLog(str) {
...@@ -85,25 +84,25 @@ cc.Class({ ...@@ -85,25 +84,25 @@ cc.Class({
}); });
}, },
async getBundleInfoList() { getBundleInfoList() {
await this.asyncDelayLog('汪汪汪31');
const jsonStr = this.callNativeFunction({ name: 'loadSceneList', value: '' }); const jsonStr = this.callNativeFunction({ name: 'loadSceneList', value: '' });
// const jsonStr = `{"bundleInfoList":[{"sceneName":"dfzx_cocos_T_FT_01","version":"c1a41","bondleUrl":"http://staging-teach.cdn.ireadabc.com//h5template/dfzx_cocos_T_FT_01/v3/android/dfzx_cocos_T_FT_01","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NDYyLCJ1dWlkIjoiZDNlODE0OGItOTNlNC00NzdiLWEyMmEtMjNkYTk4ZWVlMGYwIiwicGhvbmUiOiIxNTk0MDgzMzk1MCIsIm5pY2tfbmFtZSI6IuaZk-aFp-a1i-ivlSIsIm9yZ19pZCI6MTEsInNjaG9vbF9pZCI6MjA0LCJjbGFzc19pZCI6MTQxLCJkZnp4X3VzZXJfdXVpZCI6ImVmMTNhNTI3ZDg2ZDQ1MGY4MWJjMWE1OWQ0NDcyZTQwIiwiZGVsIjowLCJjcmVhdGVkX2RhdGUiOiIyMDIwLTA4LTA2VDA2OjA1OjUxLjAwMFoiLCJ1cGRhdGVkX2RhdGUiOiIyMDIwLTA4LTA3VDA4OjI3OjQwLjAwMFoiLCJhY2NvdW50X3R5cGUiOjIsImVuZF9kYXRlIjoiMjAyMS0xMC0xM1QxNjowMDowMC4wMDBaIiwiY2xhc3NSb2xlIjoic3R1IiwiaWF0IjoxNjI5ODYyMTA2LCJleHAiOjE2MzI0NTQxMDZ9.pKvGgI9yijd57vJBLAM9wuiPV5KkCriezV-FlD8fmLI","baseUrl":"http://staging-teach.ireadabc.com/api/","homework_id":"313","syllabus_id":"18984","role":"student"},{"sceneName":"dfzx_cocos_T_FT_01","version":"c1a41","bondleUrl":"http://staging-teach.cdn.ireadabc.com//h5template/dfzx_cocos_T_FT_01/v3/android/dfzx_cocos_T_FT_01","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NDYyLCJ1dWlkIjoiZDNlODE0OGItOTNlNC00NzdiLWEyMmEtMjNkYTk4ZWVlMGYwIiwicGhvbmUiOiIxNTk0MDgzMzk1MCIsIm5pY2tfbmFtZSI6IuaZk-aFp-a1i-ivlSIsIm9yZ19pZCI6MTEsInNjaG9vbF9pZCI6MjA0LCJjbGFzc19pZCI6MTQxLCJkZnp4X3VzZXJfdXVpZCI6ImVmMTNhNTI3ZDg2ZDQ1MGY4MWJjMWE1OWQ0NDcyZTQwIiwiZGVsIjowLCJjcmVhdGVkX2RhdGUiOiIyMDIwLTA4LTA2VDA2OjA1OjUxLjAwMFoiLCJ1cGRhdGVkX2RhdGUiOiIyMDIwLTA4LTA3VDA4OjI3OjQwLjAwMFoiLCJhY2NvdW50X3R5cGUiOjIsImVuZF9kYXRlIjoiMjAyMS0xMC0xM1QxNjowMDowMC4wMDBaIiwiY2xhc3NSb2xlIjoic3R1IiwiaWF0IjoxNjI5ODYyMTA2LCJleHAiOjE2MzI0NTQxMDZ9.pKvGgI9yijd57vJBLAM9wuiPV5KkCriezV-FlD8fmLI","baseUrl":"http://staging-teach.ireadabc.com/api/","homework_id":"313","syllabus_id":"18984","role":"student"}],"defaultBundleIdx":0}`; // const jsonStr = `{"bundleInfoList":[{"sceneName":"dfzx_cocos_T_FT_01","version":"c1a41","bondleUrl":"http://staging-teach.cdn.ireadabc.com//h5template/dfzx_cocos_T_FT_01/v3/android/dfzx_cocos_T_FT_01","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NDYyLCJ1dWlkIjoiZDNlODE0OGItOTNlNC00NzdiLWEyMmEtMjNkYTk4ZWVlMGYwIiwicGhvbmUiOiIxNTk0MDgzMzk1MCIsIm5pY2tfbmFtZSI6IuaZk-aFp-a1i-ivlSIsIm9yZ19pZCI6MTEsInNjaG9vbF9pZCI6MjA0LCJjbGFzc19pZCI6MTQxLCJkZnp4X3VzZXJfdXVpZCI6ImVmMTNhNTI3ZDg2ZDQ1MGY4MWJjMWE1OWQ0NDcyZTQwIiwiZGVsIjowLCJjcmVhdGVkX2RhdGUiOiIyMDIwLTA4LTA2VDA2OjA1OjUxLjAwMFoiLCJ1cGRhdGVkX2RhdGUiOiIyMDIwLTA4LTA3VDA4OjI3OjQwLjAwMFoiLCJhY2NvdW50X3R5cGUiOjIsImVuZF9kYXRlIjoiMjAyMS0xMC0xM1QxNjowMDowMC4wMDBaIiwiY2xhc3NSb2xlIjoic3R1IiwiaWF0IjoxNjI5ODYyMTA2LCJleHAiOjE2MzI0NTQxMDZ9.pKvGgI9yijd57vJBLAM9wuiPV5KkCriezV-FlD8fmLI","baseUrl":"http://staging-teach.ireadabc.com/api/","homework_id":"313","syllabus_id":"18984","role":"student"},{"sceneName":"dfzx_cocos_T_FT_01","version":"c1a41","bondleUrl":"http://staging-teach.cdn.ireadabc.com//h5template/dfzx_cocos_T_FT_01/v3/android/dfzx_cocos_T_FT_01","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NDYyLCJ1dWlkIjoiZDNlODE0OGItOTNlNC00NzdiLWEyMmEtMjNkYTk4ZWVlMGYwIiwicGhvbmUiOiIxNTk0MDgzMzk1MCIsIm5pY2tfbmFtZSI6IuaZk-aFp-a1i-ivlSIsIm9yZ19pZCI6MTEsInNjaG9vbF9pZCI6MjA0LCJjbGFzc19pZCI6MTQxLCJkZnp4X3VzZXJfdXVpZCI6ImVmMTNhNTI3ZDg2ZDQ1MGY4MWJjMWE1OWQ0NDcyZTQwIiwiZGVsIjowLCJjcmVhdGVkX2RhdGUiOiIyMDIwLTA4LTA2VDA2OjA1OjUxLjAwMFoiLCJ1cGRhdGVkX2RhdGUiOiIyMDIwLTA4LTA3VDA4OjI3OjQwLjAwMFoiLCJhY2NvdW50X3R5cGUiOjIsImVuZF9kYXRlIjoiMjAyMS0xMC0xM1QxNjowMDowMC4wMDBaIiwiY2xhc3NSb2xlIjoic3R1IiwiaWF0IjoxNjI5ODYyMTA2LCJleHAiOjE2MzI0NTQxMDZ9.pKvGgI9yijd57vJBLAM9wuiPV5KkCriezV-FlD8fmLI","baseUrl":"http://staging-teach.ireadabc.com/api/","homework_id":"313","syllabus_id":"18984","role":"student"}],"defaultBundleIdx":0}`;
await this.asyncDelayLog('汪汪汪32');
const { bundleInfoList, defaultBundleIdx } = JSON.parse(jsonStr); const { bundleInfoList, defaultBundleIdx } = JSON.parse(jsonStr);
await this.asyncDelayLog('汪汪汪33');
this.bundleInfoList = bundleInfoList; this.bundleInfoList = bundleInfoList;
await this.asyncDelayLog('汪汪汪34');
this.jumpToBundleByIndex(defaultBundleIdx); this.jumpToBundleByIndex(defaultBundleIdx);
await this.asyncDelayLog('汪汪汪35');
}, },
async jumpToBundleByIndex(index) { jumpToBundleByIndex(index) {
this.currentBundleIndex = index; this.currentBundleIndex = index;
const currentBundleInfo = this.bundleInfoList[this.currentBundleIndex]; const currentBundleInfo = this.bundleInfoList[this.currentBundleIndex];
...@@ -113,11 +112,11 @@ cc.Class({ ...@@ -113,11 +112,11 @@ cc.Class({
btnRight.active = true; btnRight.active = true;
if (this.currentBundleIndex == 0) { if (this.currentBundleIndex == 0) {
console.log('汪汪汪 1111');
btnLeft.active = false; btnLeft.active = false;
} }
if (this.currentBundleIndex == this.bundleInfoList.length - 1) { if (this.currentBundleIndex == this.bundleInfoList.length - 1) {
console.log('汪汪汪 2222');
btnRight.active = false; btnRight.active = false;
} }
...@@ -126,33 +125,33 @@ cc.Class({ ...@@ -126,33 +125,33 @@ cc.Class({
this.homework_id = currentBundleInfo.homework_id; this.homework_id = currentBundleInfo.homework_id;
this.syllabus_id = currentBundleInfo.syllabus_id; this.syllabus_id = currentBundleInfo.syllabus_id;
this.role = currentBundleInfo.role; this.role = currentBundleInfo.role;
await this.asyncDelayLog('汪汪汪41');
cc.assetManager.loadBundle(currentBundleInfo.bondleUrl, { version: currentBundleInfo.version }, async (err, bundle) => { cc.assetManager.loadBundle(currentBundleInfo.bondleUrl, { version: currentBundleInfo.version }, async (err, bundle) => {
await this.asyncDelayLog('汪汪汪42');
if (err) { if (err) {
return this.asyncDelayLog(err); return this.asyncDelayLog(err);
} }
await this.asyncDelayLog('汪汪汪43');
bundle.loadScene(currentBundleInfo.sceneName, async (err, scene) => { bundle.loadScene(currentBundleInfo.sceneName, (err, scene) => {
if (err) { if (err) {
await this.asyncDelayLog('err: ', err); this.asyncDelayLog('err: ', err);
} }
await this.asyncDelayLog('汪汪汪44');
this.hideWaitingLetters(); this.hideWaitingLetters();
await this.asyncDelayLog('汪汪汪45');
cc.director.runScene(scene); cc.director.runScene(scene);
await this.asyncDelayLog('汪汪汪46');
}); });
await this.asyncDelayLog('汪汪汪47');
}); });
await this.asyncDelayLog('汪汪汪48');
}, },
async loadDefaultBundle() { loadDefaultBundle() {
await this.asyncDelayLog('汪汪汪11');
const jsonStr = this.callNativeFunction({ name: 'loadScene', value: '' }); const jsonStr = this.callNativeFunction({ name: 'loadScene', value: '' });
await this.asyncDelayLog('汪汪汪12');
const { const {
sceneName, sceneName,
version, version,
...@@ -163,30 +162,30 @@ cc.Class({ ...@@ -163,30 +162,30 @@ cc.Class({
syllabus_id, syllabus_id,
role role
} = JSON.parse(jsonStr); } = JSON.parse(jsonStr);
await this.asyncDelayLog('汪汪汪13');
this.baseUrl = baseUrl; this.baseUrl = baseUrl;
this.token = token; this.token = token;
this.homework_id = homework_id; this.homework_id = homework_id;
this.syllabus_id = syllabus_id; this.syllabus_id = syllabus_id;
this.role = role; this.role = role;
await this.asyncDelayLog('汪汪汪14');
cc.assetManager.loadBundle(bondleUrl, { version: version }, async (err, bundle) => {
await this.asyncDelayLog('汪汪汪16'); cc.assetManager.loadBundle(bondleUrl, { version: version }, (err, bundle) => {
if (err) { if (err) {
return this.asyncDelayLog(err); return this.asyncDelayLog(err);
} }
await this.asyncDelayLog('汪汪汪17');
bundle.loadScene(sceneName, async (err, scene) => { bundle.loadScene(sceneName, (err, scene) => {
await this.asyncDelayLog('汪汪汪18');
this.hideWaitingLetters(); this.hideWaitingLetters();
await this.asyncDelayLog('汪汪汪19');
cc.director.runScene(scene); cc.director.runScene(scene);
await this.asyncDelayLog('汪汪汪20');
}); });
}); });
await this.asyncDelayLog('汪汪汪15');
}, },
initListener() { initListener() {
......
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