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
e8f4db40
Commit
e8f4db40
authored
Nov 10, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复正常用户登录左上角用户信息错误的问题
parent
7efb6e2d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
35 deletions
+29
-35
middleLayer_for_kyxq.fire
assets/middleLayer_for_kyxq/scene/middleLayer_for_kyxq.fire
+5
-5
HomePage.ts
assets/middleLayer_for_kyxq/script/HomePage.ts
+23
-28
PageViewer.ts
assets/middleLayer_for_kyxq/script/PageViewer.ts
+1
-1
UnitPage.ts
assets/middleLayer_for_kyxq/script/UnitPage.ts
+0
-1
No files found.
assets/middleLayer_for_kyxq/scene/middleLayer_for_kyxq.fire
View file @
e8f4db40
...
@@ -6395,7 +6395,7 @@
...
@@ -6395,7 +6395,7 @@
"__id__": 157
"__id__": 157
}
}
],
],
"_active":
fals
e,
"_active":
tru
e,
"_components": [
"_components": [
{
{
"__id__": 158
"__id__": 158
...
@@ -6717,8 +6717,8 @@
...
@@ -6717,8 +6717,8 @@
],
],
"_srcBlendFactor": 770,
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_dstBlendFactor": 771,
"_string": "
Delia
",
"_string": "",
"_N$string": "
Delia
",
"_N$string": "",
"_fontSize": 40,
"_fontSize": 40,
"_lineHeight": 40,
"_lineHeight": 40,
"_enableWrapText": true,
"_enableWrapText": true,
...
@@ -6973,8 +6973,8 @@
...
@@ -6973,8 +6973,8 @@
],
],
"_srcBlendFactor": 770,
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_dstBlendFactor": 771,
"_string": "
123456
",
"_string": "",
"_N$string": "
123456
",
"_N$string": "",
"_fontSize": 40,
"_fontSize": 40,
"_lineHeight": 40,
"_lineHeight": 40,
"_enableWrapText": true,
"_enableWrapText": true,
...
...
assets/middleLayer_for_kyxq/script/HomePage.ts
View file @
e8f4db40
...
@@ -134,7 +134,6 @@ export default class HomePageClass extends cc.Component {
...
@@ -134,7 +134,6 @@ export default class HomePageClass extends cc.Component {
}
}
getSprNodeByUrl
(
row
.
cover
,
async
(
resSpr
)
=>
{
getSprNodeByUrl
(
row
.
cover
,
async
(
resSpr
)
=>
{
// getSpriteFrimeByUrl(row.cover, async (spriteFrame) => {
const
coverNode
=
cc
.
find
(
`bg`
,
ci
);
const
coverNode
=
cc
.
find
(
`bg`
,
ci
);
const
spr
=
coverNode
.
getComponent
(
cc
.
Sprite
);
const
spr
=
coverNode
.
getComponent
(
cc
.
Sprite
);
...
@@ -143,10 +142,6 @@ export default class HomePageClass extends cc.Component {
...
@@ -143,10 +142,6 @@ export default class HomePageClass extends cc.Component {
spr
.
spriteFrame
=
resSpr
.
spriteFrame
;
spr
.
spriteFrame
=
resSpr
.
spriteFrame
;
// const sx = 476 / coverNode.width;
// const sy = 630 / coverNode.height;
// coverNode.scale = Math.max(sx, sy);
ci
.
active
=
true
;
ci
.
active
=
true
;
ci
.
attr
({
syllabus_id
:
row
.
id
});
ci
.
attr
({
syllabus_id
:
row
.
id
});
ci
.
on
(
"
click
"
,
()
=>
{
ci
.
on
(
"
click
"
,
()
=>
{
...
@@ -165,7 +160,6 @@ export default class HomePageClass extends cc.Component {
...
@@ -165,7 +160,6 @@ export default class HomePageClass extends cc.Component {
}
else
{
}
else
{
this
.
SvContent
.
x
=
-
canvas
.
width
/
2
;
this
.
SvContent
.
x
=
-
canvas
.
width
/
2
;
}
}
this
.
loading
.
active
=
false
;
this
.
loading
.
active
=
false
;
}
}
});
});
...
@@ -176,28 +170,30 @@ export default class HomePageClass extends cc.Component {
...
@@ -176,28 +170,30 @@ export default class HomePageClass extends cc.Component {
ci
.
scale
=
scale
;
ci
.
scale
=
scale
;
this
.
SvContent
.
addChild
(
ci
);
this
.
SvContent
.
addChild
(
ci
);
}
}
// this.loading.active = false;
}
}
// onLoad () {}
// onLoad () {}
userInfo
;
userInfo
;
async
getUserInfo
()
{
async
getUserInfo
()
{
this
.
userInfo
=
null
;
this
.
initTopUserPanel
();
const
userInfo
=
await
this
.
Viewer
.
getComponent
(
"
PageViewer
"
).
getUserInfo
();
const
userInfo
=
await
this
.
Viewer
.
getComponent
(
"
PageViewer
"
).
getUserInfo
();
this
.
userInfo
=
userInfo
.
detail
;
this
.
userInfo
=
userInfo
.
detail
;
// 如果是匿名登录 隐藏右上角头像按钮
// 如果是匿名登录 隐藏右上角头像按钮
cc
.
find
(
"
/UserInfo
"
,
this
.
node
).
active
=
this
.
userInfo
.
isAnonymous
?
true
:
fals
e
;
cc
.
find
(
"
/UserInfo
"
,
this
.
node
).
active
=
userInfo
.
isAnonymous
?
false
:
tru
e
;
cc
.
find
(
"
/UserLogin
"
,
this
.
node
).
active
=
this
.
userInfo
.
isAnonymous
?
false
:
tru
e
;
cc
.
find
(
"
/UserLogin
"
,
this
.
node
).
active
=
userInfo
.
isAnonymous
?
true
:
fals
e
;
this
.
initTopUserPanel
();
this
.
initTopUserPanel
();
}
}
nameLabel
;
nameLabel
;
goldLabel
;
goldLabel
;
initTopUserPanel
()
{
initTopUserPanel
()
{
if
(
!
this
.
userInfo
)
{
let
nameLabelString
=
""
;
return
;
let
goldLabelString
=
""
;
if
(
this
.
userInfo
)
{
nameLabelString
=
this
.
userInfo
.
nick_name
;
goldLabelString
=
this
.
userInfo
.
golds
;
}
}
if
(
!
this
.
nameLabel
)
{
if
(
!
this
.
nameLabel
)
{
...
@@ -207,8 +203,8 @@ export default class HomePageClass extends cc.Component {
...
@@ -207,8 +203,8 @@ export default class HomePageClass extends cc.Component {
this
.
goldLabel
=
goldLabelNode
.
getComponent
(
cc
.
Label
);
this
.
goldLabel
=
goldLabelNode
.
getComponent
(
cc
.
Label
);
}
}
this
.
nameLabel
.
string
=
this
.
userInfo
.
nick_name
;
this
.
nameLabel
.
string
=
nameLabelString
;
this
.
goldLabel
.
string
=
this
.
userInfo
.
golds
;
this
.
goldLabel
.
string
=
goldLabelString
;
}
}
formatDate
(
date
)
{
formatDate
(
date
)
{
...
@@ -227,27 +223,26 @@ export default class HomePageClass extends cc.Component {
...
@@ -227,27 +223,26 @@ export default class HomePageClass extends cc.Component {
bg
.
scale
=
Math
.
max
(
sx
,
sy
);
bg
.
scale
=
Math
.
max
(
sx
,
sy
);
}
}
_canTouch
=
false
;
async
start
()
{
async
start
()
{
this
.
initBg
();
this
.
initBg
();
// 注册PageViwer发来的beforeMounted事件 [页面即将被显示]
this
.
node
.
on
(
"
beforeMounted
"
,
this
.
beforeMounted
.
bind
(
this
));
// 注册PageViwer发来的mounted事件 [页面已经切换完毕]
this
.
node
.
on
(
"
mounted
"
,
this
.
mounted
.
bind
(
this
));
}
async
beforeMounted
()
{
}
async
mounted
()
{
await
this
.
getUserInfo
();
await
this
.
getUserInfo
();
await
this
.
getCourseList
();
await
this
.
getCourseList
();
this
.
initTopUserPanel
();
this
.
initTopUserPanel
();
this
.
_canTouch
=
true
;
this
.
_inited
=
true
;
}
}
async
onEnable
()
{
async
onEnable
()
{
this
.
_canTouch
=
false
;
if
(
this
.
_inited
)
{
// await this.getCourseList();
await
this
.
getUserInfo
();
await
this
.
getCourseList
();
this
.
initTopUserPanel
();
this
.
_canTouch
=
true
;
}
}
}
// update (dt) {}
// update (dt) {}
}
}
assets/middleLayer_for_kyxq/script/PageViewer.ts
View file @
e8f4db40
...
@@ -213,7 +213,7 @@ export default class PageViewerClass extends cc.Component {
...
@@ -213,7 +213,7 @@ export default class PageViewerClass extends cc.Component {
return
new
Promise
((
resovle
,
reject
)
=>
{
return
new
Promise
((
resovle
,
reject
)
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
resovle
(
true
)
resovle
(
true
)
},
1
)
},
200
)
})
})
}
}
}
}
...
...
assets/middleLayer_for_kyxq/script/UnitPage.ts
View file @
e8f4db40
...
@@ -355,7 +355,6 @@ export default class UnitPageClass extends cc.Component {
...
@@ -355,7 +355,6 @@ export default class UnitPageClass extends cc.Component {
rowCount
=
0
;
rowCount
=
0
;
colCount
++
;
colCount
++
;
}
}
}
}
}
}
...
...
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