Commit 29416e3c authored by liujiangnan's avatar liujiangnan

fix: 索引页跳转错误问题

parent ba04a86e
...@@ -95,13 +95,23 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -95,13 +95,23 @@ export default class SceneComponent extends MyCocosSceneComponent {
}); });
} }
jumpToCourseWare(this.rows[this.currentPartIdx].id); const realPartIndex = this.getPartToRowIndex();
jumpToCourseWare(this.rows[realPartIndex].id);
} }
getPartLength() { getPartLength() {
return this.data.pageArr.map(page => page.hotZoneItemArr).flat().length; return this.data.pageArr.map(page => page.hotZoneItemArr).flat().length;
} }
getPartToRowIndex() {
let index = 0;
for (let i=0; i<this.currentPageIdx; i++) {
index += this.data.pageArr[i].hotZoneItemArr.length;
}
index += this.currentPartIdx;
return index;
}
checkPage() { checkPage() {
if (!window["courseware"] || cc.sys.isBrowser) { if (!window["courseware"] || cc.sys.isBrowser) {
// 没有中间层的话,直接判断为检测成功 // 没有中间层的话,直接判断为检测成功
......
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