import { asyncDelay, delayCall, getSprNode, getSprNodeByUrl, onHomeworkFinish, playAudio, playAudioByUrl } from "../script/OP_18_util";

cc.Class({

	extends: cc.Component,

	properties: {
	},

	// 生命周期 onLoad
	onLoad() {
		this._timeoutIds = [];
		this._intervalIds = [];
		this.initSceneData();
		this.initSize();
	},

	_imageResList: null,
	_audioResList: null,
	_animaResList: null,
	initSceneData() {
		this._imageResList = [];
		this._audioResList = [];
		this._animaResList = [];
	},

	_designSize: null,  // 设计分辨率
	_frameSize: null,  // 屏幕分辨率
	_mapScaleMin: null,  // 场景中常用缩放（取大值）
	_mapScaleMax: null,  // 场景中常用缩放（取小值）
	_cocosScale: null,  // cocos 自缩放 （较少用到）
	initSize() {
		// 注意cc.winSize只有在适配后(修改fitHeight/fitWidth后)才能获取到正确的值,因此使用cc.getFrameSize()来获取初始的屏幕大小
		let screen_size = cc.view.getFrameSize().width / cc.view.getFrameSize().height
		let design_size = cc.Canvas.instance.designResolution.width / cc.Canvas.instance.designResolution.height
		let f = screen_size >= design_size

		cc.Canvas.instance.fitHeight = f
		cc.Canvas.instance.fitWidth = !f

		const frameSize = cc.view.getFrameSize();
		this._frameSize = frameSize;

		this._designSize = cc.view.getDesignResolutionSize();

		let sx = cc.winSize.width / frameSize.width;
		let sy = cc.winSize.height / frameSize.height;
		this._cocosScale = Math.min(sx, sy);

		sx = frameSize.width / this._designSize.width;
		sy = frameSize.height / this._designSize.height;
		this._mapScaleMin = Math.min(sx, sy) * this._cocosScale;
		this._mapScaleMax = Math.max(sx, sy) * this._cocosScale;

		this.canvas = cc.find('Canvas');
	},


	// 生命周期 start
	start() {
		let getData = this.getData.bind(this);
		if (window && window.courseware) {
			getData = window.courseware.getData;
		}

		getData((data) => {
			console.log('data:', data);
			this.data = data || this.getDefaultData();

			console.log('this.data:', this.data);

			this.data = JSON.parse(JSON.stringify(this.data))
			this.preloadItem()
		})
	},

	getData(func) {
		// if (window && window.courseware) {
		// 	window.courseware.getData(func, 'scene');
		// 	return;
		// }

		// const middleLayer = cc.find('middleLayer');
		// if (middleLayer) {
		// 	const middleLayerComponent = middleLayer.getComponent('middleLayer');
		// 	middleLayerComponent.getData(func);
		// 	return;
		// }

		func(this.getDefaultData());
	},

	getDefaultData() {

		// return {"write_big_0_audio_url":"https://teach.cdn.ireadabc.com/90dabc173753ed6035c8a119057aa5bd.mp3","write_big_1_audio_url":"https://teach.cdn.ireadabc.com/4c5a39defde0e90f3a53bf50db6943f4.mp3","write_big_2_audio_url":"https://teach.cdn.ireadabc.com/d4b65a66108b46eb83dbfb93b742fc0d.mp3","write_small_0_audio_url":"https://teach.cdn.ireadabc.com/d099918c85ac7afc33f169c9038f46d4.mp3","write_small_1_audio_url":"https://teach.cdn.ireadabc.com/2f1ea180fb4d17dce34e8d7cc6cf9159.mp3","write_small_2_audio_url":"https://teach.cdn.ireadabc.com/841ba4410e6b4c9da6ba58cd3a4e86e0.mp3","tip_audio_url":"https://teach.cdn.ireadabc.com/d5cdef3f02abe29b14ca8c16ad4e7543.mp3","finish_audio_url":"https://teach.cdn.ireadabc.com/7fb349c67a76d2112a0604e624acaa97.mp3","letter":"G","animArr":[{"key":"letter_big_0","title":"大写彩色动画","skeJsonData":{"url":"https://teach.cdn.ireadabc.com/46648eaa3466cbb103c93d05dff1d995.json","name":"G大彩_ske.json"},"texJsonData":{"url":"https://teach.cdn.ireadabc.com/9267521512c602ee3bef2390d8b13947.json","name":"G大彩_tex.json"},"texPngData":{"url":"https://teach.cdn.ireadabc.com/42b25f1defaec7b11813825bfe0154d0.png","name":"G大彩_tex.png"}},{"key":"letter_big_1","title":"大写黑色动画","skeJsonData":{"url":"https://teach.cdn.ireadabc.com/f1c4994d43eaf2f73650aa80760d32fa.json","name":"G大黑_ske.json"},"texJsonData":{"url":"https://teach.cdn.ireadabc.com/343c9d1c8849e89f7144b593f17175a8.json","name":"G大黑_tex.json"},"texPngData":{"url":"https://teach.cdn.ireadabc.com/940b5059f2ead824a3f6088f20ce7ea5.png","name":"G大黑_tex.png"}},{"key":"letter_small_0","title":"小写彩色动画","skeJsonData":{"url":"https://teach.cdn.ireadabc.com/a4f58f48a8ab425fea95208280a2c8b8.json","name":"G小彩_ske.json"},"texJsonData":{"url":"https://teach.cdn.ireadabc.com/4503b6d5bb2c1a3bcea14747d3a01552.json","name":"G小彩_tex.json"},"texPngData":{"url":"https://teach.cdn.ireadabc.com/d92b9ea0e00045ad21324be26cefc726.png","name":"G小彩_tex.png"}},{"key":"letter_small_1","title":"小写黑色动画","skeJsonData":{"url":"https://teach.cdn.ireadabc.com/20ca0a1db036c6f8d5fd8860b3322a40.json","name":"G小黑_ske.json"},"texJsonData":{"url":"https://teach.cdn.ireadabc.com/f48f121f0dbd575ddbba4f12d657767c.json","name":"G小黑_tex.json"},"texPngData":{"url":"https://teach.cdn.ireadabc.com/faabc51aacefa4d6ed982c6a322c430f.png","name":"G小黑_tex.png"}}],"bg_pic_url":"https://teach.cdn.ireadabc.com/27037fea3bbe4f3fd9cfd09939197b82.png","dot_big_1_url":"https://teach.cdn.ireadabc.com/f2263a4e1e0e172c8e14998b04cd2f9f.png","dot_big_2_url":"https://teach.cdn.ireadabc.com/11aa8e1a3eed220e23d4d3087f24abf5.png","dot_small_1_url":"https://teach.cdn.ireadabc.com/031aa9423ac13e962173dfde3a07cb66.png","dot_small_2_url":"https://teach.cdn.ireadabc.com/2b70aabb5a4c8fce6c97e4dcbc99b16b.png","page_id":"25","book_id":"Oxford_Phonics_World_1_SB","part_name":"c","bgItem2":{"url":"https://teach.cdn.ireadabc.com/49fac1cb7ddef0d80253d100fcdfdc73.png","rect":{"x":137.07,"y":0,"width":1076.85,"height":1393}},"hotZoneItemArr2":[{"id":"1667986757301","index":0,"itemType":"rect","fontScale":1.05546875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.05546875,"dragDot":{"x":675.5,"y":709.4506065857886},"gIdx":"3","labelText":"rac a say","posX":343,"posY":118,"rect":{"x":87.89,"y":108.04,"width":363.19,"height":55.17}},{"id":"1667986804356","index":1,"itemType":"rect","fontScale":1.05546875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.05546875,"dragDot":{"x":675.5,"y":709.4506065857886},"gIdx":"5","labelText":"G","posX":224,"posY":190,"rect":{"x":87.89,"y":173.55,"width":89.65,"height":89.65}},{"id":"1667986845495","index":2,"itemType":"rect","fontScale":1.05546875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.05546875,"dragDot":{"x":675.5,"y":709.4506065857886},"gIdx":"1","labelText":"G_0_b","posX":414,"posY":191,"rect":{"x":308.56,"y":174.7,"width":85.05,"height":89.65}},{"id":"1667986930683","index":3,"itemType":"rect","fontScale":1.05546875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.05546875,"dragDot":{"x":675.5,"y":709.4506065857886},"gIdx":"1","labelText":"G_1_b","posX":500.00458302879935,"posY":191.00048861314352,"rect":{"x":406.28,"y":174.7,"width":87.34,"height":89.65}},{"id":"1667986957700","index":4,"itemType":"rect","fontScale":1.05546875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.05546875,"dragDot":{"x":675.5,"y":709.4506065857886},"gIdx":"1","labelText":"G_2_b","posX":589.0048081489912,"posY":191.00048861314352,"rect":{"x":509.71,"y":174.7,"width":85.04,"height":89.65}},{"id":"1667986992262","index":5,"itemType":"rect","fontScale":1.05546875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.05546875,"dragDot":{"x":675.5,"y":709.4506065857886},"gIdx":"1","labelText":"G_3_b","posX":676.0050358273669,"posY":192.00048861314352,"rect":{"x":609.73,"y":175.85,"width":85.04,"height":89.65}},{"id":"1667987011440","index":6,"itemType":"rect","fontScale":1.05546875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.05546875,"dragDot":{"x":675.5,"y":709.4506065857886},"gIdx":"1","labelText":"G_4_b","posX":764.0052609475587,"posY":191.00049117132752,"rect":{"x":712.02,"y":174.7,"width":82.74,"height":89.65}},{"id":"1667987046498","index":7,"itemType":"rect","fontScale":1.05546875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.05546875,"dragDot":{"x":675.5,"y":709.4506065857886},"gIdx":"1","labelText":"G_5_b","posX":852.0154886515163,"posY":192.00049372951153,"rect":{"x":813.18,"y":175.85,"width":82.72,"height":89.65}},{"id":"1667987078242","index":8,"itemType":"rect","fontScale":1.05546875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.05546875,"dragDot":{"x":675.5,"y":709.4506065857886},"gIdx":"1","labelText":"G_6_b","posX":938.0257163554738,"posY":192.00049117132752,"rect":{"x":913.2,"y":175.85,"width":80.39,"height":89.65}},{"id":"1667987243378","index":9,"itemType":"rect","fontScale":1.05546875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.05546875,"dragDot":{"x":675.5,"y":709.4506065857886},"gIdx":"1","labelText":"g||6||9||q||a_0_s","posX":415.0309235811686,"posY":339.00049117132755,"rect":{"x":321.28,"y":345.95,"width":62,"height":87.35}},{"id":"1667987276179","index":10,"itemType":"rect","fontScale":1.05546875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.05546875,"dragDot":{"x":675.5,"y":709.4506065857886},"gIdx":"1","labelText":"g||6||9||q||a_1_s","posX":502.0345856637288,"posY":339.00086722437516,"rect":{"x":421.27,"y":345.95,"width":62,"height":87.35}},{"id":"1667987300225","index":11,"itemType":"rect","fontScale":1.05546875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.05546875,"dragDot":{"x":675.5,"y":709.4506065857886},"gIdx":"1","labelText":"g||6||9||q||a_2_s","posX":592.0348107839206,"posY":339.00086978255916,"rect":{"x":524.71,"y":345.95,"width":62,"height":87.35}},{"id":"1667987330641","index":12,"itemType":"rect","fontScale":1.05546875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.05546875,"dragDot":{"x":675.5,"y":709.4506065857886},"gIdx":"1","labelText":"g||6||9||q||a_3_s","posX":679.0350384622964,"posY":339.0008723407432,"rect":{"x":624.72,"y":345.95,"width":62,"height":87.35}},{"id":"1667987360891","index":13,"itemType":"rect","fontScale":1.05546875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.05546875,"dragDot":{"x":675.5,"y":709.4506065857886},"gIdx":"1","labelText":"g||6||9||q||a_4_s","posX":769.0352610243042,"posY":340.0008723407432,"rect":{"x":728.18,"y":347.1,"width":62,"height":87.35}},{"id":"1667987402567","index":14,"itemType":"rect","fontScale":1.05546875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.05546875,"dragDot":{"x":675.5,"y":709.4506065857886},"gIdx":"1","labelText":"g||6||9||q||a_5_s","posX":854.0454912864458,"posY":340.00086978255916,"rect":{"x":825.88,"y":347.1,"width":62,"height":87.35}},{"id":"1667987419969","index":15,"itemType":"rect","fontScale":1.05546875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.05546875,"dragDot":{"x":675.5,"y":709.4506065857886},"gIdx":"1","labelText":"g||6||9||q||a_6_s","posX":939.0557087576674,"posY":339.00086978255916,"rect":{"x":923.59,"y":345.95,"width":62,"height":87.35}},{"id":"1667987449223","index":16,"itemType":"rect","fontScale":1.05546875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.05546875,"dragDot":{"x":675.5,"y":709.4506065857886},"gIdx":"2","posX":589,"posY":242,"rect":{"x":46.52,"y":99.99,"width":1011.42,"height":356.3}}],"isDebug":true}


		// return {"write_big_0_audio_url":"http://teach.cdn.ireadabc.com/34bdf0dfff014d8ba8d21a954052ed72.mp3","write_big_1_audio_url":"http://teach.cdn.ireadabc.com/4c5a39defde0e90f3a53bf50db6943f4.mp3","write_big_2_audio_url":"http://teach.cdn.ireadabc.com/4414404648097fd17a2f68d90f5f3826.mp3","write_small_0_audio_url":"http://teach.cdn.ireadabc.com/d099918c85ac7afc33f169c9038f46d4.mp3","write_small_1_audio_url":"http://teach.cdn.ireadabc.com/2f1ea180fb4d17dce34e8d7cc6cf9159.mp3","write_small_2_audio_url":"http://teach.cdn.ireadabc.com/f711246a0105fd437f83041b28cb7283.mp3","tip_audio_url":"http://teach.cdn.ireadabc.com/d5cdef3f02abe29b14ca8c16ad4e7543.mp3","finish_audio_url":"http://teach.cdn.ireadabc.com/7fb349c67a76d2112a0604e624acaa97.mp3","letter":"O","animArr":[{"key":"letter_big_0","title":"大写彩色动画","skeJsonData":{"url":"http://teach.cdn.ireadabc.com/a6eb903542260d9fd057261d3d8cd916.json","name":"O大彩_ske.json"},"texJsonData":{"url":"http://teach.cdn.ireadabc.com/ffa8d016aa6b77ce92a24cf64aa67822.json","name":"O大彩_tex.json"},"texPngData":{"url":"http://teach.cdn.ireadabc.com/bb57debf0de27979990adcea5a083747.png","name":"O大彩_tex.png"}},{"key":"letter_big_1","title":"大写黑色动画","skeJsonData":{"url":"http://teach.cdn.ireadabc.com/a21e416c0663c7145ac1f56f1b9a359c.json","name":"O大黑_ske.json"},"texJsonData":{"url":"http://teach.cdn.ireadabc.com/25c5628b107dde62fbb8764d50877c48.json","name":"O大黑_tex.json"},"texPngData":{"url":"http://teach.cdn.ireadabc.com/940b082e1c78fa6975d65795d0c0de1f.png","name":"O大黑_tex.png"}},{"key":"letter_small_0","title":"小写彩色动画","skeJsonData":{"url":"http://teach.cdn.ireadabc.com/6195d9ba221550929511456f9585a282.json","name":"O小彩_ske.json"},"texJsonData":{"url":"http://teach.cdn.ireadabc.com/9c6711f9533e931bb723dfe01a27d77b.json","name":"O小彩_tex.json"},"texPngData":{"url":"http://teach.cdn.ireadabc.com/c509b7b6cf66054c505c87879fbbbb2e.png","name":"O小彩_tex.png"}},{"key":"letter_small_1","title":"小写黑色动画","skeJsonData":{"url":"http://teach.cdn.ireadabc.com/0793022b629803766b729dd2c6d36095.json","name":"O小黑_ske.json"},"texJsonData":{"url":"http://teach.cdn.ireadabc.com/09b9b04f7803ab64c4689e9771899896.json","name":"O小黑_tex.json"},"texPngData":{"url":"http://teach.cdn.ireadabc.com/bdec6de4a9943b788a1113bded88a374.png","name":"O小黑_tex.png"}}],"bg_pic_url":"http://teach.cdn.ireadabc.com/311e82c0bef7eb5ca9b30b97433634b8.png","dot_big_1_url":"http://teach.cdn.ireadabc.com/8bcf92fd090cfa76a657aef38a0cd3e6.png","dot_big_2_url":"http://teach.cdn.ireadabc.com/8bcf92fd090cfa76a657aef38a0cd3e6.png","dot_small_1_url":"http://teach.cdn.ireadabc.com/64e967ea643f557174b2fa6d63d66de0.png","dot_small_2_url":"http://teach.cdn.ireadabc.com/64e967ea643f557174b2fa6d63d66de0.png","bgItem2":{"url":"http://teach.cdn.ireadabc.com/2df6362f502da486362afcdb931143a4.png","rect":{"x":173.35,"y":0,"width":1385.3,"height":1792}},"hotZoneItemArr2":[{"id":"1667996384613","index":0,"itemType":"rect","fontScale":1.353125,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.353125,"dragDot":{"x":866,"y":909.5251299826689},"gIdx":"3","labelText":"Trace w a say","posX":347,"posY":118,"rect":{"x":114.54,"y":138.98,"width":476.09,"height":70.97}},{"id":"1667996429449","index":1,"itemType":"rect","fontScale":1.353125,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.353125,"dragDot":{"x":866,"y":909.5251299826689},"gIdx":"5","labelText":"O","posX":223,"posY":190,"rect":{"x":111.59,"y":223.26,"width":115.33,"height":115.33}},{"id":"1667996475755","index":2,"itemType":"rect","fontScale":1.353125,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.353125,"dragDot":{"x":866,"y":909.5251299826689},"gIdx":"1","labelText":"O_0_b","posX":413,"posY":190,"rect":{"x":393.99,"y":224.74,"width":112.37,"height":112.37}},{"id":"1667996514606","index":3,"itemType":"rect","fontScale":1.353125,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.353125,"dragDot":{"x":866,"y":909.5251299826689},"gIdx":"1","labelText":"O_1_b","posX":501.00458047061534,"posY":189.0004860549595,"rect":{"x":524.1,"y":223.26,"width":112.37,"height":112.37}},{"id":"1667996537563","index":4,"itemType":"rect","fontScale":1.353125,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.353125,"dragDot":{"x":866,"y":909.5251299826689},"gIdx":"1","labelText":"O_2_b","posX":589.0048055908071,"posY":190.00048349677553,"rect":{"x":654.22,"y":224.74,"width":112.37,"height":112.37}},{"id":"1667996628116","index":5,"itemType":"rect","fontScale":1.353125,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.353125,"dragDot":{"x":866,"y":909.5251299826689},"gIdx":"1","labelText":"O_3_b","posX":677.005030710999,"posY":191.0004860549595,"rect":{"x":784.36,"y":226.22,"width":112.37,"height":112.37}},{"id":"1667996647292","index":6,"itemType":"rect","fontScale":1.353125,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.353125,"dragDot":{"x":866,"y":909.5251299826689},"gIdx":"1","labelText":"O_4_b","posX":764.0052558311908,"posY":191.00048861314352,"rect":{"x":913.01,"y":226.22,"width":112.37,"height":112.37}},{"id":"1667996663956","index":7,"itemType":"rect","fontScale":1.353125,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.353125,"dragDot":{"x":866,"y":909.5251299826689},"gIdx":"1","labelText":"O_5_b","posX":851.0154784187804,"posY":191.00048861314352,"rect":{"x":1041.65,"y":226.22,"width":112.37,"height":112.37}},{"id":"1667996680692","index":8,"itemType":"rect","fontScale":1.353125,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.353125,"dragDot":{"x":866,"y":909.5251299826689},"gIdx":"1","labelText":"O_6_b","posX":937.02570100637,"posY":191.00048861314352,"rect":{"x":1168.82,"y":226.22,"width":112.37,"height":112.37}},{"id":"1667996735804","index":9,"itemType":"rect","fontScale":1.353125,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.353125,"dragDot":{"x":866,"y":909.5251299826689},"gIdx":"1","labelText":"o_0_s","posX":414.0391379943202,"posY":327.0058339807742,"rect":{"x":417.75,"y":449.54,"width":67.91,"height":67.91}},{"id":"1667996746463","index":10,"itemType":"rect","fontScale":1.353125,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.353125,"dragDot":{"x":866,"y":909.5251299826689},"gIdx":"1","labelText":"o_1_s","posX":502.0395831183358,"posY":327.00583653895814,"rect":{"x":547.86,"y":449.54,"width":67.91,"height":67.91}},{"id":"1667996766201","index":11,"itemType":"rect","fontScale":1.353125,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.353125,"dragDot":{"x":866,"y":909.5251299826689},"gIdx":"1","labelText":"o_2_s","posX":591.0398082385276,"posY":327.00583653895814,"rect":{"x":679.45,"y":449.54,"width":67.91,"height":67.91}},{"id":"1667996792956","index":12,"itemType":"rect","fontScale":1.353125,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.353125,"dragDot":{"x":866,"y":909.5251299826689},"gIdx":"1","labelText":"o_3_s","posX":677.0400359169033,"posY":326.00583653895814,"rect":{"x":806.65,"y":448.08,"width":67.9,"height":67.9}},{"id":"1667996807381","index":13,"itemType":"rect","fontScale":1.353125,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.353125,"dragDot":{"x":866,"y":909.5251299826689},"gIdx":"1","labelText":"o_4_s","posX":764.0402559207271,"posY":325.00583653895814,"rect":{"x":935.29,"y":446.58,"width":67.91,"height":67.91}},{"id":"1667996825251","index":14,"itemType":"rect","fontScale":1.353125,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.353125,"dragDot":{"x":866,"y":909.5251299826689},"gIdx":"1","labelText":"o_5_s","posX":851.0504810665007,"posY":326.00583653895814,"rect":{"x":1063.94,"y":448.06,"width":67.91,"height":67.91}},{"id":"1667997008158","index":15,"itemType":"rect","fontScale":1.353125,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.353125,"dragDot":{"x":866,"y":909.5251299826689},"gIdx":"1","labelText":"o_6_s","posX":939.0707011214882,"posY":326.0058339807742,"rect":{"x":1194.06,"y":448.06,"width":67.91,"height":67.91}},{"id":"1667997079815","index":16,"itemType":"rect","fontScale":1.353125,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.353125,"dragDot":{"x":866,"y":909.5251299826689},"gIdx":"2","posX":880.7500124043811,"posY":349.8094961982715,"rect":{"x":96.76,"y":119.16,"width":1221.28,"height":461.31}}],"page_id":"49","book_id":"Oxford_Phonics_World_1_SB","part_name":"c","isDebug":false}
		return {"write_big_0_audio_url":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","write_big_1_audio_url":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","tip_audio_url":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","finish_audio_url":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","write_small_0_audio_url":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","write_small_1_audio_url":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","write_small_2_audio_url":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","write_big_2_audio_url":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","letter":"A","animArr":[{"key":"letter_big_0","title":"大写彩色动画","skeJsonData":{"url":"http://teach.cdn.ireadabc.com/cdee11a12d4bf498bd3f0931bfe858cf.json","name":"A大彩_ske.json"},"texJsonData":{"url":"http://teach.cdn.ireadabc.com/ae2b83555093e3a739fcef9f107f52bb.json","name":"A大彩_tex.json"},"texPngData":{"url":"http://teach.cdn.ireadabc.com/db4a8c0d718e998f8fd3983aaf39e8d5.png","name":"A大彩_tex.png"}},{"key":"letter_big_1","title":"大写黑色动画","skeJsonData":{"url":"http://teach.cdn.ireadabc.com/14c5231012b4a1f3ac898ca6f83bc213.json","name":"A大黑_ske.json"},"texJsonData":{"url":"http://teach.cdn.ireadabc.com/a9e874a147023e0944cf89c351661218.json","name":"A大黑_tex.json"},"texPngData":{"url":"http://teach.cdn.ireadabc.com/8e12ae87d2c1a7bb6fc320272a930d9b.png","name":"A大黑_tex.png"}},{"key":"letter_small_0","title":"小写彩色动画","skeJsonData":{"url":"http://teach.cdn.ireadabc.com/8c0ccddb1d49eb555846c006244b27dc.json","name":"A小彩_ske.json"},"texJsonData":{"url":"http://teach.cdn.ireadabc.com/667e32080f139a09ab434a698dccc18b.json","name":"A小彩_tex.json"},"texPngData":{"url":"http://teach.cdn.ireadabc.com/65abc1cc2e73a2b9bbaffa497d81e5a4.png","name":"A小彩_tex.png"}},{"key":"letter_small_1","title":"小写黑色动画","skeJsonData":{"url":"http://teach.cdn.ireadabc.com/356e9e26a2a74c57791fff7471142d54.json","name":"A小黑_ske.json"},"texJsonData":{"url":"http://teach.cdn.ireadabc.com/9a262fdad701a170994510e1562baa76.json","name":"A小黑_tex.json"},"texPngData":{"url":"http://teach.cdn.ireadabc.com/500b883b3c0c0613a6de963f3deb7f72.png","name":"A小黑_tex.png"}}],"bg_pic_url":"http://teach.cdn.ireadabc.com/520b8785f6b253aef7ced8941711c1cf.png","dot_big_1_url":"http://teach.cdn.ireadabc.com/125b10277b51185a8238f0ad2d399e3e.png","dot_big_2_url":"http://teach.cdn.ireadabc.com/e61ae4cb1ce8dfbec37f153980233d6b.png","dot_small_1_url":"http://teach.cdn.ireadabc.com/9b5c4f22242cff975aa6189235e4caf9.png","dot_small_2_url":"http://teach.cdn.ireadabc.com/cd32e56db4dc9fadea2ad52aa0c93066.png","bgItem2":{"url":"http://staging-teach.cdn.ireadabc.com/e94766af9c75bcdc8308a914929afc74.png","rect":{"x":129.59,"y":0,"width":1076.82,"height":1393}},"hotZoneItemArr2":[{"id":"1666861109826","index":0,"itemType":"rect","fontScale":1.04375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.04375,"dragDot":{"x":668,"y":696.5},"gIdx":"3","labelText":"rac w a say","posX":429,"posY":134.5,"rect":{"x":148.41,"y":115,"width":302,"height":39}},{"id":"1666861174704","index":1,"itemType":"rect","fontScale":1.04375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.04375,"dragDot":{"x":668,"y":696.5},"gIdx":"5","labelText":"A","posX":274,"posY":218.5,"rect":{"x":111.41,"y":171.5,"width":66,"height":94}},{"id":"1666861206985","index":2,"itemType":"rect","fontScale":1.04375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.04375,"dragDot":{"x":668,"y":696.5},"gIdx":"1","labelText":"A_0_b","posX":480,"posY":218.5,"rect":{"x":316.41,"y":173.5,"width":68,"height":90}},{"id":"1666861234571","index":3,"itemType":"rect","fontScale":1.04375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.04375,"dragDot":{"x":668,"y":696.5},"gIdx":"1","labelText":"A_1_b","posX":579.9994148178125,"posY":218.50068011865952,"rect":{"x":416.41,"y":173.5,"width":68,"height":90}},{"id":"1666861243415","index":4,"itemType":"rect","fontScale":1.04375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.04375,"dragDot":{"x":668,"y":696.5},"gIdx":"1","labelText":"A_2_b","posX":680.9997260849336,"posY":218.50068011865952,"rect":{"x":517.41,"y":173.5,"width":68,"height":90}},{"id":"1666861256459","index":5,"itemType":"rect","fontScale":1.04375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.04375,"dragDot":{"x":668,"y":696.5},"gIdx":"1","labelText":"A_3_b","posX":782.0000404647258,"posY":218.50068011865952,"rect":{"x":618.41,"y":173.5,"width":68,"height":90}},{"id":"1666861265658","index":6,"itemType":"rect","fontScale":1.04375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.04375,"dragDot":{"x":668,"y":696.5},"gIdx":"1","labelText":"A_4_b","posX":883.0003548445179,"posY":218.50068011865952,"rect":{"x":719.41,"y":173.5,"width":68,"height":90}},{"id":"1666861273357","index":7,"itemType":"rect","fontScale":1.04375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.04375,"dragDot":{"x":668,"y":696.5},"gIdx":"1","labelText":"A_5_b","posX":982.0006692243103,"posY":219.50068011865952,"rect":{"x":818.41,"y":174.5,"width":68,"height":90}},{"id":"1666861282232","index":8,"itemType":"rect","fontScale":1.04375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.04375,"dragDot":{"x":668,"y":696.5},"gIdx":"1","labelText":"A_6_b","posX":1082.0009773787601,"posY":218.50068323133073,"rect":{"x":918.41,"y":173.5,"width":68,"height":90}},{"id":"1666861309564","index":9,"itemType":"rect","fontScale":1.04375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.04375,"dragDot":{"x":668,"y":696.5},"gIdx":"1","labelText":"a_0_s","posX":482.00128864588123,"posY":374.5006801186595,"rect":{"x":325.91,"y":348,"width":53,"height":53}},{"id":"1666861329877","index":10,"itemType":"rect","fontScale":1.04375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.04375,"dragDot":{"x":668,"y":696.5},"gIdx":"1","labelText":"a_1_s","posX":580.9994210431548,"posY":375.50116569536834,"rect":{"x":424.91,"y":349,"width":53,"height":53}},{"id":"1666861341548","index":11,"itemType":"rect","fontScale":1.04375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.04375,"dragDot":{"x":668,"y":696.5},"gIdx":"1","labelText":"a_2_s","posX":678.9997291976047,"posY":375.50116880803955,"rect":{"x":522.91,"y":349,"width":53,"height":53}},{"id":"1666861355826","index":12,"itemType":"rect","fontScale":1.04375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.04375,"dragDot":{"x":668,"y":696.5},"gIdx":"1","labelText":"a_3_s","posX":780.0000342393834,"posY":375.50116880803955,"rect":{"x":623.91,"y":349,"width":53,"height":53}},{"id":"1666861368341","index":13,"itemType":"rect","fontScale":1.04375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.04375,"dragDot":{"x":668,"y":696.5},"gIdx":"1","labelText":"a_4_s","posX":880.0003486191756,"posY":376.50116880803955,"rect":{"x":723.91,"y":350,"width":53,"height":53}},{"id":"1666861378863","index":14,"itemType":"rect","fontScale":1.04375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.04375,"dragDot":{"x":668,"y":696.5},"gIdx":"1","labelText":"a_5_s","posX":981.0006598862966,"posY":375.50117192071076,"rect":{"x":824.91,"y":349,"width":53,"height":53}},{"id":"1666861393045","index":15,"itemType":"rect","fontScale":1.04375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.04375,"dragDot":{"x":668,"y":696.5},"gIdx":"1","labelText":"a_6_s","posX":1081.0009742660889,"posY":376.50116880803955,"rect":{"x":924.91,"y":350,"width":53,"height":53}},{"id":"1666861425231","index":16,"itemType":"rect","fontScale":1.04375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.04375,"dragDot":{"x":668,"y":696.5},"gIdx":"2","posX":684,"posY":314.5,"rect":{"x":69.41,"y":96,"width":970,"height":437}}],"page_id":"5","book_id":"opw1","part_name":"c","isDebug":false}
		// return {"write_big_0_audio_url":"http://teach.cdn.ireadabc.com/0d9ba4c3952dacb4f045b9e3dd256a3a.mp3","write_big_1_audio_url":"http://teach.cdn.ireadabc.com/4c5a39defde0e90f3a53bf50db6943f4.mp3","write_big_2_audio_url":"http://teach.cdn.ireadabc.com/1cebfe41cdf1d3d217722c04a448c744.mp3","write_small_0_audio_url":"http://teach.cdn.ireadabc.com/d099918c85ac7afc33f169c9038f46d4.mp3","write_small_1_audio_url":"http://teach.cdn.ireadabc.com/2f1ea180fb4d17dce34e8d7cc6cf9159.mp3","write_small_2_audio_url":"http://teach.cdn.ireadabc.com/df245c175c417ec439d2ca1da033e238.mp3","finish_audio_url":"http://teach.cdn.ireadabc.com/7fb349c67a76d2112a0604e624acaa97.mp3","tip_audio_url":"http://teach.cdn.ireadabc.com/d5cdef3f02abe29b14ca8c16ad4e7543.mp3","letter":"E","animArr":[{"key":"letter_big_0","title":"大写彩色动画","skeJsonData":{"url":"http://teach.cdn.ireadabc.com/2eb49219aaf80a4c2dc7fb708b43bf6d.json","name":"E大彩_ske.json"},"texJsonData":{"url":"http://teach.cdn.ireadabc.com/ee396cbb457c02c6830f26812c167d95.json","name":"E大彩_tex.json"},"texPngData":{"url":"http://teach.cdn.ireadabc.com/4266c47663a7279280b98ea93d6898e9.png","name":"E大彩_tex.png"}},{"key":"letter_big_1","title":"大写黑色动画","skeJsonData":{"url":"http://teach.cdn.ireadabc.com/4442c5a87ad1dcce2e978dcf67df9de0.json","name":"E大黑_ske.json"},"texJsonData":{"url":"http://teach.cdn.ireadabc.com/07047fd00fd79a2e9e2da04afbc90d23.json","name":"E大黑_tex.json"},"texPngData":{"url":"http://teach.cdn.ireadabc.com/f3afdce454873c0e3febe7868e6ac77f.png","name":"E大黑_tex.png"}},{"key":"letter_small_0","title":"小写彩色动画","skeJsonData":{"url":"http://teach.cdn.ireadabc.com/fca2c94f11ebed28d300993d1dc5d5cd.json","name":"E小彩_ske.json"},"texJsonData":{"url":"http://teach.cdn.ireadabc.com/2ebcdd6e674598812e36e1ed01714a5d.json","name":"E小彩_tex.json"},"texPngData":{"url":"http://teach.cdn.ireadabc.com/e6f07f6b03482e8ce30947b0c0f8e24c.png","name":"E小彩_tex.png"}},{"key":"letter_small_1","title":"小写黑色动画","skeJsonData":{"url":"http://teach.cdn.ireadabc.com/c5b8da1226b9833f666ef3c0b73321df.json","name":"NewProject_ske.json"},"texJsonData":{"url":"http://teach.cdn.ireadabc.com/06b1de9f9f269e70c2a969a0518c2f4b.json","name":"NewProject_tex.json"},"texPngData":{"url":"http://teach.cdn.ireadabc.com/2035cfe53400c0e4608484c6709ac46f.png","name":"NewProject_tex.png"}}],"bg_pic_url":"http://teach.cdn.ireadabc.com/7e2e266a6e2e596103ac973e0a22d3ac.jpg","dot_big_1_url":"http://teach.cdn.ireadabc.com/2459ff2237e6fd5db3cd5114a963142c.png","dot_big_2_url":"http://teach.cdn.ireadabc.com/dc479b6c0ab7d3c9aaf67602d15461ee.png","dot_small_1_url":"http://teach.cdn.ireadabc.com/9a55ab875ba30762c8f3e0d62019fe87.png","dot_small_2_url":"http://teach.cdn.ireadabc.com/7f782ff0bbd8b2f6567c4ad7940f0e52.png","page_id":"15","book_id":"opw1","part_name":"c","bgItem2":{"url":"http://teach.cdn.ireadabc.com/5ebe42f28b4800c177911a963fa470c9.png","rect":{"x":237.51,"y":0,"width":1818.98,"height":2353}},"hotZoneItemArr2":[{"id":"1667985423743","index":0,"itemType":"rect","fontScale":1.7921875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.7921875,"dragDot":{"x":1147,"y":1204.6481802426345},"gIdx":"3","labelText":"Trace w a say","posX":739.6403738837666,"posY":226.8698116550978,"rect":{"x":246.77,"y":192,"width":510.72,"height":69.74}},{"id":"1667985443483","index":1,"itemType":"rect","fontScale":1.7921875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.7921875,"dragDot":{"x":1147,"y":1204.6481802426345},"gIdx":"5","labelText":"E","posX":495.55054165659374,"posY":371.08969275547736,"rect":{"x":218.59,"y":294,"width":78.9,"height":154.18}},{"id":"1667985570867","index":2,"itemType":"rect","fontScale":1.7921875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.7921875,"dragDot":{"x":1147,"y":1204.6481802426345},"gIdx":"1","labelText":"E_0_b","posX":416,"posY":190,"rect":{"x":548.39,"y":291.21,"width":97.07,"height":155.31}},{"id":"1667985632531","index":3,"itemType":"rect","fontScale":1.7921875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.7921875,"dragDot":{"x":1147,"y":1204.6481802426345},"gIdx":"1","labelText":"E_1_b","posX":503.0045881451673,"posY":191.00048605495954,"rect":{"x":717.3,"y":293.16,"width":97.07,"height":155.31}},{"id":"1667985641077","index":4,"itemType":"rect","fontScale":1.7921875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.7921875,"dragDot":{"x":1147,"y":1204.6481802426345},"gIdx":"1","labelText":"E_2_b","posX":589.0048107071751,"posY":191.00048861314355,"rect":{"x":884.26,"y":293.16,"width":97.07,"height":155.31}},{"id":"1667985654351","index":5,"itemType":"rect","fontScale":1.7921875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.7921875,"dragDot":{"x":1147,"y":1204.6481802426345},"gIdx":"1","labelText":"E_3_b","posX":675.0050332691828,"posY":190.0004911713275,"rect":{"x":1051.22,"y":291.21,"width":97.07,"height":155.31}},{"id":"1667985689529","index":6,"itemType":"rect","fontScale":1.7921875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.7921875,"dragDot":{"x":1147,"y":1204.6481802426345},"gIdx":"1","labelText":"E_4_b","posX":765.0052507148226,"posY":190.00048605495954,"rect":{"x":1225.97,"y":291.21,"width":97.07,"height":155.31}},{"id":"1667985702528","index":7,"itemType":"rect","fontScale":1.7921875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.7921875,"dragDot":{"x":1147,"y":1204.6481802426345},"gIdx":"1","labelText":"E_5_b","posX":852.0154733024123,"posY":190.00048605495954,"rect":{"x":1394.89,"y":291.21,"width":97.07,"height":155.31}},{"id":"1667985714293","index":8,"itemType":"rect","fontScale":1.7921875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.7921875,"dragDot":{"x":1147,"y":1204.6481802426345},"gIdx":"1","labelText":"E_6_b","posX":939.0256907736339,"posY":191.00048861314355,"rect":{"x":1563.82,"y":293.16,"width":97.07,"height":155.31}},{"id":"1667985790355","index":9,"itemType":"rect","fontScale":1.7921875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.7921875,"dragDot":{"x":1147,"y":1204.6481802426345},"gIdx":"1","labelText":"e_0_s","posX":413.03913543613623,"posY":326.00082885161515,"rect":{"x":546.59,"y":586.31,"width":89.17,"height":93.19}},{"id":"1667985813529","index":10,"itemType":"rect","fontScale":1.7921875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.7921875,"dragDot":{"x":1147,"y":1204.6481802426345},"gIdx":"1","labelText":"e_1_s","posX":501.0395805601518,"posY":325.00083396798317,"rect":{"x":715.51,"y":586.31,"width":93.03,"height":89.31}},{"id":"1667985833937","index":11,"itemType":"rect","fontScale":1.7921875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.7921875,"dragDot":{"x":1147,"y":1204.6481802426345},"gIdx":"1","labelText":"e_2_s","posX":589.0448056931345,"posY":326.00083140979916,"rect":{"x":886.36,"y":588.25,"width":93.03,"height":89.31}},{"id":"1667985881974","index":12,"itemType":"rect","fontScale":1.7921875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.7921875,"dragDot":{"x":1147,"y":1204.6481802426345},"gIdx":"1","labelText":"e_3_s","posX":677.0450256969583,"posY":325.00083140979916,"rect":{"x":1057.2,"y":586.31,"width":93.03,"height":89.31}},{"id":"1667985902797","index":13,"itemType":"rect","fontScale":1.7921875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.7921875,"dragDot":{"x":1147,"y":1204.6481802426345},"gIdx":"1","labelText":"e_4_s","posX":764.0452508171501,"posY":326.00083140979916,"rect":{"x":1226.13,"y":588.25,"width":93.03,"height":89.31}},{"id":"1667985936521","index":14,"itemType":"rect","fontScale":1.7921875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.7921875,"dragDot":{"x":1147,"y":1204.6481802426345},"gIdx":"1","labelText":"e_5_s","posX":850.0554785211076,"posY":326.00083140979916,"rect":{"x":1393.11,"y":588.25,"width":93.03,"height":89.31}},{"id":"1667986010733","index":15,"itemType":"rect","fontScale":1.7921875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.7921875,"dragDot":{"x":1147,"y":1204.6481802426345},"gIdx":"1","labelText":"e_6_s","posX":938.0656985505134,"posY":327.00083396798317,"rect":{"x":1563.97,"y":590.19,"width":93.03,"height":89.31}},{"id":"1667986124358","index":16,"itemType":"rect","fontScale":1.7921875,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.7921875,"dragDot":{"x":1147,"y":1204.6481802426345},"gIdx":"2","posX":1188.3049848033966,"posY":458.0596147426486,"rect":{"x":127.63,"y":155.2,"width":1646.33,"height":605.72}}],"isDebug":false}
		// return {"write_big_0_audio_url":"http://teach.cdn.ireadabc.com/408c71e718e626d16df25239fdd71163.mp3","write_big_1_audio_url":"http://teach.cdn.ireadabc.com/4c5a39defde0e90f3a53bf50db6943f4.mp3","write_big_2_audio_url":"http://teach.cdn.ireadabc.com/87294765bb8f37041744dc48d876c052.mp3","write_small_0_audio_url":"http://teach.cdn.ireadabc.com/d099918c85ac7afc33f169c9038f46d4.mp3","write_small_2_audio_url":"http://teach.cdn.ireadabc.com/9ccf4a2c0bf3e3baf66bddd4a0abb620.mp3","write_small_1_audio_url":"http://teach.cdn.ireadabc.com/2f1ea180fb4d17dce34e8d7cc6cf9159.mp3","finish_audio_url":"http://teach.cdn.ireadabc.com/7fb349c67a76d2112a0604e624acaa97.mp3","tip_audio_url":"http://teach.cdn.ireadabc.com/d5cdef3f02abe29b14ca8c16ad4e7543.mp3","letter":"C","animArr":[{"key":"letter_big_0","title":"大写彩色动画","skeJsonData":{"url":"http://teach.cdn.ireadabc.com/4dd75bd1c8b9f556b580f5d256fecfb7.json","name":"C大彩_ske.json"},"texJsonData":{"url":"http://teach.cdn.ireadabc.com/725d676582a580ae2cee26652712efd6.json","name":"C大彩_tex.json"},"texPngData":{"url":"http://teach.cdn.ireadabc.com/5780883b33891b445070dcd67232ca98.png","name":"C大彩_tex.png"}},{"key":"letter_big_1","title":"大写黑色动画","skeJsonData":{"url":"http://teach.cdn.ireadabc.com/8d6671efb002131453b527eeed3bf97f.json","name":"C大黑_ske.json"},"texJsonData":{"url":"http://teach.cdn.ireadabc.com/73fe384407514cdb6367e836a45cfa03.json","name":"C大黑_tex.json"},"texPngData":{"url":"http://teach.cdn.ireadabc.com/ef6a958b04c1fed3a47881a592483df7.png","name":"C大黑_tex.png"}},{"key":"letter_small_0","title":"小写彩色动画","skeJsonData":{"url":"http://teach.cdn.ireadabc.com/66d8a9651b82fa83d8d3e1bbe8ffeeb6.json","name":"C小彩_ske.json"},"texJsonData":{"url":"http://teach.cdn.ireadabc.com/2d25d66f78bc30c7782274f97c263303.json","name":"C小彩_tex.json"},"texPngData":{"url":"http://teach.cdn.ireadabc.com/ddddad84a4723ab74bd37f6fca21b4fe.png","name":"C小彩_tex.png"}},{"key":"letter_small_1","title":"小写黑色动画","skeJsonData":{"url":"http://teach.cdn.ireadabc.com/d1dd83aed85d64945dfc13f6a14d0020.json","name":"C小黑_ske.json"},"texJsonData":{"url":"http://teach.cdn.ireadabc.com/92be77c123e33cab47275d1437dd28df.json","name":"C小黑_tex.json"},"texPngData":{"url":"http://teach.cdn.ireadabc.com/44a6134566cb62daca7dc5a2c2ebb449.png","name":"C小黑_tex.png"}}],"bg_pic_url":"http://teach.cdn.ireadabc.com/520b8785f6b253aef7ced8941711c1cf.png","dot_big_1_url":"http://teach.cdn.ireadabc.com/f58a94261f588126b877f6bfc4382e5c.png","dot_big_2_url":"http://teach.cdn.ireadabc.com/f58a94261f588126b877f6bfc4382e5c.png","dot_small_1_url":"http://teach.cdn.ireadabc.com/e6d93412e4a0b3fb49a6d3c73368ddf7.png","dot_small_2_url":"http://teach.cdn.ireadabc.com/e6d93412e4a0b3fb49a6d3c73368ddf7.png","page_id":"9","part_name":"c","book_id":"opw1","bgItem2":{"url":"http://teach.cdn.ireadabc.com/7975e4a930fe51033b0e1321260d4046.png","rect":{"x":108.53,"y":0,"width":936.93,"height":1212}},"hotZoneItemArr2":[{"id":"1667983507722","index":0,"itemType":"rect","fontScale":0.9015625,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":0.9015625,"dragDot":{"x":577,"y":606},"gIdx":"3","labelText":"Trace w a say","posX":367,"posY":120,"rect":{"x":123.47,"y":101,"width":270,"height":38}},{"id":"1667983545642","index":1,"itemType":"rect","fontScale":0.9015625,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":0.9015625,"dragDot":{"x":577,"y":606},"gIdx":"5","labelText":"C","posX":233.00411743931176,"posY":190.00048861314352,"rect":{"x":85.47,"y":149,"width":78,"height":82}},{"id":"1667983648436","index":2,"itemType":"rect","fontScale":0.9015625,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":0.9015625,"dragDot":{"x":577,"y":606},"gIdx":"1","labelText":"C_0_b","posX":415.005000012791,"posY":191.00155025950244,"rect":{"x":270.48,"y":150,"width":71.99,"height":82}},{"id":"1667983754171","index":3,"itemType":"rect","fontScale":0.9015625,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":0.9015625,"dragDot":{"x":577,"y":606},"gIdx":"1","labelText":"C_1_b","posX":503.00958559977425,"posY":192.00048861314352,"rect":{"x":358.48,"y":151,"width":71.99,"height":82}},{"id":"1667983783176","index":4,"itemType":"rect","fontScale":0.9015625,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":0.9015625,"dragDot":{"x":577,"y":606},"gIdx":"1","labelText":"C_2_b","posX":592.009810719966,"posY":193.00049117132752,"rect":{"x":447.48,"y":152,"width":71.99,"height":82}},{"id":"1667983805194","index":5,"itemType":"rect","fontScale":0.9015625,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":0.9015625,"dragDot":{"x":577,"y":606},"gIdx":"1","labelText":"C_3_b","posX":680.0100383983419,"posY":193.0004937295115,"rect":{"x":535.49,"y":152,"width":71.99,"height":82}},{"id":"1667983832332","index":6,"itemType":"rect","fontScale":0.9015625,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":0.9015625,"dragDot":{"x":577,"y":606},"gIdx":"1","labelText":"C_4_b","posX":767.0102635185336,"posY":193.0004937295115,"rect":{"x":622.5,"y":152,"width":71.99,"height":82}},{"id":"1667983858989","index":7,"itemType":"rect","fontScale":0.9015625,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":0.9015625,"dragDot":{"x":577,"y":606},"gIdx":"1","labelText":"C_5_b","posX":852.0204861061233,"posY":193.0004937295115,"rect":{"x":707.51,"y":152,"width":71.99,"height":82}},{"id":"1667983874768","index":8,"itemType":"rect","fontScale":0.9015625,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":0.9015625,"dragDot":{"x":577,"y":606},"gIdx":"1","labelText":"C_6_b","posX":942.0407036029267,"posY":194.0004937295115,"rect":{"x":797.52,"y":153,"width":71.99,"height":82}},{"id":"1667984313677","index":9,"itemType":"rect","fontScale":0.9015625,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":0.9015625,"dragDot":{"x":577,"y":606},"gIdx":"1","labelText":"c_0_s","posX":416.0509338650684,"posY":325.0004962876955,"rect":{"x":281.52,"y":299,"width":52,"height":52}},{"id":"1667984371817","index":10,"itemType":"rect","fontScale":0.9015625,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":0.9015625,"dragDot":{"x":577,"y":606},"gIdx":"1","labelText":"c_1_s","posX":503.05458827307643,"posY":324.00083140979916,"rect":{"x":368.52,"y":298,"width":52,"height":52}},{"id":"1667984395135","index":11,"itemType":"rect","fontScale":0.9015625,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":0.9015625,"dragDot":{"x":577,"y":606},"gIdx":"1","labelText":"c_2_s","posX":592.0548108350843,"posY":325.00082885161515,"rect":{"x":457.52,"y":299,"width":52,"height":52}},{"id":"1667984433522","index":12,"itemType":"rect","fontScale":0.9015625,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":0.9015625,"dragDot":{"x":577,"y":606},"gIdx":"1","labelText":"c_3_s","posX":678.0550385134601,"posY":325.00083140979916,"rect":{"x":543.52,"y":299,"width":52,"height":52}},{"id":"1667984454505","index":13,"itemType":"rect","fontScale":0.9015625,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":0.9015625,"dragDot":{"x":577,"y":606},"gIdx":"1","labelText":"c_4_s","posX":763.0552585172838,"posY":326.00083140979916,"rect":{"x":628.53,"y":300,"width":52,"height":52}},{"id":"1667984468040","index":14,"itemType":"rect","fontScale":0.9015625,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":0.9015625,"dragDot":{"x":577,"y":606},"gIdx":"1","labelText":"c_5_s","posX":851.0654759885056,"posY":325.00083396798317,"rect":{"x":716.54,"y":299,"width":52,"height":52}},{"id":"1667984480032","index":15,"itemType":"rect","fontScale":0.9015625,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":0.9015625,"dragDot":{"x":577,"y":606},"gIdx":"1","labelText":"c_6_s","posX":937.0757011342791,"posY":326.00083140979916,"rect":{"x":802.55,"y":300,"width":52,"height":52}},{"id":"1667984500595","index":16,"itemType":"rect","fontScale":0.9015625,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":0.9015625,"dragDot":{"x":577,"y":606},"gIdx":"2","posX":582,"posY":241,"rect":{"x":41.47,"y":83,"width":864,"height":316}}],"isDebug":true}
		// return  {"animArr":[{"key":"letter_big_0","title":"大写彩色动画","skeJsonData":{"url":"https://staging-teach.cdn.ireadabc.com/3854b249ba08fe0d7f7be94308eda238.json","name":"D大彩_ske.json"},"texJsonData":{"url":"https://staging-teach.cdn.ireadabc.com/047c4030ce0956e7fa491bb10efa99d0.json","name":"D大彩_tex.json"},"texPngData":{"url":"https://staging-teach.cdn.ireadabc.com/fdeefde6344de8b50de4c1e97532de46.png","name":"D大彩_tex.png"}},{"key":"letter_big_1","title":"大写黑色动画","skeJsonData":{"url":"https://staging-teach.cdn.ireadabc.com/4a73aa0ed1abe9fe59cbc9396164ab0b.json","name":"D大黑_ske.json"},"texJsonData":{"url":"https://staging-teach.cdn.ireadabc.com/264182a83f00f862662611adde7afc05.json","name":"D大黑_tex.json"},"texPngData":{"url":"https://staging-teach.cdn.ireadabc.com/444b96de33fb48ab6a488b058d81449d.png","name":"D大黑_tex.png"}},{"key":"letter_small_0","title":"小写彩色动画","skeJsonData":{"url":"https://staging-teach.cdn.ireadabc.com/4fbe3832ff08127bb2899c525f3c0918.json","name":"D小彩_ske.json"},"texJsonData":{"url":"https://staging-teach.cdn.ireadabc.com/958bfb6722f4bf5f2b5d975e420cf23c.json","name":"D小彩_tex.json"},"texPngData":{"url":"https://staging-teach.cdn.ireadabc.com/489483bb7b433044f5736ac1f05d4bf2.png","name":"D小彩_tex.png"}},{"key":"letter_small_1","title":"小写黑色动画","skeJsonData":{"url":"https://staging-teach.cdn.ireadabc.com/f88764f49c73d2bdc7ab21d3f3f3c4bc.json","name":"D小黑_ske.json"},"texJsonData":{"url":"https://staging-teach.cdn.ireadabc.com/403916dcfd80ce24069eddce10e0124c.json","name":"D小黑_tex.json"},"texPngData":{"url":"https://staging-teach.cdn.ireadabc.com/840b55ebf6ae75ec7cf011c48f3189ec.png","name":"D小黑_tex.png"}}],"write_big_0_audio_url":"https://staging-teach.cdn.ireadabc.com/d4c2f72fd4238c48c1b19d747d0ce382.mp3","write_big_1_audio_url":"https://staging-teach.cdn.ireadabc.com/4c5a39defde0e90f3a53bf50db6943f4.mp3","write_big_2_audio_url":"https://staging-teach.cdn.ireadabc.com/a5652eadaf165869b2b551530921bb0d.mp3","write_small_0_audio_url":"https://staging-teach.cdn.ireadabc.com/d099918c85ac7afc33f169c9038f46d4.mp3","write_small_1_audio_url":"https://staging-teach.cdn.ireadabc.com/2f1ea180fb4d17dce34e8d7cc6cf9159.mp3","write_small_2_audio_url":"https://staging-teach.cdn.ireadabc.com/15147c1c4ae733303566baf84fae2840.mp3","finish_audio_url":"https://staging-teach.cdn.ireadabc.com/7fb349c67a76d2112a0604e624acaa97.mp3","tip_audio_url":"https://staging-teach.cdn.ireadabc.com/d5cdef3f02abe29b14ca8c16ad4e7543.mp3","letter":"A","dot_small_2_url":"https://staging-teach.cdn.ireadabc.com/8a8cbc71ad861b372418f36aef32a8cd.png","dot_small_1_url":"https://staging-teach.cdn.ireadabc.com/80221b2a4b62f57c33c7e6491f372077.png","dot_big_1_url":"https://staging-teach.cdn.ireadabc.com/e2b74edc1520bc2001d82b4e8aaba5d7.png","dot_big_2_url":"https://staging-teach.cdn.ireadabc.com/e2b74edc1520bc2001d82b4e8aaba5d7.png","bg_pic_url":"http://staging-teach.cdn.ireadabc.com/7e2e266a6e2e596103ac973e0a22d3ac.jpg","bgItem2":{"url":"http://staging-teach.cdn.ireadabc.com/e94766af9c75bcdc8308a914929afc74.png","rect":{"x":172.26,"y":0,"width":1367.48,"height":1769}},"hotZoneItemArr2":[{"id":"1666840073802","index":0,"itemType":"rect","fontScale":1.3375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.3375,"dragDot":{"x":856,"y":875.97907444668},"gIdx":"3","labelText":"rac w a say","posX":803.5,"posY":249.5,"rect":{"x":182.53,"y":152.34,"width":391.64,"height":42.43}},{"id":"1666840147464","index":1,"itemType":"rect","fontScale":1.3375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.3375,"dragDot":{"x":856,"y":875.97907444668},"gIdx":"5","labelText":"A","posX":522.5,"posY":398.5,"rect":{"x":138.71,"y":220.52,"width":88.35,"height":113.39}},{"id":"1666840195993","index":2,"itemType":"rect","fontScale":1.3375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.3375,"dragDot":{"x":856,"y":875.97907444668},"gIdx":"1","labelText":"A_0_b","posX":899.5,"posY":401.5,"rect":{"x":403.75,"y":223.99,"width":82.78,"height":110.61}},{"id":"1666840237362","index":3,"itemType":"rect","fontScale":1.3375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.3375,"dragDot":{"x":856,"y":875.97907444668},"gIdx":"1","labelText":"A_1_b","posX":1082.4997014371008,"posY":398.5003494839767,"rect":{"x":531.05,"y":221.91,"width":82.78,"height":110.61}},{"id":"1666840289442","index":4,"itemType":"rect","fontScale":1.3375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.3375,"dragDot":{"x":856,"y":875.97907444668},"gIdx":"1","labelText":"A_2_b","posX":"1265","posY":398.5003494839767,"rect":{"x":658,"y":221.91,"width":82.78,"height":110.61}},{"id":"1666840378939","index":5,"itemType":"rect","fontScale":1.3375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.3375,"dragDot":{"x":856,"y":875.97907444668},"gIdx":"1","labelText":"A_3_b","posX":"1448","posY":398.5003494839767,"rect":{"x":785.3,"y":221.91,"width":82.78,"height":110.61}},{"id":"1666840417298","index":6,"itemType":"rect","fontScale":1.3375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.3375,"dragDot":{"x":856,"y":875.97907444668},"gIdx":"1","labelText":"A_4_b","posX":"1632","posY":398.5003494839767,"rect":{"x":913.3,"y":221.91,"width":82.78,"height":110.61}},{"id":"1666840451040","index":7,"itemType":"rect","fontScale":1.3375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.3375,"dragDot":{"x":856,"y":875.97907444668},"gIdx":"1","labelText":"A_5_b","posX":1814.0003364272902,"posY":398.5003468726394,"rect":{"x":1039.91,"y":221.91,"width":82.78,"height":110.61}},{"id":"1666840547094","index":8,"itemType":"rect","fontScale":1.3375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.3375,"dragDot":{"x":856,"y":875.97907444668},"gIdx":"1","labelText":"A_6_b","posX":1999.0004974597578,"posY":398.5003468726394,"rect":{"x":1168.6,"y":221.91,"width":82.78,"height":110.61}},{"id":"1666840559646","index":9,"itemType":"rect","fontScale":1.3375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.3375,"dragDot":{"x":856,"y":875.97907444668},"gIdx":"1","labelText":"a_0_s","posX":901.000658492225,"posY":683.5003468726394,"rect":{"x":412.79,"y":445.21,"width":66.78,"height":60.52}},{"id":"1666840588967","index":10,"itemType":"rect","fontScale":1.3375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.3375,"dragDot":{"x":856,"y":875.97907444668},"gIdx":"1","labelText":"a_1_s","posX":1082.9997027427694,"posY":682.500594949684,"rect":{"x":539.4,"y":444.51,"width":66.78,"height":60.52}},{"id":"1666840599411","index":11,"itemType":"rect","fontScale":1.3375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.3375,"dragDot":{"x":856,"y":875.97907444668},"gIdx":"1","labelText":"a_2_s","posX":1260.9998611638996,"posY":683.5005940792382,"rect":{"x":663.22,"y":445.21,"width":66.78,"height":60.52}},{"id":"1666840612277","index":12,"itemType":"rect","fontScale":1.3375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.3375,"dragDot":{"x":856,"y":875.97907444668},"gIdx":"1","labelText":"a_3_s","posX":1444.0000161032467,"posY":684.500594949684,"rect":{"x":790.52,"y":445.9,"width":66.78,"height":60.52}},{"id":"1666840622998","index":13,"itemType":"rect","fontScale":1.3375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.3375,"dragDot":{"x":856,"y":875.97907444668},"gIdx":"1","labelText":"a_4_s","posX":1631.0001753948227,"posY":682.5005958201295,"rect":{"x":920.6,"y":444.51,"width":66.78,"height":60.52}},{"id":"1666840636543","index":14,"itemType":"rect","fontScale":1.3375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.3375,"dragDot":{"x":856,"y":875.97907444668},"gIdx":"1","labelText":"a_5_s","posX":1811.0003381681818,"posY":682.5005940792382,"rect":{"x":1045.82,"y":444.51,"width":66.78,"height":60.52}},{"id":"1666840652074","index":15,"itemType":"rect","fontScale":1.3375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.3375,"dragDot":{"x":856,"y":875.97907444668},"gIdx":"1","labelText":"a_6_s","posX":1993.0004948484204,"posY":684.5005940792382,"rect":{"x":1172.42,"y":445.9,"width":66.78,"height":60.52}},{"id":"1666840663151","index":16,"itemType":"rect","fontScale":1.3375,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.3375,"dragDot":{"x":856,"y":875.97907444668},"gIdx":"2","posX":1249.5,"posY":520.5,"rect":{"x":59.41,"y":134.26,"width":1258.4,"height":455.64}}],"page_id":"5","book_id":"opw1","part_name":"c"}
		// return {"write_big_0_audio_url":"https://teach.cdn.ireadabc.com/d1dc9853d03d0237f0d2206dcf7f62e9.mp3","write_big_1_audio_url":"https://teach.cdn.ireadabc.com/eb0054aa1415046dfa35ed31a3a7e35c.mp3","tip_audio_url":"https://teach.cdn.ireadabc.com/52824b6c66664de8ee7b3bef3af5593f.mp3","finish_audio_url":"https://staging-teach.cdn.ireadabc.com/750a7079ea924a9260cebf649645b87c.mp3","write_small_0_audio_url":"https://teach.cdn.ireadabc.com/b2ce05a59cbdcaef5d85e56c6ffdcc20.mp3","write_small_1_audio_url":"https://teach.cdn.ireadabc.com/eb0054aa1415046dfa35ed31a3a7e35c.mp3","write_small_2_audio_url":"https://teach.cdn.ireadabc.com/908269df525600b866042ab473a0b879.mp3","write_big_2_audio_url":"https://teach.cdn.ireadabc.com/0fd3a090c37a2c11bb8503908a1326f2.mp3","letter":"A","animArr":[{"key":"letter_big_0","title":"大写彩色动画","skeJsonData":{"url":"https://teach.cdn.ireadabc.com/cdee11a12d4bf498bd3f0931bfe858cf.json","name":"A大彩_ske.json"},"texJsonData":{"url":"https://teach.cdn.ireadabc.com/ae2b83555093e3a739fcef9f107f52bb.json","name":"A大彩_tex.json"},"texPngData":{"url":"https://teach.cdn.ireadabc.com/db4a8c0d718e998f8fd3983aaf39e8d5.png","name":"A大彩_tex.png"}},{"key":"letter_big_1","title":"大写黑色动画","skeJsonData":{"url":"https://teach.cdn.ireadabc.com/14c5231012b4a1f3ac898ca6f83bc213.json","name":"A大黑_ske.json"},"texJsonData":{"url":"https://teach.cdn.ireadabc.com/a9e874a147023e0944cf89c351661218.json","name":"A大黑_tex.json"},"texPngData":{"url":"https://teach.cdn.ireadabc.com/8e12ae87d2c1a7bb6fc320272a930d9b.png","name":"A大黑_tex.png"}},{"key":"letter_small_0","title":"小写彩色动画","skeJsonData":{"url":"https://teach.cdn.ireadabc.com/8c0ccddb1d49eb555846c006244b27dc.json","name":"A小彩_ske.json"},"texJsonData":{"url":"https://teach.cdn.ireadabc.com/667e32080f139a09ab434a698dccc18b.json","name":"A小彩_tex.json"},"texPngData":{"url":"https://teach.cdn.ireadabc.com/65abc1cc2e73a2b9bbaffa497d81e5a4.png","name":"A小彩_tex.png"}},{"key":"letter_small_1","title":"小写黑色动画","skeJsonData":{"url":"https://teach.cdn.ireadabc.com/356e9e26a2a74c57791fff7471142d54.json","name":"A小黑_ske.json"},"texJsonData":{"url":"https://teach.cdn.ireadabc.com/9a262fdad701a170994510e1562baa76.json","name":"A小黑_tex.json"},"texPngData":{"url":"https://teach.cdn.ireadabc.com/500b883b3c0c0613a6de963f3deb7f72.png","name":"A小黑_tex.png"}}],"bg_pic_url":"https://teach.cdn.ireadabc.com/520b8785f6b253aef7ced8941711c1cf.png","dot_big_1_url":"https://teach.cdn.ireadabc.com/125b10277b51185a8238f0ad2d399e3e.png","dot_big_2_url":"https://teach.cdn.ireadabc.com/e61ae4cb1ce8dfbec37f153980233d6b.png","dot_small_1_url":"https://teach.cdn.ireadabc.com/9b5c4f22242cff975aa6189235e4caf9.png","dot_small_2_url":"https://teach.cdn.ireadabc.com/cd32e56db4dc9fadea2ad52aa0c93066.png"};
	},

	preloadItem() {
		this.addPreloadImage();
		this.addPreloadAudio();
		this.addPreloadAnima();
		this.preload();
	},


	addPreloadImage() {

		this._imageResList.push({ url: this.data.dot_big_1_url || '' });
		this._imageResList.push({ url: this.data.dot_big_2_url || '' });
		this._imageResList.push({ url: this.data.dot_small_1_url || '' });
		this._imageResList.push({ url: this.data.dot_small_2_url || '' });
		this._imageResList.push({ url: this.data.bg_pic_url || '' });



	},

	addPreloadAudio() {

		if (this.data) {
			this._audioResList.push({ url: this.data.write_big_0_audio_url || '' });
			this._audioResList.push({ url: this.data.write_big_1_audio_url || '' });
			this._audioResList.push({ url: this.data.write_big_2_audio_url || '' });
			this._audioResList.push({ url: this.data.write_small_0_audio_url || '' });
			this._audioResList.push({ url: this.data.write_small_1_audio_url || '' });
			this._audioResList.push({ url: this.data.write_small_2_audio_url || '' });
			this._audioResList.push({ url: this.data.finish_audio_url || '' });
			this._audioResList.push({ url: this.data.tip_audio_url || '' });
		}
	},

	addPreloadAnima() {

		const animArr = this.data.animArr;
		for (let i=0; i<animArr.length; i++) {
			this._animaResList.push({ url: animArr[i]?.skeJsonData?.url || '' });
			this._animaResList.push({ url: animArr[i]?.texJsonData?.url || '' });
			this._animaResList.push({ url: animArr[i]?.texPngData?.url || '' });
		}
	},

	preload() {

		const preloadArr = this._imageResList.concat(this._audioResList).concat(this._animaResList);
		cc.assetManager.loadAny(preloadArr, null, null, (err, data) => {

			this.addServerListener();


			cc.debug.setDisplayStats(false);
		});
	},

	addServerListener() {

		if (window && window["air"]) {


			// cc.find('Canvas').opacity = 0;
			window.air.onCourseInScreen = (next) => {
				//  cc.find('Canvas').opacity = 255;
				this.loadEnd();
				next();
			}
			window.air.hideAirClassLoading();
		} else {
			this.loadEnd();
		}


		if (window.air) {
			window.air.osmoHandwritingCallback = (data) => {

				if (!data) {
					console.log('data is not exist!!!');
					return;
				}

				console.log('osmoHandwritingCallback data: ', data);

				if (typeof (data) == 'string') {
					console.log('data is string ');
					const dataObj = JSON.parse(data);

					this.photoEnd(dataObj);
					return;
				}

				// 哲学逻辑
				this.photoEnd(data);

			}
		}

	},

	loadEnd() {

		console.log('loadEnd')

		// this.data.isDebug = true;

		this.initData();
		this.initAudio();
		this.initView();


		const node = cc.find('middleLayer/ConsoleNode/BtnOpen');
		if (node) {
			node.opacity = 0;
		}
		// this.initListener();
	},


	step: null,
	canTouch: null,
	dataPool: null,
	initData() {
		// 所有全局变量 默认都是null 

		console.log(' canTouch = fasle  0');

		this.canTouch = false;
		this.step = 1;
		this.dataPool = [];


		this.nodePoolArr = [];

		this.centerItemArr = this.getGroupArrByGIdx(this.data.hotZoneItemArr2, '1');
		this.benchmark1Data = this.getGroupArrByGIdx(this.data.hotZoneItemArr2, '3')[0];
		this.benchmark2Data = this.getGroupArrByGIdx(this.data.hotZoneItemArr2, '4')[0];
		this.firstItemData = this.getGroupArrByGIdx(this.data.hotZoneItemArr2, '5')[0];


		this.newRectArr = this.getGroupArrByGIdx(this.data.hotZoneItemArr2, '1');

		this.initCheckBase();
		this.initQuesRegion();
		// this.initTestPointArr();
	},


	ques_region: null,
	initQuesRegion() {
		const regionItem = this.data.hotZoneItemArr2.find(hzItem => {
			return hzItem.gIdx == '2'
		})

		const bgRect = this.data.bgItem2.rect;
		const regionRect = regionItem.rect;
		this.regionRect = regionRect;

		const left = Math.round( (regionRect.x ) / bgRect.width  * 1000 ) / 1000;
		const right =  Math.round( (regionRect.x + regionRect.width) / bgRect.width * 1000 ) / 1000;
		const top =  Math.round( (regionRect.y ) / bgRect.height * 1000 ) / 1000;
		const bottom =  Math.round( (regionRect.y + regionRect.height) / bgRect.height * 1000 ) / 1000;

		this.ques_region = [
			left, top,
			right, top,
			right, bottom,
			left, bottom
		]

		this.ques_region_opt = {
			left,
			top,
			right,
			bottom
		}

		console.log(' this.ques_region: ' , this.ques_region);

		console.log('regionItem: ', regionItem);
	},

	initTestPointArr() {
		
		const linkeItemArr = this.data.hotZoneItemArr.filter(hzItem => {
			return hzItem.gIdx == '0';
		})

		const bgRect = this.data.bgItem2.rect;

		const setDebugCenterPos = (hzItem) => {

			const debugItemIndex = (Number(hzItem.pointItem) - 1) 
			const debugItem = this.data.hotZoneItemArr2[debugItemIndex];
			const {rect} = debugItem

			const left = Math.round( (rect.x ) / bgRect.width  * 1000 ) / 1000;
			const right =  Math.round( (rect.x + rect.width) / bgRect.width * 1000 ) / 1000;
			const top =  Math.round( (rect.y ) / bgRect.height * 1000 ) / 1000;
			const bottom =  Math.round( (rect.y + rect.height) / bgRect.height * 1000 ) / 1000;
	
			
			const x = left + (right - left) / 2;
			const y = bottom - (bottom - top) / 2;

			// console.log('~~x: ', x);
			// console.log('~~y: ', y);
			hzItem.debugCenterPos = [x, y];
		}

		console.log('linkeItemArr: ', linkeItemArr);

		linkeItemArr.forEach(hzItem => {
			return setDebugCenterPos(hzItem);
		})

		const startPosObj = {};
		const endPosObj = {};

		for (let i=0; i<linkeItemArr.length; i++) {
			const index = this.data.hotZoneItemArr.indexOf(linkeItemArr[i]);
			const key = (index + 1).toString();
			if (!startPosObj[key] && !endPosObj[key]) {
				startPosObj[key] = linkeItemArr[i];


				const endKey = linkeItemArr[i].linkItem.toString();
				const endIndex = Number(endKey) - 1;
				const endItem = this.data.hotZoneItemArr[endIndex];
				endPosObj[endKey] = endItem;
			}
		}

		console.log('startPosObj: ', startPosObj);
		console.log('endPosObj: ', endPosObj);

		this.start_points = [];
		for (let key in startPosObj) {
			const item = startPosObj[key];
			this.start_points = this.start_points.concat(item.debugCenterPos);
		}

		console.log('this.start_points: ', this.start_points);

		this.end_points = [];
		for (let key in endPosObj) {
			const item = endPosObj[key];
			this.end_points = this.end_points.concat(item.debugCenterPos);
		}
		
		console.log('this.end_points: ', this.end_points);

	},

	initCheckBase() {

		console.log('benchmark1Data: ', this.benchmark1Data);
		console.log('benchmark2Data: ', this.benchmark2Data);
		console.log('centerItemArr: ', this.centerItemArr);

		const benchmark1Rect = this.benchmark1Data.rect;
		const benchmark1CenterY = (benchmark1Rect.y + benchmark1Rect.height / 2);

		let unitH;
		let unitW;
		let baseX;
		let baseY;

		if (this.benchmark2Data) {
			const benchmark2Rect = this.benchmark2Data.rect;
			const benchmark2CenterY = (benchmark2Rect.y + benchmark2Rect.height / 2);
			
			unitH = benchmark2CenterY - benchmark1CenterY;
			unitW = benchmark2Rect.x + benchmark2Rect.width - benchmark1Rect.x;
			baseX = benchmark1Rect.x;
			baseY = benchmark1CenterY;
		}

		if (this.firstItemData) {
			const firstItemRect = this.firstItemData.rect;
			baseX = firstItemRect.x + firstItemRect.width / 2;
			baseY = firstItemRect.y + firstItemRect.height / 2;
			unitW = benchmark1Rect.x + benchmark1Rect.width - (firstItemRect.x + firstItemRect.width / 2);
			// unitW = (firstItemRect.x + firstItemRect.width / 2);
			unitH = (firstItemRect.y + firstItemRect.height / 2) - benchmark1CenterY;
		}


		for(let i=0; i<this.centerItemArr.length; i++) {

			const itemRect = this.centerItemArr[i].rect;
			const x = itemRect.x + itemRect.width / 2;
			const y = itemRect.y + itemRect.height / 2;

			const unitX = (x - baseX) / unitW;
			const unitY = (y - baseY) / unitH;
			const unitW2 = itemRect.width / unitW;
			const unitH2 = itemRect.height / unitH;


			this.centerItemArr[i].unitX = unitX;
			this.centerItemArr[i].unitY = unitY;
			this.centerItemArr[i].unitW = unitW2;
			this.centerItemArr[i].unitH = unitH2;

			this.initCheckLetter(this.centerItemArr[i]);

			// console.log('unitX: ', unitX)
			// console.log('unitY: ', unitY)
		}

		// console.log('unitH: ', unitH)
		// console.log('unitW: ', unitW)
		// console.log('baseX: ', baseX)
		// console.log('baseY: ', baseY)
	
		const centerX = this.data.bgItem2.rect.width / 2;
		this.centerUnitW = (centerX - baseX) / unitW;

	},


	getGroupArrByGIdx(arr, gIdx) {
		const groupArr = [];
		for (let i=0; i<arr.length; i++) {
			if (arr[i].gIdx == gIdx) {
				groupArr.push(arr[i]);
			}
		}

		return groupArr;
	},

	initCheckLetter(checkLetter) {
		console.log('checkLetter: ' ,checkLetter);
		const tempTextArr = checkLetter.labelText.split("_");
		console.log('tempTextArr: ' ,tempTextArr);
		if (tempTextArr.length > 1) {

			checkLetter.labelText = tempTextArr[0];
			checkLetter.index = tempTextArr[1];
			checkLetter.sizeType = tempTextArr[2];
			checkLetter.key = tempTextArr[1] + '_' + tempTextArr[2];
		}
	},



	audioBtn: null,
	audioBegin: null,
	audioTipArea: null,
	audioTipLetter: null,
	audioTipIcon: null,
	audioTipSuccess: null,

	audioTipError: null,
	audioTipNotFill: null,
	audioTipFillWrong: null,
	audioOsmoTip: null,
	audioRight: null,
	initAudio() {
		const audioNode = cc.find('Canvas/res/audio');

		const getAudioByResName = (resName) => {
			return audioNode.getChildByName(resName).getComponent(cc.AudioSource);
		}

		this.audioBtn = getAudioByResName('btn');

		this.audioBegin = getAudioByResName('begin');



		this.audioTip1 = getAudioByResName('tip_1');
		this.audioTip2 = getAudioByResName('tip_2');
		this.audioTip3 = getAudioByResName('tip_3');

		this.audioOsmoTip = getAudioByResName('osmo_tip');
		this.audioRight = getAudioByResName('right');

		this.audioDefault = getAudioByResName('default');


		this.helpClip = getAudioByResName('help').clip;
	},






	resetHelperTime() {

		this.helperTime = new Date().getTime();

	},

	showHelper() {

		console.log("in showHelper");

		this.helpAudioId = playAudio(this.helpClip, () => {
			this.helpAudioId = null;
			this.showHelperWrite();
		})
	},

	pauseHelper() {
		if (this.helpAudioId) {
			cc.audioEngine.stopEffect(this.helpAudioId);
			this.helpAudioId = null;
		}
	},

	showHelperSign() {

		for (let i = 0; i < this.signAnimaNodeArr.length; i++) {

			const animaNode = this.signAnimaNodeArr[i];

			if (!animaNode.isShowEnd) {
		
				this.showSign(animaNode);
				break;
			}
			
		}
	},
	

	showHelperCircle() {
		
		for (let i = 0; i < this.circleAnimaNodeArr.length; i++) {

			const animaNode = this.circleAnimaNodeArr[i];

			if (!animaNode.isShowEnd) {

				this.showCircle(animaNode);
				break;				
			}
			
		}

	},

	showHelperWrite() {

		for (let i=0; i<this.writeNodeArr1.length; i++) {
			const animNode = this.writeNodeArr1[i];
			if (!animNode.isShowEnd) {
				this.showLetter(i, null, false)
				return;
			}
		}


		for (let i=0; i<this.writeNodeArr2.length; i++) {
			const animNode = this.writeNodeArr2[i];
			if (!animNode.isShowEnd) {
				this.showLetter(i, null, true)
				return;
			}
		}

	},

	
	showHelperLink() {

		console.log(' in showHelperLink..');
		
		let item;
		for (let i=0; i<this.linkRectGroup.length; i++) {

			const {hzItemId} = this.linkRectGroup[i].linkData;

			const rectNode = this.getItemById(hzItemId);
			
			if (!rectNode.isShowEnd && this.linkRectGroup[i].isRightPoint) {
				item = this.linkRectGroup[i];
				break;
			}
		}

		if (item) {
			const {hzItemId, linkHzItemId} = item.linkData
			this.showSuccess(hzItemId, linkHzItemId);
		}
	},


	startHelper() {

		this.resetHelperTime();
		this.isHelpCountDown = true;

		const checkTime = () => {

			if (!this.isHelpCountDown) {
				return;
			}

			let disTime = 10;
			if (this.data.helpTime) {

				if (this.data.helpTime <= 0) {
					return;
				}
				disTime = this.data.helpTime;
			}
			

			const curTime = new Date().getTime();
			if (curTime - this.helperTime > disTime * 1000) {
				this.showHelper();
				this.resetHelperTime();
			} 
	
			delayCall(0.05, () => {
				checkTime();
			})
		}

		checkTime();
		
	},

	stopHelper() {
		this.isHelpCountDown = false;
	},


	getRegionByRect(regionRect, bgRect) {

		const left = Math.round( (regionRect.x ) / bgRect.width  * 1000 ) / 1000;
		const right =  Math.round( (regionRect.x + regionRect.width) / bgRect.width * 1000 ) / 1000;
		const top =  Math.round( (regionRect.y ) / bgRect.height * 1000 ) / 1000;
		const bottom =  Math.round( (regionRect.y + regionRect.height) / bgRect.height * 1000 ) / 1000;

		return {left, top, right, bottom};
	},
	getGroupArrByGIdx(arr, gIdx) {
		const groupArr = [];
		for (let i=0; i<arr.length; i++) {
			if (arr[i].gIdx == gIdx) {

				const data = JSON.parse(JSON.stringify(arr[i]));
				groupArr.push(data);
			}
		}

		return groupArr;
	},
	getRegionsByGidx(gIdx) {

		const arr = this.getGroupArrByGIdx(this.data.hotZoneItemArr2, gIdx);
		const bgRect = this.data.bgItem2.rect;
		
		console.log("arr:", arr);
		const newLocationArr = [];
		for (let i=0; i<arr.length; i++) {

			const hzItem = arr[i];
			const regionRect = hzItem.rect;

			let region = this.getRegionByRect(regionRect, bgRect);

			newLocationArr.push(region)
		}

		return newLocationArr;

	},



	//调起检测
	startTesting() {


		if (!this.debugBgImg || !this.firstAudioEnd) {
			return;
		}


		this.startHelper();

		// setInterval(() => {
		// 	this.getPhotoData((data) => {
		// 		this.photoEnd(data);
		// 	});     
		// }, 30);
		// return;

		const partRegions = this.getRegionsByGidx('2');
		console.log('partRegions: ', partRegions);
		

		const cw = window.courseware;
		if (!cw || !cw.openOsmoHandwriting) {

			console.log('cw.openOsmoHandwriting not exist');
			return;
		}


		let lineType = 1;
		let circleSize = 1;

		const para = {
			"library_id": "iplayabc",
			"page_id": this.data.page_id, //27,
			"book_id": this.data.book_id,//"opw1",
			"part_name": this.data.part_name, //"d",
			"is_hand_writing": true,
			"is_line_link": false,
			// "write_regions": [this.ques_region_opt],
			"write_regions": partRegions,

			lineType,
			circleSize
			// 'ques_region' : []
		}

		console.log('aaa: ', para)
		cw.openOsmoHandwriting(para);


	},

	//结束检测
	endTesting() {

		this.stopHelper();

		const cw = window.courseware;
		if (!cw || !cw.closeOsmoHandwriting) {

			return;
		}
		cw.closeOsmoHandwriting();
		// this.isTesting = false;
	},

	isTesting: null,
	initTestingListener() {

		if (window.air) {
			window.air.osmoCallback = (res) => {
				// 哲学逻辑
				console.log('initTestingListener res: ', res);
				this.photoEnd(res);
			}
		}

	},


	initView() {

		this.initBg();

		this.initLetterItem();



		this.initWriteArea(false);
		this.initWriteArea(true);

		this.initDebugLayer();


		this.initCatListener();

		this.gameStart();





	},



	initCatListener() {

		const content = cc.find("Canvas/content");
		content.zIndex = 10;

		const catBox = cc.find("Canvas/content/catFrame/catBox")
		catBox.on('touchstart', () => {
			if (this.isPlayTip) {
				return;
			}

			if (!this.canTouch) {
				return;
			}


			if (!this.data.tip_audio_url) {
				return;
			}


			this.isPlayTip = true;

			this.playAni('begin', 0)
			//播放引导音频1
	
			playAudioByUrl(this.data.tip_audio_url, () => {
	
				this.isPlayTip = false;
				this.playAni('normal', 0);
	
			})

		})
	},


	writeNodeArr: null,
	initWriteArea(isSmall) {

		let writeBg;
		if (isSmall) {
			writeBg = this.itemBgSmall;
		} else {
			writeBg = this.itemBgBig;
		}


		const num = 7;

		const edge = 0.05;
		const baseW = 132
		const baseX = 250;
		const baseH = writeBg.height * 0.9;

		
		const writeNodeArr = [];

		for (let i = 0; i < num; i++) {

			const writeNode = new cc.Node();
			writeNode.x = baseX + baseW * i;
			// writeNode.y = -baseH / 2;
			writeNode.width = baseW;
			writeNode.height = baseH;
			writeBg.addChild(writeNode);

			writeNode.hitCount = 0;



			writeNodeArr.push(writeNode);
		}

		if (isSmall) {
			this.writeNodeArr2 = writeNodeArr;
		} else {
			this.writeNodeArr1 = writeNodeArr;
		}
	},



	maskNode: null,
	initMask() {

		const maskNode = new cc.Node();
		maskNode.width = this.canvas.width;
		maskNode.height = this.canvas.height;
		maskNode.anchorX = 0.5;
		maskNode.anchorY = 0.5;
		const mask = maskNode.addComponent(cc.Graphics);
		mask.fillColor = cc.Color.BLACK.setA(100);
		mask.fillRect(-this.canvas.width / 2, -this.canvas.height / 2, this.canvas.width, this.canvas.height);
		this.canvas.addChild(maskNode, 9);

		maskNode.addComponent(cc.BlockInputEvents);
		maskNode.active = false;
		this.maskNode = maskNode;
	},

	addDefaultMusic() {
		// console.log(' in ')
		// playAudio(this.audioDefault.clip, () => {
		// 	console.log(' wusheng end');
		// })
		cc.audioEngine.play(this.audioDefault.clip, true, 0.8);

	},


	initBg() {

		const bg = new cc.Node();
		this.canvas.addChild(bg);

		getSprNodeByUrl(this.data.bg_pic_url, (spr) => {
			// spr.node.parent = animNode.parent;
			// spr.node.x = animNode.x;
			// spr.node.y = animNode.y;
			// spr.node.scale = animNode.scale;

			// console.log('	spr.node.width: ', spr.node.width)
			// console.log('	spr.node.height: ', spr.node.height)
			bg.width = spr.node.width;
			bg.height = spr.node.height;

			spr.node.anchorX = 1;
			spr.node.anchorY = 0;
			bg.anchorX = 1;
			bg.anchorY = 0;
			bg.addChild(spr.node);

			const canvas = cc.find('Canvas');
			bg.scale = Math.max((canvas.width / bg.width), (canvas.height / bg.height));
			bg.y = -this.canvas.height / 2;
			bg.x = this.canvas.width / 2;
		})

		// const bgNode = cc.find('Canvas/bg');
		// bgNode.scale = this._mapScaleMax;

		// const canvas = cc.find('Canvas');
		// bgNode.scale = Math.max((canvas.width / bgNode.width), (canvas.height / bgNode.height));
	},


	letterItemArr: null,
	initLetterItem() {

		this.addLetterItemBig();
		this.addLetterItemSmall();
	
		
	},

	addLetterItemBig() {

		const itemBgBig = getSprNode('item_bg');
		itemBgBig.scale = this._mapScaleMin;
		itemBgBig.anchorX = 0;
		this.canvas.addChild(itemBgBig);
		this.itemBgBig = itemBgBig;

	
			
		const letterW = 50 * this._mapScaleMin;
		itemBgBig.x = -itemBgBig.width / 2 * itemBgBig.scaleX + letterW;
		itemBgBig.y =  200 * this._mapScaleMin;
		// itemLetterBig.x = itemBgBig.x - letterW;
		// itemLetterBig.y = itemBgBig.y;

		// getSprNodeByUrl(this.data.letter_big_pic_url, (spr) => {
		// 	const itemLetterBig = spr.node;
		// 	this.canvas.addChild(itemLetterBig);

		// 	itemLetterBig.scale = itemBgBig.height / itemLetterBig.height;

		// 	itemLetterBig.x = itemBgBig.x - letterW;
		// 	itemLetterBig.y = itemBgBig.y;
		// })

		

		let animColor;
		let animBlack;
		const checkShowOneLineAnim = () => {
			if (animColor && animBlack) {
				this.setOneLineAllAnimBig(animColor, animBlack, itemBgBig)
				console.log(' ~~~ showLetterAnim 5')

				this.showLetterAnim(1000,	this.letterAnimBig);
				this.addColorLetterListener( this.letterAnimBig );
			}
		}

		const bigColorData = this.getAnimData('letter_big_0');
		const bigBlackData = this.getAnimData('letter_big_1');

		this.getOneAnim(bigColorData, (animNode) => {

			animColor = animNode;
			animColor.x = 100;
			animColor.name = 'daxie_yanse'
			this.letterAnimBig = animColor;
			itemBgBig.addChild(animColor);
			checkShowOneLineAnim();			

		})

		this.getOneAnim(bigBlackData, (animNode) => {
			animBlack = animNode;
			checkShowOneLineAnim();

			const itemLetterBig = cc.instantiate(animNode);
			this.canvas.addChild(itemLetterBig);
			itemLetterBig.animationNames = animNode.animationNames;


			console.log(' ~~~ showLetterAnim 6')

			this.showLetterAnim(1000, itemLetterBig);

			itemLetterBig.x = itemBgBig.x - letterW;
			itemLetterBig.y = itemBgBig.y;


			// itemLetterBig.scale = 0.614;

			// itemLetterBig.y += itemBgBig.height / 6;

		})


		

		// const letterAnim0 = this.getLetterAnimBig0(letterS.toUpperCase());
		// letterAnim0.x = 100;
		// this.letterAnimBig = letterAnim0;
		// itemBgBig.addChild(letterAnim0);

		// const baseX = letterAnim0.x + 150;
		// const baseY = letterAnim0.y + 32;
		// const disW = 132;
		// for (let i=0; i<7; i++) {
		// 	const letterAnim1 = this.getLetterAnimBig1(letterS);
		// 	letterAnim1.x = baseX + i * disW;
		// 	letterAnim1.y = baseY;
		// 	itemBgBig.addChild(letterAnim1);

		// 	if (i < 2) {
		// 		letterAnim1.opacity = 255 * 0.5;
		// 	} else {
		// 		letterAnim1.active = false;
		// 	}
		// }
	},

	setLetterDot(animNode, key) {
		const url = this.data[key + '_url'];
		if (url) {
			getSprNodeByUrl(url, (spr) => {
				spr.node.parent = animNode.parent;
				spr.node.x = animNode.x;
				spr.node.y = animNode.y;
				spr.node.scale = animNode.scale;

				// console.log('	spr.node.width: ', spr.node.width)
				// console.log('	spr.node.height: ', spr.node.height)
			})
		}
	},


	addColorLetterListener(letter) {

		console.log(' in addColorLetterListener 1', letter.name || '')


		const nodeW = 258;
		const nodeH = 138;
		letter.width = nodeW;
		letter.height = nodeH;
		
		letter.on('touchstart', ()=> {

			console.log( ' in addColorLetterListener 2')

			if (!this.canTouch) {
				return;
			}

			console.log(' canTouch = fasle  1');

			this.canTouch = false;

			console.log(' ~~~ showLetterAnim 7')

			this.showLetterAnim(1, 	letter, () => {

				this.canTouch = true;

				this.checkShowDataPool();
			});

		})
	},

	getAnimData(key) {
		const animArr = this.data.animArr;
		for (let i=0; i<animArr.length; i++) {
			if (animArr[i].key == key) {
				return animArr[i];
			}
		}
	},

	setOneLineAllAnimBig(animColor, animBlack, animBg) {

		this.lineLetterBigArr = [];
		const baseX = animColor.x + 150;
		// const baseY = animColor.y + 32;
		const disW = 132;
		for (let i=0; i<7; i++) {
			const anim = cc.instantiate(animBlack);
			anim.animationNames = animBlack.animationNames;
			anim.x = baseX + i * disW;

			// anim.scale = animBg.height / anim.height;
			
			if (anim.height) {
				// anim.scale = 0.614;
				// if(animBg != this.itemBgSmall) {
				// 	anim.y += animBg.height / 6;
				// }
			} else {
				
				// anim.scale = 0.614;
				// if(animBg != this.itemBgSmall) {
				// 	anim.y += animBg.height / 6;
				// }
			}

			// console.log('	anim.scale ~ ', 	anim.scale);

			animBg.addChild(anim, 1);

			console.log(' ~~~ showLetterAnim 8')

			this.showLetterAnim(1000, anim);
			// const dragonDisplay = anim.getComponent(dragonBones.ArmatureDisplay);
			// dragonDisplay.timeScale = 1000;
			// dragonDisplay.playAnimation(anim.animationNames[0], 1);

			if (i < 2) {
				anim.opacity = 255 * 0.3;
				if (i == 0) {
					this.setLetterDot(anim, 'dot_big_1');
				}

			} else {
				anim.active = false;
				this.setLetterDot(anim, 'dot_big_2');
			}

			this.lineLetterBigArr.push(anim);
		}
	},


	setOneLineAllAnimSmall(animColor, animBlack, animBg) {

		this.lineLetterSmallArr = [];
		const baseX = animColor.x + 150;
		const disW = 132;
		for (let i=0; i<7; i++) {
			const anim = cc.instantiate(animBlack);
			anim.animationNames = animBlack.animationNames;
			anim.x = baseX + i * disW;
				
			// anim.scale = 0.614;

			// console.log('	anim.scale ~ ', 	anim.scale);

			animBg.addChild(anim, 1);

			console.log(' ~~~ showLetterAnim 9')

			this.showLetterAnim(1000, anim);
			// const dragonDisplay = anim.getComponent(dragonBones.ArmatureDisplay);
			// dragonDisplay.timeScale = 1000;
			// dragonDisplay.playAnimation(anim.animationNames[0], 1);

			if (i < 2) {
				anim.opacity = 255 * 0.3;

				if (i == 0) {
					this.setLetterDot(anim, 'dot_small_1');
				}

			} else {
				anim.active = false;

				this.setLetterDot(anim, 'dot_small_2');
			}


			this.lineLetterSmallArr.push(anim);
		}
	},

	addLetterItemSmall() {


		const itemBgSmall = getSprNode('item_bg');
		itemBgSmall.scale = this._mapScaleMin;
		itemBgSmall.anchorX = 0;
		this.canvas.addChild(itemBgSmall);
		this.itemBgSmall = itemBgSmall;

			
		const letterW = 50 * this._mapScaleMin;
		itemBgSmall.x = -itemBgSmall.width / 2 * itemBgSmall.scaleX + letterW;
		itemBgSmall.y =  -30 * this._mapScaleMin;
	

		let animColor;
		let animBlack;
		const checkShowOneLineAnim = () => {
			if (animColor && animBlack) {
				this.setOneLineAllAnimSmall(animColor, animBlack, itemBgSmall)
				console.log(' ~~~ showLetterAnim 10')

				this.showLetterAnim(1000, this.letterAnimSmall);
				this.addColorLetterListener( this.letterAnimSmall );
			}
		}

		const smallColorData = this.getAnimData('letter_small_0');
		const smallBlackData = this.getAnimData('letter_small_1');

		this.getOneAnim(smallColorData, (animNode) => {

			animColor = animNode;
			animColor.x = 100;
			this.letterAnimSmall = animColor;
			itemBgSmall.addChild(animColor);
			checkShowOneLineAnim();			

		})

		this.getOneAnim(smallBlackData, (animNode) => {
			animBlack = animNode;
			checkShowOneLineAnim();

			const itemLetterSmall = cc.instantiate(animNode);
			this.canvas.addChild(itemLetterSmall);
			itemLetterSmall.animationNames = animNode.animationNames;

			console.log(' ~~~ showLetterAnim 11')

			this.showLetterAnim(1000, itemLetterSmall);

			itemLetterSmall.x = itemBgSmall.x - letterW;
			itemLetterSmall.y = itemBgSmall.y;

			// itemLetterSmall.scale = 0.614;

			// itemLetterSmall.y += itemBgSmall.height / 6;
		})


		// const letterS = this.data.letter.toLowerCase();

		// const itemLetterSmall = getSprNode('letter/' + letterS + '_0_1');
		// // itemLetterSmall.x = -this.canvas.width / 2 + 70 * this._mapScaleMin;
		// // itemLetterSmall.y = -30 * this._mapScaleMin;
		// itemLetterSmall.scale = this._mapScaleMin;
		// this.canvas.addChild(itemLetterSmall);

		// const itemBgSmall = getSprNode('item_bg');
		// itemBgSmall.scale = this._mapScaleMin;
		// // itemBgSmall.x = itemLetterSmall.x + 70 * this._mapScaleMin;
		// // itemBgSmall.y = itemLetterSmall.y;
		// itemBgSmall.anchorX = 0;
		// this.canvas.addChild(itemBgSmall);
		// this.itemBgSmall = itemBgSmall;


		// const letterW = 50 * this._mapScaleMin;
		// itemBgSmall.x = -itemBgSmall.width / 2 * itemBgSmall.scaleX + letterW;
		// itemBgSmall.y =  -30 * this._mapScaleMin;
		// itemLetterSmall.x = itemBgSmall.x - letterW;
		// itemLetterSmall.y = itemBgSmall.y;


		// const letterAnim0 = this.getLetterAnimSmall0(letterS.toLowerCase());
		// letterAnim0.x = 100;
		// letterAnim0.y = 7;
		// letterAnim0.opacity = 160;
		// this.letterAnimSmall = letterAnim0;

		// itemBgSmall.addChild(letterAnim0);

		// const baseX = letterAnim0.x + 150;
		// const baseY = 4;
		// const disW = 132;
		// for (let i=0; i<7; i++) {
		// 	const letterAnim1 = this.getLetterAnimSmall1(letterS);
		// 	letterAnim1.x = baseX + i * disW;
		// 	letterAnim1.y = baseY;

		// 	if (i < 2) {
		// 		letterAnim1.opacity = 255 * 0.5;
		// 	} else {
		// 		letterAnim1.active = false;
		// 	}

		// 	itemBgSmall.addChild(letterAnim1);
		// }
	},

	getLetterAnimBig0(resName) {

		const anim = cc.find("Canvas/res/anim/" + resName + "_0")
		const letter = cc.instantiate(anim);
		// letter.scale *= 0.588;
		letter.name = resName;

		letter.on('touchstart', ()=> {

			if (!this.canTouch) {
				return;
			}

			console.log(' canTouch = fasle  2');

			this.canTouch = false;
			// const letterAnim = letter.getComponent(cc.Animation);
			// letterAnim.play('anim_A_0');

			// const cb = () => {
			// 	// this.canTouch = true;
			// 	this.checkShowDataPool();
			// 	letterAnim.off('finished', cb)
			// }
			// letterAnim.on('finished', cb);


			console.log(' ~~~ showLetterAnim 12')

			this.showLetterAnim(1, letter, () => {
				this.canTouch = true
				this.checkShowDataPool();
			});

		})


		return letter;

	},

	getLetterAnimBig1(letter) {
		const sprNode = getSprNode('letter/' + letter + '_1_1');
		return sprNode;
	},

	getLetterAnimSmall0(resName) {

		const anim = cc.find("Canvas/res/anim/" + resName + "_0")
		const letter = cc.instantiate(anim);
		// letter.scale *= 0.588;
		letter.name = resName;


		letter.on('touchstart', ()=> {

			if (!this.canTouch) {
				return;
			}

			console.log(' canTouch = fasle  3');

			this.canTouch = false;
			// const letterAnim = letter.getComponent(cc.Animation);
			// letterAnim.play('anim_a_0');

			// const cb = () => {
			// 	// this.canTouch = true;
			// 	this.checkShowDataPool();
			// 	letterAnim.off('finished', cb)
			// }
			// letterAnim.on('finished', cb);

			console.log(' ~~~ showLetterAnim 13')

			this.showLetterAnim(1, letter, () => {

				this.canTouch = true;

				this.checkShowDataPool();
			});
		})


		return letter;

		// const sprNode = getSprNode('letter/' + letter + '_0_0');
		// return sprNode;
	},

	getLetterAnimSmall1(letter) {
		const sprNode = getSprNode('letter/' + letter + '_0_1');
		return sprNode;
	},


	debugLayer: null,
	initDebugLayer() {


		console.log(' in initDebugLayer');
		const layer = new cc.Node();

		if (this.data.isDebug) {
			layer.parent = cc.find('Canvas');
		}


		layer.width = this.canvas.width / 2;
		layer.height = this.canvas.height / 2;

		layer.zIndex = 100;
		layer.anchorX = 0;
		layer.anchorY = 1;


		if (!this.data.bgItem2) {
			return;
		}


		cc.loader.load({url: this.data.bgItem2.url}, (err, img) => {

			this.debugBgImg = img;

			this.changeNumToInt(img, ['x', 'y', 'width', 'height'], 0.01);

			this.checkBg = img;
			layer.width = img.width;
			layer.height = img.height;

			const sprNode = layer;
	
			var sf = new cc.SpriteFrame(img);

			const spr = sprNode.addComponent(cc.Sprite);
			spr.spriteFrame = sf			

			const sx = this.canvas.width / 2 / layer.width;
			const sy = (this.canvas.height) / 2 / layer.height;
			const s = Math.min(sx, sy);
			layer.scale = s;

			layer.data = this.data.bgItem2;

			this.addNewRect();

			this.startTesting();
	
		});

		layer.x = -this.canvas.width / 2 + 10;
		layer.y = this.canvas.height / 2 - this.canvas.height / 3;
		layer.opacity = 150;

		this.debugLayer = layer;

		const drawLayer = new cc.Node();
    this.debugLayer.addChild(drawLayer, 2);

    this.debugDrawLayer = drawLayer;

	},


	addNewRect() {
		
		if (!this.newRectArr) {
			return;
		}

		this.newRectCheckArr = [];
		const bg = this.debugLayer;
		for (let i=0; i<this.newRectArr.length; i++) {
			const oneData = this.newRectArr[i];
			this.setNewRectDot(oneData, bg);
			console.log('oneData: ', oneData);
		}

	},


	setNewRectDot(data, bg) {
		const bgData = bg.data;
		const rate = (bg.scale * bg.width) / bgData.rect.width;

		const rectNode = new cc.Node();
		rectNode.name = 'rect' + data.index;
		bg.addChild(rectNode);


		const ctx = rectNode.addComponent(cc.Graphics);
		// 红色矩形
		ctx.lineWidth = 4;
		ctx.strokeColor = cc.Color.BLACK;
		ctx.fillColor = cc.Color.WHITE.setA(100);

		const scale = rate / bg.scaleY;

		console.log('scale: ', scale);

		rectNode.width = data.rect.width * scale;
		rectNode.height = data.rect.height * scale;
		rectNode.x = data.rect.x * scale;
		rectNode.y =  - data.rect.y * scale - data.rect.height * scale;


		rectNode.anchorX = rectNode.anchorY = 0;


		rectNode.x /= bg.width;
		rectNode.y /= bg.height;
		rectNode.width /= bg.width;
		rectNode.height /= bg.height;
		const colorRect = this.getColorRect(rectNode, 'green');
		colorRect.opacity = 180;
		colorRect.data = data;

		colorRect.parent = bg;
		colorRect.zIndex = 20;
		// bg.addChild(colorRect, 20);

		this.newRectCheckArr.push(colorRect);                                                                                                                                                                                        

	},
	 




	gameStart() {

		this.beginShowAudio();
	},

	beginShowAudio() {


		console.log(' canTouch = fasle 4');

		this.canTouch = false;

		const playEnd = () => {

			this.isPlayTip = false;
			this.playAni('normal', 0);
			// this.startTesting();

			console.log(' ~~~ showLetterAnim 14')

			this.showLetterAnim(1, this.letterAnimBig, () => {
				this.showBigLetter1Audio();
			});
		}


		if (!this.data.write_big_0_audio_url) {
			playEnd();
			return;
		}

		this.isPlayTip = true;
		this.playAni('begin', 0)
		//播放引导音频1
		playAudioByUrl(this.data.write_big_0_audio_url, () => {
			if (this.isDestroy) {
				return;
			}
			playEnd();
		})
	},

	showLetterAnim(timeScale = 1, animNode, cb=null) {
		console.log(' in showLetterAnim')

		const dragonDisplay = animNode.getComponent(dragonBones.ArmatureDisplay);
		dragonDisplay.timeScale = timeScale;
		dragonDisplay.playAnimation(animNode.animationNames[0], 1);

		dragonDisplay.once(	dragonBones.EventObject.LOOP_COMPLETE , () => {
			cb && cb();
		})

	

		// const anim = this.letterAnimBig.getComponent(cc.Animation);

		// anim.play('anim_A_0');
		// const cb = () => {
		// 	console.log('in finished');
		// 	this.showBigLetter1Audio();
		// 	anim.off('finished', cb)
		// }

		// anim.on('finished', cb);



	},

	showBigLetter1Audio() {

		const playEnd = () => {

			this.playAni('normal', 0);

			console.log( 'this.canTouch = true  1 ');
			this.canTouch = true;
			this.firstAudioEnd = true;
			this.startTesting();

			// this.showLetterAnim();
		}


		if (!this.data.write_big_1_audio_url) {
			playEnd();
			return;
		}

		this.playAni('begin', 0)
		//播放引导音频1
		playAudioByUrl(this.data.write_big_1_audio_url, () => {
			if (this.isDestroy) {
				return;
			}
			playEnd();
		})
	},






	showSecondLetter() {
		this.showLetter(1, () => {

			playAudio(this.audioTip3.clip, () => {

				if (this.isDestroy) {
					return;
				}
				// })
				//播放引导音频3
				// this.playAudioByUrl(this.data.guideAudioUrl3, () => {

				// state.stop();

				// this.playAni('normal', 0);

				// this.showPhotoBtn();

				this.showAllSound();
				this.showPhotoBtn();

				this.playAni('normal', 0);

			});

		})
	},

	showLetter(index, cb, isSmall) {


		let writeRect;

		if (isSmall) {
			writeRect = this.writeNodeArr2[Number(index)];

			console.log('show Letter small 1 :' , index)
		} else {
			writeRect = this.writeNodeArr1[Number(index)];
		}

		writeRect.hitCount++;
		if (writeRect.hitCount < 1) {
			return;
		}

		if (writeRect.isShowEnd) {
			return;
		}
		writeRect.isShowEnd = true;


		playAudio(this.audioRight.clip);

		if (!isSmall) {
			const animNode = this.lineLetterBigArr[index];
			animNode.active = true;
			animNode.opacity = 255;

			console.log(' ~~~ showLetterAnim 1')

			this.showLetterAnim(1, animNode, () => {
				if (!this.isGameEnd) {
					this.checkGameEnd();
				}
			});

		} else {

			const animNode = this.lineLetterSmallArr[index];
			animNode.active = true;
			animNode.opacity = 255;
			console.log(' ~~~ showLetterAnim 2')

			this.showLetterAnim(1, animNode, () => {
				if (!this.isGameEnd) {
					this.checkGameEnd();
				}
			});

		}
		return;



		console.log('show Letter small 2 :' , index)

		const letterAnim = this.getLetterAnim(isSmall);

		letterAnim.parent = writeRect;
		letterAnim.y = 4;

		// letterAnim.x = writeRect.width / 2;
		// letterAnim.y = writeRect.height / 2;

		this.showItemAniNew(letterAnim, () => {

			if (!this.isGameEnd) {
				this.checkGameEnd();

			}
		})

		playAudio(this.audioRight.clip);

	},

	checkGameEnd() {

		this.pauseHelper();

		const writeNodeArr = this.writeNodeArr1.concat(this.writeNodeArr2);
		const isEnd = writeNodeArr.every(node => {
			return node.isShowEnd;
		})
		
		if (isEnd) {
			this.gameEnd();
		} else {

			this.resetHelperTime();
		}
	},

	isGameEnd: null,
	gameEnd() {

		this.isGameEnd = true;
		console.log('in gameEnd');

		console.log(' play finish_audio_url:' , this.data.finish_audio_url)
		playAudioByUrl(this.data.finish_audio_url, () => {
			// 结束位置
			if (this.isDestroy) {
				return;
			}
			onHomeworkFinish();
			console.log(' onHomeworkFinish ~ ')
	
		});

		this.endTesting();
	},

	getLetterAnim(isSmall) {

		let resName;
		if (isSmall) {
			resName = this.data.letter.toLowerCase();
		} else {
			resName = this.data.letter.toUpperCase();
		}
		const anim = cc.find("Canvas/res/anim/" + resName)
		const letter = cc.instantiate(anim);
		letter.scale *= 0.588;
		letter.name = resName;

		if (!isSmall) {
			letter.anchorY = 0.28
		}

		return letter;
	},

	showItemAniNew(item, cb) {
		if (item.isShow) {
			return;
		}
		item.isShow = true;
		item.active = true;

		// const anim = item.getComponent(cc.Animation);
		// console.log(' showItemAniNew  item: ', item);

		// anim.play(item.name);

		// anim.on('finished', () => {
		// 	console.log('in finished');
		// 	if (cb) {
		// 		cb();
		// 	}
		// });

		console.log(' ~~~ showLetterAnim 3')

		this.showLetterAnim(1, item, () => {
			cb && cb();
		});


	},

	showItemAni(item, cb) {
		if (item.isShow) {
			return;
		}
		item.isShow = true;

		item.opacity = 0;
		item.active = true;
		cc.tween(item)
			.to(1, { opacity: 255 })
			.call(() => {
				if (cb) {
					cb();
				}
			})
			.start();
	},

	showAllSound() {
		const letterItemArr = this.letterItemArr;
		for (let i = 0; i < letterItemArr.length; i++) {
			const item = letterItemArr[i];
			this.showItemAni(item.btnSound);
		}
	},




	playAni(name, times = 1) {

		const cat = cc.find('Canvas/content/catFrame/cat');

		var dragonDisplay = cat.getComponent(dragonBones.ArmatureDisplay);

		const state = dragonDisplay.playAnimation(name, times);
		return state;
	},

	playTipAni(name, times = 1, cb = null) {

		const tip = cc.find('Canvas/tipFrame/tip');
		tip.parent.zIndex = 10;
		tip.active = true;

		var dragonDisplay = tip.getComponent(dragonBones.ArmatureDisplay);

		const state = dragonDisplay.playAnimation(name, times);

		dragonDisplay.on(dragonBones.EventObject.COMPLETE, () => {
			tip.active = false;
			if (cb) {
				cb();
			}
		})

		return state;
	},

	moveHand(index, callback = null) {

		let textNode = cc.find("Canvas/content/bg_green/bg_word-background/text");

		let wordNodeArr = textNode.wordNodeArr

		let wordNode = wordNodeArr[2 * index];

		if (!wordNode) {

			if (callback) {
				callback();
			}
			return;
		}

		let handNode = cc.find("Canvas/content/bg_green/bg_word-background/text/icon_hand");
		handNode.x = wordNode.x;

		this.handAni();

		if (callback) {
			callback();
		}
	},

	/**
	 * 播放文本音频
	 * @param {*} callback 
	 */
	playTextAutio(callback = null) {

		this.playAudioByUrl(this.data.exercises.audioUrl, () => {

			if (this.isDestroy) {
				return;
			}
			//停止监听动画
			this._stopAni = true;

			if (callback) {
				callback();
			}
		}, (audioId) => {

			//显示完成，不再播放动画
			if (this._shown) {
				return;
			}

			//设置可播放动画
			this._stopAni = false;

			//隐藏手指
			let handNode = cc.find("Canvas/content/bg_green/bg_word-background/text/icon_hand");
			handNode.opacity = 0;

			let lyrics = this.data.exercises.lrcData.lyrics;

			//临时音频打点数组
			let arr = JSON.parse(JSON.stringify(lyrics));
			console.log(arr);

			this.monitor(audioId, arr);
		})
	},

	/**
	 * 重新设置文字位置
	 */
	resetTextPosition() {

		let textNode = cc.find("Canvas/content/bg_green/bg_word-background/text");

		let wordNodeArr = textNode.wordNodeArr;

		//间隔
		let space = 40;

		let tW = 0;

		for (let i = 0; i < wordNodeArr.length; ++i) {

			let wordNode = wordNodeArr[i];
			wordNode.removeFromParent();
			wordNode.parent = textNode;
			tW += wordNode.width;

			let widget = wordNode.getComponent(cc.Widget);
			widget.bottom = - wordNode.getComponent(cc.Label).fontSize / 2;
			widget.updateAlignment();

			wordNode.initScale = wordNode.scale;
		}

		tW += (this.data.exercises.wordArr.length - 1) * space;

		let startX = -  tW / 2;

		for (let i = 0; i < wordNodeArr.length; ++i) {
			let width = wordNodeArr[i].width;
			wordNodeArr[i].x = startX + width / 2;
			startX += width;

			if (wordNodeArr[i].isInitial) {
				continue;
			}
			startX += space;
		}

		if (tW > textNode.width) {
			const sx = textNode.width / tW;

			textNode.scale = Math.round(sx * 1000) / 1000;

			textNode.initScale = textNode.scale;
		}
	},


	/**
	 * 显示结束
	 */
	_shown: null,
	showEnd() {

		console.log(' in showEnd');

		if (this._curIndex < this.data.exercises.wordArr.length) {
			return;
		}

		if (this._shown) {
			return;
		}

		this._shown = true;

		let handNode = cc.find("Canvas/content/bg_green/bg_word-background/text/icon_hand");
		handNode.opacity = 0;
		this._stop = true;

		//播放动画
		const state = this.playAni('finish', 0);

		//播放引导音频2
		this.playAudioByUrl(this.data.guideAudioUrl2, () => {

			if (this.isDestroy) {
				return;
			}

			state.stop();

			this.playAni('normal', 0);

			this.showPhotoBtn();
		});


	},

	_stop: null,
	_tween: null,
	handAni() {

		let handNode = cc.find("Canvas/content/bg_green/bg_word-background/text/icon_hand");

		handNode.opacity = 255;
		handNode.y = handNode.initY;
		const move = () => {
			this._tween = cc.tween(handNode)
				.to(0.5, { y: handNode.initY + 50 })
				.to(0.5, { y: handNode.initY })
				.call(() => {

					if (!this._stop) {
						move()
					}
				})
				.start();
		}

		this._stop = false;

		move();
	},

	_stopAni: null,
	monitor(audioId, arr) {

		if (this._stopAni) {
			return;
		}

		this._stopAni = false;

		let currentTime = cc.audioEngine.getCurrentTime(audioId);

		let len = arr.length;

		for (let i = len - 1; i >= 0; --i) {

			let time = arr[i].time;

			time = Math.round(time * 1000) / 1000;

			currentTime = Math.round(currentTime * 1000) / 1000;

			if (time < currentTime) {

				//如果是最后一个匹配，则播放内容动画
				if (len == 1) {
					this.contentAni();
				}
				else {
					this.textAni();
				}

				//移除匹配上的元素
				arr.splice(i, 1);

				break;
			}

		}

		requestAnimationFrame(() => {

			this.monitor(audioId, arr);
		})
	},

	/**
	 * 文本动画
	 */
	_playText: null,
	textAni() {

		if (this._playText) {
			return;
		}

		this._playText = true;

		console.log(' canTouch = fasle  5');

		this.canTouch = false;

		const twinkle = (node) => {
			cc.tween(node)
				.to(0.3, { scale: node.initScale * 1.5 })
				.to(0.3, { scale: node.initScale })
				.call(() => {
					this._playText = false;
				})
				.start();
		};

		let textNode = cc.find("Canvas/content/bg_green/bg_word-background/text");

		let wordNodeArr = textNode.wordNodeArr;

		for (let i = 0; i < wordNodeArr.length; ++i) {
			let wordNode = wordNodeArr[i];

			//如果是首字母，则执行动画
			if (wordNode.isInitial) {
				twinkle(wordNode);
			}
		}

	},


	/**
	 * 内容动画
	 */
	contentAni() {

		let handNode = cc.find("Canvas/content/bg_green/bg_word-background/text/icon_hand");
		handNode.opacity = 0;

		const twinkle = (node) => {
			cc.tween(node)
				.to(0.5, { scale: node.initScale * 1.1 })
				.to(0.5, { scale: node.initScale })
				.to(0.5, { scale: node.initScale * 1.1 })
				.to(0.5, { scale: node.initScale })
				.call(() => {
					this.canTouch = true;
				})
				.start();
		};

		let textNode = cc.find("Canvas/content/bg_green/bg_word-background/text");

		twinkle(textNode);
	},



	photoBtn: null,
	initPhotoBtn() {

		const canvas = cc.find('Canvas');

		const photoBtn = this.getSprNode('btn_photo');
		photoBtn.active = false;
		canvas.addChild(photoBtn);
		photoBtn.scale = this._mapScaleMin;
		// photoBtn.x = 100;
		photoBtn.y = -canvas.height / 2 + photoBtn.height / 2 * photoBtn.scaleY;
		photoBtn.addComponent(cc.Button);
		photoBtn.on('click', () => {
			this.showPhotoTip();
		})

		this.photoBtn = photoBtn;
	},

	showPhotoBtn() {
		if (!this.photoBtn) {
			this.initPhotoBtn();
		}
		this.photoBtn.active = true;
	},

	hidePhotoBtn() {
		if (!this.photoBtn) {
			return;
		}
		this.photoBtn.active = false;
	},

	showPhotoTip() {

		this.maskNode.active = true;
		playAudio(this.audioOsmoTip.clip);
		this.playAni('begin', 0)
		this.playTipAni('normal', 1, () => {
			console.log('play ani end');

			this.playAni('normal', 0)


			this.photoBtnClick();

		})


	},

	isOpenPhotoCheck: null,
	openPhotoData() {
		this.isOpenPhotoCheck = true;
	},

	closePhotoData() {
		this.isOpenPhotoCheck = true;
	},


	photoBtnClick() {
		console.log(' in photoBtnClick')

		if (!window || !window.courseware) {
			console.log('window.courseware not found')
			return;
		}


		// window.courseware.openRecognitionCamera = this.getPhotoData.bind(this);

		const openRecognitionCamera = window.courseware.openRecognitionCamera;
		if (!openRecognitionCamera) {
			console.log('openRecognitionCamera not found')
			return;
		}
		openRecognitionCamera((data) => {
			console.log('openRecognitionCamera data: ', data)

			this._timeoutIds.push(setTimeout(() => {

				if (typeof data == 'string') {
					data = JSON.parse(data);
				}

				const { result } = data;
				this.photoEnd(result);

				this.maskNode.active = false;
			}, 100));



		})

	},

	filterData(data) {

		const textArr = data?.result?.text
		if (!textArr) {
			return;
		}

		for (let j=0; j<textArr.length; j++) {

			let {characters, content} = textArr[j];
			if (!characters) {
				return;
			}

			textArr[j].content = content.replace(/0/g, 'o')


			for (let i=0; i<characters.length; i++) {

				const {character} = characters[i];

				if (character == 0) {
					characters[i].character = 'o'
				}
			}
			
		}

		
	},



	photoEndNewRect(data) {

		let textArr = data?.result?.text;
		if (!textArr) {
			return;
		}

		const answerData = {};




		const checkOneByData = (oneData) => {

			const oneTextData = oneData
			const x = oneTextData.location.left//oneTextData.location.left + (oneTextData.location.right - oneTextData.location.left) / 2;
			const y = -oneTextData.location.bottom//-oneTextData.location.top - (oneTextData.location.bottom - oneTextData.location.top) / 2;
			const w = oneTextData.location.right - oneTextData.location.left;
			const h = oneTextData.location.bottom - oneTextData.location.top;

			const rect = {
				x, y,
				width: w,
				height: h
			}

			console.log('oneTextData: ', oneTextData);

			const content = oneTextData.content;

			console.log('x: ', x);
			console.log('y: ', y);
			console.log('w: ', w);
			console.log('h: ', h);
			console.log('~!rect: ', rect);

			const colorRect = this.getColorRect(rect, "red");
			colorRect.labelText = content;
			// this.debugDrawLayer.addChild(colorRect, 1);

			console.log('~~colorRect.ccRect:', colorRect.ccRect);

			const label = this.getLabel(content, colorRect.scaleX *  colorRect.width);
			label.x = colorRect.x + colorRect.width / 2 * colorRect.scaleX;
			label.y = colorRect.y + colorRect.height / 2 * colorRect.scaleY;
			label.color = cc.Color.BLACK;

			this.debugDrawLayer.addChild(label, 2);

			this.setOneAnswerDataNew(colorRect, answerData);


		}

		for (let i=0; i<textArr.length; i++) {

			const oneTextData = textArr[i];
			if ( oneTextData.characters) {
				console.log('~~ oneTextData: ', oneTextData);
				const tempArr = this.getArrByCharacters(oneTextData);
				console.log('tempArr~: ', tempArr);
				for (let j=0; j<tempArr.length; j++) {
					checkOneByData(tempArr[j]);
				}
			} else {
				checkOneByData(oneTextData);
			}

		}

		console.log('answerData:' , answerData);
		this.showUserRight(answerData, data);

		// this.showUserRightNew(answerData);
	},

	setOneAnswerDataNew(colorRect, answerData) {
		const rect = colorRect.ccRect;

		console.log('~rect: ', rect);

		const dotV2 = new cc.Vec2(rect.x + rect.width/2, rect.y + rect.height / 2);


		const targetLabelText = colorRect.labelText;

		console.log('--targetLabelText--', targetLabelText);


		const newRectCheckArr = this.newRectCheckArr;
		

		for (let i=0; i<newRectCheckArr.length; i++) {

			let labelText = newRectCheckArr[i].data.labelText;
			const checkRect = newRectCheckArr[i].ccRect;
			const key = newRectCheckArr[i].data.index + 1;

			console.log('--labelText--', labelText);
			labelText = labelText.split("_")[0];

			console.log('checkRect: ', checkRect);
			console.log('dotV2: ', dotV2);

			if (checkRect.contains(dotV2)) {

				console.log('--1--');

				const index = labelText.indexOf("||");
				if (index != -1) {

					console.log('--2--');

					const keyArr = labelText.split("||");

					for (let j=0; j<keyArr.length; j++) {

						console.log('--3--');

						if (targetLabelText.indexOf(keyArr[j]) != -1 ) {
							console.log('--4--');
							const tempTextArr = newRectCheckArr[i].data.labelText.split("_");
							const key2 = tempTextArr[1] + '_' + tempTextArr[2];
							answerData[key2] = {isFinish: true};
							// answerData[key] = {isFinish: true};
							break;
						}

					}
				} else {

					console.log('--5--');

					if (targetLabelText.indexOf(labelText) != -1 ) {
						console.log('--6--');

						const tempTextArr = newRectCheckArr[i].data.labelText.split("_");
						const key2 = tempTextArr[1] + '_' + tempTextArr[2];
						answerData[key2] = {isFinish: true};
						// answerData[key] = {isFinish: true};
					}
				}

			}

		}
	},



	photoEnd(data, isPool=false) {

		
		
		console.log(' this.photo end ', data);
		// this.filterData(data);

		this.pushNodePoolArr();


		if (this.debugLayer.parent && this.debugLayer.active) {

			if (this.isCanDraw) {
				return;
			}
			this.isCanDraw = true;

			delayCall(0.1, () => {
				this.isCanDraw = false;
			})
		}


		

		if (!this.canTouch && isPool == false) {
			this.dataPool.push(data);
			console.log('! cantouch')
			return;
		}
		


		this.photoEndNewRect(data);
		return;

		// this.changeBboxPos(data);

		const isRightArea = this.checkIsRightArea(data);
		if (!isRightArea) {
			console.log('没有检测到区域')
			return;
		}

		// return;


	

	



		// if (this.debugLayer.parent && this.debugLayer.active) {
		// 	this.debugDrawLayer.removeAllChildren();
		// } else {
		// 	this.pushNodePoolArr();
		// }




		const answerData = this.getAnswerData(data);




		console.log('answerData: ', answerData);
		this.showUserRight(answerData, data);

		return;

		const answerWrongData = this.getAnswerWrongData(data);
		let isShowWrong = false;
		if (this.oldAnswerWrongData) {
		
			for (let key in answerWrongData) {
				const wrongData = answerWrongData[key];
				const oldWrongData = this.oldAnswerWrongData[key];
				if (oldWrongData && oldWrongData.sentence == wrongData.sentence) {
					wrongData.count += oldWrongData.count;

					if (wrongData.count >= 3) {
						isShowWrong = true;
					}
				}
			}
		}

		if (isShowWrong) {
			this.showUserWrong(answerWrongData);
		}

		this.oldAnswerWrongData = answerWrongData;

		console.log('answerWrongData: ', JSON.stringify( answerWrongData) );
	},

	pushNodePoolArr() {
		const arr = this.debugDrawLayer.children;
		for (let i=0; i<arr.length; i++) {
			const node = arr[i];
			if (node.isPoolNode) {
				this.nodePoolArr.push(node);
				node.active = false;

			} else {
				node.removeFromParent();
			}
		}
	},

	photoEndOld(data, isPool = false) {

		console.log(' this.photo end');

		if (!this.canTouch && isPool == false) {
			this.dataPool.push(data);
			console.log('! cantouch')
			return;
		}


		this.changeWriteDataToBboxData(data.result)

		console.log("data.result: ", data.result);

		// const result = data.result;
		// for (let i=0; i<result.length; i++) {
		// 	result[i].top *= 400;
		// 	result[i].bottom *= 400;
		// 	result[i].left *= 400;
		// 	result[i].right *= 400;
		// }

			
		// this.topTitleData = null;
		// this.bottomTitleData = null;


		// const isRightArea1 = this.checkIsRightArea(data, false);
		// const isRightArea2 = this.checkIsRightArea(data, true);
		// if (!isRightArea1 && !isRightArea2) {
		// 	// playAudio(this.audioTipArea.clip)
		// 	console.log('没有检测到此题的区域')
		// 	return;
		// }


		// this.debugLayer.removeAllChildren();


		delayCall(1, () => {
			this.sample.removeAllChildren();
		})


		for (let i=0; i<this.dotArr1.length; i++) {
			this.dotArr1[i].parent = this.sample;
		}
		for (let i=0; i<this.dotArr2.length; i++) {
			this.dotArr2[i].parent = this.sample;
		}
		
		// this.colorRectTop = null;


		const answerData1 = this.getAnswerDataNew(data, false);
		const answerData2 = this.getAnswerDataNew(data, true);



		this.showUserRight(answerData1, false);
		this.showUserRight(answerData2, true);


		const oldStep = this.step;
		this.checkShowStepAudio();
		if (oldStep != this.step) {

			console.log(' canTouch = fasle  6');

			this.canTouch = false;
			this.showStepAudio();
		} else {
			// this.canTouch = true;
			this.checkShowDataPool();
		}

		// const isFillAll = this.checkIsFillAll(answerData);
		// if (!isFillAll) {
		// 	// playAudio(this.audioTipNotFill.clip)
		// 	// playAudio(this.audioTipFillWrong.clip)

		// 	// console.log('这道题还有空没填哦')
		// 	return;
		// }

		// // const isFillWrong = this.checkIsFillWrong(answerData);
		// // if (!isFillWrong) {
		// // 	playAudio(this.audioTipFillWrong.clip)

		// // 	console.log('这道题有空填错了哦')
		// // 	return;
		// // }

		// this.showPhotoSuccess();

	},

	async showStepAudio() {
		console.log(' in showStepAudio: ', this.step);
		await asyncDelay(0.5);

		switch(this.step) {
			case 2:
				this.playAudioStep2();
				break;
			case 3:
				this.playAudioStep3();
				break;
			case 4:
				this.playAudioStep4();
				break;
			case 5:
				this.playAudioStep5();
				break;
		}
	},

	playAudioStep2() {
		playAudioByUrl(this.data.write_big_2_audio_url, () => {
			// this.canTouch = true;
			this.checkShowDataPool();
		});
	},

	playAudioStep3() {
		if (this.isDestroy) {
			return;
		}
		this.beginShowAudioSmall();
	},

	playAudioStep4() {
		playAudioByUrl(this.data.write_small_2_audio_url, () => {
			this.checkShowDataPool();
			// this.canTouch = true;
		});
	},

	playAudioStep5() {
		setTimeout(() => {
			if (this.isDestroy ) {
				return;
			}

			console.log(' play finish_audio_url:' , this.data.finish_audio_url)
			playAudioByUrl(this.data.finish_audio_url, () => {
							// 结束位置
			onHomeworkFinish();
			});
		}, 500);

	},

	checkShowDataPool() {

		if (this.dataPool.length == 0) {
			console.log('	this.canTouch = true  6')
			this.canTouch = true;
			return;
		}

		const data = this.dataPool.shift();
		this.photoEnd(data, true);

	},


	checkShowStepAudio() {


		switch(this.step) {
			case 1:
				this.checkStep1();
				break;
			case 2:
				this.checkStep2();
				break;
			case 3:
				this.checkStep3();
				break;			
			case 4:
				this.checkStep4();
				break;

			case 5:
				break;

			case 6:
				break;
		}
	},

	checkStep1() {
		let writeNodeArr = this.writeNodeArr1;

		let isShowEnd = true;
		for (let i = 0; i < 2; i++) {

			if (!writeNodeArr[i].isShowEnd) {
				isShowEnd = false;
				break;
			}
		}

		if (isShowEnd) {
			this.step ++;
			this.checkShowStepAudio();
		} 
	},

	checkStep2() {
		let writeNodeArr = this.writeNodeArr1;

		let isShowEnd = true;
		for (let i = 2; i < 7; i++) {

			if (!writeNodeArr[i].isShowEnd) {
				isShowEnd = false;
				break;
			}
		}

		if (isShowEnd) {
			this.step ++;
			this.checkShowStepAudio();
		} 
	},

	checkStep3() {
		let writeNodeArr = this.writeNodeArr2;

		let isShowEnd = true;
		for (let i = 0; i < 2; i++) {

			if (!writeNodeArr[i].isShowEnd) {
				isShowEnd = false;
				break;
			}
		}

		if (isShowEnd) {
			this.step ++;
			this.checkShowStepAudio();
		} 
	},

	checkStep4() {
		let writeNodeArr = this.writeNodeArr2;

		let isShowEnd = true;
		for (let i = 2; i < 7; i++) {

			if (!writeNodeArr[i].isShowEnd) {
				isShowEnd = false;
				break;
			}
		}

		if (isShowEnd) {
			this.step ++;
			this.checkShowStepAudio();
		} 
	},



	beginShowAudioSmall() {
		const playEnd = () => {
			this.playAni('normal', 0);
			this.showSmallLetterAnim();
			// this.checkShowDataPool();
			// this.canTouch = true;
		}

		console.log('')
		if (!this.data.write_small_0_audio_url) {
			playEnd();
			return;
		}

		this.playAni('begin', 0)
		playAudioByUrl(this.data.write_small_0_audio_url, () => {
			if (this.isDestroy) {
				return;
			}
			playEnd();
		})
	},

	showSmallLetterAnim() {
		console.log(' in showSmallLetterAnim')
		// const anim = this.letterAnimSmall.getComponent(cc.Animation);

		// anim.play('anim_a_0');
		// const cb = () => {
		// 	console.log('in finished');
		// 	this.showSmallLetter1Audio();
		// 	anim.off('finished', cb)
		// }

		// anim.on('finished', cb);

		console.log(' ~~~ showLetterAnim 4')

		this.showLetterAnim(1, this.letterAnimSmall, () => {
			this.showSmallLetter1Audio();
		});
	},

	showSmallLetter1Audio() {
		console.log(' in showSmallLetter1Audio')
		const playEnd = () => {

			console.log(' in playEnd ~')
			this.playAni('normal', 0);
			// this.canTouch = true;
			this.checkShowDataPool();
			// this.startTesting();

		}


		if (!this.data.write_small_1_audio_url) {
			playEnd();
			return;
		}

		this.playAni('begin', 0)
		//播放引导音频1
		playAudioByUrl(this.data.write_small_1_audio_url, () => {
			if (this.isDestroy) {
				return;
			}
			playEnd();
		})
	},


	showUserRightNew(answerData, isSmall) {

		console.log('answerData: ', answerData.toString());

		if (!answerData || Object.keys(answerData).length == 0) {
			return;
		}

		let writeNodeArr;
		if (isSmall) {
			writeNodeArr = this.writeNodeArr2
		} else {
			writeNodeArr = this.writeNodeArr1
		}

		for (let i = 0; i < 7; i++) {
			const key = i.toString();
			if (answerData[key]) {
				this.showLetter(i, null, isSmall);

			} else {
				let writeRect = writeNodeArr[i];
				writeRect.hitCount = 0;
			}
		}
	},

	showUserRight(answerData, data) {

		const text = data?.result?.text
		if (!text) {
			return false;
		}


		// console.log('answerData: ', answerData);
		// console.log('this.picNodeArr: ', this.picNodeArr);

		if (Object.keys(answerData).length == 0) {
			return;
		}

		// let writeNodeArr;
		// if (isSmall) {
		// 	writeNodeArr = this.writeNodeArr2
		// } else {
		// 	writeNodeArr = this.writeNodeArr1
		// }

		// for (let i = 0; i < 7; i++) {
		// 	const key = i.toString();
		// 	if (answerData[key]) {
		// 		this.showLetter(i, null, isSmall);

		// 	} else {
		// 		let writeRect = writeNodeArr[i];
		// 		writeRect.hitCount = 0;
		// 	}
		// }


		const bigNodeArr = this.writeNodeArr1;
		const smallNodeArr = this.writeNodeArr2;
		
		// console.log('bigNodeArr: ', bigNodeArr);
		// console.log('smallNodeArr: ', smallNodeArr);

		for (let i = 0; i < 7; i++) {
			const keyB = i + '_' + 'b';
			const keyS = i + '_' + 's';

			if (answerData[keyB]) {

				delayCall(Math.random() * 0.3, () => {
					this.showLetter(i, null, false);
				})
			} else {

				let writeRect = bigNodeArr[i];
				writeRect.hitCount = 0;
			}
			
			if (answerData[keyS]) {
				delayCall(Math.random() * 0.3, () => {
					this.showLetter(i, null, true);
				})
			}  else {

				let writeRect = smallNodeArr[i];
				writeRect.hitCount = 0;
			}
		
		}


	},



	

	checkIsFillAll(answerData) {

		const letterArr = this.data.letter_arr;
		for (let i = 0; i < letterArr.length; i++) {
			const key = i.toString();
			const letterData = letterArr[i];

			const item = this.letterItemArr[i];
			if (!item.isShow) {
				if (letterData.is_right && !answerData[key]) {
					console.log("没有看到第" + (i + 1) + "个空的答案哦")
					return false;
				}
			}



		}

		return true;

	},


	checkIsFillWrong(answerData) {

		const letterArr = this.data.letter_arr;
		for (let i = 0; i < letterArr.length; i++) {
			const key = i.toString();
			const letterData = letterArr[i];

			const item = this.letterItemArr[i];
			if (!item.isShow) {
				if (!letterData.is_right && answerData[key]) {
					console.log("第" + (i + 1) + "个空填错了哦")
					return false;
				}
			}


		}

		return true;

	},

	getTopLeftLetter(text, block, topLabelData, bottomLabelData) {

		// const titleTopLeft = topLabelData.location.top_left;
		// const titleRightBottom = topLabelData.location.right_bottom;
		// const checkX = titleTopLeft.x + (titleRightBottom.x - titleTopLeft.x) / 3;
		// const checkY = titleRightBottom.y;

		console.log('topLabelData:', topLabelData);
		console.log('bottomLabelData:', bottomLabelData);

		const topY = -topLabelData.word[0].location.top;
		const bottomY = -bottomLabelData.word[0].location.bottom;


		text = text.trim();

		let topLeftLetter;

		for (let j = 0; j < block.length; j++) {

			const line = block[j].line;
			if (!line) {
				continue;
			}


			for (let i = 0; i < line.length; i++) {

				// const {word, location} = line[i];
				const word = line[i].word;
				const location = line[i].word[0].location;

				const curTop = -location.top;
				if (curTop >= topY || curTop <= bottomY) {
					continue;
				}

				console.log(' center line: ', line[i]);


				let sentence = ''
				word.forEach(item => {
					sentence += item.content + ' ';
				});

				sentence.trim();

				line[i].sentence = sentence;
				console.log('sentence: ', sentence);
				if (sentence.indexOf(text) != -1) {

					line[i].tmpLen = this.getToZeroLen(location)
					if (!topLeftLetter) {
						topLeftLetter = line[i];
					} else {
						if (topLeftLetter.tmpLen > line[i].tmpLen) {
							topLeftLetter = line[i];
						}
					}
				}
			}
		}

		return topLeftLetter;
	},

	getToZeroLen(location) {
		const { top, left } = location;
		const len = Math.sqrt(Math.pow(left, 2) + Math.pow(top, 2));
		return len;
	},

	getPhotoLabelData(textArr, block, isShow=true) {


		for(let j=0; j<block.length; j++) {

			const line = block[j];
			if (!line) {
				continue;
			}

			const sentence = line.content;


			if (isShow) {
				const label = this.getLabel(sentence, 150);
				label.x = line.left * this.debugBgImg.width;
				label.y = -(line.top + (line.bottom - line.top) / 2) * this.debugBgImg.height;
				label.parent = this.debugDrawLayer;
				label.zIndex = 200;
				// label.color = cc.Color.RED;
				const l = label.getComponent(cc.Label);
				label.anchorX = 0;
				// console.log(' sentence~:  ', sentence);
			}




			if (this.checkIsInsert(textArr, sentence)) {
				return line;
			}

		}

		return false;

	},

	checkIsInsert(textArr, sentence) {
		// console.log('textArr: ', textArr);
		// console.log('sentence: ', sentence);

		let index = -1;
		for (let i = 0; i < textArr.length; i++) {
			index = sentence.indexOf(textArr[i], index);
			// console.log('index: ', index);
			if (index == -1) {
				return false;
			}
		}

		return true;
	},

	getTempWordArr(line, splitText) {

		if (line.characters) {
			return this.getArrByCharacters(line);
		}

		const lineBox = {left: line.left, top: line.top, right: line.right, bottom: line.bottom};
		const baseX = lineBox.left;

		let textIndex = 0;
		const oneDisW = (lineBox.right - lineBox.left) / line.content.length;

		let arr = line.content.split(splitText);
	
		

		const wordArr = [];
		for (let i=0; i<arr.length; i++) {
			const content = arr[i];
			const location = {}
			location.left = baseX + textIndex * oneDisW;
			location.right = location.left + oneDisW * content.length;
			location.top = lineBox.top;
			location.bottom = lineBox.bottom;
			
			const centerX = location.left + (location.right - location.left) / 2;
			const centerY = location.top + (location.bottom - location.top) / 2;
			const centerLoc = [centerX, centerY];
			
			wordArr.push({content, location, centerLoc});

			textIndex += content.length;
		}

		return wordArr;
	},

	getArrByCharacters(line) {
		const wordArr = [];
		const arr = line.characters;
		for (let i=0; i<arr.length; i++) {

			const {character, poly, centerLoc} = arr[i];

			if (character == 0) {
				arr[i].character = 'o'
			}

			let content = character;

		

			const location = {}
			location.left = poly[0];
			location.top = poly[1];
			location.right = poly[2];
			location.bottom = poly[7];

			if (poly.length < 8) {
				location.bottom = poly[3];
			}
			
			wordArr.push({content, location, centerLoc});
		}

		return wordArr;
	},

	getPhotoWordArr(text, block, benchmark1Data) {

		const wordArr = [];
		// const maxLen = 10;

		text = text.trim();

		const topY = this.regionRect.top;
		const bottomY = this.regionRect.bottom;

		for(let j=0; j<block.length; j++) {

			const line = block[j];
			if (!line) {
				continue;
			}

			if (line.top > topY || line.bottom < bottomY) {
				continue;
			}

			const sentence = line.content;

			if (text.indexOf("||") != -1) {

				const textArr = text.split("||");
				for (let k=0; k<textArr.length; k++) {
					if (sentence.indexOf(textArr[k]) != -1 ) {
						wordArr.push( line );
						break;
					}
				}

			} else {

				if (sentence.indexOf(text) != -1 ) {
					wordArr.push( line );
				}
			}


			

		}

		return wordArr;
	},



	checkCutWordData(wordArr) {

		let newWordArr = [];
		for (let i = 0; i < wordArr.length; i++) {

			let wordObj = wordArr[i];

			wordObj.content = wordObj.content.trim();

			if (wordObj.content.length > 1) {

				const tmpArr = [];
				const w = wordObj.location.right - wordObj.location.left
				const subW = w / wordObj.content.length;
				for (let j = 0; j < wordObj.content.length; j++) {

					const subWordObj = {};
					subWordObj.content = wordObj.content[j];
					subWordObj.location = {
						top: wordObj.location.top,
						bottom: wordObj.location.bottom,
						left: wordObj.location.left + subW * j,
						right: wordObj.location.left + subW * (j + 1)
					}

					tmpArr.push(subWordObj);
				}
				newWordArr = newWordArr.concat(tmpArr)


			} else {
				newWordArr.push(wordObj)
			}

		}

		console.log('newWordArr: ', newWordArr);
		return newWordArr;
	},





	getOneAnim(data ,cb) {

		if (!data.texPngData) {
			cb && cb();
			return
		}

		const animaNode = new cc.Node();

		const dragonDisplay = animaNode.addComponent(dragonBones.ArmatureDisplay);
		
		const image = data.texPngData.url//"http://staging-teach.cdn.ireadabc.com/5a0c5af3e952acd0ac83a6e5c6f03ff1.png";
		const ske = data.skeJsonData.url//"http://staging-teach.cdn.ireadabc.com/bd825dcceea298d1146be8067ae3d17f.json";
		const atlas = data.texJsonData.url//"http://staging-teach.cdn.ireadabc.com/246f8991b729fa3e5a7f4802de828efa.json";
		cc.loader.load(image, (error, texture) => {

			cc.loader.load({url: atlas, type: 'txt'}, (error, atlasJson) => {

				cc.loader.load({url: ske, type: 'txt'}, (error, dragonBonesJson) => {

					const atlas = new dragonBones.DragonBonesAtlasAsset();
					atlas.atlasJson = atlasJson;
					atlas.texture = texture;

					const asset = new dragonBones.DragonBonesAsset();
					asset.dragonBonesJson = dragonBonesJson;

					dragonDisplay.dragonAtlasAsset = atlas;
					dragonDisplay.dragonAsset = asset;

					let json = JSON.parse(asset.dragonBonesJson);
					let armatures = json["armature"];
					let armatureNames = [];
					for (let i = 0; i < armatures.length; i++) {
						armatureNames.push(armatures[i].name);
					}

					if (armatureNames.length > 0) {
						let defaultArmatureName = armatureNames[0];
						dragonDisplay.armatureName = defaultArmatureName;

						let defaultArmature = armatures[0];
						let animations = defaultArmature.animation;
						let animationNames = [];
						for (let i = 0; i < animations.length; i++) {
							animationNames.push(animations[i].name);
						}

						animaNode.animationNames = animationNames;
					}

					cb(animaNode);

				});
			});
		});

	},


	checkIsRightArea(data) {

		const text = data?.result?.text
		if (!text) {
			return false;
		}

		const benchmark1Text = this.benchmark1Data.labelText
		const benchmark1TextArr = benchmark1Text.split(' ');
		console.log('benchmark1TextArr: ', benchmark1TextArr);
		// const letter = this.data.letter || 'Aa';

		const benchmark1LabelData = this.getPhotoLabelData(benchmark1TextArr, text, false);
		if (!benchmark1LabelData) {
			console.log('!benchmark1LabelData')
			return false;
		}
		this.benchmark1LabelData = benchmark1LabelData;
		console.log('benchmark1LabelData: ', benchmark1LabelData);
		

		if ( this.firstItemData ) {

			const firstText = this.firstItemData.labelText
			const firstTextArr = firstText.split(' ');

			const firstItemLabelData = this.getTopLeftLetter2(firstText, text, this.benchmark1LabelData);

			if (!firstItemLabelData) {
				return false;
			}
			this.firstItemLabelData = firstItemLabelData;

			console.log('firstItemLabelData: ', firstItemLabelData);
			return true

		} else if (this.benchmark2Data) {
		
			const benchmark2Text = this.benchmark2Data.labelText
			const benchmark2TextArr = benchmark2Text.split(' ');
			const benchmark2LabelData = this.getPhotoLabelData(benchmark2TextArr, text, false);
			if (!benchmark2LabelData) {
				return false;
			}
			this.benchmark2LabelData = benchmark2LabelData;
			return true;
		}

		return false;

	
	
	},


	getTopLeftLetter2(text, block, topLabelData) {

		const benchmark1Rect = this.benchmark1Data.rect;

		const rect = {
			x: topLabelData.left, 
			y: -topLabelData.bottom, 
			width: Math.abs( topLabelData.right - topLabelData.left ), 
			height: Math.abs( topLabelData.bottom - topLabelData.top ), 
		}                        
		const colorRect = this.getColorRect(rect, "green");
		// this.debugDrawLayer.addChild(colorRect);
		


		const tempUnitW = benchmark1Rect.x + benchmark1Rect.width;
		const tempUnitH = benchmark1Rect.y + benchmark1Rect.height;
		const tempBaseX = benchmark1Rect.x + benchmark1Rect.width / 2;
		const tempBaseY = benchmark1Rect.y + benchmark1Rect.height / 2;


		const firstItemData = this.firstItemData;		
		const firstItemRect = this.firstItemData.rect;

	
		const firstItemX = firstItemRect.x + firstItemRect.width / 2;
		const firstItemY = firstItemRect.y + firstItemRect.height / 2;

		const unitX = (firstItemX - tempBaseX) / tempUnitW;
		const unitY = (firstItemY - tempBaseY) / tempUnitH;
		const unitW2 = firstItemRect.width / tempUnitW;
		const unitH2 = firstItemRect.height / tempUnitH;



		// console.log('tempUnitW: ', tempUnitW);
		// console.log('tempUnitH: ', tempUnitH);
		// console.log('tempBaseX: ', tempBaseX);
		// console.log('tempBaseY: ', tempBaseY);

		// console.log('firstItemY: ', firstItemY);
		// console.log('tempBaseY: ', tempBaseY);
		// console.log('tempUnitH: ', tempUnitH);

		firstItemData.unitX = unitX;
		firstItemData.unitY = unitY;
		firstItemData.unitW = unitW2;
		firstItemData.unitH = unitH2;



		const topLocationLeft = topLabelData.left;
		const topLocationTop = topLabelData.top;
		const topLocationRight = topLabelData.right;
		const topLocationBottom = topLabelData.bottom;

		const baseX = topLocationLeft + (topLocationRight - topLocationLeft) / 2;
		const baseY =	topLocationTop + (topLocationBottom - topLocationTop) / 2;
		const unitW = topLocationRight;
		const unitH = topLocationTop + (topLocationBottom - topLocationTop);
		

		const checkLetter = firstItemData;

		// console.log('baseY: ', baseY);
		// console.log('checkLetter.unitY: ', checkLetter.unitY);
		// console.log('unitH: ', unitH);


		let x = baseX + checkLetter.unitX * unitW;
		const y = baseY + checkLetter.unitY * unitH;
		const w = checkLetter.unitW * unitW;
		const h = checkLetter.unitH * unitH;
		const r = Math.min(w, h) / 2;


		// console.log(' baseX:  ', baseX);
		// console.log(' checkLetter.unitX:  ', checkLetter.unitX);
		// console.log(' unitW:  ', unitW);
		// console.log(' x:  ', x);
		// console.log(' y:  ', y);
		// console.log(' r:  ', r);
		// console.log(' checkLetter:  ', checkLetter);

		const dot = this.getColorDot(x, -y, r, r, 'blue');
		// this.debugDrawLayer.addChild(dot, 5);

		dot.labelText = checkLetter.labelText;


		const wordDataArr =  this.getPhotoWordArr(text, block, topLabelData);
		let topLeftLetterData;


		const {dotRect, labelText} = dot
		


		const specialLetterArr = [
			'c', 'C',
			'k', 'K',
			'o', "O",
			'p', 'P',
			's', 'S',
			'u', 'U',
			'v', 'V',
			'w', 'W',
			'x', 'X',
			'z', 'Z',
		]


		for (let i=0; i<wordDataArr.length; i++) {

			// const tempWordArr = wordDataArr[i].word;
			const tempWordArr = this.getTempWordArr(wordDataArr[i],['']);


			for (let k=0; k<tempWordArr.length; k++) {
					
				const {location , content} = tempWordArr[k];

				const rect = {
					x: location.left, 
					y: -location.bottom, 
					width: Math.abs( location.right - location.left ), 
					height: Math.abs( location.bottom - location.top ), 
				}     
				
				console.log('rect~: ', rect);
				const colorRect = this.getColorRect(rect, "yellow");
				colorRect.labelText = content;
				// this.debugDrawLayer.addChild(colorRect);

				// console.log('colorRect: ', colorRect);

				const label = this.getLabel(content);
				label.x = colorRect.x + colorRect.width / 2 * colorRect.scaleX;
				label.y = colorRect.y - colorRect.height / 2 //* colorRect.scaleY;
				label.color = cc.Color.GREEN;
				this.debugDrawLayer.addChild(label);




				///------

				const checkRect = colorRect.ccRect;
				const targetLabelText = colorRect.labelText;

				const {dotRect, labelText, key} = dot;

				if (specialLetterArr.indexOf(labelText) != -1 ) {
					labelText = labelText.toLowerCase();
					targetLabelText = targetLabelText.toLowerCase();
				}

				if (labelText.indexOf(targetLabelText) != -1 && checkRect.intersects(dotRect)) {
				// if (labelText.toLowerCase().indexOf(targetLabelText.toLowerCase()) != -1 && checkRect.intersects(dotRect)) {
					return tempWordArr[k];
				}

				///------
				
			}

		}
			
		return null;

	},


	
	getTopLeftLetterData(result, identifier, topTitleData, bottomTitleData) {
		
		const identifierArr = this.getIdentifierArr(result, identifier);

		identifierArr.forEach(item => {
			const len = Math.sqrt(Math.pow(item.left, 2) + Math.pow(item.top, 2));
			item.minLen = len;
		})

		identifierArr.sort((a, b) => {
			return a.minLen - b.minLen
		})

		const topLeftLetter = identifierArr[0];
		if (-topLeftLetter.bottom > -topTitleData.bottom || -topLeftLetter.bottom < -bottomTitleData.bottom ) {
			return;
		}

		const unit = bottomTitleData.bottom - bottomTitleData.top;
		const targetX = bottomTitleData.left + unit * 1;
		if (topLeftLetter.left > targetX) {
			return;
		}

		return topLeftLetter;
	},

	getIdentifierArr(data, identifier) {

		const result = data.result;

		const identifierArr = [];
		for (let i = 0; i < result.length; i++) {

			const data = result[i];
			const { classIdentifier } = data;

			if (classIdentifier == identifier) {
				identifierArr.push(data)
			}
		}
		return identifierArr;
	},

	


	
	getAnswerData(data) {
		
		const text = data?.result?.text
		if (!text) {
			return false;
		}

		// console.log(' in getAnswerData: ', text);

		const benchmark1LabelData = this.benchmark1LabelData;
		let benchmark2LabelData ;

		const centerItemArr = this.centerItemArr;

		const benchmark1Left = benchmark1LabelData.left;
		const benchmark1Top = benchmark1LabelData.top;
		const benchmark1Right = benchmark1LabelData.right;
		const benchmark1Bottom = benchmark1LabelData.bottom;

		let baseX;
		let baseY;
		let unitW;
		let unitH;

		if (this.benchmark2LabelData) {
			benchmark2LabelData = this.benchmark2LabelData;


			const benchmark2Left = benchmark2LabelData.left;
			const benchmark2Top = benchmark2LabelData.top;
			const benchmark2Right = benchmark2LabelData.right;
			const benchmark2Bottom = benchmark2LabelData.bottom;


			const bottomLocation = benchmark2LabelData;

			baseX = benchmark1Left;
			baseY =	benchmark1Top + (benchmark1Bottom - benchmark1Top) / 2;
			unitW = benchmark2Right - benchmark1Left;
			unitH = bottomLocation.top + (bottomLocation.bottom - bottomLocation.top) / 2 - baseY;


			const benchmark2Rect = {
				x: benchmark2Left, 
				y: -benchmark2Bottom,
				width: Math.abs( benchmark2Left - benchmark2Right ), 
				height: Math.abs( benchmark2Top - benchmark2Bottom ), 
			}
			

			if (this.debugLayer.parent && this.debugLayer.active) {
				const colorbenchmark2Rect = this.getColorRect(benchmark2Rect, 'green');
				// this.debugDrawLayer.addChild(colorbenchmark2Rect);
			}
		} 


		if (this.firstItemLabelData) {
			const {location} = this.firstItemLabelData;
			const firstItemLeft = location.left;
			const firstItemRight = location.right;
			const firstItemTop = location.top;
			const firstItemBottom = location.bottom;

			// console.log(' location: ', location);
			// console.log(' firstItemLeft: ', firstItemLeft);
			// console.log(' firstItemRight: ', firstItemRight);
			// console.log(' firstItemTop: ', firstItemTop);
			// console.log(' firstItemBottom: ', firstItemBottom);

			baseX = firstItemLeft + (firstItemRight - firstItemLeft) / 2;
			baseY =	firstItemTop + (firstItemBottom - firstItemTop) / 2;
			unitW = benchmark1Left + (benchmark1Right -  benchmark1Left) - ( firstItemLeft + (firstItemRight - firstItemLeft) / 2 );
			// unitW = ( firstItemLeft + (firstItemRight - firstItemLeft) / 2 );
			unitH = ( firstItemTop + (firstItemBottom - firstItemTop) / 2 ) - (benchmark1Top + (benchmark1Bottom -  benchmark1Top) / 2);
		}

		// console.log(' baseX ~~~ ', baseX);
		// console.log(' baseY ~~~ ', baseY);
		// console.log(' unitW ~~~ ', unitW);
		// console.log(' unitH ~~~ ', unitH);

		// console.log("centerItemArr: ", centerItemArr);

		const dotArr = [];
		for (let i=0; i<this.centerItemArr.length; i++) {
			const checkLetter = this.centerItemArr[i];

			let x = baseX + checkLetter.unitX * unitW;
			const y = baseY + checkLetter.unitY * unitH;
			const w = checkLetter.unitW * unitW;
			const h = checkLetter.unitH * unitH;
			const r = Math.min(w, h)

			const dot = this.getColorDot(x, -y, w , h );


			if (this.debugLayer.parent && this.debugLayer.active) {
				// this.debugDrawLayer.addChild(dot, 5);
			}

			// dot.key = centerItemArr[i].index + 1;

	
			dot.key = checkLetter.key;
			dot.labelText = checkLetter.labelText;


			dotArr.push(dot);


		}



		// console.log('dotArr: ', dotArr);
		// console.log('benchmark1LabelData: ', benchmark1LabelData);

		const answerData = {};

		for (let j=0; j<this.centerItemArr.length; j++) {
			const checkLetter = this.centerItemArr[j];

			const wordDataArr = this.getPhotoWordArr(checkLetter.labelText, text, benchmark1LabelData);

			// console.log('~~~wordDataArr: ', wordDataArr);


			for (let i=0; i<wordDataArr.length; i++) {


				if ( !wordDataArr[i].tempWordArr ) {
					wordDataArr[i].tempWordArr =  this.getTempWordArr(wordDataArr[i],['']);
				} 


				const tempWordArr = wordDataArr[i].tempWordArr;
				if (tempWordArr) {
					
				}

				for (let k=0; k<tempWordArr.length; k++) {
				
					const tempWordData = tempWordArr[k];
					const {location , content, centerLoc} = tempWordData;

					// console.log('content : ', content);


					const rect = {
						x: location.left, 
						y: -location.bottom, 
						width: Math.abs( location.right - location.left ), 
						height: Math.abs( location.bottom - location.top ), 
					}               


					if (!tempWordData.colorRect) {
						tempWordData.colorRect = this.getColorDot(centerLoc[0], -centerLoc[1], 0.01, 0.01, 'purple');
					}
					// const colorRect = this.getColorRect(rect, "purple");
					const colorRect = tempWordData.colorRect


					colorRect.labelText = content;


					if (this.debugLayer.parent && this.debugLayer.active) {

						if (!tempWordData.label) {
							tempWordData.label = this.getLabel(content, rect.width * this.debugBgImg.width);
							const label = tempWordData.label
							label.color = cc.Color.BLACK;
							this.debugDrawLayer.addChild(label);
						}
						// const label = this.getLabel(content, colorRect.scaleX *  colorRect.width);
						const label = tempWordData.label
						label.x = colorRect.x + colorRect.width / 2 * colorRect.scaleX;
						label.y = colorRect.y + colorRect.height / 2 * colorRect.scaleY;
					}

					// console.log('colorRect: ', colorRect);

					
		
					// console.log('colorRect: ', colorRect);
					// console.log('dotArr: ', dotArr);
					// console.log('answerData: ', answerData.toString());
					// console.log('wordDataArr[i]: ', wordDataArr[i].toString());
	
					this.setOneAnswerData(colorRect, dotArr, answerData, wordDataArr[i]);
	
				}
				
			}

		}



		const benchmark1Rect = {
			x: benchmark1Left, 
			y: -benchmark1Bottom,
			width: Math.abs( benchmark1Left - benchmark1Right ), 
			height: Math.abs( benchmark1Top - benchmark1Bottom ), 
		}

		// console.log('benchmark1Rect: ', benchmark1Rect);
		
		const colorbenchmark1Rect = this.getColorRect(benchmark1Rect, 'green');
		// this.debugDrawLayer.addChild(colorbenchmark1Rect);

		return answerData;

	},

	changeWriteDataToBboxData(result) {
		const curTextArr = result.text;
		const bboxTextArr = [];
		for (let i=0; i<curTextArr.length; i++) {

			const score = curTextArr[i].score;

			const {left, right, top, bottom} = curTextArr[i];
			const text = curTextArr[i].content;

			// console.log('text..', JSON.stringify( curTextArr[i] ));
			// console.log('text..', text);
			const disW = (right - left) / text.length;
			const disH = (bottom - top);
			for (let j=0; j<text.length; j++) {

				const x1 = left + j * disW;
				const y1 = top;

				const x2 = x1 + disW;
				const y2 = y1;

				const x3 = x2;
				const y3 = y2 + disH;

				const x4 = x1;
				const y4 = y3;

				const bbox = [{x1, y1}, {x2, y2}, {x3, y3}, {x4, y4}]


				this.changeBboxPos(bbox);

				const content = text[j];
				bboxTextArr.push({bbox, content, score});
			}

		}

		result.text = bboxTextArr;

	},

	changeBboxPos(data) {

		const text = data?.result?.text;
		if (!text) {
			return;
		}


		for (let i=0; i<text.length; i++) {

			let {left, top, right, bottom} = text[i];

			const q_left = this.ques_region[0];
			const q_top = this.ques_region[1];
			const q_right = this.ques_region[2];
			const q_bottom = this.ques_region[7];

			const rect = {x: q_left, y: q_top, width: q_right - q_left, height: q_bottom - q_top};

			text[i].left = q_left + left * rect.width;
			text[i].top = q_top + top * rect.height;
			text[i].right = q_left + right * rect.width;
			text[i].bottom = q_top + bottom * rect.height;

		}

	
	},



	setTestLabel(labelData) {

		if (!this.debugLayer.parent || !this.debugLayer.active) {
			return;
		}

		console.log('labelData: ', labelData)
		const location = labelData.word[0].location;
		const label = this.getLabel(labelData.sentence);
		label.anchorX = 0;
		// label.anchorY = 1;
		label.x = location.left;
		label.y = -location.top
		label.zIndex = 50;


		// const rect = {};
		// rect.width = location.right - location.left;
		// rect.height = location.bottom - location.top;
		// rect.x = location.left;
		// rect.y = -location.top;
		// const colorRect = this.getColorRect(rect, cc.Color.YELLOW);
		// this.debugLayer.addChild(colorRect);

		this.debugLayer.addChild(label);
	},

	setTestRectDot(topLabelData, bottomLabelData, topLeftLetter, wordDataArr) {


		const topLeftPosX = topLeftLetter.left;
		const topLeftPosY = topLeftLetter.top;

		const totalH = -topLabelData.top + bottomLabelData.top;
	
		const unitH = -topLabelData.top + bottomLabelData.bottom;
		const rate = 0.26;

		// console.log('unitH: ', unitH);


		let rectH;
		let rectW;
		let disW;

		let unit;
		if (-topLeftPosY > -topLabelData.top - totalH / 3) {

			unit = topLeftLetter.bottom - topLabelData.bottom;
			// console.log('unit: ', unit);

			// 50

			rectH = 0.88 *rate * unitH; //44  
			rectW = 0.5 *rate * unitH; //27;
			disW = 0.66 *rate * unitH; //55;
		
		} else {

			unit = bottomLabelData.top - topLeftLetter.top;
			// 50

			rectH = 0.5 *rate * unitH; //25  
			rectW = 0.54 *rate * unitH; //27;
			disW = 0.6 *rate * unitH; //46;

			// console.log('unit: ', unit);


		}



		const baseX = topLeftPosX + rectW / 2;
		let baseY = -(topLeftPosY - rectH / 2);


		let col = 0;

		const dotArr = [];
		for (let i = 0; i < 9; i++) {
			const x = baseX + col * disW;
			const y = baseY;
			const dot = this.getColorDot(x, y, rectW * 0.1);
			// this.debugLayer.addChild(dot,5);
			dotArr.push(dot);
			col++;


		}

		return dotArr;







		// const topLeftPosX = topLeftLetter.word[0].location.left;
		// const topLeftPosY = topLeftLetter.word[0].location.top;

		// const totalH = -topLabelData.word[0].location.top + bottomLabelData.word[0].location.top;


		// const unitH = -topLeftLetter.word[0].location.top + topLeftLetter.word[0].location.bottom;


		// console.log('unitH: ', unitH);



		// let rectH = 1 * unitH; //21  
		// let rectW = 1.476 * unitH; //31;
		// let disW = 2.08 * unitH; //45;


		// const letterLocation = topLeftLetter.word[0].location;
		// const bottomLocation = bottomLabelData.word[0].location;
		// const topLocation = topLabelData.word[0].location;
		// let unit;
		// if (-topLeftPosY > -topLabelData.word[0].location.top - totalH / 3 ) {

		// 	unit = letterLocation.bottom - topLocation.bottom;
		// 	// 50

		// 	rectH = 0.88 * unit; //44  
		// 	rectW = 0.54 * unit; //27;
		// 	disW = 1.07 * unit; //55;

		// } else {

		// 	unit = bottomLocation.top - letterLocation.top;
		// 	// 50

		// 	rectH = 0.5 * unit; //25  
		// 	rectW = 0.54 * unit; //27;
		// 	disW = 1.13 * unit; //46;

		// }





		// const baseX = topLeftPosX + rectW / 2;
		// let baseY = -(topLeftPosY - rectH / 2 );


		// let col = 0;

		// const dotArr = [];
		// for (let i=0; i<9; i++) {
		// 	const x = baseX + col * disW;
		// 	const y = baseY;
		// 	const dot = this.getColorDot(x, y, rectW * 0.6);
		// 	this.debugLayer.addChild(dot,5);
		// 	dotArr.push(dot);
		// 	col ++;


		// }

		// return dotArr;

	},

	


	setOneAnswerData(colorRect, dotArr, answerData, line) {

		// console.log(' in setOneAnswerData')
		// console.log('colorRect: ', colorRect)
		// console.log('dotArr: ', dotArr)
		// console.log('answerData: ', answerData)

		const specialLetterArr = [
			'c', 'C',
			'k', 'K',
			'o', "O",
			'p', 'P',
			's', 'S',
			'u', 'U',
			'v', 'V',
			'w', 'W',
			'x', 'X',
			'z', 'Z',
		]
		
		const rect = colorRect.ccRect;
		let targetLabelText = colorRect.labelText;


		const checkIsContains = (dotRect, labelText, key)=> {


			if (specialLetterArr.indexOf(labelText) != -1 ) {

				labelText = labelText.toLowerCase();
				targetLabelText = targetLabelText.toLowerCase();
			}

			if (labelText.indexOf(targetLabelText) != -1 && dotRect.intersects(rect)) {

				const len = targetLabelText.trim().length;

				if (!answerData[key]) {
					answerData[key] = {colorRect, count: len};
				} else {
					answerData[key].count += len;
				}

				if ( labelText.length <= 1) {
					answerData[key].isFinish = true;
					answerData[key].line = line;
					return true;

				} else {
					if (answerData[key].count >= labelText.length) {
						answerData[key].isFinish = true;
						answerData[key].line = line;
						return true;
					}
				}
			}
		}

		for (let i=0; i<dotArr.length; i++) {

			let {dotRect, labelText, key} = dotArr[i];

				// console.log('targetLabelText.toLowerCase() : ', targetLabelText.toLowerCase() );
				// console.log('labelText.toLowerCase()  : ', labelText.toLowerCase()  );
				// console.log('rect.intersects(dotRect) : ', rect.intersects(dotRect) );

			if (labelText.indexOf("||") != -1) {

				const labelTextArr = labelText.split("||");


				// console.log('targetLabelText: ', targetLabelText);
				// console.log('labelTextArr: ', labelTextArr);


				for (let j=0; j<labelTextArr.length; j++) {
					const isContains = checkIsContains(dotRect, labelTextArr[j], key);
					if (isContains) {
						break;
					}
				}
			} else {
				checkIsContains(dotRect, labelText, key);
			}


			// if (specialLetterArr.indexOf(labelText) != -1 ) {
			// 	labelText = labelText.toLowerCase();
			// 	targetLabelText = targetLabelText.toLowerCase();
			// 	// console.log(' in small letter');
			// }

			// if (labelText.indexOf(targetLabelText) != -1 && dotRect.intersects(rect)) {
			// // if (labelText.indexOf(targetLabelText) != -1 && rect.intersects(dotRect)) {
			// // if (labelText.toLowerCase().indexOf(targetLabelText.toLowerCase()) != -1 && rect.intersects(dotRect)) {
			// 	const len = targetLabelText.trim().length;

			// 	// console.log('len: ', len);

			// 	if (!answerData[key]) {
			// 		answerData[key] = {colorRect, count: len};
			// 	} else {
			// 		answerData[key].count += len;

			// 		// console.log('len: ', len);
			// 		// console.log('	answerData[key].count: ', 	answerData[key].count);

			// 	}

			// 	if ( labelText.length <= 1) {
			// 		answerData[key].isFinish = true;
			// 		answerData[key].line = line;

			// 	} else {
			// 		if (answerData[key].count >= labelText.length) {
			// 			answerData[key].isFinish = true;
			// 			answerData[key].line = line;
			// 		}
			// 	}

			
			// 	// return;
			// }

		}

	},

	

	getLabel(text, fontSize = 20) {
		const labelNode = new cc.Node();
		const label = labelNode.addComponent(cc.Label);
		label.string = text;
		labelNode.color = cc.Color.BLACK;
		label.fontSize = fontSize;
		label.lineHeight = fontSize;
		return labelNode;
	},

	getColorRect(rect, color=null) {

		if (!color) {
			color = 'red'
		}

		// console.log('rect.x1: ', rect.x);
		this.changeNumToInt(rect, ['x', 'y', 'width', 'height'], 0.0001);
		// console.log('rect.x2: ', rect.x);

		rect.x *= this.debugBgImg.width;
		rect.y *= this.debugBgImg.height;
		rect.width *= this.debugBgImg.width;
		rect.height *= this.debugBgImg.height;

		let node 


		if (this.debugLayer.parent && this.debugLayer.active) {
			
			// node = getSprNode(color);

			node = this.getNewNode(color);

			node.anchorX = 0;
			node.anchorY = 0;
			node.x = rect.x;
			node.y = rect.y;
			node.scaleX = rect.width / node.width;
			node.scaleY = rect.height / node.height;



		} else {
			node = this.getNewNode();
		}

		node.ccRect = new cc.Rect(rect.x, rect.y, rect.width, rect.height);


		return node;
	},

	getNewNode(color = null) {

		const deleteItemByArr = (item, arr) => {
			const index = arr.indexOf(item);
			if (index != -1) {
				arr.splice(index, 1);
			}
		}

		let node;

		if (this.nodePoolArr.length > 0) {


			if (color) {

				node = this.nodePoolArr.find((n) => {
					return n.rectColor == color;
				})

				if (node) {
					deleteItemByArr(node, this.nodePoolArr)
				} else {
					node = getSprNode(color);
					this.debugDrawLayer.addChild(node);
				}

			} else {

				node = this.nodePoolArr.find((n) => {
					return n.rectColor == color;
				})
				if (node) {
					deleteItemByArr(node, this.nodePoolArr)
				} else {
					node = new cc.Node();
					this.debugDrawLayer.addChild(node);
				}
				
			}


		} else {


			if (color) {

				node = getSprNode(color);
			} else {

				node = new cc.Node();
			}

			this.debugDrawLayer.addChild(node);

		}

		node.rectColor = color;
		node.isPoolNode = true;
		node.active = true;
		return node;
	},

	changeNumToInt(obj, opt, digit) {

		for (let i=0; i<opt.length; i++) {
			const prop = opt[i];
			if (obj[prop]) {
				// console.log('prop: ', prop);
				obj[prop] = Math.floor( obj[prop] / digit ) * digit;
			}
		}
	},


	

	
	getColorDot(x, y, w=100, h=100, color='red') {
		let node = new cc.Node();

		if (!h) {
			h = w;
		}

		x *= this.debugBgImg.width;
		y *= this.debugBgImg.height;
		w *= this.debugBgImg.width;
		h *= this.debugBgImg.height;

		if (this.debugLayer.parent && this.debugLayer.active) {

			const rect = {
				x:- w/2,
				y: - h/ 2, 
				width:w, 
				height:h
			}


			const colorDot = getSprNode(color);

		
			colorDot.scaleX = rect.width / colorDot.width;
			colorDot.scaleY = rect.height / colorDot.height;
			node.addChild(colorDot);



			// node.anchorX = 0;
			// node.anchorY = 0;
			// node.x = x;
			// node.y = y;
			// node.scaleX = w / node.width;
			// node.scaleY = h / node.height;

			this.debugDrawLayer.addChild(node);

		}

		node.x = x;
		node.y = y;



		


		const rect = new cc.Rect(node.x -w/2, node.y -h/2, w, h);
		node.dotRect = rect;
		node.ccRect = rect;
		return node;
	},


	checkIsRightLetter(result) {
		const block = result?.data?.block
		if (!block) {
			return false;
		}
		return false;

		const letter = this.data.letter;
		const letterLabelData = this.getPhotoLabelData(letter, block);

		return letterLabelData;
	},

	checkIsRightPos(result) {
		const block = result?.data?.block
		if (!block) {
			return false;
		}

		return false;

		const iconLabelData = this.getPhotoLabelData('I like', block);
		const topLabelData = this.getPhotoLabelData('n and repeat', block);
		const bottomLabelData = this.getPhotoLabelData('n, point, and repeat', block);
		if (!iconLabelData) {
			return false;
		}

		const topY = topLabelData.location.top_left.y;
		const bottomY = bottomLabelData.location.top_left.y;
		const iconY = iconLabelData.location.top_left.y;
		if (bottomY <= iconY <= topY) {
			return true;
		}
	},

	showPhotoSuccess() {
		console.log(' in showPhotoSuccess')

		if (!this.data.finish_audio_url) {
			return;
		}

		playAudio(this.data.finish_audio_url)

	},

	getPhotoData(cb) {

		const tmpData2 = {"result":{"text":[{"left":0.19333332777023315,"right":0.9316666722297668,"top":0.12628865242004395,"bottom":0.21778351068496704,"score":0.9017215371131897,"content":"A A A A A A A A","characters":[{"character":"A","centerLoc":[0.2175,0.17203608],"poly":[0.19333333,0.12628865,0.24166666,0.21778351]},{"character":" ","centerLoc":[0.26666665,0.17203608],"poly":[0.24166666,0.12628865,0.29166666,0.21778351]},{"character":"A","centerLoc":[0.31583333,0.17203608],"poly":[0.29166666,0.12628865,0.34,0.21778351]},{"character":" ","centerLoc":[0.365,0.17203608],"poly":[0.34,0.12628865,0.39,0.21778351]},{"character":"A","centerLoc":[0.41416666,0.17203608],"poly":[0.39,0.12628865,0.43833333,0.21778351]},{"character":" ","centerLoc":[0.46333334,0.17203608],"poly":[0.43833333,0.12628865,0.48833334,0.21778351]},{"character":"A","centerLoc":[0.51250005,0.17203608],"poly":[0.48833334,0.12628865,0.5366667,0.21778351]},{"character":" ","centerLoc":[0.56166667,0.17203608],"poly":[0.5366667,0.12628865,0.58666664,0.21778351]},{"character":"A","centerLoc":[0.6108333,0.17203608],"poly":[0.58666664,0.12628865,0.635,0.21778351]},{"character":" ","centerLoc":[0.65999997,0.17203608],"poly":[0.635,0.12628865,0.685,0.21778351]},{"character":"A","centerLoc":[0.70916665,0.17203608],"poly":[0.685,0.12628865,0.73333335,0.21778351]},{"character":" ","centerLoc":[0.7583333,0.17203608],"poly":[0.73333335,0.12628865,0.78333336,0.21778351]},{"character":"A","centerLoc":[0.8075,0.17203608],"poly":[0.78333336,0.12628865,0.83166665,0.21778351]},{"character":" ","centerLoc":[0.8566667,0.17203608],"poly":[0.83166665,0.12628865,0.88166666,0.21778351]},{"character":"A","centerLoc":[0.90666664,0.17203608],"poly":[0.88166666,0.12628865,0.9316667,0.21778351]}]},{"left":0.19333332777023315,"right":0.9350000023841858,"top":0.22809278964996338,"bottom":0.31572166085243225,"score":0.9455733895301819,"content":"aaaaaaa a","characters":[{"character":"a","centerLoc":[0.23416667,0.2719072],"poly":[0.19333333,0.22809279,0.275,0.31572166]},{"character":"a","centerLoc":[0.31583333,0.2719072],"poly":[0.275,0.22809279,0.35666665,0.31572166]},{"character":"a","centerLoc":[0.3983333,0.2719072],"poly":[0.35666665,0.22809279,0.44,0.31572166]},{"character":"a","centerLoc":[0.48083332,0.2719072],"poly":[0.44,0.22809279,0.52166665,0.31572166]},{"character":"a","centerLoc":[0.56333333,0.2719072],"poly":[0.52166665,0.22809279,0.605,0.31572166]},{"character":"a","centerLoc":[0.6458334,0.2719072],"poly":[0.605,0.22809279,0.68666667,0.31572166]},{"character":"a","centerLoc":[0.72833335,0.2719072],"poly":[0.68666667,0.22809279,0.77,0.31572166]},{"character":" ","centerLoc":[0.81083333,0.2719072],"poly":[0.77,0.22809279,0.8516667,0.31572166]},{"character":"a","centerLoc":[0.8933333,0.2719072],"poly":[0.8516667,0.22809279,0.935,0.31572166]}]},{"left":0.1899999976158142,"right":0.351666659116745,"top":0.4110824763774872,"bottom":0.5180412530899048,"score":0.9947138428688049,"content":"A a","characters":[{"character":"A","centerLoc":[0.21666667,0.46456188],"poly":[0.19,0.41108248,0.24333334,0.51804125]},{"character":" ","centerLoc":[0.26999998,0.46456188],"poly":[0.24333334,0.41108248,0.29666665,0.51804125]},{"character":"a","centerLoc":[0.32416666,0.46456188],"poly":[0.29666665,0.41108248,0.35166666,0.51804125]}]}]}}
		// const tmpData2 = {"result":{"text":[{"left":0.07833333313465118,"right":0.4300000071525574,"top":0.0758659765124321,"bottom":0.11839175224304199,"score":1,"content":"C Trace,write,and say.","characters":[{"character":"C","centerLoc":[0.11,0.093907215],"poly":[0.09166667,0.07715464,0.12666667,0.111948445]},{"character":" ","centerLoc":[0.13,0.093907215],"poly":[0.12833333,0.078443296,0.13166666,0.109371126]},{"character":"T","centerLoc":[0.14333333,0.093907215],"poly":[0.13666667,0.084886596,0.15166667,0.102927834]},{"character":"r","centerLoc":[0.15666667,0.096484534],"poly":[0.15166667,0.090041235,0.16166666,0.104216486]},{"character":"a","centerLoc":[0.17,0.097773194],"poly":[0.16333333,0.090041235,0.17666666,0.10550515]},{"character":"c","centerLoc":[0.18333334,0.097773194],"poly":[0.17833333,0.090041235,0.19166666,0.10550515]},{"character":"e","centerLoc":[0.20166667,0.097773194],"poly":[0.19500001,0.090041235,0.20833333,0.10550515]},{"character":",","centerLoc":[0.21666667,0.099061854],"poly":[0.20833333,0.092618555,0.22666667,0.106793806]},{"character":"w","centerLoc":[0.23666666,0.099061854],"poly":[0.22666667,0.093907215,0.245,0.104216486]},{"character":"r","centerLoc":[0.25,0.097773194],"poly":[0.24666667,0.091329895,0.255,0.104216486]},{"character":"i","centerLoc":[0.26,0.096484534],"poly":[0.25666666,0.087463915,0.26666665,0.10550515]},{"character":"t","centerLoc":[0.27333334,0.096484534],"poly":[0.26666665,0.088752575,0.28,0.10550515]},{"character":"e","centerLoc":[0.285,0.097773194],"poly":[0.28,0.091329895,0.29,0.10550515]},{"character":",","centerLoc":[0.29833332,0.102927834],"poly":[0.29,0.100350514,0.30666667,0.106793806]},{"character":"a","centerLoc":[0.315,0.097773194],"poly":[0.30666667,0.091329895,0.32333332,0.10550515]},{"character":"n","centerLoc":[0.335,0.099061854],"poly":[0.32666668,0.091329895,0.345,0.10550515]},{"character":"d","centerLoc":[0.35166666,0.096484534],"poly":[0.345,0.087463915,0.35666665,0.10550515]},{"character":" ","centerLoc":[0.36166668,0.095195875],"poly":[0.35833335,0.087463915,0.36333334,0.102927834]},{"character":"s","centerLoc":[0.375,0.097773194],"poly":[0.36833334,0.091329895,0.38333333,0.10550515]},{"character":"a","centerLoc":[0.39000002,0.097773194],"poly":[0.38333333,0.090041235,0.395,0.10550515]},{"character":"y","centerLoc":[0.40833333,0.101639174],"poly":[0.4,0.092618555,0.415,0.111948445]},{"character":".","centerLoc":[0.42000002,0.102927834],"poly":[0.41666666,0.100350514,0.425,0.10550515]}]},{"left":0.08500000089406967,"right":0.9483333230018616,"top":0.12225772440433502,"bottom":0.1944226771593094,"score":0.9797745943069458,"content":"AAA AAAA AA","characters":[{"character":"A","centerLoc":[0.13833334,0.15705153],"poly":[0.11333333,0.12612371,0.16499999,0.18926804]},{"character":"A","centerLoc":[0.23166667,0.15962887],"poly":[0.19,0.12741236,0.27166668,0.1905567]},{"character":"A","centerLoc":[0.32666668,0.1583402],"poly":[0.295,0.12870103,0.35833335,0.18926804]},{"character":" ","centerLoc":[0.37333333,0.15576288],"poly":[0.35833335,0.12741236,0.38666666,0.18540207]},{"character":"A","centerLoc":[0.425,0.15962887],"poly":[0.40166667,0.12741236,0.45166668,0.19184536]},{"character":"A","centerLoc":[0.50333333,0.15576288],"poly":[0.47666666,0.12612371,0.53,0.18540207]},{"character":"A","centerLoc":[0.61833334,0.15705153],"poly":[0.57,0.12612371,0.665,0.18926804]},{"character":"A","centerLoc":[0.69166666,0.15705153],"poly":[0.665,0.124835044,0.7166667,0.19184536]},{"character":" ","centerLoc":[0.755,0.15576288],"poly":[0.735,0.12612371,0.7783333,0.18797937]},{"character":"A","centerLoc":[0.8,0.15576288],"poly":[0.7783333,0.12612371,0.82,0.18540207]},{"character":"A","centerLoc":[0.88,0.15060824],"poly":[0.85,0.122257724,0.90833336,0.18024743]}]},{"left":0.18333333730697632,"right":0.9483333230018616,"top":0.23565979301929474,"bottom":0.2975154519081116,"score":0.9791452288627625,"content":"a a a a a a aa","characters":[{"character":"a","centerLoc":[0.24333334,0.27174228],"poly":[0.21333334,0.25498968,0.27166668,0.2897835]},{"character":" ","centerLoc":[0.285,0.26916495],"poly":[0.27166668,0.25241238,0.29999998,0.28591752]},{"character":"a","centerLoc":[0.33333334,0.2704536],"poly":[0.31666666,0.25241238,0.35166666,0.2897835]},{"character":" ","centerLoc":[0.37166667,0.26916495],"poly":[0.35166666,0.25241238,0.39333335,0.28591752]},{"character":"a","centerLoc":[0.425,0.2704536],"poly":[0.40666667,0.25241238,0.445,0.2897835]},{"character":" ","centerLoc":[0.46333334,0.26916495],"poly":[0.445,0.25112373,0.48333335,0.28849483]},{"character":"a","centerLoc":[0.5233333,0.2704536],"poly":[0.49333334,0.25112373,0.5516667,0.29107216]},{"character":" ","centerLoc":[0.565,0.26916495],"poly":[0.5516667,0.25112373,0.5783333,0.28849483]},{"character":"a","centerLoc":[0.6166667,0.27174228],"poly":[0.5916667,0.25241238,0.64,0.29107216]},{"character":" ","centerLoc":[0.6566667,0.26916495],"poly":[0.64,0.24854639,0.67333335,0.28849483]},{"character":"a","centerLoc":[0.705,0.2704536],"poly":[0.68333334,0.24854639,0.7266667,0.29107216]},{"character":" ","centerLoc":[0.74666667,0.26916495],"poly":[0.7266667,0.25112373,0.77,0.28849483]},{"character":"a","centerLoc":[0.805,0.2704536],"poly":[0.78000003,0.25112373,0.83166665,0.2897835]},{"character":"a","centerLoc":[0.9,0.26658762],"poly":[0.87,0.24725772,0.9316667,0.28591752]}]}]}}
		// const tmpData2 = {"result":{"text":[{"left":0.07000000029802322,"right":0.42666664719581604,"top":0.08275257796049118,"bottom":0.11625772714614868,"score":1,"content":"CTrace,write,and say.","characters":[{"character":"C","centerLoc":[0.09833334,0.09821649],"poly":[0.08166666,0.08275258,0.115,0.11625773]},{"character":"T","centerLoc":[0.13,0.09821649],"poly":[0.12166667,0.08919588,0.13833334,0.10852577]},{"character":"r","centerLoc":[0.14500001,0.10079381],"poly":[0.13833334,0.09435052,0.15333334,0.10852577]},{"character":"a","centerLoc":[0.16,0.10079381],"poly":[0.15333334,0.09435052,0.16666666,0.10852577]},{"character":"c","centerLoc":[0.175,0.10079381],"poly":[0.16666666,0.09435052,0.18333334,0.10852577]},{"character":"e","centerLoc":[0.19333333,0.10079381],"poly":[0.185,0.09435052,0.20166665,0.107237116]},{"character":",","centerLoc":[0.21000001,0.10079381],"poly":[0.20166665,0.09435052,0.22,0.10852577]},{"character":"w","centerLoc":[0.22999999,0.09950516],"poly":[0.22,0.09435052,0.24000001,0.10594845]},{"character":"r","centerLoc":[0.245,0.09950516],"poly":[0.24000001,0.09306186,0.25,0.10594845]},{"character":"i","centerLoc":[0.255,0.09692784],"poly":[0.25,0.08919588,0.26,0.10594845]},{"character":"t","centerLoc":[0.26833335,0.09821649],"poly":[0.26,0.09048454,0.27666667,0.10594845]},{"character":"e","centerLoc":[0.28166667,0.09950516],"poly":[0.27666667,0.09306186,0.28833333,0.10594845]},{"character":",","centerLoc":[0.29666668,0.10337113],"poly":[0.28833333,0.09950516,0.305,0.107237116]},{"character":"a","centerLoc":[0.31333333,0.09950516],"poly":[0.305,0.09306186,0.32166666,0.10594845]},{"character":"n","centerLoc":[0.32999998,0.09950516],"poly":[0.32333332,0.09306186,0.33833334,0.10594845]},{"character":"d","centerLoc":[0.34833333,0.09692784],"poly":[0.34166667,0.08790722,0.35666665,0.10594845]},{"character":" ","centerLoc":[0.35999998,0.09563918],"poly":[0.35666665,0.08790722,0.36499998,0.10337113]},{"character":"s","centerLoc":[0.37,0.09950516],"poly":[0.36499998,0.09306186,0.37666667,0.10594845]},{"character":"a","centerLoc":[0.38666666,0.09821649],"poly":[0.37833333,0.0917732,0.39499998,0.10594845]},{"character":"y","centerLoc":[0.40166667,0.102082476],"poly":[0.39499998,0.09306186,0.40833333,0.112391755]},{"character":".","centerLoc":[0.41333333,0.09950516],"poly":[0.40833333,0.09306186,0.42,0.10594845]}]},{"left":0.2516666650772095,"right":0.6366666555404663,"top":0.12270103394985199,"bottom":0.19486597180366516,"score":0.7862052917480469,"content":"O00C","characters":[{"character":"O","centerLoc":[0.32166666,0.15749484],"poly":[0.275,0.12398969,0.36833334,0.19228865]},{"character":"0","centerLoc":[0.415,0.1587835],"poly":[0.37,0.126567,0.46166667,0.19486597]},{"character":"0","centerLoc":[0.51666665,0.1587835],"poly":[0.48,0.12398969,0.555,0.19486597]},{"character":"C","centerLoc":[0.605,0.15491752],"poly":[0.58166665,0.122701034,0.63,0.18842268]}]},{"left":0.7316666841506958,"right":0.9483333230018616,"top":0.11883504688739777,"bottom":0.189711332321167,"score":0.7896353006362915,"content":")00","characters":[{"character":")","centerLoc":[0.755,0.15362886],"poly":[0.735,0.12785567,0.77666664,0.18069072]},{"character":"0","centerLoc":[0.8183333,0.15362886],"poly":[0.7783333,0.12141237,0.8616667,0.18584536]},{"character":"0","centerLoc":[0.9083333,0.15491752],"poly":[0.875,0.12398969,0.945,0.18842268]}]}]}}

		cb(tmpData2);
		return;

		const tmpData1 = {
			"result": {
				"text": [{
					"bottom": 0.11539175361394882,
					"score": 1.5765148266412024e+26,
					"characters": [{
						"character": "T",
						"centerLoc": [0.13066667318344116, 0.096061855554580688],
						"poly": [0.12400000542402267, 0.087041236460208893, 0.13899999856948853, 0.10637113451957703]
					}, {
						"character": "r",
						"centerLoc": [0.14733333885669708, 0.097350515425205231],
						"poly": [0.13899999856948853, 0.088329896330833435, 0.15566666424274445, 0.10637113451957703]
					}, {
						"character": "a",
						"centerLoc": [0.16233333945274353, 0.098639175295829773],
						"poly": [0.15566666424274445, 0.092195875942707062, 0.17066666483879089, 0.10637113451957703]
					}, {
						"character": "c",
						"centerLoc": [0.17900000512599945, 0.098639175295829773],
						"poly": [0.17400000989437103, 0.092195875942707062, 0.18566666543483734, 0.10637113451957703]
					}, {
						"character": "e",
						"centerLoc": [0.19566667079925537, 0.098639175295829773],
						"poly": [0.18733333051204681, 0.092195875942707062, 0.20233333110809326, 0.10637113451957703]
					}, {
						"character": ",",
						"centerLoc": [0.21233333647251129, 0.098639175295829773],
						"poly": [0.20233333110809326, 0.092195875942707062, 0.22400000691413879, 0.10637113451957703]
					}, {
						"character": "w",
						"centerLoc": [0.23233333230018616, 0.098639175295829773],
						"poly": [0.22400000691413879, 0.092195875942707062, 0.24233333766460419, 0.10508247464895248]
					}, {
						"character": "r",
						"centerLoc": [0.24566666781902313, 0.098639175295829773],
						"poly": [0.24233333766460419, 0.092195875942707062, 0.25233334302902222, 0.10508247464895248]
					}, {
						"character": "i",
						"centerLoc": [0.25566667318344116, 0.096061855554580688],
						"poly": [0.25233334302902222, 0.088329896330833435, 0.26066666841506958, 0.10508247464895248]
					}, {
						"character": "t",
						"centerLoc": [0.265666663646698, 0.096061855554580688],
						"poly": [0.26066666841506958, 0.088329896330833435, 0.27066665887832642, 0.10508247464895248]
					}, {
						"character": "e",
						"centerLoc": [0.28066667914390564, 0.097350515425205231],
						"poly": [0.27399998903274536, 0.09090721607208252, 0.28733333945274353, 0.10508247464895248]
					}, {
						"character": ",",
						"centerLoc": [0.29566666483879089, 0.10121649503707886],
						"poly": [0.28733333945274353, 0.096061855554580688, 0.30566665530204773, 0.10637113451957703]
					}, {
						"character": "a",
						"centerLoc": [0.31400001049041748, 0.097350515425205231],
						"poly": [0.30566665530204773, 0.092195875942707062, 0.32066667079925537, 0.10508247464895248]
					}, {
						"character": "n",
						"centerLoc": [0.33399999141693115, 0.098639175295829773],
						"poly": [0.32566666603088379, 0.092195875942707062, 0.3423333466053009, 0.10379381477832794]
					}, {
						"character": "d",
						"centerLoc": [0.34900000691413879, 0.096061855554580688],
						"poly": [0.3423333466053009, 0.087041236460208893, 0.35733333230018616, 0.10508247464895248]
					}, {
						"character": " ",
						"centerLoc": [0.3606666624546051, 0.094773195683956146],
						"poly": [0.35733333230018616, 0.087041236460208893, 0.36399999260902405, 0.10379381477832794]
					}, {
						"character": "s",
						"centerLoc": [0.3723333477973938, 0.098639175295829773],
						"poly": [0.36566665768623352, 0.092195875942707062, 0.38066667318344116, 0.10637113451957703]
					}, {
						"character": "a",
						"centerLoc": [0.38733333349227905, 0.098639175295829773],
						"poly": [0.38066667318344116, 0.092195875942707062, 0.39566665887832642, 0.10637113451957703]
					}, {
						"character": "y",
						"centerLoc": [0.40233334898948669, 0.10121649503707886],
						"poly": [0.39566665887832642, 0.092195875942707062, 0.40900000929832458, 0.1115257740020752]
					}, {
						"character": ".",
						"centerLoc": [0.41566666960716248, 0.098639175295829773],
						"poly": [0.40900000929832458, 0.093484535813331604, 0.42233332991600037, 0.10508247464895248]
					}],
					"content": "Trace,write,and say.",
					"left": 0.11233333498239517,
					"top": 0.079309277236461639,
					"right": 0.42899999022483826
				}, {
					"bottom": 0.1940000057220459,
					"score": 1.5765148266412024e+26,
					"characters": [{
						"character": "A",
						"centerLoc": [0.13566666841506958, 0.15662886202335358],
						"poly": [0.11566667258739471, 0.1269896924495697, 0.15900000929832458, 0.18884536623954773]
					}, {
						"character": "A",
						"centerLoc": [0.23733334243297577, 0.15920618176460266],
						"poly": [0.18733333051204681, 0.1269896924495697, 0.28566667437553406, 0.19142268598079681]
					}, {
						"character": "A",
						"centerLoc": [0.32233333587646484, 0.15662886202335358],
						"poly": [0.289000004529953, 0.1269896924495697, 0.35566666722297668, 0.18884536623954773]
					}, {
						"character": "-",
						"centerLoc": [0.38566666841506958, 0.17080412805080414],
						"poly": [0.37066668272018433, 0.15276288986206055, 0.40400001406669617, 0.18884536623954773]
					}, {
						"character": "A",
						"centerLoc": [0.42733332514762878, 0.15920618176460266],
						"poly": [0.40400001406669617, 0.1269896924495697, 0.45066666603088379, 0.19142268598079681]
					}],
					"content": "AAA-A",
					"left": 0.090666666626930237,
					"top": 0.12312371283769608,
					"right": 0.47233334183692932
				}, {
					"bottom": 0.1940000057220459,
					"score": 1.5765148266412024e+26,
					"characters": [{
						"character": "A",
						"centerLoc": [0.7473333477973938, 0.15662886202335358],
						"poly": [0.68566668033599854, 0.12054639309644699, 0.80900001525878906, 0.19142268598079681]
					}, {
						"character": "A",
						"centerLoc": [0.89399999380111694, 0.15276288986206055],
						"poly": [0.86066669225692749, 0.12054639309644699, 0.92733335494995117, 0.18755669891834259]
					}],
					"content": "AA",
					"left": 0.65233331918716431,
					"top": 0.11668041348457336,
					"right": 0.9623333215713501
				}, {
					"bottom": 0.37570104002952576,
					"score": 1.5765148266412024e+26,
					"characters": [{
						"character": "O",
						"centerLoc": [0.10733333975076675, 0.35637113451957703],
						"poly": [0.090666666626930237, 0.34090721607208252, 0.12400000542402267, 0.37312370538711548]
					}, {
						"character": "L",
						"centerLoc": [0.13566666841506958, 0.35637113451957703],
						"poly": [0.12900000810623169, 0.34735050797462463, 0.14233334362506866, 0.36539176106452942]
					}, {
						"character": "i",
						"centerLoc": [0.14733333885669708, 0.35765978693962097],
						"poly": [0.14233334362506866, 0.34863916039466858, 0.1523333340883255, 0.36539176106452942]
					}, {
						"character": "s",
						"centerLoc": [0.15733332931995392, 0.35894843935966492],
						"poly": [0.1523333340883255, 0.3525051474571228, 0.164000004529953, 0.36539176106452942]
					}, {
						"character": "t",
						"centerLoc": [0.17066666483879089, 0.35765978693962097],
						"poly": [0.164000004529953, 0.34863916039466858, 0.17733334004878998, 0.36539176106452942]
					}, {
						"character": "e",
						"centerLoc": [0.18400000035762787, 0.35894843935966492],
						"poly": [0.17733334004878998, 0.35121649503707886, 0.19233334064483643, 0.36539176106452942]
					}, {
						"character": "n",
						"centerLoc": [0.20066666603088379, 0.35894843935966492],
						"poly": [0.19233334064483643, 0.35121649503707886, 0.20900000631809235, 0.36539176106452942]
					}, {
						"character": ".",
						"centerLoc": [0.21566666662693024, 0.36281442642211914],
						"poly": [0.20900000631809235, 0.36023712158203125, 0.22400000691413879, 0.36539176106452942]
					}, {
						"character": "T",
						"centerLoc": [0.23233333230018616, 0.35508248209953308],
						"poly": [0.22400000691413879, 0.34606185555458069, 0.24066667258739471, 0.36539176106452942]
					}, {
						"character": "h",
						"centerLoc": [0.24899999797344208, 0.35508248209953308],
						"poly": [0.24066667258739471, 0.34606185555458069, 0.25900000333786011, 0.36539176106452942]
					}, {
						"character": "e",
						"centerLoc": [0.26399999856948853, 0.35765978693962097],
						"poly": [0.25900000333786011, 0.35121649503707886, 0.27066665887832642, 0.36539176106452942]
					}, {
						"character": "n",
						"centerLoc": [0.28233334422111511, 0.35765978693962097],
						"poly": [0.27566668391227722, 0.3525051474571228, 0.289000004529953, 0.36539176106452942]
					}, {
						"character": " ",
						"centerLoc": [0.29733332991600037, 0.35765978693962097],
						"poly": [0.29066666960716248, 0.3525051474571228, 0.30399999022483826, 0.36281442642211914]
					}, {
						"character": "w",
						"centerLoc": [0.31066668033599854, 0.35765978693962097],
						"poly": [0.30399999022483826, 0.3525051474571228, 0.3190000057220459, 0.36410307884216309]
					}, {
						"character": "r",
						"centerLoc": [0.32400000095367432, 0.35765978693962097],
						"poly": [0.3190000057220459, 0.35121649503707886, 0.32899999618530273, 0.36539176106452942]
					}, {
						"character": "i",
						"centerLoc": [0.33399999141693115, 0.35508248209953308],
						"poly": [0.32899999618530273, 0.34863916039466858, 0.33900001645088196, 0.36410307884216309]
					}, {
						"character": "t",
						"centerLoc": [0.34566667675971985, 0.35637113451957703],
						"poly": [0.33900001645088196, 0.34992784261703491, 0.35233333706855774, 0.36410307884216309]
					}, {
						"character": "e",
						"centerLoc": [0.35733333230018616, 0.35765978693962097],
						"poly": [0.35233333706855774, 0.35121649503707886, 0.36399999260902405, 0.36539176106452942]
					}, {
						"character": " ",
						"centerLoc": [0.3723333477973938, 0.35379379987716675],
						"poly": [0.36733332276344299, 0.34477320313453674, 0.37900000810623169, 0.3615257740020752]
					}, {
						"character": "A",
						"centerLoc": [0.38566666841506958, 0.35508248209953308],
						"poly": [0.37900000810623169, 0.34477320313453674, 0.39233332872390747, 0.36410307884216309]
					}, {
						"character": "a",
						"centerLoc": [0.40066668391227722, 0.35894843935966492],
						"poly": [0.39399999380111694, 0.35379379987716675, 0.40900000929832458, 0.36539176106452942]
					}, {
						"character": " ",
						"centerLoc": [0.414000004529953, 0.35894843935966492],
						"poly": [0.40900000929832458, 0.3525051474571228, 0.41899999976158142, 0.36410307884216309]
					}, {
						"character": "o",
						"centerLoc": [0.43066665530204773, 0.36023712158203125],
						"poly": [0.42399999499320984, 0.3525051474571228, 0.43900001049041748, 0.36668041348457336]
					}, {
						"character": "r",
						"centerLoc": [0.4440000057220459, 0.36023712158203125],
						"poly": [0.43900001049041748, 0.3525051474571228, 0.45066666603088379, 0.36668041348457336]
					}, {
						"character": " ",
						"centerLoc": [0.45233333110809326, 0.35894843935966492],
						"poly": [0.45066666603088379, 0.3525051474571228, 0.45566666126251221, 0.36410307884216309]
					}, {
						"character": "c",
						"centerLoc": [0.4673333466053009, 0.36023712158203125],
						"poly": [0.4623333215713501, 0.3525051474571228, 0.47400000691413879, 0.36668041348457336]
					}, {
						"character": "r",
						"centerLoc": [0.48233333230018616, 0.36023712158203125],
						"poly": [0.47400000691413879, 0.3525051474571228, 0.49066665768623352, 0.36668041348457336]
					}, {
						"character": "o",
						"centerLoc": [0.4973333477973938, 0.36023712158203125],
						"poly": [0.49066665768623352, 0.3525051474571228, 0.50566667318344116, 0.36668041348457336]
					}, {
						"character": "s",
						"centerLoc": [0.51066666841506958, 0.36023712158203125],
						"poly": [0.50566667318344116, 0.3525051474571228, 0.515666663646698, 0.36668041348457336]
					}, {
						"character": "s",
						"centerLoc": [0.52233332395553589, 0.36023712158203125],
						"poly": [0.515666663646698, 0.3525051474571228, 0.52899998426437378, 0.36668041348457336]
					}, {
						"character": " ",
						"centerLoc": [0.52899998426437378, 0.35894843935966492],
						"poly": [0.52899998426437378, 0.3525051474571228, 0.52899998426437378, 0.36539176106452942]
					}, {
						"character": "i",
						"centerLoc": [0.53733330965042114, 0.35765978693962097],
						"poly": [0.53233331441879272, 0.34992784261703491, 0.54400002956390381, 0.36668041348457336]
					}, {
						"character": "t",
						"centerLoc": [0.54900002479553223, 0.35765978693962097],
						"poly": [0.54400002956390381, 0.35121649503707886, 0.55566668510437012, 0.36668041348457336]
					}, {
						"character": " ",
						"centerLoc": [0.56233334541320801, 0.35765978693962097],
						"poly": [0.55733335018157959, 0.3525051474571228, 0.56733334064483643, 0.36410307884216309]
					}, {
						"character": "o",
						"centerLoc": [0.57400000095367432, 0.35894843935966492],
						"poly": [0.56733334064483643, 0.3525051474571228, 0.58233332633972168, 0.36668041348457336]
					}, {
						"character": "u",
						"centerLoc": [0.58899998664855957, 0.35894843935966492],
						"poly": [0.58233332633972168, 0.35379379987716675, 0.59733331203460693, 0.36668041348457336]
					}, {
						"character": "t",
						"centerLoc": [0.60233330726623535, 0.35765978693962097],
						"poly": [0.59733331203460693, 0.35121649503707886, 0.60900002717971802, 0.36668041348457336]
					}, {
						"character": ".",
						"centerLoc": [0.61733335256576538, 0.36281442642211914],
						"poly": [0.60900002717971802, 0.36023712158203125, 0.62733334302902222, 0.36539176106452942]
					}, {
						"character": "o",
						"centerLoc": [0.63733333349227905, 0.36023712158203125],
						"poly": [0.62733334302902222, 0.35379379987716675, 0.64899998903274536, 0.36796906590461731]
					}, {
						"character": "s",
						"centerLoc": [0.65399998426437378, 0.35765978693962097],
						"poly": [0.64899998903274536, 0.34606185555458069, 0.66066664457321167, 0.36796906590461731]
					}],
					"content": "OListen.Then write Aa or cross it out.os",
					"left": 0.077333338558673859,
					"top": 0.34090721607208252,
					"right": 0.67066669464111328
				}]
			}
		}
		// const tmpData1 = {"result":{"text":[{"left":0.0716666653752327,"right":0.4300000071525574,"top":0.07830928266048431,"bottom":0.11568041145801544,"score":0.9845871925354004,"content":"C Trace,write,and say.","characters":[{"character":"C","centerLoc":[0.10666667,0.09635052],"poly":[0.08833333,0.07959794,0.125,0.07959794,0.125,0.11439176,0.08833333,0.11439176]},{"character":" ","centerLoc":[0.12833333,0.09506186],"poly":[0.125,0.0808866,0.13333333,0.0808866,0.13333333,0.11181444,0.125,0.11181444]},{"character":"T","centerLoc":[0.14,0.09506186],"poly":[0.135,0.0873299,0.14666666,0.0873299,0.14666666,0.10408248,0.135,0.10408248]},{"character":"r","centerLoc":[0.15166667,0.09763918],"poly":[0.14666666,0.09119588,0.15833333,0.09119588,0.15833333,0.10408248,0.14666666,0.10408248]},{"character":"a","centerLoc":[0.16833334,0.09763918],"poly":[0.16,0.09119588,0.17666666,0.09119588,0.17666666,0.1066598,0.16,0.1066598]},{"character":"c","centerLoc":[0.18333334,0.09763918],"poly":[0.17666666,0.09119588,0.19166666,0.09119588,0.19166666,0.10537113,0.17666666,0.10537113]},{"character":"e","centerLoc":[0.20166667,0.09763918],"poly":[0.19333334,0.09119588,0.21000001,0.09119588,0.21000001,0.10537113,0.19333334,0.10537113]},{"character":",","centerLoc":[0.21833333,0.09763918],"poly":[0.21000001,0.09119588,0.22833334,0.09119588,0.22833334,0.1066598,0.21000001,0.1066598]},{"character":"w","centerLoc":[0.23666666,0.09635052],"poly":[0.22833334,0.09119588,0.24666667,0.09119588,0.24666667,0.10408248,0.22833334,0.10408248]},{"character":"r","centerLoc":[0.25166667,0.09763918],"poly":[0.24666667,0.09119588,0.25666666,0.09119588,0.25666666,0.10408248,0.24666667,0.10408248]},{"character":"i","centerLoc":[0.26166666,0.09635052],"poly":[0.25666666,0.0873299,0.26666665,0.0873299,0.26666665,0.10408248,0.25666666,0.10408248]},{"character":"t","centerLoc":[0.27333334,0.09635052],"poly":[0.26666665,0.08861856,0.28,0.08861856,0.28,0.10408248,0.26666665,0.10408248]},{"character":"e","centerLoc":[0.28666666,0.09763918],"poly":[0.28,0.09119588,0.29333332,0.09119588,0.29333332,0.10408248,0.28,0.10408248]},{"character":",","centerLoc":[0.29999998,0.10279381],"poly":[0.29333332,0.10021649,0.30833334,0.10021649,0.30833334,0.1066598,0.29333332,0.1066598]},{"character":"a","centerLoc":[0.31666666,0.09892784],"poly":[0.30833334,0.09248454,0.325,0.09248454,0.325,0.10537113,0.30833334,0.10537113]},{"character":"n","centerLoc":[0.33666667,0.09892784],"poly":[0.32833335,0.09248454,0.34666666,0.09248454,0.34666666,0.10537113,0.32833335,0.10537113]},{"character":"d","centerLoc":[0.35333332,0.09635052],"poly":[0.34666666,0.08861856,0.36,0.08861856,0.36,0.10537113,0.34666666,0.10537113]},{"character":" ","centerLoc":[0.36333334,0.09506186],"poly":[0.36,0.08861856,0.36666667,0.08861856,0.36666667,0.10279381,0.36,0.10279381]},{"character":"s","centerLoc":[0.375,0.09892784],"poly":[0.36833334,0.09248454,0.38333333,0.09248454,0.38333333,0.10537113,0.36833334,0.10537113]},{"character":"a","centerLoc":[0.39000002,0.09892784],"poly":[0.38333333,0.09248454,0.39833334,0.09248454,0.39833334,0.10537113,0.38333333,0.10537113]},{"character":"y","centerLoc":[0.405,0.10150516],"poly":[0.39833334,0.09248454,0.41166666,0.09248454,0.41166666,0.11052577,0.39833334,0.11052577]},{"character":".","centerLoc":[0.41666666,0.10279381],"poly":[0.41166666,0.10021649,0.42333335,0.10021649,0.42333335,0.10537113,0.41166666,0.10537113]}]},{"left":0.08999999612569809,"right":0.9366666674613953,"top":0.11696907877922058,"bottom":0.19557732343673706,"score":0.9984811544418335,"content":"EEE E-E EEEE","characters":[{"character":"E","centerLoc":[0.14,0.15691753],"poly":[0.11833333,0.12470104,0.16333333,0.12470104,0.16333333,0.19042268,0.11833333,0.19042268]},{"character":"E","centerLoc":[0.22666667,0.15176289],"poly":[0.2,0.11696908,0.25666666,0.11696908,0.25666666,0.19042268,0.2,0.19042268]},{"character":"E","centerLoc":[0.325,0.15691753],"poly":[0.30166665,0.12470104,0.35166666,0.12470104,0.35166666,0.19042268,0.30166665,0.19042268]},{"character":" ","centerLoc":[0.37166667,0.15434021],"poly":[0.35166666,0.12470104,0.39333335,0.12470104,0.39333335,0.1865567,0.35166666,0.1865567]},{"character":"E","centerLoc":[0.42000002,0.15691753],"poly":[0.4,0.12470104,0.44333333,0.12470104,0.44333333,0.19042268,0.4,0.19042268]},{"character":"-","centerLoc":[0.46166667,0.15434021],"poly":[0.44333333,0.11696908,0.48333335,0.11696908,0.48333335,0.19557732,0.44333333,0.19557732]},{"character":"E","centerLoc":[0.50333333,0.15949485],"poly":[0.48333335,0.12470104,0.525,0.12470104,0.525,0.193,0.48333335,0.193]},{"character":" ","centerLoc":[0.54833335,0.15691753],"poly":[0.525,0.12470104,0.57166666,0.12470104,0.57166666,0.18784536,0.525,0.18784536]},{"character":"E","centerLoc":[0.6016667,0.15691753],"poly":[0.5783333,0.12470104,0.625,0.12470104,0.625,0.18784536,0.5783333,0.18784536]},{"character":"E","centerLoc":[0.685,0.15691753],"poly":[0.65833336,0.12470104,0.715,0.12470104,0.715,0.18784536,0.65833336,0.18784536]},{"character":"E","centerLoc":[0.78333336,0.15691753],"poly":[0.75333333,0.12470104,0.81666666,0.12470104,0.81666666,0.18784536,0.75333333,0.18784536]},{"character":"E","centerLoc":[0.88166666,0.15691753],"poly":[0.855,0.12341237,0.9116667,0.12341237,0.9116667,0.19042268,0.855,0.19042268]}]},{"left":0.10999999940395355,"right":0.1733333319425583,"top":0.2458350509405136,"bottom":0.29351547360420227,"score":0.7904122471809387,"content":"e","characters":[{"character":"e","centerLoc":[0.14,0.26774228],"poly":[0.11,0.24583505,0.17333333,0.24583505,0.17333333,0.29351547,0.11,0.29351547]}]},{"left":0.18333333730697632,"right":0.9133333563804626,"top":0.24196907877922058,"bottom":0.29609280824661255,"score":1,"content":"e: ee e e eee","characters":[{"character":"e","centerLoc":[0.23166667,0.26903093],"poly":[0.20666666,0.25098968,0.255,0.25098968,0.255,0.28836083,0.20666666,0.28836083]},{"character":":","centerLoc":[0.26833332,0.26903093],"poly":[0.255,0.26258764,0.28,0.26258764,0.28,0.27547425,0.255,0.27547425]},{"character":" ","centerLoc":[0.30166665,0.26774228],"poly":[0.28833333,0.25098968,0.31833333,0.25098968,0.31833333,0.28449485,0.28833333,0.28449485]},{"character":"e","centerLoc":[0.33333334,0.26903093],"poly":[0.31833333,0.25098968,0.35,0.25098968,0.35,0.28836083,0.31833333,0.28836083]},{"character":"e","centerLoc":[0.41833332,0.26903093],"poly":[0.39333335,0.25098968,0.44333333,0.25098968,0.44333333,0.2896495,0.39333335,0.2896495]},{"character":" ","centerLoc":[0.46333334,0.26774228],"poly":[0.44333333,0.25098968,0.48333335,0.25098968,0.48333335,0.28449485,0.44333333,0.28449485]},{"character":"e","centerLoc":[0.50333333,0.26903093],"poly":[0.48833334,0.25098968,0.52,0.25098968,0.52,0.28836083,0.48833334,0.28836083]},{"character":" ","centerLoc":[0.55833334,0.26645362],"poly":[0.5416666,0.25098968,0.575,0.25098968,0.575,0.2832062,0.5416666,0.2832062]},{"character":"e","centerLoc":[0.6,0.26774228],"poly":[0.575,0.25098968,0.625,0.25098968,0.625,0.28578353,0.575,0.28578353]},{"character":" ","centerLoc":[0.6433333,0.26645362],"poly":[0.625,0.25098968,0.6616667,0.25098968,0.6616667,0.2832062,0.625,0.2832062]},{"character":"e","centerLoc":[0.70166665,0.26774228],"poly":[0.665,0.25098968,0.74,0.25098968,0.74,0.28578353,0.665,0.28578353]},{"character":"e","centerLoc":[0.79333335,0.26903093],"poly":[0.745,0.25098968,0.84,0.25098968,0.84,0.28836083,0.745,0.28836083]},{"character":"e","centerLoc":[0.86833334,0.27031958],"poly":[0.84,0.25098968,0.8983333,0.25098968,0.8983333,0.29093814,0.84,0.29093814]}]}]}}
		// const tmpData1 = {"result":{"text":[{"left":0.07899999618530273,"right":0.42899999022483826,"top":0.07959794253110886,"bottom":0.11568041145801544,"score":0.992110013961792,"content":"CTrace,write,and say.","characters":[{"character":"C","centerLoc":[0.10733333,0.09635052],"poly":[0.09066667,0.07959794,0.12566666,0.07959794,0.12566666,0.11310309,0.09066667,0.11310309]},{"character":"T","centerLoc":[0.139,0.09506186],"poly":[0.13233334,0.08604124,0.14733332,0.08604124,0.14733332,0.10408248,0.13233334,0.10408248]},{"character":"r","centerLoc":[0.15233333,0.09635052],"poly":[0.14733332,0.09119588,0.15900001,0.09119588,0.15900001,0.10279381,0.14733332,0.10279381]},{"character":"a","centerLoc":[0.169,0.09763918],"poly":[0.16066667,0.09119588,0.17733334,0.09119588,0.17733334,0.10408248,0.16066667,0.10408248]},{"character":"c","centerLoc":[0.18566667,0.09763918],"poly":[0.17733334,0.09119588,0.194,0.09119588,0.194,0.10408248,0.17733334,0.10408248]},{"character":"e","centerLoc":[0.20066667,0.09763918],"poly":[0.194,0.09248454,0.209,0.09248454,0.209,0.10408248,0.194,0.10408248]},{"character":",","centerLoc":[0.219,0.09892784],"poly":[0.21066667,0.09248454,0.229,0.09248454,0.229,0.10537113,0.21066667,0.10537113]},{"character":"w","centerLoc":[0.23733333,0.09763918],"poly":[0.229,0.09248454,0.24566667,0.09248454,0.24566667,0.10408248,0.229,0.10408248]},{"character":"r","centerLoc":[0.25066668,0.09763918],"poly":[0.24566667,0.09248454,0.25733334,0.09248454,0.25733334,0.10408248,0.24566667,0.10408248]},{"character":"i","centerLoc":[0.26233333,0.09635052],"poly":[0.25733334,0.08861856,0.269,0.08861856,0.269,0.10408248,0.25733334,0.10408248]},{"character":"t","centerLoc":[0.274,0.09635052],"poly":[0.269,0.08861856,0.28066665,0.08861856,0.28066665,0.10408248,0.269,0.10408248]},{"character":"e","centerLoc":[0.28566664,0.09763918],"poly":[0.28066665,0.09248454,0.29233333,0.09248454,0.29233333,0.10408248,0.28066665,0.10408248]},{"character":",","centerLoc":[0.30066666,0.10150516],"poly":[0.29233333,0.09763918,0.309,0.09763918,0.309,0.1066598,0.29233333,0.1066598]},{"character":"a","centerLoc":[0.31733334,0.09892784],"poly":[0.309,0.09248454,0.32733333,0.09248454,0.32733333,0.10537113,0.309,0.10537113]},{"character":"n","centerLoc":[0.33566666,0.09892784],"poly":[0.32733333,0.09248454,0.34566668,0.09248454,0.34566668,0.10537113,0.32733333,0.10537113]},{"character":"d","centerLoc":[0.35233334,0.09635052],"poly":[0.34566668,0.08861856,0.36066666,0.08861856,0.36066666,0.10537113,0.34566668,0.10537113]},{"character":" ","centerLoc":[0.36566666,0.09506186],"poly":[0.36233333,0.08861856,0.369,0.08861856,0.369,0.10279381,0.36233333,0.10279381]},{"character":"s","centerLoc":[0.37566668,0.09892784],"poly":[0.369,0.09248454,0.384,0.09248454,0.384,0.10537113,0.369,0.10537113]},{"character":"a","centerLoc":[0.39066666,0.10021649],"poly":[0.384,0.09119588,0.399,0.09119588,0.399,0.10923712,0.384,0.10923712]},{"character":"y","centerLoc":[0.40566668,0.10150516],"poly":[0.399,0.09248454,0.41233334,0.09248454,0.41233334,0.11052577,0.399,0.11052577]},{"character":".","centerLoc":[0.41733333,0.10279381],"poly":[0.41233334,0.10021649,0.424,0.10021649,0.424,0.10537113,0.41233334,0.10537113]}]},{"left":0.07566666603088379,"right":0.9523333311080933,"top":0.11052577197551727,"bottom":0.19557732343673706,"score":0.9962258338928223,"content":"CcccCCCCC","characters":[{"character":"C","centerLoc":[0.134,0.14918557],"poly":[0.10566667,0.11052577,0.16566667,0.11052577,0.16566667,0.19042268,0.10566667,0.19042268]},{"character":"c","centerLoc":[0.229,0.15562886],"poly":[0.19233333,0.12470104,0.27066666,0.12470104,0.27066666,0.19042268,0.19233333,0.19042268]},{"character":"c","centerLoc":[0.324,0.15562886],"poly":[0.28566664,0.12470104,0.36233333,0.12470104,0.36233333,0.19042268,0.28566664,0.19042268]},{"character":"c","centerLoc":[0.419,0.14918557],"poly":[0.38066667,0.11052577,0.45566666,0.11052577,0.45566666,0.19042268,0.38066667,0.19042268]},{"character":"C","centerLoc":[0.519,0.15562886],"poly":[0.48733333,0.12212372,0.5506667,0.12212372,0.5506667,0.19042268,0.48733333,0.19042268]},{"character":"C","centerLoc":[0.61399996,0.15562886],"poly":[0.58566666,0.12212372,0.6423334,0.12212372,0.6423334,0.19042268,0.58566666,0.19042268]},{"character":"C","centerLoc":[0.70566666,0.15305156],"poly":[0.674,0.1195464,0.7406666,0.1195464,0.7406666,0.19042268,0.674,0.19042268]},{"character":"C","centerLoc":[0.8006667,0.15176289],"poly":[0.7723334,0.11696908,0.8323333,0.11696908,0.8323333,0.18784536,0.7723334,0.18784536]},{"character":"C","centerLoc":[0.8923334,0.15305156],"poly":[0.8573333,0.11696908,0.929,0.11696908,0.929,0.19042268,0.8573333,0.19042268]}]},{"left":0.10400000214576721,"right":0.9423333406448364,"top":0.24068041145801544,"bottom":0.29609280824661255,"score":0.9850702285766602,"content":"CCCCCCCCC","characters":[{"character":"C","centerLoc":[0.14566666,0.26903093],"poly":[0.12733334,0.24970104,0.164,0.24970104,0.164,0.28707218,0.12733334,0.28707218]},{"character":"C","centerLoc":[0.23566666,0.26903093],"poly":[0.209,0.24970104,0.264,0.24970104,0.264,0.28707218,0.209,0.28707218]},{"character":"C","centerLoc":[0.32566667,0.26903093],"poly":[0.30233333,0.24970104,0.34733334,0.24970104,0.34733334,0.28707218,0.30233333,0.28707218]},{"character":"C","centerLoc":[0.41733333,0.26903093],"poly":[0.39733332,0.24970104,0.43733335,0.24970104,0.43733335,0.28707218,0.39733332,0.28707218]},{"character":"C","centerLoc":[0.53400004,0.26903093],"poly":[0.489,0.24970104,0.579,0.24970104,0.579,0.28707218,0.489,0.28707218]},{"character":"C","centerLoc":[0.62399995,0.26903093],"poly":[0.579,0.24970104,0.6706667,0.24970104,0.6706667,0.28707218,0.579,0.28707218]},{"character":"C","centerLoc":[0.70066667,0.26516497],"poly":[0.6706667,0.24583505,0.73399997,0.24583505,0.73399997,0.28578353,0.6706667,0.28578353]},{"character":"C","centerLoc":[0.794,0.26516497],"poly":[0.73399997,0.24583505,0.8573333,0.24583505,0.8573333,0.28578353,0.73399997,0.28578353]},{"character":"C","centerLoc":[0.88900006,0.27031958],"poly":[0.8573333,0.24970104,0.919,0.24970104,0.919,0.29093814,0.8573333,0.29093814]}]}]}}
		// const tmpData1 = {  "result" : {    "text" : [      {        "bottom" : 0.12310344725847244,        "top" : 0.0817241370677948,        "score" : 6.4884182106673037e+28,        "content" : "CTrace, write,and say.",        "right" : 0.4464285671710968,        "left" : 0.071428574621677399      },      {        "bottom" : 0.21137930452823639,        "top" : 0.12448275834321976,        "score" : 6.4884182106673037e+28,        "content" : "AAA AAA",        "right" : 0.69285714626312256,        "left" : 0.078571431338787079      },      {        "bottom" : 0.30241379141807556,        "top" : 0.25689655542373657,        "score" : 6.4884182106673037e+28,        "content" : "O1o",        "right" : 0.39642858505249023,        "left" : 0.19285714626312256      }    ]  }}
		// const tmpData1 = {"result":{"text":[{"left":0.08800879865884781,"right":0.42794278264045715,"top":0.010067113675177097,"bottom":0.16778524219989777,"score":1,"content":"CTrace,write,and say."},{"left":0.09350935369729996,"right":0.48184818029403687,"top":0.1845637559890747,"bottom":0.46644294261932373,"score":0.9882554411888123,"content":"AAAA"},{"left":0.5731573104858398,"right":0.6347634792327881,"top":0.20469798147678375,"bottom":0.463087260723114,"score":0.9638504385948181,"content":"A"},{"left":0.751375138759613,"right":0.8129813075065613,"top":0.20134228467941284,"bottom":0.4563758373260498,"score":0.8285241723060608,"content":"A"},{"left":0.5665566325187683,"right":0.6281628012657166,"top":0.6677852272987366,"bottom":0.8791946172714233,"score":0.8251835703849792,"content":"a"}]}}
		// const tmpData1 = {"result":{"text":[{"left":0,"right":0.33299797773361206,"top":0.0971250981092453,"bottom":0.12354312092065811,"content":1,"text":"race,write,and say."},{"left":0.14084507524967194,"right":0.9476861357688904,"top":0.13131313025951385,"bottom":0.21445220708847046,"content":0.9066159129142761,"text":"AAAA-A-AA"},{"left":0.28470826148986816,"right":0.9315895438194275,"top":0.2735042870044708,"bottom":0.32867133617401123,"content":0.9610617756843567,"text":"aaaq qa"},{"left":0.03018108569085598,"right":0.6438632011413574,"top":0.37995338439941406,"bottom":0.41025641560554504,"content":1,"text":"Listen. Then write Aa or cross it out. o5"},{"left":0.636820912361145,"right":0.7655935883522034,"top":0.4755244851112366,"bottom":0.5314685106277466,"content":0.8729087710380554,"text":"Aa"},{"left":0.10663983970880508,"right":0.11167001724243164,"top":0.5788655877113342,"bottom":0.6021755933761597,"content":0.7464486360549927,"text":"4"},{"left":0.1589537262916565,"right":0.29074445366859436,"top":0.5936285853385925,"bottom":0.6596736311912537,"content":0.8887001872062683,"text":"Aa"},{"left":0.6549295783042908,"right":0.7786720395088196,"top":0.5920745730400085,"bottom":0.6643356680870056,"content":0.9307805895805359,"text":"Aa"},{"left":0.11267605423927307,"right":0.4034205377101898,"top":0.7700077891349792,"bottom":0.807303786277771,"content":1,"text":"Lusten and chant, bd"},{"left":0.28973841667175293,"right":0.7162978053092957,"top":0.9254079461097717,"bottom":0.9712509512901306,"content":0.9342746138572693,"text":"户藤미 Ow"},{"left":0.8158953785896301,"right":0.7203219532966614,"top":0.9611499905586243,"bottom":0.9370629191398621,"content":0.7845855951309204,"text":"0章"}]}}
		cb(tmpData1);
		return;
		const tmpData = 
		{
			"code":200000,
			"message":"success",
			"result":{
					"homography":{
							"matrix":[
									[
											1.4966796485557876,
											0.5865544493734395,
											46.43280157429157
									],
									[
											-0.01005137610702238,
											1.4984154182794625,
											96.67508554672378
									],
									[
											0.000019639357377687945,
											0.001378134169965562,
											1
									]
							],
							"query_size":[
									640,
									832
							],
							"support_size":[
									640,
									480
							]
					},
					"support_results":[
							[
									[
											0.2924,
											0.1243,
											0.3488,
											0.1873,
											"A",
											0.9908210039138794
									],
									[
											0.3907,
											0.1245,
											0.4472,
											0.1909,
											"A",
											0.9895601272583008
									],
									[
											0.7505,
											0.1161,
											0.8179,
											0.1909,
											"A",
											0.9865421056747437
									],
									[
											0.8503,
											0.1128,
											0.9112,
											0.1917,
											"A",
											0.9810258150100708
									],
									[
											0.6587,
											0.1186,
											0.719,
											0.186,
											"A",
											0.9783920049667358
									],
									[
											0.4766,
											0.1212,
											0.5328,
											0.1916,
											"A",
											0.9687917828559875
									],
									[
											0.5683,
											0.1199,
											0.6217,
											0.1859,
											"A",
											0.9639236927032471
									],
									[
											0.7852,
											0.2524,
											0.8253,
											0.288,
											"a",
											0.9914705753326416
									],
									[
											0.5002,
											0.2517,
											0.5432,
											0.2862,
											"a",
											0.9906148314476013
									],
									[
											0.6927,
											0.2471,
											0.7312,
											0.2832,
											"a",
											0.9835354089736938
									],
									[
											0.5963,
											0.2489,
											0.6354,
											0.2856,
											"a",
											0.9809314608573914
									],
									[
											0.4034,
											0.2494,
											0.4504,
											0.2877,
											"a",
											0.9800149202346802
									],
									[
											0.8807,
											0.248,
											0.9223,
											0.2903,
											"a",
											0.9736253023147583
									],
									[
											0.3024,
											0.2486,
											0.3559,
											0.2896,
											"a",
											0.9720337986946106
									]
							]
					],
					"text":[
							{
									"bbox":[
											{
													"x1":0.2924,
													"y1":0.1243
											},
											{
													"x2":0.3488,
													"y2":0.1243
											},
											{
													"x3":0.3488,
													"y3":0.1873
											},
											{
													"x4":0.2924,
													"y4":0.1873
											}
									],
									"content":"A",
									"score":0.9908210039138794
							},
							{
									"bbox":[
											{
													"x1":0.3907,
													"y1":0.1245
											},
											{
													"x2":0.4472,
													"y2":0.1245
											},
											{
													"x3":0.4472,
													"y3":0.1909
											},
											{
													"x4":0.3907,
													"y4":0.1909
											}
									],
									"content":"A",
									"score":0.9895601272583008
							},
							{
									"bbox":[
											{
													"x1":0.7505,
													"y1":0.1161
											},
											{
													"x2":0.8179,
													"y2":0.1161
											},
											{
													"x3":0.8179,
													"y3":0.1909
											},
											{
													"x4":0.7505,
													"y4":0.1909
											}
									],
									"content":"A",
									"score":0.9865421056747437
							},
							{
									"bbox":[
											{
													"x1":0.8503,
													"y1":0.1128
											},
											{
													"x2":0.9112,
													"y2":0.1128
											},
											{
													"x3":0.9112,
													"y3":0.1917
											},
											{
													"x4":0.8503,
													"y4":0.1917
											}
									],
									"content":"A",
									"score":0.9810258150100708
							},
							{
									"bbox":[
											{
													"x1":0.6587,
													"y1":0.1186
											},
											{
													"x2":0.719,
													"y2":0.1186
											},
											{
													"x3":0.719,
													"y3":0.186
											},
											{
													"x4":0.6587,
													"y4":0.186
											}
									],
									"content":"A",
									"score":0.9783920049667358
							},
							{
									"bbox":[
											{
													"x1":0.4766,
													"y1":0.1212
											},
											{
													"x2":0.5328,
													"y2":0.1212
											},
											{
													"x3":0.5328,
													"y3":0.1916
											},
											{
													"x4":0.4766,
													"y4":0.1916
											}
									],
									"content":"A",
									"score":0.9687917828559875
							},
							{
									"bbox":[
											{
													"x1":0.5683,
													"y1":0.1199
											},
											{
													"x2":0.6217,
													"y2":0.1199
											},
											{
													"x3":0.6217,
													"y3":0.1859
											},
											{
													"x4":0.5683,
													"y4":0.1859
											}
									],
									"content":"A",
									"score":0.9639236927032471
							},
							{
									"bbox":[
											{
													"x1":0.7852,
													"y1":0.2524
											},
											{
													"x2":0.8253,
													"y2":0.2524
											},
											{
													"x3":0.8253,
													"y3":0.288
											},
											{
													"x4":0.7852,
													"y4":0.288
											}
									],
									"content":"a",
									"score":0.9914705753326416
							},
							{
									"bbox":[
											{
													"x1":0.5002,
													"y1":0.2517
											},
											{
													"x2":0.5432,
													"y2":0.2517
											},
											{
													"x3":0.5432,
													"y3":0.2862
											},
											{
													"x4":0.5002,
													"y4":0.2862
											}
									],
									"content":"a",
									"score":0.9906148314476013
							},
							{
									"bbox":[
											{
													"x1":0.6927,
													"y1":0.2471
											},
											{
													"x2":0.7312,
													"y2":0.2471
											},
											{
													"x3":0.7312,
													"y3":0.2832
											},
											{
													"x4":0.6927,
													"y4":0.2832
											}
									],
									"content":"a",
									"score":0.9835354089736938
							},
							{
									"bbox":[
											{
													"x1":0.5963,
													"y1":0.2489
											},
											{
													"x2":0.6354,
													"y2":0.2489
											},
											{
													"x3":0.6354,
													"y3":0.2856
											},
											{
													"x4":0.5963,
													"y4":0.2856
											}
									],
									"content":"a",
									"score":0.9809314608573914
							},
							{
									"bbox":[
											{
													"x1":0.8807,
													"y1":0.248
											},
											{
													"x2":0.9223,
													"y2":0.248
											},
											{
													"x3":0.9223,
													"y3":0.2903
											},
											{
													"x4":0.8807,
													"y4":0.2903
											}
									],
									"content":"a",
									"score":0.9736253023147583
							},
							{
									"bbox":[
											{
													"x1":0.3024,
													"y1":0.2486
											},
											{
													"x2":0.3559,
													"y2":0.2486
											},
											{
													"x3":0.3559,
													"y3":0.2896
											},
											{
													"x4":0.3024,
													"y4":0.2896
											}
									],
									"content":"a",
									"score":0.9720337986946106
							}
					]
			}
	}
		// {
		// 	"code": 200000,
		// 	"message": "success",
		// 	"result": {
		// 		"support_results": [
		// 			[
		// 				[
		// 					0.49317359924316406,
		// 					0.25097235652010197,
		// 					0.5522325038909912,
		// 					0.288081715131967,
		// 					"a",
		// 					0.990108072757721
		// 				]
		// 			],
		// 			[
		// 				[
		// 					0.7815923094749451,
		// 					0.2423561773522615,
		// 					0.8420042395591736,
		// 					0.2829396176165032,
		// 					"a",
		// 					0.9900233745574951
		// 				]
		// 			],
		// 			[
		// 				[
		// 					0.5897714495658875,
		// 					0.24693736438131567,
		// 					0.6457504034042358,
		// 					0.2819446122459721,
		// 					"a",
		// 					0.9894896745681763
		// 				]
		// 			],
		// 			[
		// 				[
		// 					0.2031928449869156,
		// 					0.25154209940460914,
		// 					0.26929566264152527,
		// 					0.29193248868186233,
		// 					"a",
		// 					0.983356773853302
		// 				]
		// 			],
		// 			[
		// 				[
		// 					0.39285269379615784,
		// 					0.24877103711543316,
		// 					0.45319148898124695,
		// 					0.2872285145969844,
		// 					"a",
		// 					0.9817916750907898
		// 				]
		// 			],
		// 			[
		// 				[
		// 					0.30443957448005676,
		// 					0.2532131404780602,
		// 					0.3565950095653534,
		// 					0.2885934469473862,
		// 					"a",
		// 					0.9796608090400696
		// 				]
		// 			],
		// 			[
		// 				[
		// 					0.8672714233398438,
		// 					0.24161506162136312,
		// 					0.9294711947441101,
		// 					0.2848689417255425,
		// 					"a",
		// 					0.9749398231506348
		// 				]
		// 			],
		// 			[
		// 				[
		// 					0.680833101272583,
		// 					0.24406777752747533,
		// 					0.7436296343803406,
		// 					0.28508718252948045,
		// 					"a",
		// 					0.9576545357704163
		// 				]
		// 			],
		// 			[
		// 				[
		// 					0.48491987586021423,
		// 					0.12172665519367754,
		// 					0.5459403395652771,
		// 					0.19091845712618705,
		// 					"A",
		// 					0.9131966829299927
		// 				]
		// 			],
		// 			[
		// 				[
		// 					0.5817452669143677,
		// 					0.12464039263645885,
		// 					0.6427905559539795,
		// 					0.18670312292435287,
		// 					"A",
		// 					0.8777841925621033
		// 				]
		// 			],
		// 			[
		// 				[
		// 					0.6734722256660461,
		// 					0.12392509000705718,
		// 					0.7303305864334106,
		// 					0.18485528186833022,
		// 					"A",
		// 					0.8367360234260559
		// 				]
		// 			],
		// 			[
		// 				[
		// 					0.8564218282699585,
		// 					0.1192738632772547,
		// 					0.9225841164588928,
		// 					0.19054701754113432,
		// 					"A",
		// 					0.7801001071929932
		// 				]
		// 			],
		// 			[
		// 				[
		// 					0.7687476277351379,
		// 					0.12338259301840243,
		// 					0.8205023407936096,
		// 					0.18305307740282176,
		// 					"A",
		// 					0.6130796670913696
		// 				]
		// 			],
		// 			[
		// 				[
		// 					0.3863550126552582,
		// 					0.1285817704766488,
		// 					0.4408574104309082,
		// 					0.18449943199799176,
		// 					"A",
		// 					0.5841907858848572
		// 				]
		// 			]
		// 		],
		// 		"text": [
		// 			{
		// 				"bbox": [
		// 					{
		// 						"x1": 0.49317359924316406,
		// 						"y1": 0.25097235652010197
		// 					},
		// 					{
		// 						"x2": 0.5522325038909912,
		// 						"y2": 0.25097235652010197
		// 					},
		// 					{
		// 						"x3": 0.5522325038909912,
		// 						"y3": 0.288081715131967
		// 					},
		// 					{
		// 						"x4": 0.49317359924316406,
		// 						"y4": 0.288081715131967
		// 					}
		// 				],
		// 				"content": "a",
		// 				"score": 0.990108072757721
		// 			},
		// 			{
		// 				"bbox": [
		// 					{
		// 						"x1": 0.7815923094749451,
		// 						"y1": 0.2423561773522615
		// 					},
		// 					{
		// 						"x2": 0.8420042395591736,
		// 						"y2": 0.2423561773522615
		// 					},
		// 					{
		// 						"x3": 0.8420042395591736,
		// 						"y3": 0.2829396176165032
		// 					},
		// 					{
		// 						"x4": 0.7815923094749451,
		// 						"y4": 0.2829396176165032
		// 					}
		// 				],
		// 				"content": "a",
		// 				"score": 0.9900233745574951
		// 			},
		// 			{
		// 				"bbox": [
		// 					{
		// 						"x1": 0.5897714495658875,
		// 						"y1": 0.24693736438131567
		// 					},
		// 					{
		// 						"x2": 0.6457504034042358,
		// 						"y2": 0.24693736438131567
		// 					},
		// 					{
		// 						"x3": 0.6457504034042358,
		// 						"y3": 0.2819446122459721
		// 					},
		// 					{
		// 						"x4": 0.5897714495658875,
		// 						"y4": 0.2819446122459721
		// 					}
		// 				],
		// 				"content": "a",
		// 				"score": 0.9894896745681763
		// 			},
		// 			{
		// 				"bbox": [
		// 					{
		// 						"x1": 0.2031928449869156,
		// 						"y1": 0.25154209940460914
		// 					},
		// 					{
		// 						"x2": 0.26929566264152527,
		// 						"y2": 0.25154209940460914
		// 					},
		// 					{
		// 						"x3": 0.26929566264152527,
		// 						"y3": 0.29193248868186233
		// 					},
		// 					{
		// 						"x4": 0.2031928449869156,
		// 						"y4": 0.29193248868186233
		// 					}
		// 				],
		// 				"content": "a",
		// 				"score": 0.983356773853302
		// 			},
		// 			{
		// 				"bbox": [
		// 					{
		// 						"x1": 0.39285269379615784,
		// 						"y1": 0.24877103711543316
		// 					},
		// 					{
		// 						"x2": 0.45319148898124695,
		// 						"y2": 0.24877103711543316
		// 					},
		// 					{
		// 						"x3": 0.45319148898124695,
		// 						"y3": 0.2872285145969844
		// 					},
		// 					{
		// 						"x4": 0.39285269379615784,
		// 						"y4": 0.2872285145969844
		// 					}
		// 				],
		// 				"content": "a",
		// 				"score": 0.9817916750907898
		// 			},
		// 			{
		// 				"bbox": [
		// 					{
		// 						"x1": 0.30443957448005676,
		// 						"y1": 0.2532131404780602
		// 					},
		// 					{
		// 						"x2": 0.3565950095653534,
		// 						"y2": 0.2532131404780602
		// 					},
		// 					{
		// 						"x3": 0.3565950095653534,
		// 						"y3": 0.2885934469473862
		// 					},
		// 					{
		// 						"x4": 0.30443957448005676,
		// 						"y4": 0.2885934469473862
		// 					}
		// 				],
		// 				"content": "a",
		// 				"score": 0.9796608090400696
		// 			},
		// 			{
		// 				"bbox": [
		// 					{
		// 						"x1": 0.8672714233398438,
		// 						"y1": 0.24161506162136312
		// 					},
		// 					{
		// 						"x2": 0.9294711947441101,
		// 						"y2": 0.24161506162136312
		// 					},
		// 					{
		// 						"x3": 0.9294711947441101,
		// 						"y3": 0.2848689417255425
		// 					},
		// 					{
		// 						"x4": 0.8672714233398438,
		// 						"y4": 0.2848689417255425
		// 					}
		// 				],
		// 				"content": "a",
		// 				"score": 0.9749398231506348
		// 			},
		// 			{
		// 				"bbox": [
		// 					{
		// 						"x1": 0.680833101272583,
		// 						"y1": 0.24406777752747533
		// 					},
		// 					{
		// 						"x2": 0.7436296343803406,
		// 						"y2": 0.24406777752747533
		// 					},
		// 					{
		// 						"x3": 0.7436296343803406,
		// 						"y3": 0.28508718252948045
		// 					},
		// 					{
		// 						"x4": 0.680833101272583,
		// 						"y4": 0.28508718252948045
		// 					}
		// 				],
		// 				"content": "a",
		// 				"score": 0.9576545357704163
		// 			},
		// 			{
		// 				"bbox": [
		// 					{
		// 						"x1": 0.48491987586021423,
		// 						"y1": 0.12172665519367754
		// 					},
		// 					{
		// 						"x2": 0.5459403395652771,
		// 						"y2": 0.12172665519367754
		// 					},
		// 					{
		// 						"x3": 0.5459403395652771,
		// 						"y3": 0.19091845712618705
		// 					},
		// 					{
		// 						"x4": 0.48491987586021423,
		// 						"y4": 0.19091845712618705
		// 					}
		// 				],
		// 				"content": "A",
		// 				"score": 0.9131966829299927
		// 			},
		// 			{
		// 				"bbox": [
		// 					{
		// 						"x1": 0.5817452669143677,
		// 						"y1": 0.12464039263645885
		// 					},
		// 					{
		// 						"x2": 0.6427905559539795,
		// 						"y2": 0.12464039263645885
		// 					},
		// 					{
		// 						"x3": 0.6427905559539795,
		// 						"y3": 0.18670312292435287
		// 					},
		// 					{
		// 						"x4": 0.5817452669143677,
		// 						"y4": 0.18670312292435287
		// 					}
		// 				],
		// 				"content": "A",
		// 				"score": 0.8777841925621033
		// 			},
		// 			{
		// 				"bbox": [
		// 					{
		// 						"x1": 0.6734722256660461,
		// 						"y1": 0.12392509000705718
		// 					},
		// 					{
		// 						"x2": 0.7303305864334106,
		// 						"y2": 0.12392509000705718
		// 					},
		// 					{
		// 						"x3": 0.7303305864334106,
		// 						"y3": 0.18485528186833022
		// 					},
		// 					{
		// 						"x4": 0.6734722256660461,
		// 						"y4": 0.18485528186833022
		// 					}
		// 				],
		// 				"content": "A",
		// 				"score": 0.8367360234260559
		// 			},
		// 			{
		// 				"bbox": [
		// 					{
		// 						"x1": 0.8564218282699585,
		// 						"y1": 0.1192738632772547
		// 					},
		// 					{
		// 						"x2": 0.9225841164588928,
		// 						"y2": 0.1192738632772547
		// 					},
		// 					{
		// 						"x3": 0.9225841164588928,
		// 						"y3": 0.19054701754113432
		// 					},
		// 					{
		// 						"x4": 0.8564218282699585,
		// 						"y4": 0.19054701754113432
		// 					}
		// 				],
		// 				"content": "A",
		// 				"score": 0.7801001071929932
		// 			},
		// 			{
		// 				"bbox": [
		// 					{
		// 						"x1": 0.7687476277351379,
		// 						"y1": 0.12338259301840243
		// 					},
		// 					{
		// 						"x2": 0.8205023407936096,
		// 						"y2": 0.12338259301840243
		// 					},
		// 					{
		// 						"x3": 0.8205023407936096,
		// 						"y3": 0.18305307740282176
		// 					},
		// 					{
		// 						"x4": 0.7687476277351379,
		// 						"y4": 0.18305307740282176
		// 					}
		// 				],
		// 				"content": "A",
		// 				"score": 0.6130796670913696
		// 			},
		// 			{
		// 				"bbox": [
		// 					{
		// 						"x1": 0.3863550126552582,
		// 						"y1": 0.1285817704766488
		// 					},
		// 					{
		// 						"x2": 0.4408574104309082,
		// 						"y2": 0.1285817704766488
		// 					},
		// 					{
		// 						"x3": 0.4408574104309082,
		// 						"y3": 0.18449943199799176
		// 					},
		// 					{
		// 						"x4": 0.3863550126552582,
		// 						"y4": 0.18449943199799176
		// 					}
		// 				],
		// 				"content": "A",
		// 				"score": 0.5841907858848572
		// 			}
		// 		]
		// 	}
		// }

		cb(tmpData);
	},


	photoCheckStart() {
		this.getPhotoData((data) => {
			this.photoEnd(data);
		})
	},


	updatePhotoCheck() {

		if (this.isOpenPhotoCheck) {

			this.photoCheckStart();

			this.isOpenPhotoCheck = false;
		}
	},


	update() {
		// this.updatePhotoCheck();
	},


	// ------------------------------------------------
	getSprNode(resName) {
		const sf = cc.find('Canvas/res/img/' + resName).getComponent(cc.Sprite).spriteFrame;
		const node = new cc.Node();
		node.addComponent(cc.Sprite).spriteFrame = sf;
		return node;
	},


	getSpriteFrimeByUrl(url, cb) {
		cc.loader.load({ url }, (err, img) => {
			const spriteFrame = new cc.SpriteFrame(img)
			if (cb) {
				cb(spriteFrame);
			}
		})
	},

	getSprNodeByUrl(url, cb) {
		const node = new cc.Node();
		const spr = node.addComponent(cc.Sprite);
		this.getSpriteFrimeByUrl(url, (sf) => {
			spr.spriteFrame = sf;
			if (cb) {
				cb(node);
			}
		})
	},

	_audioId: null,
	playAudioByUrl(audio_url, cb = null, loadcb = null, loop = false) {

		if (this._audioId) {
			cc.audioEngine.pause(this._audioId);
		}

		let audioId;

		if (audio_url) {
			cc.assetManager.loadRemote(audio_url, (err, audioClip) => {

				audioId = cc.audioEngine.play(audioClip, loop, 0.8);
				this._audioId = audioId;

				if (cb) {
					cc.audioEngine.setFinishCallback(audioId, () => {
						cb();
					});
				}

				if (loadcb) {
					loadcb(audioId);
				}

			});
		}
	},
	_timeoutIds: null,
	_intervalIds: null,
	// 生命周期
	onDestroy() {
		this.isDestroy = true;
		this._timeoutIds.forEach(id => {
			clearTimeout(id);
		});
		this._intervalIds.forEach(id => {
			clearInterval(id);
		});
		this.stopHelper();
	},


	// ------------------------------------------

});

