Commit 19e7ac6e authored by liujiangnan's avatar liujiangnan

feat: 添加其他原生方法

parent 1ef49150
......@@ -19,6 +19,9 @@ export function initAir(_this) {
_this.log(`***成功调用osmoFingerReadCallback***参数==${res}`);
},
getEngineInfoCallback: null,
recognitionCameraCallBack: null,
testCallBack: null,
recordCallBack: null,
onCourseInScreen: null,
}
window.courseware = {
......@@ -64,21 +67,55 @@ export function initAir(_this) {
},
startRecord(testText) {
_this.log(`===成功调用startRecord=== testText == ${testText}`);
this.callOcMethod("startRecord", {"params": testText});
},
stopRecord(_isgradepapers, _callback) {
_this.log(`===成功调用stopRecord=== _isgradepapers == ${_isgradepapers}`);
_callback && _callback(null);
let callback = _callback;
let isgradepapers;
if(_isgradepapers && typeof _isgradepapers === "function") {
callback = _isgradepapers;
isgradepapers = 1;
} else {
isgradepapers = _isgradepapers;
}
if(!callback){
// 不传回调函数就表示取消评测
this.callOcMethod("stopRecord", {isBreak: 1});
return;
}
// 结束录音
window.air.recordCallBack = (res) => {
callback && callback(res);
window.air.recordCallBack = null;
};
this.callOcMethod("stopRecord", {isBreak: 0, isGradePapers: isgradepapers});
},
startTest(testText) {
_this.log(`===成功调用startTest=== testText == ${testText}`);
this.callOcMethod("startTest", {"params": testText});
},
stopTest(callback) {
_this.log(`===成功调用stopTest===`);
callback && callback(null);
if(!callback){
// 不传回调函数就表示取消评测
this.callOcMethod("stopTest", {isBreak: 1});
return;
}
// 结束录音
window.air.testCallBack = (res) => {
callback && callback(res);
window.air.testCallBack = null;
};
this.callOcMethod("stopTest", {});
},
openRecognitionCamera(callback) {
_this.log(`===成功调用openRecognitionCamera===`);
callback && callback(null);
window.air.recognitionCameraCallBack = (res) => {
callback && callback(res);
window.air.recognitionCameraCallBack = null;
};
this.callOcMethod("openRecognitionCamera", {});
},
getEngineInfo(callback) {
_this.log(`===成功调用getEngineInfo===`);
......
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