Commit 49d24721 authored by limingzhe's avatar limingzhe

fix: debug

parent 5105f7e6
...@@ -156,14 +156,15 @@ cc.Class({ ...@@ -156,14 +156,15 @@ cc.Class({
if (window.air) { if (window.air) {
window.air.osmoHandwritingMlkitCallback = (data) => {
window.air.osmoHandwritingCallback = (data) => {
if (!data) { if (!data) {
console.log('data is not exist!!!'); console.log('data is not exist!!!');
return; return;
} }
console.log('osmoHandwritingMlkitCallback data: ', data); console.log('osmoHandwritingCallback data: ', data);
if (typeof (data) == 'string') { if (typeof (data) == 'string') {
console.log('data is string '); console.log('data is string ');
...@@ -177,6 +178,28 @@ cc.Class({ ...@@ -177,6 +178,28 @@ cc.Class({
this.photoEnd(data); this.photoEnd(data);
} }
// window.air.osmoHandwritingMlkitCallback = (data) => {
// if (!data) {
// console.log('data is not exist!!!');
// return;
// }
// console.log('osmoHandwritingMlkitCallback data: ', data);
// if (typeof (data) == 'string') {
// console.log('data is string ');
// const dataObj = JSON.parse(data);
// this.photoEnd(dataObj);
// return;
// }
// // 哲学逻辑
// this.photoEnd(data);
// }
} }
}, },
...@@ -495,12 +518,29 @@ cc.Class({ ...@@ -495,12 +518,29 @@ cc.Class({
const cw = window.courseware; const cw = window.courseware;
if (!cw || !cw.openOsmoHandwritingMlkit) { if (!cw || !cw.openOsmoHandwriting) {
console.log('cw.openOsmoHandwritingMlkit not exist'); console.log('cw.openOsmoHandwriting not exist');
return; return;
} }
cw.openOsmoHandwritingMlkit(0.3);
const para = {
"library_id": "iplayabc",
'page_id': 5,
'book_id': 'opw1',
'part_name': 'c',
'is_hand_writing': true,
'is_line_link': false,
'ques_region' : [
0, 0.077,
1, 0.077,
1, 0.331,
0, 0.331,
]
}
cw.openOsmoHandwriting(para);
// setInterval(() => { // setInterval(() => {
...@@ -514,14 +554,21 @@ cc.Class({ ...@@ -514,14 +554,21 @@ cc.Class({
//结束检测 //结束检测
endTesting() { endTesting() {
const cw = window.courseware; const cw = window.courseware;
if (!cw || !cw.closeOsmoHandwritingMlkit) { if (!cw || !cw.closeOsmoHandwriting) {
return; return;
} }
cw.closeOsmoHandwritingMlkit(); cw.closeOsmoHandwriting();
// this.isTesting = false;
// const cw = window.courseware;
// if (!cw || !cw.closeOsmoHandwritingMlkit) {
// return;
// }
// cw.closeOsmoHandwritingMlkit();
// // this.isTesting = false;
}, },
photoEnd(data) { photoEnd(data) {
......
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