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
1ef72cc6
Commit
1ef72cc6
authored
May 20, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 个人中心所有数据
parent
0bb49d32
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
194 additions
and
151 deletions
+194
-151
NJ_usercenter.fire
assets/NJ_usercenter/scene/NJ_usercenter.fire
+151
-151
NJ_usercenter.ts
assets/NJ_usercenter/scene/NJ_usercenter.ts
+43
-0
No files found.
assets/NJ_usercenter/scene/NJ_usercenter.fire
View file @
1ef72cc6
This diff is collapsed.
Click to expand it.
assets/NJ_usercenter/scene/NJ_usercenter.ts
View file @
1ef72cc6
...
@@ -33,6 +33,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -33,6 +33,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
await
this
.
initSpeakInfo
();
await
this
.
initSpeakInfo
();
await
this
.
initKnowledgeInfo
();
await
this
.
initKnowledgeInfo
();
await
this
.
drawChart
();
await
this
.
drawChart
();
await
this
.
drawLearnProcess
();
this
.
initBg
();
this
.
initBg
();
this
.
initListener
();
this
.
initListener
();
}
}
...
@@ -68,6 +69,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -68,6 +69,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
cc
.
find
(
"
nickname
"
,
usercenter
).
getComponent
(
cc
.
Label
).
string
=
userInfo
.
nick_name
||
""
;
cc
.
find
(
"
nickname
"
,
usercenter
).
getComponent
(
cc
.
Label
).
string
=
userInfo
.
nick_name
||
""
;
// 日历牌
// 日历牌
cc
.
find
(
"
learndate
"
,
usercenter
).
getComponent
(
cc
.
Label
).
string
=
this
.
getFomartDate
();
cc
.
find
(
"
learndate
"
,
usercenter
).
getComponent
(
cc
.
Label
).
string
=
this
.
getFomartDate
();
// 当前学习进度
if
(
userInfo
.
last_game_str
){
const
gameNames
=
userInfo
.
last_game_str
.
split
(
"
~!
"
);
cc
.
find
(
"
learning
"
,
usercenter
).
getComponent
(
cc
.
RichText
).
string
=
`<color=#138977>当前正在学习</c> <color=#ef8d36>
${
gameNames
[
0
]}
-
${
gameNames
[
1
]}
</color>`
;
}
}
}
// 学习小结
// 学习小结
...
@@ -201,6 +208,42 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -201,6 +208,42 @@ export default class SceneComponent extends MyCocosSceneComponent {
chart_line
.
stroke
();
chart_line
.
stroke
();
}
}
async
drawLearnProcess
()
{
if
(
!
this
.
userInfo
)
{
return
;
}
const
draw
=
async
(
type
)
=>
{
const
pdtd
:
any
=
await
asyncCallNetworkApiGet
(
`/api/oxford/v1/kid/learn/
${
type
}
/process`
,
{
kidid
:
this
.
userInfo
.
id
,
token
:
this
.
token
});
const
resProcess
=
JSON
.
parse
(
pdtd
).
data
;
const
typeNode
=
cc
.
find
(
`Canvas/usercenter/view/content/scollpage/
${
type
}
_node/typebg`
);
// 现在规定死5个级别
for
(
let
i
=
1
;
i
<=
5
;
i
++
)
{
const
prcss
=
resProcess
[
i
];
if
(
prcss
)
{
cc
.
find
(
`L
${
i
}
/percent`
,
typeNode
).
getComponent
(
cc
.
Label
).
string
=
prcss
.
process
+
"
%
"
;
const
maxLen
=
cc
.
find
(
`L
${
i
}
`
,
typeNode
).
width
cc
.
find
(
`L
${
i
}
/processlan`
,
typeNode
).
width
=
Math
.
floor
(
maxLen
*
prcss
.
process
/
100
);
}
else
{
console
.
log
(
`L
${
i
}
/processlan`
);
console
.
log
(
cc
.
find
(
`L
${
i
}
/processlan`
,
typeNode
));
cc
.
find
(
`L
${
i
}
/percent`
,
typeNode
).
getComponent
(
cc
.
Label
).
string
=
"
0%
"
;
cc
.
find
(
`L
${
i
}
/processlan`
,
typeNode
).
width
=
0
;
}
}
}
// 拼读天地
await
draw
(
"
pdtd
"
);
// 趣问趣答
await
draw
(
"
qwqd
"
);
// 阅读加油站
await
draw
(
"
ydjyz
"
);
}
initBg
()
{
initBg
()
{
const
bgNode
=
cc
.
find
(
'
Canvas/bg
'
);
const
bgNode
=
cc
.
find
(
'
Canvas/bg
'
);
bgNode
.
scale
=
this
.
_mapScaleMax
;
bgNode
.
scale
=
this
.
_mapScaleMax
;
...
...
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