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
040a0b77
Commit
040a0b77
authored
Feb 12, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 上送星星到后台
parent
f5085024
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
8 deletions
+22
-8
middleLayer.js
assets/middleLayer_for_iplayabc/script/middleLayer.js
+22
-8
No files found.
assets/middleLayer_for_iplayabc/script/middleLayer.js
View file @
040a0b77
...
...
@@ -162,7 +162,18 @@ cc.Class({
},
addStar
(
count
,
animationFlag
)
{
// TODO 添加星星的动画并且保存星星到后台
if
(
animationFlag
){
// TODO 添加星星的动画
}
this
.
callNetworkApiPost
(
this
.
baseApiUrl
,
`v1/terminal/star/save`
,
{
syllabus_id
:
this
.
courseItem
.
course_id
,
courseware_id
:
this
.
courseItem
.
id
,
engine_code
:
this
.
engineCode
,
template_name
:
this
.
courseItem
.
template_name
,
stars
:
count
,
})
},
preloadAll
()
{
...
...
@@ -622,16 +633,19 @@ cc.Class({
}
window
.
courseware
.
sendAnswer
=
(
answerObj
)
=>
{
this
.
log
(
"
===成功调用sendAnswer===
"
+
JSON
.
stringify
(
answerObj
));
this
.
callNetworkApiPost
(
`https://staging-teach.ireadabc.com`
,
`/api/oxford/courseware/v1/
${
this
.
courseItem
.
id
}
/saveanswer`
,
answerObj
,
(
data
)
=>
{
this
.
addStar
(
3
,
true
);
// 上报成绩则获得三颗星星并展示动画
this
.
callNetworkApiPost
(
this
.
baseApiUrl
,
`v1/terminal/save/answer`
,
{
syllabus_id
:
this
.
courseItem
.
course_id
,
courseware_id
:
this
.
courseItem
.
id
,
engine_code
:
this
.
engineCode
,
name
:
this
.
name
,
template_name
:
this
.
courseItem
.
template_name
,
result
:
JSON
.
stringify
(
answerObj
),
},
(
data
)
=>
{
answerObj
.
callback
&&
answerObj
.
callback
(
JSON
.
stringify
(
data
.
row
));
});
}
window
.
courseware
.
getAnswer
=
(
queryObj
,
callback
)
=>
{
this
.
log
(
"
===成功调用getAnswer===
"
+
JSON
.
stringify
(
queryObj
));
this
.
callNetworkApiGet
(
`http://staging-teach.ireadabc.com`
,
`/api/oxford/courseware/v1/
${
this
.
courseItem
.
id
}
/getanswer`
,
queryObj
,
(
data
)
=>
{
callback
&&
callback
(
JSON
.
stringify
(
data
.
rows
));
});
}
window
.
courseware
.
addStar
=
this
.
addStar
;
},
callNativeFunction
(
param
)
{
...
...
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