Commit d0d4798a authored by liujiangnan's avatar liujiangnan

debug

parent fc1185ad
...@@ -33,8 +33,8 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -33,8 +33,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
async startStep1() { async startStep1() {
await this.asyncPlayAudioByUrl(this.data.pageArr[this.currentPageIdx].startAudio); await this.asyncPlayAudioByUrl(this.data.pageArr[this.currentPageIdx].startAudio);
await asyncDelay(0.3);
const circulate = async () => { const circulate = async () => {
await asyncDelay(0.3);
const circle = cc.find('Canvas/step1/pad/circle'); const circle = cc.find('Canvas/step1/pad/circle');
circle.active = true; circle.active = true;
const progress = cc.find('Canvas/step1/pad/circle/progress'); const progress = cc.find('Canvas/step1/pad/circle/progress');
...@@ -42,12 +42,13 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -42,12 +42,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
bar.progress = 1; bar.progress = 1;
try { try {
await Promise.race([ await Promise.race([
this.asyncCountDown(progress, 3), this.asyncCountDown(progress, 10),
this.checkPage() this.checkPage()
]); ]);
this.step = 1; this.step = 1;
} catch (error) { } catch (error) {
this.showTips(`未检测到对应页面`); this.showTips(`未检测到对应页面`);
bar.progress = 1;
circle.active = false; circle.active = false;
await circulate(); await circulate();
} }
...@@ -88,7 +89,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -88,7 +89,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
window["courseware"].closeOsmoFingerRead(); window["courseware"].closeOsmoFingerRead();
} }
reject(new Error('checkpage timeout')); reject(new Error('checkpage timeout'));
}, 2800) }, 10000)
}); });
const pageId = this.data.pageArr[this.currentPageIdx].pageIdx; const pageId = this.data.pageArr[this.currentPageIdx].pageIdx;
const check = new Promise<void>((resolve, reject) => { const check = new Promise<void>((resolve, reject) => {
...@@ -131,7 +132,6 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -131,7 +132,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
const pageId = this.data.pageArr[this.currentPageIdx].pageIdx; const pageId = this.data.pageArr[this.currentPageIdx].pageIdx;
return new Promise<void>((resolve, reject) => { return new Promise<void>((resolve, reject) => {
window["air"].osmoFingerReadCallback = (result) => { window["air"].osmoFingerReadCallback = (result) => {
this.showTips("===========");
const resultObj = JSON.parse(result); const resultObj = JSON.parse(result);
const p = resultObj.finger_pos_in_page; const p = resultObj.finger_pos_in_page;
if (p.x == -1 || p.y == -1) { if (p.x == -1 || p.y == -1) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment