Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
middleLayer_for_kyxq
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_kyxq
Commits
1ba0ac6f
Commit
1ba0ac6f
authored
Sep 27, 2023
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 单元页面
parent
2ec8b7f4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
65 deletions
+13
-65
UnitPage.ts
assets/middleLayer_for_kyxq/script/UnitPage.ts
+13
-65
No files found.
assets/middleLayer_for_kyxq/script/UnitPage.ts
View file @
1ba0ac6f
...
...
@@ -71,62 +71,6 @@ export default class NewClass extends cc.Component {
async
initUnitListView
()
{
const
dataBaseArr
=
[
[
{
text
:
"
apple
"
,
pic_url
:
"
https://staging-teach.cdn.ireadabc.com/5b4a2228deee47ef6ca2029a7a6adfa4.png
"
,
audio_url
:
"
https://staging-teach.cdn.ireadabc.com/ec8b6ea698103a474898bbcaec8c6ad2.mp3
"
},
{
text
:
"
cat
"
,
pic_url
:
"
https://staging-teach.cdn.ireadabc.com/100c6b50e6c846c712f12332a05446cc.png
"
,
audio_url
:
"
https://staging-teach.cdn.ireadabc.com/b0887ec7ab86516e10f1a33722ff1589.mp3
"
}
],
[
{
text
:
"
dog
"
,
pic_url
:
"
https://staging-teach.cdn.ireadabc.com/cdbfca8e7db0e05e0d776594e7872296.png
"
,
audio_url
:
"
https://staging-teach.cdn.ireadabc.com/d043f93e77866ac80e85148c4f0065c4.mp3
"
},
{
text
:
"
ant
"
,
pic_url
:
"
https://staging-teach.cdn.ireadabc.com/ed98242b08679b8b39f9ce34578ee614.png
"
,
audio_url
:
"
https://staging-teach.cdn.ireadabc.com/dfee6ae3a4de96774e97edcf9e20dfd5.mp3
"
},
{
text
:
"
bag
"
,
pic_url
:
"
https://staging-teach.cdn.ireadabc.com/7d83d91717e64ebe7474be1c5278eb44.png
"
,
audio_url
:
"
https://staging-teach.cdn.ireadabc.com/b9cd983101c534a6a0222cbda80f3a60.mp3
"
}
],
[
{
text
:
"
dog
"
,
pic_url
:
"
https://staging-teach.cdn.ireadabc.com/cdbfca8e7db0e05e0d776594e7872296.png
"
,
audio_url
:
"
https://staging-teach.cdn.ireadabc.com/d043f93e77866ac80e85148c4f0065c4.mp3
"
},
{
text
:
"
ant
"
,
pic_url
:
"
https://staging-teach.cdn.ireadabc.com/ed98242b08679b8b39f9ce34578ee614.png
"
,
audio_url
:
"
https://staging-teach.cdn.ireadabc.com/dfee6ae3a4de96774e97edcf9e20dfd5.mp3
"
},
{
text
:
"
bag
"
,
pic_url
:
"
https://staging-teach.cdn.ireadabc.com/7d83d91717e64ebe7474be1c5278eb44.png
"
,
audio_url
:
"
https://staging-teach.cdn.ireadabc.com/b9cd983101c534a6a0222cbda80f3a60.mp3
"
},
{
text
:
"
cat
"
,
pic_url
:
"
https://staging-teach.cdn.ireadabc.com/100c6b50e6c846c712f12332a05446cc.png
"
,
audio_url
:
"
https://staging-teach.cdn.ireadabc.com/b0887ec7ab86516e10f1a33722ff1589.mp3
"
}
]
]
const
dataArr
=
JSON
.
parse
(
JSON
.
stringify
(
dataBaseArr
))
// dataArr.length = Math.ceil( Math.random() * dataArr.length ); //随机显示几个假数据
const
{
rows
}
=
await
asyncCallNetworkApiGet
(
`/api/syllabus/v2/tree`
,
{
pid
:
this
.
node
[
'
syllabus_pid
'
],
deep
:
2
});
await
this
.
getAndStoreSyllabusStatus
(
rows
);
...
...
@@ -187,27 +131,30 @@ export default class NewClass extends cc.Component {
})
const
classCount
=
8
;
const
finishCount
=
Math
.
floor
(
Math
.
random
()
*
9
);
const
pointBase
=
cc
.
find
(
"
point
"
,
subNode
);
const
pointLayer
=
cc
.
find
(
"
pint_layer
"
,
subNode
);
const
pointDisX
=
57
;
pointBase
.
opacity
=
0
;
for
(
let
m
=
0
;
m
<
classCount
;
m
++
)
{
for
(
let
k
=
0
;
k
<
8
;
k
++
)
{
const
clsData
=
subData
.
children
[
k
];
const
pointNode
=
cc
.
instantiate
(
pointBase
);
pointNode
.
opacity
=
255
;
if
(
m
>=
finishCount
)
{
if
(
clsData
)
{
const
finished
=
this
.
syllabusLockStatusStore
[
clsData
.
id
]
===
'
finished
'
;
if
(
!
finished
)
{
const
finishIcon
=
cc
.
find
(
"
blue
"
,
pointNode
);
finishIcon
.
active
=
false
;
}
}
else
{
const
finishIcon
=
cc
.
find
(
"
blue
"
,
pointNode
);
finishIcon
.
active
=
false
;
}
pointLayer
.
addChild
(
pointNode
);
pointNode
.
x
=
pointBase
.
x
+
m
*
pointDisX
;
pointNode
.
x
=
pointBase
.
x
+
k
*
pointDisX
;
}
// 为方便测试,先全部解锁
const
lockCover
=
cc
.
find
(
"
bg_cover_mask
"
,
subNode
);
lockCover
.
active
=
false
;
...
...
@@ -223,6 +170,7 @@ export default class NewClass extends cc.Component {
subNode
.
addComponent
(
cc
.
Button
);
subNode
.
on
(
"
click
"
,
()
=>
{
const
vc
=
this
.
Viewer
.
getComponent
(
"
PageViewer
"
);
vc
.
missionPage
.
attr
({
syllabus_pid
:
subData
.
id
});
vc
.
toView
(
"
MissionPage
"
,
"
rightIn
"
)
})
}
...
...
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