Commit f62290f6 authored by 范雪寒's avatar 范雪寒

feat: 更新弹窗

parent da6369ab
......@@ -26,6 +26,7 @@ export function initAir(_this) {
_this.log(`***成功调用osmoFingerReadCallback***参数==${res}`);
},
startScanCodeCallback: null,
needUpdateCallback: null,
getEngineInfoCallback: null,
recognitionCameraCallBack: null,
testCallBack: null,
......@@ -179,6 +180,15 @@ export function initAir(_this) {
};
window.courseware.callOcMethod("getEngineInfo", {});
},
needUpdate(label, url, callback) {
_this.log(`===成功调用needUpdate===`);
// 调用原生获取机器信息
window.air.needUpdateCallback = (res) => {
callback && callback(res);
window.air.needUpdateCallback = null;
};
window.courseware.callOcMethod("needUpdate", { label: label, url: url });
},
startScanCode(callback) {
_this.log(`===成功调用startScanCode===`);
// 调用原生开始扫码
......
......@@ -547,6 +547,12 @@ cc.Class({
});
});
cc.find('middleLayer/ui/BtnNeedUpdate').on('click', () => {
window.courseware.needUpdate('检测到更新:', 'http://www.baidu.com', (res) => {
this.showLog(res);
});
});
cc.find('middleLayer/ui/BtnOpenTest').on('click', () => {
window.courseware.startTest('apple');
});
......
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