Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NJ_usercenter
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_usercenter
Commits
48461b5c
Commit
48461b5c
authored
Sep 21, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 类型
parent
34cb16d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
18 deletions
+20
-18
clickEvent.ts
assets/NJ_usercenter/script/clickEvent.ts
+20
-18
No files found.
assets/NJ_usercenter/script/clickEvent.ts
View file @
48461b5c
...
...
@@ -7,6 +7,13 @@ const levels = {
ydjyz
:
[],
};
let
reportType
=
"
pdtd
"
;
const
reportObj
=
{
"
pdtd
"
:
"
拼读天地
"
,
"
qwqd
"
:
"
趣问趣答
"
,
"
ydjyz
"
:
"
阅读加油站
"
,
};
@
ccclass
export
default
class
NewClass
extends
cc
.
Component
{
...
...
@@ -42,12 +49,7 @@ export default class NewClass extends cc.Component {
return
rows
;
}
reportType
=
"
pdtd
"
;
reportObj
=
{
"
pdtd
"
:
"
拼读天地
"
,
"
qwqd
"
:
"
趣问趣答
"
,
"
ydjyz
"
:
"
阅读加油站
"
,
};
userInfo
=
null
;
// 查看拼读天地详情
async
onClickView
(
evt
,
type
)
{
...
...
@@ -58,17 +60,17 @@ export default class NewClass extends cc.Component {
return
;
}
this
.
userInfo
=
JSON
.
parse
(
userInfo
);
this
.
reportType
=
type
;
reportType
=
type
;
this
.
showLoading
();
cc
.
find
(
"
Canvas/learnreport
"
).
active
=
true
;
cc
.
find
(
"
Canvas/usercenter
"
).
active
=
false
;
cc
.
find
(
"
Canvas/learnreport/avatar
"
).
getComponent
(
cc
.
Sprite
).
spriteFrame
=
cc
.
find
(
`Canvas/avatars/
${
this
.
userInfo
.
avatar_url
||
1
}
`
).
getComponent
(
cc
.
Sprite
).
spriteFrame
;
await
this
.
loadSyllabusTree
();
if
(
this
.
reportType
===
'
pdtd
'
)
{
if
(
reportType
===
'
pdtd
'
)
{
await
this
.
drawPagePdtd
();
}
if
(
this
.
reportType
===
'
ydjyz
'
)
{
if
(
reportType
===
'
ydjyz
'
)
{
await
this
.
drawPageYdjyz
();
}
this
.
hideLoading
();
...
...
@@ -89,10 +91,10 @@ export default class NewClass extends cc.Component {
async
drawPagePdtd
()
{
const
node
=
cc
.
find
(
"
Canvas/learnreport
"
);
cc
.
find
(
"
typeLabel
"
,
node
).
getComponent
(
cc
.
Label
).
string
=
this
.
reportObj
[
this
.
reportType
];
cc
.
find
(
"
typeLabel
"
,
node
).
getComponent
(
cc
.
Label
).
string
=
reportObj
[
reportType
];
// 设置每个级别激活状态(是否显示锁头)
const
levelIds
=
levels
[
this
.
reportType
].
map
(
item
=>
item
.
id
);
const
levelIds
=
levels
[
reportType
].
map
(
item
=>
item
.
id
);
const
unLocks
=
this
.
getUnlockSyllabuses
();
for
(
let
i
=
1
;
i
<
5
;
i
++
)
{
const
id
=
levelIds
[
i
];
...
...
@@ -108,11 +110,11 @@ export default class NewClass extends cc.Component {
async
drawPageYdjyz
()
{
const
node
=
cc
.
find
(
"
Canvas/learnreport
"
);
cc
.
find
(
"
typeLabel
"
,
node
).
getComponent
(
cc
.
Label
).
string
=
this
.
reportObj
[
this
.
reportType
];
cc
.
find
(
"
typeLabel
"
,
node
).
getComponent
(
cc
.
Label
).
string
=
reportObj
[
reportType
];
// 设置每个级别激活状态(是否显示锁头)
for
(
let
i
=
1
;
i
<
5
;
i
++
)
{
cc
.
find
(
`level
${
i
+
1
}
/lock_1`
,
node
).
active
=
false
;
cc
.
find
(
`level
${
i
+
1
}
/lock_1`
,
node
).
active
=
(
i
>=
3
)
;
}
// 激活索引为0的Level
await
this
.
drawPageItems
(
0
);
...
...
@@ -132,15 +134,15 @@ export default class NewClass extends cc.Component {
const
node
=
cc
.
find
(
"
Canvas/learnreport
"
);
this
.
activeLevelIndex
(
index
);
let
rows
=
[];
if
(
levels
[
this
.
reportType
][
index
])
{
rows
=
await
this
.
loadData
(
levels
[
this
.
reportType
][
index
].
id
);
if
(
levels
[
reportType
][
index
])
{
rows
=
await
this
.
loadData
(
levels
[
reportType
][
index
].
id
);
rows
=
rows
.
filter
(
item
=>
item
.
name
.
trim
()
!==
'
more games
'
);
}
let
unLocks
=
[];
if
(
this
.
reportType
===
'
pdtd
'
)
{
if
(
reportType
===
'
pdtd
'
)
{
unLocks
=
this
.
getUnlockSyllabuses
();
}
if
(
this
.
reportType
===
'
ydjyz
'
)
{
if
(
reportType
===
'
ydjyz
'
)
{
// 全都解锁(没有解锁逻辑)
unLocks
=
rows
.
map
(
item
=>
item
.
id
);
}
...
...
@@ -485,7 +487,7 @@ export default class NewClass extends cc.Component {
// 返回用户中心
async
onClickBackToUserCenter
()
{
this
.
reportType
=
null
;
reportType
=
null
;
this
.
clearnContent
();
cc
.
find
(
"
Canvas/usercenter
"
).
active
=
true
;
cc
.
find
(
"
Canvas/learnreport
"
).
active
=
false
;
...
...
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