Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MingSnake_241120
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
MingSnake_241120
Commits
0a45bd72
Commit
0a45bd72
authored
Dec 08, 2024
by
王杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 再写一点点
parent
ae12560f
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
2390 additions
and
1097 deletions
+2390
-1097
HomeScene.scene
assets/Bundles/HomeScene/HomeScene.scene
+14
-14
MyBagItem.prefab
assets/Bundles/MyBagPanel/MyBagItem.prefab
+1715
-0
MyBagItem.prefab.meta
assets/Bundles/MyBagPanel/MyBagItem.prefab.meta
+13
-0
MyBagPanel.prefab
assets/Bundles/MyBagPanel/MyBagPanel.prefab
+426
-1061
MyBagPanel.ts
assets/Scripts/Panels/MyBagPanel.ts
+169
-17
SignSucPanel.ts
assets/Scripts/Panels/SignSucPanel.ts
+6
-3
HomeScene.ts
assets/Scripts/Scenes/HomeScene.ts
+1
-1
WebNet.ts
assets/Scripts/Utils/WebNet/WebNet.ts
+11
-0
doSign.do.json
preview-template/mock/checkin_1/doSign.do.json
+1
-1
exchangeDecoration.do.json
preview-template/mock/myBackpack/exchangeDecoration.do.json
+5
-0
getSp.do.json
preview-template/mock/myBackpack/getSp.do.json
+29
-0
No files found.
assets/Bundles/HomeScene/HomeScene.scene
View file @
0a45bd72
...
...
@@ -185,7 +185,7 @@
"_priority": 1073741824,
"_fov": 45,
"_fovAxis": 0,
"_orthoHeight":
897.0108303249098
,
"_orthoHeight":
739.5
,
"_near": 1,
"_far": 2000,
"_color": {
...
...
@@ -478,7 +478,7 @@
"y": -180,
"z": -12.000012657215834
},
"_id": "a
bCxfLOeRFsoE++XP//VtM
"
"_id": "a
4oWxEwWFM4Lu4iPpKs1mI
"
},
{
"__type__": "cc.UITransform",
...
...
@@ -500,7 +500,7 @@
"x": 0,
"y": 1
},
"_id": "
33RwZa4M9FZag9hBPETZZk
"
"_id": "
784o5UlktClINNtz+eDuKT
"
},
{
"__type__": "cc.Sprite",
...
...
@@ -536,7 +536,7 @@
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "
19CjnR2elHtrtIZETYGWEx
"
"_id": "
041XaUO5xCMqrKhy8dz0sj
"
},
{
"__type__": "cc.Node",
...
...
@@ -584,7 +584,7 @@
"y": -180,
"z": -11.00000220913452
},
"_id": "
earDIrholGhbmpP7XD6Jzl
"
"_id": "
04Tdz2+fFHAJLzQWJ1ci1C
"
},
{
"__type__": "cc.UITransform",
...
...
@@ -606,7 +606,7 @@
"x": 0,
"y": 1
},
"_id": "
279n81WyRIZqDz+br2gOIX
"
"_id": "
1aREbZQ7VJWpexIdzFxLdf
"
},
{
"__type__": "cc.Sprite",
...
...
@@ -642,7 +642,7 @@
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "
3aPWmZkihGm4v9Jrsx94Bm
"
"_id": "
8dHtVRBuFFVr837DP5zESg
"
},
{
"__type__": "cc.Node",
...
...
@@ -690,7 +690,7 @@
"y": -180,
"z": -64.00000614258742
},
"_id": "
7bf1Ek/JBL9psN0qa5v3dJ
"
"_id": "
07hM/etCZB97LhgBJSV+xy
"
},
{
"__type__": "cc.UITransform",
...
...
@@ -712,7 +712,7 @@
"x": 0,
"y": 1
},
"_id": "
d30vc8Fi9C1bQZdFw1z20v
"
"_id": "
27yKoFl6dNO7YhAD7VD6vz
"
},
{
"__type__": "cc.Sprite",
...
...
@@ -748,7 +748,7 @@
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "
55rhcxkEZDoJweYMXLHzUw
"
"_id": "
cbctaCqZlAoqm9waaeZyEc
"
},
{
"__type__": "cc.Node",
...
...
@@ -796,7 +796,7 @@
"y": 180,
"z": 25.99999385741257
},
"_id": "
6bngQbXfNEKICc+jymGjOA
"
"_id": "
2c2zj2DklHk5Dr0S+gknHq
"
},
{
"__type__": "cc.UITransform",
...
...
@@ -818,7 +818,7 @@
"x": 0,
"y": 1
},
"_id": "
b98/4+DGFLjoCajTjjBbAN
"
"_id": "
30vhT1v3lEv6qxvwUBuxjA
"
},
{
"__type__": "cc.Sprite",
...
...
@@ -854,7 +854,7 @@
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "
6dEJzQONVI/LTK/7tv1Wv2
"
"_id": "
78O5+GLYRBOK5x/HXFHH30
"
},
{
"__type__": "cc.UITransform",
...
...
@@ -5232,7 +5232,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 1624,
"height": 750
"height": 750
.0000000000001
},
"_anchorPoint": {
"__type__": "cc.Vec2",
...
...
assets/Bundles/MyBagPanel/MyBagItem.prefab
0 → 100644
View file @
0a45bd72
This diff is collapsed.
Click to expand it.
assets/Bundles/MyBagPanel/MyBagItem.prefab.meta
0 → 100644
View file @
0a45bd72
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "8fb09e0b-1eb3-4b77-99fd-784445492b24",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "MyBagItem"
}
}
assets/Bundles/MyBagPanel/MyBagPanel.prefab
View file @
0a45bd72
This diff is collapsed.
Click to expand it.
assets/Scripts/Panels/MyBagPanel.ts
View file @
0a45bd72
import
{
_decorator
,
Button
,
Component
,
Label
,
Node
,
Size
,
Sprite
,
}
from
'cc'
;
import
{
observer
,
render
}
from
'../store/decorators'
;
import
Panel
from
"../../Module/Panel"
;
import
{
_decorator
,
Button
,
Label
,
Node
,
Sprite
,
}
from
"cc"
;
import
store
from
"../store/store"
;
import
{
observer
,
render
}
from
"../store/decorators"
;
import
{
changeScene
,
hideWaiting
,
showWaiting
}
from
'../../Module/UIFast'
;
import
{
_asyncThrottle
,
dateFormatter
,
strFormat
}
from
'../Utils/Utils'
;
import
{
HomeScene
}
from
'../Scenes/HomeScene'
;
import
{
sendWebNet
,
WebNetName
}
from
'../Utils/WebNet/WebNet'
;
import
{
YXCollectionView
,
YXFlowLayout
,
YXIndexPath
}
from
'../../Component/YXList/lib'
;
const
{
ccclass
,
property
}
=
_decorator
;
import
{
HTMLRichText
}
from
"../../Component/HTMLRichText/HTMLRichText"
;
import
{
sendWebNet
,
WebNetName
}
from
"../Utils/WebNet/WebNet"
;
import
{
strFormat
}
from
"../Utils/Utils"
;
import
{
hidePanel
,
showPanel
}
from
"../../Module/UIFast"
;
import
SignSucPanel
from
"./SignSucPanel"
;
enum
TAB
{
PRIZE
=
"PRIZE"
,
TOOL
=
"TOOL"
,
}
@
observer
@
ccclass
(
'MyBagPanel'
)
export
default
class
MyBagPanel
extends
Panel
{
static
bundle
=
"MyBagPanel"
;
static
skin
=
"MyBagPanel"
;
export
class
MyBagPanel
extends
Panel
{
static
bundle
:
string
=
"MyBagPanel"
;
static
skin
:
string
=
"MyBagPanel"
;
@
property
(
Node
)
closeBtn
:
Node
=
null
;
@
property
(
Node
)
Prize
:
Node
=
null
;
@
property
(
Node
)
Tool
:
Node
=
null
;
@
property
(
Node
)
prize_yes
:
Node
=
null
;
@
property
(
Node
)
prize_btn
:
Node
=
null
;
@
property
(
Node
)
tool_yes
:
Node
=
null
;
@
property
(
Node
)
tool_btn
:
Node
=
null
;
@
property
(
YXCollectionView
)
Prize_List
:
YXCollectionView
=
null
;
@
property
(
YXCollectionView
)
Tool_List
:
YXCollectionView
=
null
;
private
_tab
:
TAB
=
TAB
.
PRIZE
;
set
tab
(
tab
:
TAB
)
{
// 设置tab切换
this
.
_tab
=
tab
;
const
isPrize
=
tab
==
TAB
.
PRIZE
;
const
isTool
=
tab
==
TAB
.
TOOL
;
this
.
prize_yes
.
active
=
isPrize
;
this
.
tool_yes
.
active
=
isTool
;
this
.
Prize
.
active
=
isPrize
;
this
.
Tool
.
active
=
isTool
;
}
get
tab
()
{
return
this
.
_tab
;
}
prizeDate
:
any
[]
=
[];
toolDate
:
any
[]
=
[];
onLoad
()
{
this
.
closeBtn
.
on
(
Button
.
EventType
.
CLICK
,
this
.
clickClose
);
this
.
tab
=
TAB
.
TOOL
;
this
.
closeBtn
.
on
(
Button
.
EventType
.
CLICK
,
this
.
clickClose
,
this
);
this
.
prize_btn
.
on
(
Button
.
EventType
.
CLICK
,
this
.
clickSheng
,
this
);
this
.
tool_btn
.
on
(
Button
.
EventType
.
CLICK
,
this
.
clickSingle
,
this
);
}
async
start
()
{
this
.
Prize_List
.
numberOfItems
=
()
=>
this
.
prizeDate
.
length
;
this
.
Prize_List
.
onCellDisplay
=
this
.
onShengCellDisplay
;
const
shengLayout
=
new
YXFlowLayout
();
shengLayout
.
itemSize
=
new
Size
(
820
,
140
);
this
.
Prize_List
.
layout
=
shengLayout
;
this
.
Prize_List
.
reloadData
();
this
.
Tool_List
.
numberOfItems
=
()
=>
this
.
toolDate
.
length
;
this
.
Tool_List
.
onCellDisplay
=
this
.
onSingleCellDisplay
;
const
singleLayout
=
new
YXFlowLayout
();
singleLayout
.
itemSize
=
new
Size
(
820
,
140
);
this
.
Tool_List
.
layout
=
singleLayout
;
this
.
Tool_List
.
reloadData
();
showWaiting
(
true
);
await
Promise
.
all
([
this
.
updateSheng
(),
this
.
updateSingle
(),
]);
hideWaiting
();
}
update
(
deltaTime
:
number
)
{
}
clickClose
=
()
=>
{
this
.
hidePanel
();
}
// 点击省榜
clickSheng
()
{
this
.
tab
=
TAB
.
PRIZE
;
// this.Prize.getChildByName(`goCheck`).active = true;
}
// 个人榜
clickSingle
()
{
this
.
tab
=
TAB
.
TOOL
;
}
/****** 数据 ******/
// 刷新道具
async
updateSheng
()
{
const
{
success
,
data
}
=
await
sendWebNet
(
WebNetName
.
queryGameItem
);
if
(
!
success
)
return
;
console
.
log
(
"让我看看"
,
data
);
this
.
prizeDate
=
data
.
spInfo
;
this
.
Prize_List
.
reloadData
();
this
.
Prize_List
.
node
.
active
=
this
.
prizeDate
.
length
>
0
;
// for (let i = 1; i <= 7; i++) {
// const node = this[`day${i}`]
// // console.log("看看这里是什么结果",resData.signDay, i);
// if (resData.signDay >= i) {
// node.getChildByName("singed_mask").active = true;
// } else {
// node.getChildByName("singed_mask").active = false;
// }
// }
}
// 刷新奖品
async
updateSingle
()
{
const
{
success
,
data
=
[]
}
=
await
sendWebNet
(
WebNetName
.
prizeDetail
);
if
(
!
success
)
return
;
const
excludeSp
=
false
;
//排除道具
let
records
=
[]
for
(
let
item
of
data
)
{
const
{
extra
:
{
name
,
icon
,
type
},
id
,
prizeId
,
gmtCreate
}
=
item
;
records
.
push
({
id
,
prizeId
,
name
,
icon
,
gmtCreate
,
data
:
item
,
});
}
this
.
toolDate
=
records
;
this
.
Tool_List
.
reloadData
();
this
.
Tool_List
.
node
.
active
=
this
.
toolDate
.
length
>
0
;
}
// 给每个cell设置数据
onShengCellDisplay
=
(
cell
:
Node
,
indexPath
:
YXIndexPath
,
collectionView
:
YXCollectionView
)
=>
{
const
data
=
this
.
prizeDate
[
indexPath
.
item
];
this
.
onCellDisplay
(
cell
,
data
);
}
onSingleCellDisplay
=
(
cell
:
Node
,
indexPath
:
YXIndexPath
,
collectionView
:
YXCollectionView
)
=>
{
const
data
=
this
.
toolDate
[
indexPath
.
item
];
this
.
onCellDisplay
(
cell
,
data
);
}
onCellDisplay
=
(
cell
:
Node
,
data
)
=>
{
let
{
icon
=
0
,
name
=
""
,
gmtCreate
=
0
,
nickname
=
""
,
spId
=
""
,
spName
=
""
,
spNum
=
0
,
url
=
""
}
=
data
;
// const isPrize = this.tab == TAB.PRIZE;
// const isTool = this.tab == TAB.TOOL;
// const EDEN_TODO = false;
// cell.getChildByName(`goCheck`).active = isPrize;
// cell.getChildByName(`goBuy`).active = isTool && EDEN_TODO;
// cell.getChildByName(`goDress`).active = isTool && EDEN_TODO;
// cell.getChildByName(`Derssed`).active = isTool && EDEN_TODO;
cell
.
getChildByName
(
`name`
).
getComponent
(
Label
).
string
=
strFormat
(
name
||
nickname
,
32
);
cell
.
getChildByName
(
`time`
).
getComponent
(
Label
).
string
=
dateFormatter
(
gmtCreate
,
"yyyy.MM.dd hh:mm"
);
cell
.
getChildByName
(
"img"
).
getComponent
(
Sprite
).
spriteFrame
=
icon
||
url
;
}
}
assets/Scripts/Panels/SignSucPanel.ts
View file @
0a45bd72
...
...
@@ -21,9 +21,12 @@ export default class SignSucPanel extends Panel {
this
.
closeBtn
.
on
(
Button
.
EventType
.
CLICK
,
this
.
clickClose
);
}
@
render
render
()
{
console
.
log
(
"看看这里拿到了什么数1"
,
SignSucPanel
.
prototype
);
async
start
()
{
const
{
data
=
this
.
data
}
=
this
.
data
// console.log("看看这里拿到了什么数", data.prizeInfo);
this
.
PrizeName
.
getComponent
(
Label
).
string
=
data
.
prizeInfo
.
options
[
0
].
optionName
;
this
.
PrizeImg
.
getComponent
(
Sprite
).
spriteFrame
=
data
.
prizeInfo
.
options
[
0
].
optionImg
;
}
clickClose
=
()
=>
{
...
...
assets/Scripts/Scenes/HomeScene.ts
View file @
0a45bd72
...
...
@@ -17,7 +17,7 @@ import { PropPage } from "db://assets/Scripts/Scenes/PropPage";
import
{
AudioMgr
}
from
"../../core_tgx/base/AudioMgr"
;
import
SignPanel
from
"../Panels/SignPanel"
;
import
{
PointDetailScene
}
from
"./PointDetailScene"
;
import
MyBagPanel
from
"../Panels/MyBagPanel"
;
import
{
MyBagPanel
}
from
"../Panels/MyBagPanel"
;
const
{
ccclass
,
property
}
=
_decorator
;
...
...
assets/Scripts/Utils/WebNet/WebNet.ts
View file @
0a45bd72
...
...
@@ -40,6 +40,17 @@ export enum WebNetName {
// 好友榜
friendRank
=
"rank/friendRank.do"
,
/**
* 我的背包
*/
// 我的背包-查询游戏道具明细
queryGameItem
=
"myBackpack/getSp.do"
,
// 我的背包-装扮接口
doDress
=
"myBackpack/exchangeDecoration.do"
,
/**
* 奖品页面
*/
prizeDetail
=
"records.query"
,
/**
* 签到
...
...
preview-template/mock/checkin_1/doSign.do.json
View file @
0a45bd72
...
...
@@ -6,7 +6,7 @@
"options"
:
[
{
"optionId"
:
"dolor"
,
"optionImg"
:
null
,
"optionImg"
:
"https://yun.duiba.com.cn/spark/assets/f77861647e7b55e9c95e9c49d891a21526157a76.jpg"
,
"optionName"
:
"minim sunt in ut pariatur"
,
"position"
:
null
,
"prizeId"
:
"proident in amet"
,
...
...
preview-template/mock/myBackpack/exchangeDecoration.do.json
0 → 100644
View file @
0a45bd72
{
"code"
:
"in deserunt quis labore sint"
,
"message"
:
"velit Lorem ea aliqua nulla"
,
"success"
:
true
}
\ No newline at end of file
preview-template/mock/myBackpack/getSp.do.json
0 → 100644
View file @
0a45bd72
{
"code"
:
"irure id cupidatat"
,
"message"
:
"ipsum dolore incididunt sunt"
,
"success"
:
true
,
"data"
:
{
"spInfo"
:
[
{
"spId"
:
"vfvefsectetur ad"
,
"spName"
:
"commodo sed"
,
"spNum"
:
"fugiat eiusmod cupidatat ex"
,
"url"
:
"https://yun.duiba.com.cn/spark/assets/f77861647e7b55e9c95e9c49d891a21526157a76.jpg"
},
{
"spId"
:
"consectetur Ut labore cupidatat anim"
,
"spName"
:
"ex enim"
,
"spNum"
:
"est Ut"
,
"url"
:
"https://yun.duiba.com.cn/spark/assets/f77861647e7b55e9c95e9c49d891a21526157a76.jpg"
},
{
"spId"
:
"deserunt et aute"
,
"spName"
:
"deserunt"
,
"spNum"
:
"officia fugiat nostrud sed ipsum"
,
"url"
:
"https://yun.duiba.com.cn/spark/assets/f77861647e7b55e9c95e9c49d891a21526157a76.jpg"
}
],
"dressingStatus"
:
"cillum"
}
}
\ No newline at end of file
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