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
883aeb66
Commit
883aeb66
authored
May 23, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 主界面适配
parent
28e00509
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1778 additions
and
1432 deletions
+1778
-1432
NJ_usercenter.fire
assets/NJ_usercenter/scene/NJ_usercenter.fire
+1762
-1429
NJ_usercenter.ts
assets/NJ_usercenter/scene/NJ_usercenter.ts
+16
-3
No files found.
assets/NJ_usercenter/scene/NJ_usercenter.fire
View file @
883aeb66
This source diff could not be displayed because it is too large. You can
view the blob
instead.
assets/NJ_usercenter/scene/NJ_usercenter.ts
View file @
883aeb66
...
...
@@ -147,13 +147,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
cc
.
find
(
"
sentencecount
"
,
smallbg_2_right
).
getComponent
(
cc
.
RichText
).
string
=
`<color=#41954F>
${
this
.
sentencecount
}
</c> <color=#726E6F><size=15>个</size></c>`
;
}
learntimes
=
[
0
,
0
,
25
,
50
,
99
,
73
,
8
];
learntimes
=
[
0
,
0
,
0
,
0
,
0
,
0
,
0
];
learntotal
=
0
;
average
=
0
;
async
drawChart
()
{
if
(
!
this
.
userInfo
)
{
return
;
}
const
res
:
any
=
await
asyncCallNetworkApiGet
(
"
/api/oxford/v1/kid/learn/chart
"
,
{
kidid
:
this
.
userInfo
.
id
,
token
:
this
.
token
});
const
chartInfo
=
JSON
.
parse
(
res
).
data
;
if
(
chartInfo
)
{
...
...
@@ -164,6 +165,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
const
linebg
=
cc
.
find
(
"
Canvas/usercenter/view/content/scollpage/linebg
"
);
cc
.
find
(
"
textbg/desc
"
,
linebg
).
getComponent
(
cc
.
RichText
).
string
=
`<color=#726E6F>累计学习时长</c><color=#41954F><size=30>
${
this
.
learntotal
}
</size></c><color=#726E6F>分钟</c>,<color=#726E6F>平均每日学习</c><color=#41954F><size=30>
${
this
.
average
}
</size></c><color=#726E6F>分钟</c>`
;
// 清理之前的点
for
(
let
i
=
1
;
i
<
8
;
i
++
)
{
const
beforeDot
=
cc
.
find
(
`dot_
${
i
}
`
,
linebg
);
if
(
beforeDot
)
{
linebg
.
removeChild
(
beforeDot
);
}
}
const
dotHide
=
cc
.
find
(
"
dothide
"
,
linebg
);
const
xAxis
=
cc
.
find
(
"
xline
"
,
linebg
);
...
...
@@ -206,6 +215,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
const
dotClone
=
cc
.
instantiate
(
dotHide
);
dotClone
.
parent
=
linebg
;
dotClone
.
name
=
`dot_
${
i
}
`
;
cc
.
find
(
"
pop/text
"
,
dotClone
).
getComponent
(
cc
.
Label
).
string
=
`
${
value
}
分钟`
;
dotClone
.
setPosition
(
xNode
.
parent
.
x
,
itemLen
*
value
+
baseY
);
dotClone
.
active
=
true
;
...
...
@@ -251,8 +261,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
const
bgNode
=
cc
.
find
(
'
Canvas/bg
'
);
bgNode
.
scale
=
this
.
_mapScaleMax
;
// const reportNode = cc.find('Canvas/learnreport');
// reportNode.scale = this._mapScaleMax;
// 设置界面大小
const
bottomItem
=
cc
.
find
(
`Canvas/usercenter/view/content/scollpage/ydjyz_node`
);
cc
.
find
(
`Canvas/usercenter/view/content`
).
height
=
Math
.
abs
(
bottomItem
.
y
)
+
400
;
cc
.
find
(
`Canvas/usercenter/view/content/scollpage`
).
height
=
Math
.
abs
(
bottomItem
.
y
)
+
400
;
cc
.
find
(
`Canvas/usercenter/view/content/scollpage/bg`
).
height
=
Math
.
abs
(
bottomItem
.
y
)
+
400
;
}
// update (dt) {}
...
...
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