Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
middleLayer_for_debug
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
middleLayer_for_debug
Commits
6e8deec1
Commit
6e8deec1
authored
Mar 10, 2022
by
范雪寒
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://vcs.ireadabc.com/template/middleLayer_for_debug
parents
44973cb8
377a1fce
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
841 additions
and
848 deletions
+841
-848
middleLayer_for_debug.fire
...ts/middleLayer_for_debug/scene/middleLayer_for_debug.fire
+36
-9
air.js
assets/middleLayer_for_debug/script/air.js
+28
-8
middleLayer.js
assets/middleLayer_for_debug/script/middleLayer.js
+777
-831
No files found.
assets/middleLayer_for_debug/scene/middleLayer_for_debug.fire
View file @
6e8deec1
...
...
@@ -1030,14 +1030,14 @@
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.
5
,
"x": 0.
48
,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0
,
-25.600000000000023
,
0,
0,
0,
...
...
@@ -3822,8 +3822,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
4
50.324
,
-
195.849
,
4
45.858
,
-
212.224
,
0,
0,
0,
...
...
@@ -3993,8 +3993,8 @@
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "
加载资源
",
"_N$string": "
加载资源
",
"_string": "
获取设备信息
",
"_N$string": "
获取设备信息
",
"_fontSize": 20,
"_lineHeight": 40,
"_enableWrapText": false,
...
...
@@ -4177,7 +4177,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 4
62.25
,
"width": 4
40
,
"height": 50.4
},
"_anchorPoint": {
...
...
@@ -4229,8 +4229,8 @@
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "线上测试
1
:请输入课件ID",
"_N$string": "线上测试
1
:请输入课件ID",
"_string": "线上测试:请输入课件ID",
"_N$string": "线上测试:请输入课件ID",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,
...
...
@@ -6780,6 +6780,33 @@
"_N$reverse": false,
"_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",
"_name": "ConsoleNode",
...
...
assets/middleLayer_for_debug/script/air.js
View file @
6e8deec1
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
)
{
const
realAir
=
{
...
...
@@ -85,6 +87,9 @@ export function initAir(_this) {
_this
.
log
(
`===成功调用getAnswer=== queryObj ==
${
JSON
.
stringify
(
queryObj
)}
`
);
callback
&&
callback
(
null
);
},
addStar
()
{
_this
.
log
(
`===成功调用addStar===`
);
},
getTemplates
(
callback
)
{
_this
.
log
(
`===成功调用getTemplates===`
);
callback
&&
callback
(
null
);
...
...
@@ -102,8 +107,10 @@ export function initAir(_this) {
window
.
courseware
.
hasCalledStartRecord
=
true
;
window
.
courseware
.
callOcMethod
(
"
startRecord
"
,
{
isSpeechToText
});
},
stopRecord
(
callback
)
{
stopRecord
(
callback1
,
callback2
)
{
// 传两个参数是为了兼容以前
window
.
courseware
.
hasCalledStartRecord
=
false
;
const
callback
=
callback1
||
callback2
;
_this
.
log
(
`===成功调用stopRecord===`
);
if
(
!
callback
)
{
// 不传回调函数就表示取消评测
...
...
@@ -160,16 +167,21 @@ export function initAir(_this) {
_this
.
log
(
`===成功调用getEngineInfo===`
);
// 调用原生获取机器信息
window
.
air
.
getEngineInfoCallback
=
(
res
)
=>
{
if
(
typeof
(
res
)
==
'
string
'
)
{
window
.
air
.
engineInfo
=
res
;
callback
&&
callback
(
res
);
}
else
{
window
.
air
.
engineInfo
=
JSON
.
stringify
(
res
);
callback
&&
callback
(
JSON
.
stringify
(
res
));
}
window
.
air
.
getEngineInfoCallback
=
null
;
};
window
.
courseware
.
callOcMethod
(
"
getEngineInfo
"
,
{});
},
openOsmo
()
{
openOsmo
(
params
=
{}
)
{
window
.
courseware
.
hasCalledOpenOsmo
=
true
;
_this
.
log
(
`===成功调用openOsmo===`
);
window
.
courseware
.
callOcMethod
(
"
openOsmo
"
,
{}
);
_this
.
log
(
`===成功调用openOsmo===
${
JSON
.
stringify
(
params
)}
`
);
window
.
courseware
.
callOcMethod
(
"
openOsmo
"
,
params
);
},
closeOsmo
()
{
window
.
courseware
.
hasCalledOpenOsmo
=
false
;
...
...
@@ -216,9 +228,17 @@ export function initAir(_this) {
}
else
if
(
cc
.
sys
.
isNative
&&
cc
.
sys
.
os
==
cc
.
sys
.
OS_WINDOWS
)
{
console
.
log
(
'
汪汪汪
'
)
}
else
{
console
.
error
(
'
非源生环境
'
);
console
.
error
(
`非源生环境,网页版不支持
${
method
}
方法,将返回此方法的Mock数据以便于网页版调试使用`
);
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数据,请联系技术支持人员添加`
);
}
}
},
...
...
assets/middleLayer_for_debug/script/middleLayer.js
View file @
6e8deec1
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment