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
63821a9c
Commit
63821a9c
authored
Feb 28, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 测试
parent
6295a3a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
air.js
assets/middleLayer_for_debug/script/air.js
+15
-4
middleLayer.js
assets/middleLayer_for_debug/script/middleLayer.js
+2
-2
No files found.
assets/middleLayer_for_debug/script/air.js
View file @
63821a9c
...
...
@@ -162,8 +162,13 @@ export function initAir(_this) {
_this
.
log
(
`===成功调用getEngineInfo===`
);
// 调用原生获取机器信息
window
.
air
.
getEngineInfoCallback
=
(
res
)
=>
{
window
.
air
.
engineInfo
=
res
;
callback
&&
callback
(
JSON
.
stringify
(
res
));
if
(
typeof
(
res
)
==
'
string
'
)
{
callback
&&
callback
(
res
);
window
.
air
.
engineInfo
=
JSON
.
stringify
(
res
);
}
else
{
callback
&&
callback
(
JSON
.
stringify
(
res
));
window
.
air
.
engineInfo
=
res
;
}
window
.
air
.
getEngineInfoCallback
=
null
;
};
window
.
courseware
.
callOcMethod
(
"
getEngineInfo
"
,
{});
...
...
@@ -218,9 +223,15 @@ 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
==
'
stopTest
'
)
{
window
.
air
.
testCallBack
({
});
}
else
{
console
.
error
(
`
${
method
}
方法还没有Mock数据,请联系技术支持人员添加`
);
}
}
},
...
...
assets/middleLayer_for_debug/script/middleLayer.js
View file @
63821a9c
...
...
@@ -315,13 +315,13 @@ cc.Class({
});
cc
.
find
(
'
middleLayer/ui/BtnOpenTest
'
).
on
(
'
click
'
,
()
=>
{
window
.
courseware
.
startTest
(
''
);
window
.
courseware
.
startTest
(
'
apple
'
);
});
cc
.
find
(
'
middleLayer/ui/BtnCloseTest
'
).
on
(
'
click
'
,
()
=>
{
window
.
courseware
.
stopTest
(
res
=>
{
this
.
log
(
'
--------录音评测返回结果 stopTest ---------
'
);
this
.
log
(
JSON
.
stringify
(
res
)
)
this
.
log
(
res
)
this
.
log
(
'
------------------------------
'
);
});
});
...
...
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