Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
AK09
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
AK09
Commits
9eb13bc0
Commit
9eb13bc0
authored
May 08, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: addServerListener
parent
572ae4f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
29 deletions
+25
-29
AK09.js
play/assets/AK09/scene/AK09.js
+24
-28
config.json
publish/publish/config.json
+1
-1
No files found.
play/assets/AK09/scene/AK09.js
View file @
9eb13bc0
...
@@ -64,8 +64,8 @@ cc.Class({
...
@@ -64,8 +64,8 @@ cc.Class({
getData
((
data
,
aspect
)
=>
{
getData
((
data
,
aspect
)
=>
{
console
.
log
(
'
data:
'
,
data
);
console
.
log
(
'
data:
'
,
data
);
if
(
window
[
'
air
'
]?.
airClassInfo
?.
user
?.
classRole
==
'
tea
'
)
{
if
(
window
[
'
air
'
]?.
airClassInfo
?.
user
?.
classRole
==
'
tea
'
)
{
this
.
isTeacher
=
true
;
this
.
isTeacher
=
true
;
}
}
this
.
data
=
data
||
this
.
getDefaultData
();
this
.
data
=
data
||
this
.
getDefaultData
();
this
.
data
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
data
))
this
.
data
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
data
))
...
@@ -117,7 +117,7 @@ cc.Class({
...
@@ -117,7 +117,7 @@ cc.Class({
addPreloadImage
()
{
addPreloadImage
()
{
const
arr
=
this
.
data
.
options
;
const
arr
=
this
.
data
.
options
;
if
(
arr
)
{
if
(
arr
)
{
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
this
.
_imageResList
.
push
({
url
:
arr
[
i
].
image
});
this
.
_imageResList
.
push
({
url
:
arr
[
i
].
image
});
}
}
}
}
...
@@ -134,47 +134,43 @@ cc.Class({
...
@@ -134,47 +134,43 @@ cc.Class({
addServerListener
()
{
addServerListener
()
{
const
c
=
window
.
courseware
;
window
.
air
.
onCourseInScreen
=
(
next
)
=>
{
if
(
!
c
)
{
return
;
}
c
.
onEvent
(
'
course-in-screen
'
,
(
data
,
next
)
=>
{
cc
.
find
(
'
Canvas
'
).
opacity
=
255
;
cc
.
find
(
'
Canvas
'
).
opacity
=
255
;
this
.
showTemplateStartAnima
();
this
.
showTemplateStartAnima
();
this
.
loadEnd
();
this
.
loadEnd
();
next
();
next
();
}
);
}
},
},
showTemplateStartAnima
()
{
showTemplateStartAnima
()
{
const
resDragonBone
=
cc
.
find
(
"
Canvas/res/anima/pageturn
"
)
const
resDragonBone
=
cc
.
find
(
"
Canvas/res/anima/pageturn
"
)
const
pageturn
=
cc
.
instantiate
(
resDragonBone
)
const
pageturn
=
cc
.
instantiate
(
resDragonBone
)
const
canvas
=
cc
.
find
(
'
Canvas
'
);
const
canvas
=
cc
.
find
(
'
Canvas
'
);
canvas
.
addChild
(
pageturn
,
100
);
canvas
.
addChild
(
pageturn
,
100
);
const
dragonDisplay
=
pageturn
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
const
dragonDisplay
=
pageturn
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
dragonDisplay
.
on
(
dragonBones
.
EventObject
.
COMPLETE
,
()
=>
{
dragonDisplay
.
on
(
dragonBones
.
EventObject
.
COMPLETE
,
()
=>
{
pageturn
.
removeFromParent
();
pageturn
.
removeFromParent
();
})
})
dragonDisplay
.
playAnimation
(
'
pageturn2
'
,
1
);
dragonDisplay
.
playAnimation
(
'
pageturn2
'
,
1
);
},
},
showTemplateEndAnima
()
{
showTemplateEndAnima
()
{
const
resDragonBone
=
cc
.
find
(
"
Canvas/res/anima/pageturn
"
)
const
resDragonBone
=
cc
.
find
(
"
Canvas/res/anima/pageturn
"
)
const
pageturn
=
cc
.
instantiate
(
resDragonBone
)
const
pageturn
=
cc
.
instantiate
(
resDragonBone
)
const
canvas
=
cc
.
find
(
'
Canvas
'
);
const
canvas
=
cc
.
find
(
'
Canvas
'
);
canvas
.
addChild
(
pageturn
,
100
);
canvas
.
addChild
(
pageturn
,
100
);
const
dragonDisplay
=
pageturn
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
const
dragonDisplay
=
pageturn
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
dragonDisplay
.
on
(
dragonBones
.
EventObject
.
COMPLETE
,
()
=>
{
dragonDisplay
.
on
(
dragonBones
.
EventObject
.
COMPLETE
,
()
=>
{
cc
.
tween
({})
cc
.
tween
({})
.
delay
(
1
)
.
delay
(
1
)
.
call
(()
=>
{
.
call
(()
=>
{
if
(
window
&&
window
.
courseware
&&
this
.
isTeacher
)
{
if
(
window
&&
window
.
courseware
&&
this
.
isTeacher
)
{
window
.
courseware
.
nextPage
();
window
.
courseware
.
nextPage
();
}
}
})
})
.
start
();
.
start
();
})
})
dragonDisplay
.
playAnimation
(
'
pageturn
'
,
1
);
dragonDisplay
.
playAnimation
(
'
pageturn
'
,
1
);
},
},
...
@@ -299,12 +295,12 @@ cc.Class({
...
@@ -299,12 +295,12 @@ cc.Class({
if
(
!
window
.
courseware
)
{
if
(
!
window
.
courseware
)
{
return
;
return
;
}
}
window
.
courseware
.
onEvent
(
'
clickOption
'
,
(
data
,
next
)
=>
{
window
.
courseware
.
onEvent
(
'
clickOption
'
,
async
(
data
,
next
)
=>
{
this
.
showOption
(
data
.
data
.
idx
);
await
this
.
showOption
(
data
.
data
.
idx
);
next
();
next
();
});
});
window
.
courseware
.
onEvent
(
'
clickQuestion
'
,
(
data
,
next
)
=>
{
window
.
courseware
.
onEvent
(
'
clickQuestion
'
,
async
(
data
,
next
)
=>
{
this
.
showQuestion
();
await
this
.
showQuestion
();
next
();
next
();
});
});
window
.
courseware
.
onEvent
(
'
hideOption
'
,
(
data
,
next
)
=>
{
window
.
courseware
.
onEvent
(
'
hideOption
'
,
(
data
,
next
)
=>
{
...
@@ -445,7 +441,7 @@ cc.Class({
...
@@ -445,7 +441,7 @@ cc.Class({
async
showOption
(
idx
)
{
async
showOption
(
idx
)
{
console
.
log
(
"
idx:
"
,
idx
);
console
.
log
(
"
idx:
"
,
idx
);
const
optionNode
=
cc
.
find
(
`Canvas/bg/book/option/option_
${
idx
}
`
);
const
optionNode
=
cc
.
find
(
`Canvas/bg/book/option/option_
${
idx
}
`
);
if
(
!
optionNode
)
{
if
(
!
optionNode
)
{
console
.
log
(
"
!optionNode:
"
);
console
.
log
(
"
!optionNode:
"
);
...
@@ -592,7 +588,7 @@ cc.Class({
...
@@ -592,7 +588,7 @@ cc.Class({
questionNode
.
hideAction
=
null
;
questionNode
.
hideAction
=
null
;
})
})
.
start
();
.
start
();
}
}
},
},
playAudioByNodeName
(
name
)
{
playAudioByNodeName
(
name
)
{
...
...
publish/publish/config.json
View file @
9eb13bc0
{
"ios"
:{
"sceneName"
:
"AK09"
,
"version"
:
"fcbf3"
},
"android"
:{
"sceneName"
:
"AK09"
,
"version"
:
"fcbf3"
}}
{
"ios"
:{
"sceneName"
:
"AK09"
,
"version"
:
"2a5a4"
},
"android"
:{
"sceneName"
:
"AK09"
,
"version"
:
"2a5a4"
}}
\ No newline at end of file
\ No newline at end of file
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