Commit c63621fc authored by liujiangnan's avatar liujiangnan

test

parent fc59198b
......@@ -165,16 +165,32 @@ export default class SceneComponent extends MyCocosSceneComponent {
};
const pageId = this.data.pageArr[this.currentPageIdx].pageIdx;
return new Promise<void>((resolve, reject) => {
let testCount = 0;
window["air"].osmoFingerReadCallback = (result) => {
const resultObj = JSON.parse(result);
const p = resultObj.finger_pos_in_page;
if (p.x == -1 || p.y == -1) {
testCount ++;
if (testCount >= 5) {
// 检测一直没成功,直接放行
this.showTips(`检测超时`);
window["courseware"].closeOsmoFingerRead();
resolve();
}
return;
}
if (checkInRegion(p)) {
// 检测成功
window["courseware"].closeOsmoFingerRead();
resolve();
} else {
testCount ++;
if (testCount >= 5) {
// 检测一直没成功,直接放行
this.showTips(`检测超时`);
window["courseware"].closeOsmoFingerRead();
resolve();
}
}
};
window["courseware"].openOsmoFingerRead({
......
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