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
3bfe8fce
Commit
3bfe8fce
authored
Jul 24, 2024
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
整理一下代码
parent
deb491a5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
22 deletions
+33
-22
encodings.xml
.idea/encodings.xml
+1
-0
RecordScrollListItem.ts
assets/Scripts/Scenes/RecordScene/RecordScrollListItem.ts
+31
-21
changeDetails.do.json
preview-template/mock/loop/changeDetails.do.json
+1
-1
No files found.
.idea/encodings.xml
View file @
3bfe8fce
...
...
@@ -13,6 +13,7 @@
<file
url=
"file://$PROJECT_DIR$/assets/plugin/declare-process.js"
charset=
"UTF-8"
/>
<file
url=
"file://$PROJECT_DIR$/assets/plugin/declare-process.js.meta"
charset=
"UTF-8"
/>
<file
url=
"file://$PROJECT_DIR$/assets/store"
charset=
"UTF-8"
/>
<file
url=
"file://$PROJECT_DIR$/preview-template/mock/loop/changeDetails.do.json"
charset=
"UTF-8"
/>
<file
url=
"file://$PROJECT_DIR$/preview-template/mock/loop/prizeRecord.do.json"
charset=
"UTF-8"
/>
<file
url=
"file://$PROJECT_DIR$/../../批量压缩资源/点我开始处理资源压缩.bat"
charset=
"GBK"
/>
<file
url=
"PROJECT"
charset=
"GBK"
/>
...
...
assets/Scripts/Scenes/RecordScene/RecordScrollListItem.ts
View file @
3bfe8fce
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
;
const
{
ccclass
,
property
}
=
_decorator
;
@
ccclass
(
"RecordScrollListItem"
)
export
class
RecordScrollListItem
extends
ScrollListItem
{
start
()
{}
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);
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("Desc").getComponent(Label).color = new Color(255, 5, 0, 255);
const arr = data?.source.split("@");
let source = arr[0];
if (arr.length > 1) {
source += arr[arr.length - 1].slice(1);
}
this.node.getChildByName("Title").getComponent(Label).string = strFormat(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);
}
}
}
}
}
preview-template/mock/loop/changeDetails.do.json
View file @
3bfe8fce
...
...
@@ -13,7 +13,7 @@
"num"
:
1
},
{
"source"
:
"
culpa do et amet dolor
"
,
"source"
:
"
AAAAA@1@1@1任务
"
,
"type"
:
"+"
,
"timestamp"
:
-12505387.003454074
,
"num"
:
999
...
...
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