Commit 127c6c3d authored by liujiangnan's avatar liujiangnan

feat: 替换掉了接口函数

parent 0fe595c3
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent"; import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent";
import Attributes from "../script/Attributes"; import Attributes from "../script/Attributes";
import {callNetworkApiGet} from "../script/util";
// @ts-ignore // @ts-ignore
import { assign, createMachine, interpret, actions, forwardTo, matchesState } from "../script/xstate"; import { assign, createMachine, interpret, actions, forwardTo, matchesState } from "../script/xstate";
const { pure, send, raise, sendParent } = actions; const { pure, send, raise, sendParent } = actions;
...@@ -57,7 +58,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -57,7 +58,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
cc.debug.setDisplayStats(false); cc.debug.setDisplayStats(false);
} }
initialized() { initialized() {
if(this.BASE_URL && this.gameMachineService) { if(this.gameMachineService) {
this.gameMachineService.start(); this.gameMachineService.start();
this.restore(); this.restore();
} }
...@@ -161,27 +162,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -161,27 +162,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}); });
} }
globalThis.aaa = this; this.initialized();
const that = this;
// @ts-ignores
window.air = window.air || {};
// @ts-ignores
window.air.getEngineInfoCallback = function({isDev} ) {
console.log('isDev ' +(+isDev));
if (+isDev) {
// that.ROOT_PID = 21203;
that.BASE_URL = 'https://staging-teach.ireadabc.com';
} else {
// that.ROOT_PID = 21203;
that.BASE_URL = 'https://openapi.iteachabc.com';
}
that.initialized();
}
// @ts-ignores
if (!cc.sys.isNative) {
// @ts-ignores
window.air.getEngineInfoCallback({isDev: 1})
}
} }
initUnitViewPager() { initUnitViewPager() {
const pages = this.UnitViewPager.getPages(); const pages = this.UnitViewPager.getPages();
...@@ -281,7 +262,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -281,7 +262,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.playBgMusic(this.bgMusic1); this.playBgMusic(this.bgMusic1);
// event.type !== 'BACK' // event.type !== 'BACK'
this.callNetworkApiGet(this.BASE_URL + '/api/oxford/syllabus/v1/root/index/'+1+'?orgid=507', (resp: any) => { callNetworkApiGet('/api/oxford/syllabus/v1/root/index/1', {orgid: 507}, (resp: any) => {
resp = JSON.parse(resp); resp = JSON.parse(resp);
if (resp.msg == 'success') { if (resp.msg == 'success') {
let { rows } = resp let { rows } = resp
...@@ -327,7 +308,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -327,7 +308,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
width=4></outline>`; width=4></outline>`;
}); });
this.callNetworkApiGet(this.BASE_URL + '/api/syllabus/v1/tree?orgid=507&pid=' + event.id, (resp: any) => { callNetworkApiGet('/api/syllabus/v1/tree', {pid: event.id}, (resp: any) => {
resp = JSON.parse(resp); resp = JSON.parse(resp);
if (resp.msg == 'success') { if (resp.msg == 'success') {
let { rows } = resp; let { rows } = resp;
......
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