Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
ZheShangBank_TaoQuan_20240612
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
SparkProjects
ZheShangBank_TaoQuan_20240612
Commits
24c3912e
Commit
24c3912e
authored
Jun 19, 2024
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
整理一下代码
parent
062ea016
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
172 additions
and
7 deletions
+172
-7
HomeScene.ts
assets/Scripts/Scenes/HomeScene.ts
+1
-1
RankScene.meta
assets/Scripts/Scenes/RankScene.meta
+9
-0
RankScene.ts
assets/Scripts/Scenes/RankScene/RankScene.ts
+4
-4
RankScene.ts.meta
assets/Scripts/Scenes/RankScene/RankScene.ts.meta
+0
-0
RankScrollListItem.ts
assets/Scripts/Scenes/RankScene/RankScrollListItem.ts
+2
-2
RankScrollListItem.ts.meta
assets/Scripts/Scenes/RankScene/RankScrollListItem.ts.meta
+0
-0
RecordScene.meta
assets/Scripts/Scenes/RecordScene.meta
+9
-0
RecordScene.ts
assets/Scripts/Scenes/RecordScene/RecordScene.ts
+96
-0
RecordScene.ts.meta
assets/Scripts/Scenes/RecordScene/RecordScene.ts.meta
+9
-0
RecordScrollListItem.ts
assets/Scripts/Scenes/RecordScene/RecordScrollListItem.ts
+33
-0
RecordScrollListItem.ts.meta
...s/Scripts/Scenes/RecordScene/RecordScrollListItem.ts.meta
+9
-0
No files found.
assets/Scripts/Scenes/HomeScene.ts
View file @
24c3912e
...
...
@@ -6,7 +6,7 @@ import { changeScene, showPanel, showToast } from "db://assets/Module/UIFast";
import
GameMgr
from
"db://assets/Scripts/GameMgr"
;
import
RulePanel
from
'../Panels/RulePanel'
;
import
{
getUrlParam
}
from
'../Utils/Utils'
;
import
{
RankScene
}
from
'./RankScene'
;
import
{
RankScene
}
from
'./RankScene
/RankScene
'
;
import
ShareCenter
from
'../ShareCenter'
;
import
{
RecordScene
}
from
'./RecordScene/RecordScene'
;
import
{
ChangeEquipPanel
}
from
'../Panels/ChangeEquipPanel/ChangeEquipPanel'
;
...
...
assets/Scripts/Scenes/RankScene.meta
0 → 100644
View file @
24c3912e
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "83966994-6281-422c-a699-352bc57ccc27",
"files": [],
"subMetas": {},
"userData": {}
}
assets/Scripts/Scenes/RankScene.ts
→
assets/Scripts/Scenes/RankScene
/RankScene
.ts
View file @
24c3912e
import
{
_decorator
,
Label
,
Node
,
view
,
Widget
,
UITransform
,
Prefab
,
instantiate
,
assetManager
,
ImageAsset
,
SpriteFrame
,
Texture2D
,
Sprite
,
UIOpacity
}
from
"cc"
;
import
Scene
from
"db://assets/Module/Scene"
;
import
{
changeScene
}
from
"db://assets/Module/UIFast"
;
import
{
HomeScene
}
from
"
.
/HomeScene"
;
import
{
ScrollList
,
SCROLL_VERTICAL
}
from
"
..
/ScrollList/ScrollList"
;
import
{
strFormat
}
from
"
..
/Utils/Utils"
;
import
{
sendWebNet
,
WebNetName
}
from
"
..
/Utils/WebNet/WebNet"
;
import
{
HomeScene
}
from
"
db://assets/Scripts/Scenes
/HomeScene"
;
import
{
ScrollList
,
SCROLL_VERTICAL
}
from
"
db://assets/Scripts
/ScrollList/ScrollList"
;
import
{
strFormat
}
from
"
db://assets/Scripts
/Utils/Utils"
;
import
{
sendWebNet
,
WebNetName
}
from
"
db://assets/Scripts
/Utils/WebNet/WebNet"
;
const
{
ccclass
,
property
}
=
_decorator
;
@
ccclass
(
"RankScene"
)
...
...
assets/Scripts/Scenes/RankScene.ts.meta
→
assets/Scripts/Scenes/RankScene
/RankScene
.ts.meta
View file @
24c3912e
File moved
assets/Scripts/Sc
rollList
/RankScrollListItem.ts
→
assets/Scripts/Sc
enes/RankScene
/RankScrollListItem.ts
View file @
24c3912e
import
{
_decorator
,
Component
,
Node
,
Label
}
from
'cc'
;
import
{
strFormat
}
from
'
..
/Utils/Utils'
;
import
{
ScrollListItem
}
from
'
.
/ScrollListItem'
;
import
{
strFormat
}
from
'
db://assets/Scripts
/Utils/Utils'
;
import
{
ScrollListItem
}
from
'
db://assets/Scripts/ScrollList
/ScrollListItem'
;
const
{
ccclass
,
property
}
=
_decorator
;
@
ccclass
(
"RankScrollListItem"
)
...
...
assets/Scripts/Sc
rollList
/RankScrollListItem.ts.meta
→
assets/Scripts/Sc
enes/RankScene
/RankScrollListItem.ts.meta
View file @
24c3912e
File moved
assets/Scripts/Scenes/RecordScene.meta
0 → 100644
View file @
24c3912e
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "4b902be0-0dfb-4071-b305-fed78a2e239b",
"files": [],
"subMetas": {},
"userData": {}
}
assets/Scripts/Scenes/RecordScene/RecordScene.ts
0 → 100644
View file @
24c3912e
import
{
_decorator
,
Node
,
UIOpacity
,
Prefab
,
}
from
'cc'
;
import
Scene
from
"db://assets/Module/Scene"
;
import
{
changeScene
}
from
"db://assets/Module/UIFast"
;
import
{
ScrollList
,
SCROLL_VERTICAL
}
from
"db://assets/Scripts/ScrollList/ScrollList"
;
import
{
sendWebNet
,
WebNetName
}
from
'db://assets/Scripts/Utils/WebNet/WebNet'
;
import
{
HomeScene
}
from
'db://assets/Scripts/Scenes/HomeScene'
;
const
{
ccclass
,
property
}
=
_decorator
;
@
ccclass
(
"RecordScene"
)
export
class
RecordScene
extends
Scene
{
static
skin
:
string
=
"RecordScene"
;
static
group
:
string
[]
=
[
"RecordScene"
];
/** 明细页类别 */
private
_type
:
string
=
"1"
;
get
type
()
{
return
this
.
_type
;
}
set
type
(
type
:
string
)
{
this
.
_type
=
type
;
}
@
property
({
type
:
ScrollList
,
tooltip
:
"竖行滚动容器"
})
private
vScroll
:
ScrollList
;
@
property
(
Node
)
RecordBox
:
Node
=
null
;
@
property
(
Node
)
gameBg
:
Node
=
null
;
@
property
(
Node
)
countBg
:
Node
=
null
;
start
()
{
this
.
getCountRecordInfo
();
}
/** 获取次数明细 */
async
getCountRecordInfo
()
{
const
res
=
await
sendWebNet
(
WebNetName
.
changeDetails
);
if
(
res
?.
success
)
{
this
.
recordRender
(
res
?.
data
||
[]);
}
}
/** 获取游戏记录 */
async
getGameRecordInfo
()
{
const
res
=
await
sendWebNet
(
WebNetName
.
gameRecord
);
if
(
res
?.
success
)
{
this
.
recordRender
(
res
?.
data
||
[]);
}
}
/** 明细渲染 */
recordRender
(
recordInfo
=
[])
{
this
.
vScroll
.
setDataList
(
recordInfo
,
SCROLL_VERTICAL
,
[
0
,
0
,
0
]);
this
.
vScroll
.
scrollToTop
(
0
);
if
(
recordInfo
.
length
<=
0
)
{
this
.
node
.
getChildByName
(
"Empty"
).
getComponent
(
UIOpacity
).
opacity
=
255
;
}
else
{
this
.
node
.
getChildByName
(
"Empty"
).
getComponent
(
UIOpacity
).
opacity
=
0
;
}
}
/** 切换tab */
handleClickTab
(
event
,
data
)
{
this
.
type
=
data
;
if
(
data
==
"1"
)
{
this
.
countBg
.
active
=
true
;
this
.
gameBg
.
active
=
false
;
this
.
getCountRecordInfo
();
}
else
if
(
data
==
"2"
)
{
this
.
countBg
.
active
=
false
;
this
.
gameBg
.
active
=
true
;
this
.
getGameRecordInfo
();
}
}
/** 返回首页 */
handleClickBackBtn
()
{
changeScene
(
HomeScene
);
}
update
(
deltaTime
:
number
)
{
}
}
assets/Scripts/Scenes/RecordScene/RecordScene.ts.meta
0 → 100644
View file @
24c3912e
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "88be9277-d3c9-4ddb-b1f9-98c0ab63e711",
"files": [],
"subMetas": {},
"userData": {}
}
assets/Scripts/Scenes/RecordScene/RecordScrollListItem.ts
0 → 100644
View file @
24c3912e
import
{
_decorator
,
Component
,
Node
,
Label
,
Color
}
from
'cc'
;
import
{
dateFormatter
,
strFormat
}
from
'db://assets/Scripts/Utils/Utils'
;
import
{
ScrollListItem
}
from
'db://assets/Scripts/ScrollList/ScrollListItem'
;
const
{
ccclass
,
property
}
=
_decorator
;
@
ccclass
(
"RecordScrollListItem"
)
export
class
RecordScrollListItem
extends
ScrollListItem
{
start
()
{}
onItemRender
(
data
,
...
param
:
any
[])
{
if
(
Object
.
keys
(
data
).
includes
(
"ifGetPrize"
))
{
this
.
node
.
getChildByName
(
"Title"
).
getComponent
(
Label
).
string
=
`获得
${
data
?.
score
||
0
}
游园积分
`;
this.node.getChildByName("Time").getComponent(Label).string = `
$
{
dateFormatter
(
data
?.
timestamp
,
"yyyy.MM.dd hh:mm"
)}
`;
if(!!data?.ifGetPrize) {
this.node.getChildByName("Desc").getComponent(Label).color = new Color(255, 5, 0, 255);
this.node.getChildByName("Desc").getComponent(Label).string = `
获得宝箱
`;
} else {
this.node.getChildByName("Desc").getComponent(Label).string = `
未获得宝箱
`;
this.node.getChildByName("Desc").getComponent(Label).color = new Color(16, 168, 73, 255);
}
} else {
this.node.getChildByName("Title").getComponent(Label).string = strFormat(data?.source, 30);
this.node.getChildByName("Time").getComponent(Label).string = `
$
{
dateFormatter
(
data
?.
timestamp
,
"yyyy.MM.dd hh:mm"
)}
`;
this.node.getChildByName("Desc").getComponent(Label).string = `
挑战次数
$
{
data
?.
type
||
""
}
$
{
data
?.
num
}
`;
if (data?.type == "-") {
this.node.getChildByName("Desc").getComponent(Label).color = new Color(16, 168, 73, 255);
} else {
this.node.getChildByName("Desc").getComponent(Label).color = new Color(255, 5, 0, 255);
}
}
}
}
assets/Scripts/Scenes/RecordScene/RecordScrollListItem.ts.meta
0 → 100644
View file @
24c3912e
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "4f6618e5-878b-4af3-91b7-4af8f8fa0a9f",
"files": [],
"subMetas": {},
"userData": {}
}
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