Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
middleLayer_for_iplayabc
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_iplayabc
Commits
631b714c
Commit
631b714c
authored
Feb 28, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:
parent
9c500069
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
19 deletions
+20
-19
air.js
assets/middleLayer_for_iplayabc/script/air.js
+20
-19
No files found.
assets/middleLayer_for_iplayabc/script/air.js
View file @
631b714c
...
@@ -96,22 +96,17 @@ export function initAir(_this) {
...
@@ -96,22 +96,17 @@ export function initAir(_this) {
gameEnd
()
{
gameEnd
()
{
_this
.
log
(
`===成功调用gameEnd===`
);
_this
.
log
(
`===成功调用gameEnd===`
);
},
},
startRecord
(
testText
)
{
// isSpeechToText 1: 录音转文本,0:纯录音
_this
.
log
(
`===成功调用startRecord=== testText ==
${
testText
}
`
);
startRecord
(
isSpeechToText
)
{
_this
.
log
(
`===成功调用startRecord=== isSpeechToText ==
${
isSpeechToText
}
`
);
window
.
courseware
.
hasCalledStartRecord
=
true
;
window
.
courseware
.
hasCalledStartRecord
=
true
;
window
.
courseware
.
callOcMethod
(
"
startRecord
"
,
{
"
params
"
:
test
Text
});
window
.
courseware
.
callOcMethod
(
"
startRecord
"
,
{
isSpeechTo
Text
});
},
},
stopRecord
(
_isgradepapers
,
_callback
)
{
stopRecord
(
callback1
,
callback2
)
{
// 传两个参数是为了兼容以前
window
.
courseware
.
hasCalledStartRecord
=
false
;
window
.
courseware
.
hasCalledStartRecord
=
false
;
_this
.
log
(
`===成功调用stopRecord=== _isgradepapers ==
${
_isgradepapers
}
`
);
const
callback
=
callback1
||
callback2
;
let
callback
=
_callback
;
_this
.
log
(
`===成功调用stopRecord===`
);
let
isgradepapers
;
if
(
_isgradepapers
&&
typeof
_isgradepapers
===
"
function
"
)
{
callback
=
_isgradepapers
;
isgradepapers
=
1
;
}
else
{
isgradepapers
=
_isgradepapers
;
}
if
(
!
callback
)
{
if
(
!
callback
)
{
// 不传回调函数就表示取消评测
// 不传回调函数就表示取消评测
window
.
courseware
.
callOcMethod
(
"
stopRecord
"
,
{
isBreak
:
1
});
window
.
courseware
.
callOcMethod
(
"
stopRecord
"
,
{
isBreak
:
1
});
...
@@ -119,10 +114,12 @@ export function initAir(_this) {
...
@@ -119,10 +114,12 @@ export function initAir(_this) {
}
}
// 结束录音
// 结束录音
window
.
air
.
recordCallBack
=
(
res
)
=>
{
window
.
air
.
recordCallBack
=
(
res
)
=>
{
callback
&&
callback
(
JSON
.
stringify
(
res
));
res
=
typeof
(
res
)
==
'
string
'
?
res
:
JSON
.
stringify
(
res
);
_this
.
log
(
`===成功调用recordCallBack=== res ==
${
res
}
`
);
callback
&&
callback
(
res
);
window
.
air
.
recordCallBack
=
null
;
window
.
air
.
recordCallBack
=
null
;
};
};
window
.
courseware
.
callOcMethod
(
"
stopRecord
"
,
{
isBreak
:
0
,
isGradePapers
:
isgradepapers
});
window
.
courseware
.
callOcMethod
(
"
stopRecord
"
,
{
isBreak
:
0
});
},
},
startTest
(
testText
,
option
)
{
startTest
(
testText
,
option
)
{
window
.
courseware
.
hasCalledStartTest
=
true
;
window
.
courseware
.
hasCalledStartTest
=
true
;
...
@@ -176,10 +173,10 @@ export function initAir(_this) {
...
@@ -176,10 +173,10 @@ export function initAir(_this) {
};
};
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
;
...
@@ -226,9 +223,13 @@ export function initAir(_this) {
...
@@ -226,9 +223,13 @@ 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
,
uuid
:
'
debug-xxxxxx-xxxxxx
'
});
window
.
air
.
getEngineInfoCallback
({
isDev
:
1
,
uuid
:
'
debug-xxxxxx-xxxxxx
'
});
}
else
if
(
method
==
''
)
{
}
else
{
console
.
error
(
`
${
method
}
方法还没有Mock数据,请联系技术支持人员添加`
);
}
}
}
}
},
},
...
...
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