Commit 9701841a authored by 范雪寒's avatar 范雪寒

feat:

parent 2f21aa20
......@@ -59,7 +59,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
async startStep2() {
const ps1 = this.asyncPlayAudioByUrl(this.data.pageArr[this.currentPageIdx].hotZoneItemArr[this.currentPartIdx].audio_url);
const ps2 = this.checkPart();
await Promise.all([ ps1, ps2 ]);
await Promise.all([ps1, ps2]);
const pageIdxMap = this.data.pageArr.map((page, pageIdx) => {
return page.hotZoneItemArr.map(item => pageIdx);
}).flat();
const middleLayer = cc.find('middleLayer');
if (middleLayer) {
......@@ -67,6 +72,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
middleLayerComponent.setData('NJ_game_select', {
folderId: this.folderId,
courseId: this.courseId,
pageIdxMap: pageIdxMap,
partLength: this.getPartLength(),
step: this.step,
currentPageIdx: this.currentPageIdx,
......@@ -78,9 +84,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
getPartLength() {
const pageIdxMap = this.data.pageArr.map((page, pageIdx)=>page.hotZoneItemArr.map(item=>pageIdx)).flat();
console.log('pageIdxMap = ' + JSON.stringify(pageIdxMap));
return this.data.pageArr.map(page => page.hotZoneItemArr).flat().length;
}
......@@ -94,7 +97,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 定时三秒检测
const timeout = new Promise((resolve, reject) => {
setTimeout(() => {
if(!checkSuccess){
if (!checkSuccess) {
window["courseware"].closeOsmoFingerRead();
}
reject(new Error('checkpage timeout'));
......
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