Commit 50e9976b authored by 范雪寒's avatar 范雪寒
parents 74df49d4 ee636fbf
...@@ -112,6 +112,20 @@ cc.Class({ ...@@ -112,6 +112,20 @@ cc.Class({
}); });
}, },
preloadSourceImman() {
// 测试用
cc.find("middleLayer/ui/ProgressLabel").active = true;
cc.find('middleLayer/ui/loadingProgress').active = true;
this.callNetworkApiGet(`http://staging-teach.ireadabc.com`, `/api/courseware/v1/getresources`, { courseid: 20894 }, (datastr1) => {
const data1 = JSON.parse(datastr1);
if (data1.rows && data1.rows.length > 0) {
this.preloadCount += data1.rows.length;
}
this.log('data1.rows = ' + JSON.stringify(data1.rows));
this.preloadSource(data1.rows);
});
},
batchPreloadScene(scenes = []) { batchPreloadScene(scenes = []) {
const expects = [ const expects = [
// 'op_03_2', // 'op_03_2',
...@@ -245,6 +259,30 @@ cc.Class({ ...@@ -245,6 +259,30 @@ cc.Class({
window.courseware.closeOsmo(); window.courseware.closeOsmo();
}); });
cc.find('middleLayer/ui/BtnOpenRecord').on('click', () => {
window.courseware.startRecord('');
});
cc.find('middleLayer/ui/BtnCloseRecord').on('click', () => {
window.courseware.stopRecord(0, res => {
this.log('--------录音返回结果 stopRecord ------------');
this.log(JSON.stringify(res))
this.log('------------------------------');
});
});
cc.find('middleLayer/ui/BtnOpenTest').on('click', () => {
window.courseware.startTest('');
});
cc.find('middleLayer/ui/BtnCloseTest').on('click', () => {
window.courseware.stopTest(res => {
this.log('--------录音评测返回结果 stopTest ---------');
this.log(JSON.stringify(res))
this.log('------------------------------');
});
});
const BtnStartLocal = cc.find('middleLayer/ui/BtnStartLocal'); const BtnStartLocal = cc.find('middleLayer/ui/BtnStartLocal');
BtnStartLocal.on('click', () => { BtnStartLocal.on('click', () => {
const addressText = cc.find('middleLayer/ui/address'); const addressText = cc.find('middleLayer/ui/address');
...@@ -261,8 +299,6 @@ cc.Class({ ...@@ -261,8 +299,6 @@ cc.Class({
const BtnStartOnline = cc.find('middleLayer/ui/BtnStartOnline'); const BtnStartOnline = cc.find('middleLayer/ui/BtnStartOnline');
BtnStartOnline.on('click', () => { BtnStartOnline.on('click', () => {
this.showWaitingLetters();
this.hideUI();
const nameText = cc.find('middleLayer/ui/bundleName'); const nameText = cc.find('middleLayer/ui/bundleName');
const bundleName = nameText.getComponent(cc.EditBox).string; const bundleName = nameText.getComponent(cc.EditBox).string;
cc.sys.localStorage.setItem('bundleName', bundleName); cc.sys.localStorage.setItem('bundleName', bundleName);
...@@ -285,7 +321,8 @@ cc.Class({ ...@@ -285,7 +321,8 @@ cc.Class({
this.loadedCount = 0; this.loadedCount = 0;
cc.find("middleLayer/ui/ProgressLabel").active = true; cc.find("middleLayer/ui/ProgressLabel").active = true;
cc.find('middleLayer/ui/loadingProgress').active = true; cc.find('middleLayer/ui/loadingProgress').active = true;
this.preloadAll(); // this.preloadAll();
this.preloadSourceImman();
}); });
const btnClose = cc.find('middleLayer/ConsoleNode/BtnClose'); const btnClose = cc.find('middleLayer/ConsoleNode/BtnClose');
...@@ -349,6 +386,8 @@ cc.Class({ ...@@ -349,6 +386,8 @@ cc.Class({
cc.find('middleLayer/ui').active = false; cc.find('middleLayer/ui').active = false;
}, },
loadOnlineBundle(bundleName) { loadOnlineBundle(bundleName) {
this.hideUI();
this.showWaitingLetters();
this.callNetworkApiGet(`http://staging-teach.ireadabc.com`, `/api/template/v1/${bundleName}`, {}, (datastr) => { this.callNetworkApiGet(`http://staging-teach.ireadabc.com`, `/api/template/v1/${bundleName}`, {}, (datastr) => {
const data = JSON.parse(datastr); const data = JSON.parse(datastr);
let configData = null; let configData = null;
...@@ -601,6 +640,13 @@ cc.Class({ ...@@ -601,6 +640,13 @@ cc.Class({
this.showOneLog(); this.showOneLog();
}, 1000); }, 1000);
}, },
exit() {
cc.game.removePersistRootNode(this.node);
cc.director.loadScene("emptyScene", () => {
this.callNativeFunction({ name: 'exit', value: '' });
});
},
getRainbowColorList() { getRainbowColorList() {
return [ return [
......
{ {
"last-module-event-record-time": 1636882785201, "last-module-event-record-time": 1639702063432,
"migrate-history": [ "migrate-history": [
"cloud-function" "cloud-function"
] ]
......
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