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
5da57ac7
Commit
5da57ac7
authored
Dec 07, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 调用停止之前先check
parent
84c4f7e6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
11 deletions
+30
-11
air.js
assets/middleLayer_for_debug/script/air.js
+25
-6
middleLayer.js
assets/middleLayer_for_debug/script/middleLayer.js
+5
-5
No files found.
assets/middleLayer_for_debug/script/air.js
View file @
5da57ac7
...
...
@@ -90,9 +90,11 @@ export function initAir(_this) {
},
startRecord
(
testText
)
{
_this
.
log
(
`===成功调用startRecord=== testText ==
${
testText
}
`
);
window
.
courseware
.
hasCalledStartRecord
=
true
;
window
.
courseware
.
callOcMethod
(
"
startRecord
"
,
{
"
params
"
:
testText
});
},
stopRecord
(
_isgradepapers
,
_callback
)
{
window
.
courseware
.
hasCalledStartRecord
=
false
;
_this
.
log
(
`===成功调用stopRecord=== _isgradepapers ==
${
_isgradepapers
}
`
);
let
callback
=
_callback
;
let
isgradepapers
;
...
...
@@ -115,10 +117,12 @@ export function initAir(_this) {
window
.
courseware
.
callOcMethod
(
"
stopRecord
"
,
{
isBreak
:
0
,
isGradePapers
:
isgradepapers
});
},
startTest
(
testText
)
{
window
.
courseware
.
hasCalledStartTest
=
true
;
_this
.
log
(
`===成功调用startTest=== testText ==
${
testText
}
`
);
window
.
courseware
.
callOcMethod
(
"
startTest
"
,
{
"
params
"
:
testText
});
},
stopTest
(
callback
)
{
window
.
courseware
.
hasCalledStartTest
=
false
;
_this
.
log
(
`===成功调用stopTest===`
);
if
(
!
callback
)
{
// 不传回调函数就表示取消评测
...
...
@@ -150,26 +154,32 @@ export function initAir(_this) {
window
.
courseware
.
callOcMethod
(
"
getEngineInfo
"
,
{});
},
openOsmo
()
{
window
.
courseware
.
hasCalledOpenOsmo
=
true
;
_this
.
log
(
`===成功调用openOsmo===`
);
window
.
courseware
.
callOcMethod
(
"
openOsmo
"
,
{});
},
closeOsmo
()
{
window
.
courseware
.
hasCalledOpenOsmo
=
false
;
_this
.
log
(
`===成功调用closeOsmo===`
);
window
.
courseware
.
callOcMethod
(
"
closeOsmo
"
,
{});
},
openOsmoHandwriting
()
{
window
.
courseware
.
hasCalledOpenOsmoHandwriting
=
true
;
_this
.
log
(
`===成功调用openOsmoHandwriting===`
);
window
.
courseware
.
callOcMethod
(
"
openOsmoHandwriting
"
,
{});
},
closeOsmoHandwriting
()
{
window
.
courseware
.
hasCalledOpenOsmoHandwriting
=
false
;
_this
.
log
(
`===成功调用closeOsmoHandwriting===`
);
window
.
courseware
.
callOcMethod
(
"
closeOsmoHandwriting
"
,
{});
},
openOsmoFingerRead
()
{
window
.
courseware
.
hasCalledOpenOsmoFingerRead
=
true
;
_this
.
log
(
`===成功调用openOsmoFingerRead===`
);
window
.
courseware
.
callOcMethod
(
"
openOsmoFingerRead
"
,
{});
},
closeOsmoFingerRead
()
{
window
.
courseware
.
hasCalledOpenOsmoFingerRead
=
false
;
_this
.
log
(
`===成功调用closeOsmoFingerRead===`
);
window
.
courseware
.
callOcMethod
(
"
closeOsmoFingerRead
"
,
{});
},
...
...
@@ -187,12 +197,21 @@ export function initAir(_this) {
}
},
freeAllOcMethod
()
{
if
(
window
.
courseware
.
hasCalledStartRecord
)
{
window
.
courseware
.
stopRecord
();
}
if
(
window
.
courseware
.
hasCalledStartTest
)
{
window
.
courseware
.
stopTest
();
}
if
(
window
.
courseware
.
hasCalledOpenOsmo
)
{
window
.
courseware
.
closeOsmo
();
}
if
(
window
.
courseware
.
hasCalledOpenOsmoHandwriting
)
{
window
.
courseware
.
closeOsmoHandwriting
();
}
if
(
window
.
courseware
.
hasCalledOpenOsmoFingerRead
)
{
window
.
courseware
.
closeOsmoFingerRead
();
}
}
};
}
assets/middleLayer_for_debug/script/middleLayer.js
View file @
5da57ac7
...
...
@@ -82,7 +82,7 @@ cc.Class({
},
preloadAll
()
{
if
(
window
.
preloadBundleAndSourcesFlag
)
{
if
(
window
.
preloadBundleAndSourcesFlag
)
{
// 只加载一次就行了
return
;
}
...
...
@@ -457,7 +457,7 @@ cc.Class({
if
(
this
.
courseItem
.
data
)
{
data
=
JSON
.
parse
(
this
.
courseItem
.
data
);
}
this
.
log
(
"
===成功调用getData===
"
+
this
.
courseItem
.
data
);
this
.
log
(
"
===成功调用getData===
"
+
this
.
courseItem
.
data
);
callback
&&
callback
(
data
);
}
window
.
courseware
.
nextPage
=
()
=>
{
...
...
@@ -467,13 +467,13 @@ cc.Class({
this
.
goPrePage
();
}
window
.
courseware
.
sendAnswer
=
(
answerObj
)
=>
{
this
.
log
(
"
===成功调用sendAnswer===
"
+
JSON
.
stringify
(
answerObj
));
this
.
log
(
"
===成功调用sendAnswer===
"
+
JSON
.
stringify
(
answerObj
));
this
.
callNetworkApiPost
(
`http://staging-teach.ireadabc.com`
,
`/api/oxford/courseware/v1/
${
this
.
courseItem
.
id
}
/saveanswer`
,
answerObj
,
(
data
)
=>
{
answerObj
.
callback
&&
answerObj
.
callback
(
JSON
.
stringify
(
data
.
row
));
});
}
window
.
courseware
.
getAnswer
=
(
queryObj
,
callback
)
=>
{
this
.
log
(
"
===成功调用getAnswer===
"
+
JSON
.
stringify
(
queryObj
));
this
.
log
(
"
===成功调用getAnswer===
"
+
JSON
.
stringify
(
queryObj
));
this
.
callNetworkApiGet
(
`http://staging-teach.ireadabc.com`
,
`/api/oxford/courseware/v1/
${
this
.
courseItem
.
id
}
/getanswer`
,
queryObj
,
(
datastr
)
=>
{
const
data
=
JSON
.
parse
(
datastr
);
callback
&&
callback
(
JSON
.
stringify
(
data
.
rows
));
...
...
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