Commit 6e8deec1 authored by 范雪寒's avatar 范雪寒
parents 44973cb8 377a1fce
...@@ -1030,14 +1030,14 @@ ...@@ -1030,14 +1030,14 @@
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
"x": 0.5, "x": 0.48,
"y": 0.5 "y": 0.5
}, },
"_trs": { "_trs": {
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, -25.600000000000023,
0, 0,
0, 0,
0, 0,
...@@ -3822,8 +3822,8 @@ ...@@ -3822,8 +3822,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
450.324, 445.858,
-195.849, -212.224,
0, 0,
0, 0,
0, 0,
...@@ -3993,8 +3993,8 @@ ...@@ -3993,8 +3993,8 @@
], ],
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_string": "加载资源", "_string": "获取设备信息",
"_N$string": "加载资源", "_N$string": "获取设备信息",
"_fontSize": 20, "_fontSize": 20,
"_lineHeight": 40, "_lineHeight": 40,
"_enableWrapText": false, "_enableWrapText": false,
...@@ -4177,7 +4177,7 @@ ...@@ -4177,7 +4177,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 462.25, "width": 440,
"height": 50.4 "height": 50.4
}, },
"_anchorPoint": { "_anchorPoint": {
...@@ -4229,8 +4229,8 @@ ...@@ -4229,8 +4229,8 @@
], ],
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_string": "线上测试1:请输入课件ID", "_string": "线上测试:请输入课件ID",
"_N$string": "线上测试1:请输入课件ID", "_N$string": "线上测试:请输入课件ID",
"_fontSize": 40, "_fontSize": 40,
"_lineHeight": 40, "_lineHeight": 40,
"_enableWrapText": true, "_enableWrapText": true,
...@@ -6780,6 +6780,33 @@ ...@@ -6780,6 +6780,33 @@
"_N$reverse": false, "_N$reverse": false,
"_id": "bc3W7j5EVJRaoW20bSToA3" "_id": "bc3W7j5EVJRaoW20bSToA3"
}, },
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 20
},
"_enabled": true,
"alignMode": 2,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1058.88,
"_originalHeight": 469.62,
"_id": "c87OiuHMRI7YOL5SUoikbx"
},
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "ConsoleNode", "_name": "ConsoleNode",
......
const testMockData = {"eof":1,"file":"/storage/emulated/0/Android/data/com.example.oxford/cache/shengtong/gradeVoice.mp3","audioUrl":"https://staging-teach.cdn.ireadabc.com/db48d49e122ba65aa7c5ee56963418a6.mp3","result":{"duration":"2.470","fluency":100,"integrity":100,"kernel_version":"3.6.7","overall":99,"pronunciation":99,"resource_version":"2.3.6","rhythm":0,"speed":78},"tokenId":"621c32543327932cfc000002"};
const recordMockData = {"text":"what can i do for you","audioUrl":"https://staging-teach.cdn.ireadabc.com/368ad56174f85e2ff1f39f12bac5c693.mp3"};
export function initAir(_this) { export function initAir(_this) {
const realAir = { const realAir = {
...@@ -85,6 +87,9 @@ export function initAir(_this) { ...@@ -85,6 +87,9 @@ export function initAir(_this) {
_this.log(`===成功调用getAnswer=== queryObj == ${JSON.stringify(queryObj)}`); _this.log(`===成功调用getAnswer=== queryObj == ${JSON.stringify(queryObj)}`);
callback && callback(null); callback && callback(null);
}, },
addStar() {
_this.log(`===成功调用addStar===`);
},
getTemplates(callback) { getTemplates(callback) {
_this.log(`===成功调用getTemplates===`); _this.log(`===成功调用getTemplates===`);
callback && callback(null); callback && callback(null);
...@@ -102,8 +107,10 @@ export function initAir(_this) { ...@@ -102,8 +107,10 @@ export function initAir(_this) {
window.courseware.hasCalledStartRecord = true; window.courseware.hasCalledStartRecord = true;
window.courseware.callOcMethod("startRecord", { isSpeechToText }); window.courseware.callOcMethod("startRecord", { isSpeechToText });
}, },
stopRecord(callback) { stopRecord(callback1, callback2) {
// 传两个参数是为了兼容以前
window.courseware.hasCalledStartRecord = false; window.courseware.hasCalledStartRecord = false;
const callback = callback1 || callback2;
_this.log(`===成功调用stopRecord===`); _this.log(`===成功调用stopRecord===`);
if (!callback) { if (!callback) {
// 不传回调函数就表示取消评测 // 不传回调函数就表示取消评测
...@@ -160,16 +167,21 @@ export function initAir(_this) { ...@@ -160,16 +167,21 @@ export function initAir(_this) {
_this.log(`===成功调用getEngineInfo===`); _this.log(`===成功调用getEngineInfo===`);
// 调用原生获取机器信息 // 调用原生获取机器信息
window.air.getEngineInfoCallback = (res) => { window.air.getEngineInfoCallback = (res) => {
window.air.engineInfo = res; if(typeof(res) == 'string') {
callback && callback(JSON.stringify(res)); window.air.engineInfo = res;
callback && callback(res);
} else {
window.air.engineInfo = JSON.stringify(res);
callback && callback(JSON.stringify(res));
}
window.air.getEngineInfoCallback = null; window.air.getEngineInfoCallback = null;
}; };
window.courseware.callOcMethod("getEngineInfo", {}); window.courseware.callOcMethod("getEngineInfo", {});
}, },
openOsmo() { openOsmo(params = {}) {
window.courseware.hasCalledOpenOsmo = true; window.courseware.hasCalledOpenOsmo = true;
_this.log(`===成功调用openOsmo===`); _this.log(`===成功调用openOsmo===${JSON.stringify(params)}`);
window.courseware.callOcMethod("openOsmo", {}); window.courseware.callOcMethod("openOsmo", params);
}, },
closeOsmo() { closeOsmo() {
window.courseware.hasCalledOpenOsmo = false; window.courseware.hasCalledOpenOsmo = false;
...@@ -216,9 +228,17 @@ export function initAir(_this) { ...@@ -216,9 +228,17 @@ export function initAir(_this) {
} else if (cc.sys.isNative && cc.sys.os == cc.sys.OS_WINDOWS) { } else if (cc.sys.isNative && cc.sys.os == cc.sys.OS_WINDOWS) {
console.log('汪汪汪') console.log('汪汪汪')
} else { } else {
console.error('非源生环境'); console.error(`非源生环境,网页版不支持${method}方法,将返回此方法的Mock数据以便于网页版调试使用`);
if(method == 'getEngineInfo'){ if(method == 'getEngineInfo'){
window.air.getEngineInfoCallback({isDev: 1}); window.air.getEngineInfoCallback({isDev: 1, uuid: 'debug-xxxxxx-xxxxxx'});
} else if (method == 'startTest') {
} else if (method == 'stopTest') {
window.air.testCallBack(testMockData);
} else if (method == 'startRecord') {
} else if (method == 'stopRecord') {
window.air.recordCallBack(recordMockData);
} else{
console.error(`${method}方法还没有Mock数据,请联系技术支持人员添加`);
} }
} }
}, },
......
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