Commit b2554be0 authored by liujiangnan's avatar liujiangnan

debug

parent f5dceaa0
......@@ -35,23 +35,26 @@ export default class SceneComponent extends MyCocosSceneComponent {
async startStep1() {
await this.asyncPlayAudioByUrl(this.data.pageArr[this.currentPageIdx].startAudio);
await asyncDelay(0.3);
const circle = cc.find('Canvas/step1/pad/circle');
circle.active = true;
const progress = cc.find('Canvas/step1/pad/circle/progress');
const bar = progress.getComponent(cc.ProgressBar);
bar.progress = 1;
try {
await Promise.all([
this.asyncCountDown(progress, 3),
this.checkPage()
]);
this.step = 1;
} catch (error) {
// TODO 三秒内没有检测到对应页码的后续处理; 先加个提示框然后重新检测
this.showTips(`未检测到对应页面`);
circle.active = false;
await this.startStep1();
const circulate = async () => {
const circle = cc.find('Canvas/step1/pad/circle');
circle.active = true;
const progress = cc.find('Canvas/step1/pad/circle/progress');
const bar = progress.getComponent(cc.ProgressBar);
bar.progress = 1;
try {
await Promise.race([
this.asyncCountDown(progress, 3),
this.checkPage()
]);
this.step = 1;
} catch (error) {
this.showTips(`未检测到对应页面`);
circle.active = false;
await circulate();
}
}
await circulate();
}
async startStep2() {
await Promise.all([
......@@ -80,7 +83,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
// 定时三秒检测
const timeout = new Promise((resolve, reject) => {
setTimeout(() => reject(new Error('checkpage timeout')), 3000)
setTimeout(() => {
window["courseware"].closeOsmoFingerRead();
reject(new Error('checkpage timeout'));
}, 2800)
});
const pageId = this.data.pageArr[this.currentPageIdx].pageIdx;
......
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