/**
 * 数据管理器
 */
g.data_mgr = {
	data: null,//表所有数据

	nowNum: null,//剩余个数

	//获得默认数据
	getDefaultData() {
		const dataJson = {
			"sheepfoldArr": [
				{ "id": "162373800016117r8ti", "word": "标题1" },
				{ "id": "1623738000162o9u566", "word": "标题2" },
				{ "id": "3", "word": "标题3" },
				{ "id": "4", "word": "标题4" },
				{ "id": "4", "word": "标题4" }

			],
			"sheepArr": [
				{ "sheepfoldId": "162373800016117r8ti", "word": "aaa", "picUrl": "http://staging-teach.cdn.ireadabc.com/77d34b5a7f2895e9319d4485a84a1b2b.png" },
				{ "word": "aa", "sheepfoldId": "1623738000162o9u566", "picUrl": "http://staging-teach.cdn.ireadabc.com/be3debcc0598cfdde8a9e1ad2324743e.png" },
				{ "word": "12", "sheepfoldId": "4", "picUrl": "http://staging-teach.cdn.ireadabc.com/be3debcc0598cfdde8a9e1ad2324743e.png" },
				{ "word": "3", "sheepfoldId": "3", "picUrl": "http://staging-teach.cdn.ireadabc.com/be3debcc0598cfdde8a9e1ad2324743e.png" },

				{ "sheepfoldId": "1623738000162o9u566", "picUrl": "http://staging-teach.cdn.ireadabc.com/be3debcc0598cfdde8a9e1ad2324743e.png", "word": "fgsdfg" },
				{ "sheepfoldId": "162373800016117r8ti", "picUrl": "http://staging-teach.cdn.ireadabc.com/77d34b5a7f2895e9319d4485a84a1b2b.png", "word": "gdfa" }],
			"title": "asdfa",
			"audio_url": "http://staging-teach.cdn.ireadabc.com/032ce2b956871f7bc7b200d0ebbb7afc.mp3"
		}
		const data = dataJson;
		// const data = JSON.parse(dataJson);
		// const data = [];
		return data;
	},

	//获得标题
	getTitle() {
		return this.data.title;
	},

	//获得表单信息
	getSheepfoldArr() {
		return this.data.sheepfoldArr;
	},

	//获得表单信息
	getSheepfold(num) {
		return this.data.sheepfoldArr[num];
	},

	//获得所有选项
	getSheepArr() {
		return this.data.sheepArr;
	},

	//获得单项信息
	getSheep(num) {
		return this.data.sheepArr[num];
	},

	//获取当前整页数据
	getPageInfo: function () {
		return this.data.contentObj.pageArr[this.pageId].pageInfo;
	},

	//获得整条数据
	getResultInfo: function (id) {
		var pageInfo = this.data.contentObj.pageArr[this.pageId].pageInfo;
		return pageInfo[id];
	},

	//处理数据
	proGameData: function () {
		this.preload();
		console.log("数据处理完毕:");
	},

	preload() {
		cc.assetManager.loadAny(null, null, null, (err, data) => {
			//结束回调
			this.loadEnd();
			if (window && window["air"]) {
				window["air"].hideAirClassLoading();
			}

			cc.debug.setDisplayStats(false);
		});
	},
	loadEnd() {
		//更新游戏界面信息
		g.game.inst.UpdataUi();

		g.game.inst.isLoadEnd = true;
	},
}