Commit e991a11f authored by liujiangnan's avatar liujiangnan

feat:

parent 1d54eaed
...@@ -137,11 +137,12 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -137,11 +137,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
checkSuccess = true; checkSuccess = true;
window["courseware"].closeOsmoFingerRead(); window["courseware"].closeOsmoFingerRead();
resolve(); resolve();
} else if (resultObj.error) {
this.showTips(resultObj.error);
} }
}; };
window["courseware"].openOsmoFingerRead({ window["courseware"].openOsmoFingerRead({
"page_id": pageId, "page": true,
"book_id": "opw1"
}) })
}); });
return Promise.race([check, timeout]); return Promise.race([check, timeout]);
...@@ -169,12 +170,11 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -169,12 +170,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
const h = p.y > rect.y && p.y < (rect.y + rect.height); const h = p.y > rect.y && p.y < (rect.y + rect.height);
return w && h; return w && h;
}; };
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) => {
let testCount = 0; let testCount = 0;
window["air"].osmoFingerReadCallback = (result) => { window["air"].osmoFingerReadCallback = (result) => {
const resultObj = JSON.parse(result); const p = JSON.parse(result);
const p = resultObj.finger_pos_in_page;
if (p.x == -1 || p.y == -1) { if (p.x == -1 || p.y == -1) {
testCount ++; testCount ++;
if (testCount >= 5) { if (testCount >= 5) {
...@@ -200,8 +200,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -200,8 +200,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
} }
}; };
window["courseware"].openOsmoFingerRead({ window["courseware"].openOsmoFingerRead({
"page_id": pageId, "page": false,
"book_id": "opw1"
}) })
}); });
} }
......
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