Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NJ_game_select
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
NJ_game_select
Commits
867866bc
Commit
867866bc
authored
May 26, 2022
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:
parent
5507b240
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
85 additions
and
78 deletions
+85
-78
NJ_game_select.ts
assets/NJ_game_select/scene/NJ_game_select.ts
+85
-78
No files found.
assets/NJ_game_select/scene/NJ_game_select.ts
View file @
867866bc
...
...
@@ -85,25 +85,32 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
step
=
tmpData
.
step
||
0
;
folderId
=
tmpData
.
folderId
;
this
.
folderId
=
tmpData
.
folderId
;
middleLayerComponent
.
setData
(
'
NJ_game_select: partnerData
'
,
{
skeJsonData
:
this
.
data
.
skeJsonData
,
texJsonData
:
this
.
data
.
texJsonData
,
texPngData
:
this
.
data
.
texPngData
,
havePic
:
this
.
data
.
havePic
});
}
console
.
log
(
'
folderId =
'
+
folderId
);
const
resStr
=
await
asyncCallNetworkApiGet
(
'
/api/syllabus/v1/list
'
,
{
const
resStr
=
await
asyncCallNetworkApiGet
(
'
/api/syllabus/v1/list
'
,
{
pid
:
folderId
});
console
.
log
(
'
resStr =
'
+
resStr
);
const
res
=
JSON
.
parse
(
resStr
);
this
.
rows
=
res
.
rows
.
filter
(
row
=>
row
.
name
!=
'
指读索引
'
);
});
console
.
log
(
'
resStr =
'
+
resStr
);
const
res
=
JSON
.
parse
(
resStr
);
this
.
rows
=
res
.
rows
.
filter
(
row
=>
row
.
name
!=
'
指读索引
'
);
}
asyncCountDown
(
node
:
cc
.
Node
,
time
:
number
)
{
asyncCountDown
(
node
:
cc
.
Node
,
time
:
number
)
{
return
new
Promise
<
void
>
((
resolve
,
reject
)
=>
{
this
.
countDown
(
node
,
time
,
()
=>
{
resolve
();
});
});
}
countDown
(
node
:
cc
.
Node
,
time
:
number
,
callback
=
null
)
{
}
countDown
(
node
:
cc
.
Node
,
time
:
number
,
callback
=
null
)
{
const
progressComponent
=
node
.
getComponent
(
cc
.
ProgressBar
);
cc
.
tween
(
progressComponent
)
.
to
(
time
,
{
progress
:
0
})
...
...
@@ -111,9 +118,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
callback
&&
callback
();
})
.
start
();
}
}
updateView
()
{
updateView
()
{
const
page
=
cc
.
find
(
'
Canvas/step1/pad/mask/page
'
);
const
pageUrl
=
this
.
data
.
pageArr
[
this
.
currentPageIdx
].
bgItem
.
url
;
this
.
setNodeSpirteFrameByUrl
(
pageUrl
,
page
,
()
=>
{
...
...
@@ -149,9 +156,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
bgNode
.
color
=
cc
.
color
(
255
,
255
,
255
);
const
startBg
=
this
.
data
.
pageArr
[
this
.
currentPageIdx
].
startBg
;
this
.
setNodeSpirteFrameByUrl
(
startBg
,
bgNode
);
}
}
initListener
()
{
initListener
()
{
const
btn_return
=
cc
.
find
(
'
Canvas/btn_return
'
);
buttonOnClick
(
btn_return
,
()
=>
{
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
);
...
...
@@ -160,20 +167,20 @@ export default class SceneComponent extends MyCocosSceneComponent {
.
loadOnlineBundle
(
'
NJ_QianShuiTing
'
);
}
},
0.6
)
}
}
asyncPlayAudioByUrl
(
url
:
string
):
Promise
<
void
>
{
asyncPlayAudioByUrl
(
url
:
string
):
Promise
<
void
>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
playAudioByUrl
(
url
,
()
=>
{
resolve
();
});
});
}
}
setNodeSpirteFrameByUrl
(
url
:
string
,
node
:
cc
.
Node
,
callBack
=
null
)
{
setNodeSpirteFrameByUrl
(
url
:
string
,
node
:
cc
.
Node
,
callBack
=
null
)
{
cc
.
assetManager
.
loadRemote
(
url
,
(
err
,
tex
)
=>
{
node
.
getComponent
(
cc
.
Sprite
).
spriteFrame
=
new
cc
.
SpriteFrame
(
tex
);
callBack
&&
callBack
();
});
}
}
}
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