Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NJ_YouLeChang
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_YouLeChang
Commits
6e4350f3
Commit
6e4350f3
authored
Jun 06, 2022
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:
parent
f2ad9cb4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
NJ_YouLeChang.fire
assets/NJ_YouLeChang/scene/NJ_YouLeChang.fire
+2
-2
NJ_YouLeChang.ts
assets/NJ_YouLeChang/scene/NJ_YouLeChang.ts
+19
-4
No files found.
assets/NJ_YouLeChang/scene/NJ_YouLeChang.fire
View file @
6e4350f3
...
@@ -2405,7 +2405,7 @@
...
@@ -2405,7 +2405,7 @@
"__id__": 74
"__id__": 74
}
}
],
],
"_active":
fals
e,
"_active":
tru
e,
"_components": [
"_components": [
{
{
"__id__": 78
"__id__": 78
...
@@ -3036,7 +3036,7 @@
...
@@ -3036,7 +3036,7 @@
},
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "
New Label
",
"_name": "
nickname
",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 53
"__id__": 53
...
...
assets/NJ_YouLeChang/scene/NJ_YouLeChang.ts
View file @
6e4350f3
import
{
asyncCallNetworkApiGet
,
asyncDelay
,
buttonOnClick
,
jumpToBundle
,
onHomeworkFinish
,
getSpriteFrimeByUrl
}
from
"
../script/util
"
;
import
{
asyncCallNetworkApiGet
,
asyncDelay
,
buttonOnClick
,
jumpToBundle
,
onHomeworkFinish
,
getSpriteFrimeByUrl
,
callNetworkApiGet
}
from
"
../script/util
"
;
import
{
MyCocosSceneComponent
}
from
"
../script/MyCocosSceneComponent
"
;
import
{
MyCocosSceneComponent
}
from
"
../script/MyCocosSceneComponent
"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
...
@@ -79,9 +79,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -79,9 +79,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
const
middleLayerComponent
=
middleLayer
.
getComponent
(
'
middleLayer
'
);
const
middleLayerComponent
=
middleLayer
.
getComponent
(
'
middleLayer
'
);
const
userInfo
=
await
middleLayerComponent
.
getUserInfo
();
const
userInfo
=
await
middleLayerComponent
.
getUserInfo
();
console
.
log
(
'
userInfo =
'
,
userInfo
);
console
.
log
(
'
userInfo =
'
,
userInfo
);
// middleLayerComponent.showConfirm("确定退出?", () => {
// jumpToBundle('NJ_login');
const
goldDataStr
=
await
asyncCallNetworkApiGet
(
`/api/oxford/v1/kid/
${
userInfo
.
id
}
/golds`
,
{});
// });
console
.
log
(
'
goldDataStr =
'
,
goldDataStr
);
const
nickname
=
cc
.
find
(
'
Canvas/userInfo/frame/nickname
'
);
nickname
.
getComponent
(
cc
.
Label
).
string
=
userInfo
.
nick_name
;
const
headImg
=
cc
.
find
(
'
Canvas/userInfo/frame/mask/headImg
'
);
cc
.
assetManager
.
loadRemote
(
userInfo
.
avatar_url
,
(
err
,
tex
)
=>
{
headImg
.
getComponent
(
cc
.
Sprite
).
spriteFrame
=
new
cc
.
SpriteFrame
(
tex
);
});
}
}
initListener
()
{
initListener
()
{
...
@@ -123,5 +131,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -123,5 +131,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
buttonOnClick
(
avatar_border
,
()
=>
{
buttonOnClick
(
avatar_border
,
()
=>
{
cc
.
find
(
'
Canvas/userInfo
'
).
active
=
true
;
cc
.
find
(
'
Canvas/userInfo
'
).
active
=
true
;
});
});
const
BtnLogout
=
cc
.
find
(
'
Canvas/userInfo/frame/BtnLogout
'
);
buttonOnClick
(
BtnLogout
,
()
=>
{
middleLayerComponent
.
showConfirm
(
"
确定退出?
"
,
()
=>
{
jumpToBundle
(
'
NJ_login
'
);
});
});
}
}
}
}
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