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
b3eb5305
Commit
b3eb5305
authored
Dec 04, 2024
by
陈子煜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
bf848b10
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
553 additions
and
3456 deletions
+553
-3456
jsLibraryMappings.xml
.idea/jsLibraryMappings.xml
+0
-2
PropPage.scene
assets/Bundles/PropPage/PropPage.scene
+148
-3099
GamePosterPanel.ts
assets/Scripts/Panels/GamePosterPanel.ts
+0
-1
ProPop.ts
assets/Scripts/Panels/ProPop.ts
+3
-9
PropPage.ts
assets/Scripts/Scenes/PropPage.ts
+71
-19
WebNet.ts
assets/Scripts/Utils/WebNet/WebNet.ts
+1
-2
store.ts
assets/Scripts/store/store.ts
+15
-10
Start.ts
assets/Start/Start.ts
+1
-1
listExchangeLimit.do.json
preview-template/mock/excahng_1/listExchangeLimit.do.json
+314
-0
propPag.json
preview-template/mock/propPag/propPag.json
+0
-313
No files found.
.idea/jsLibraryMappings.xml
View file @
b3eb5305
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"JavaScriptLibraryMappings"
>
<file
url=
"PROJECT"
libraries=
"{rem}"
/>
<includedPredefinedLibrary
name=
"Node.js Core"
/>
<excludedPredefinedLibrary
name=
"241106_YOGURT_Snake/node_modules"
/>
</component>
</project>
\ No newline at end of file
assets/Bundles/PropPage/PropPage.scene
View file @
b3eb5305
This diff is collapsed.
Click to expand it.
assets/Scripts/Panels/GamePosterPanel.ts
View file @
b3eb5305
...
...
@@ -23,7 +23,6 @@ export default class GamePosterPanel extends Panel {
async
start
()
{
this
.
lengthTxt
.
string
=
`
${
this
.
data
.
score
}
`
;
this
.
killTxt
.
string
=
`
${
this
.
data
.
finalKill
}
`
;
// director.once(Director.EVENT_AFTER_DRAW, this.copyRenderTex);
// director.once(Director.EVENT_END_FRAME, this.copyRenderTex);
this
.
scheduleOnce
(
this
.
copyRenderTex
,
0.5
);
...
...
assets/Scripts/Panels/ProPop.ts
View file @
b3eb5305
...
...
@@ -11,8 +11,8 @@ import { HTMLRichText } from "../../Component/HTMLRichText/HTMLRichText";
@
ccclass
(
'ProPop'
)
export
default
class
ProPop
extends
Panel
{
static
bundle
=
"ProPop"
;
static
skin
=
"ProPop"
;
static
bundle
=
"Pro
p
Pop"
;
static
skin
=
"Pro
p
Pop"
;
@
property
(
Node
)
closeBtn
:
Node
=
null
;
@
property
(
Node
)
btn
:
Node
=
null
;
...
...
@@ -21,7 +21,7 @@ export default class ProPop extends Panel {
@
property
(
Node
)
num
:
Node
=
null
;
onLoad
()
{
this
.
closeBtn
.
on
(
Button
.
EventType
.
CLICK
,
this
.
clickClose
)
;
this
.
closeBtn
.
on
(
Button
.
EventType
.
CLICK
,
this
.
clickClose
)
}
async
start
()
{
...
...
@@ -32,11 +32,5 @@ export default class ProPop extends Panel {
this
.
hidePanel
();
}
// @render
// render() {
// const {ruleInfo = ""} = store;
// this.setRuleTxt(ruleInfo);
// }
}
assets/Scripts/Scenes/PropPage.ts
View file @
b3eb5305
import
{
_decorator
,
Button
,
Label
,
Nod
e
}
from
'cc'
;
import
{
_decorator
,
Button
,
instantiate
,
js
,
Label
,
Node
,
Prefab
,
Sprit
e
}
from
'cc'
;
import
Scene
from
"db://assets/Module/Scene"
;
import
{
MainGame
}
from
"./MainGame/MainGame"
;
import
{
changeScene
,
showPanel
}
from
"db://assets/Module/UIFast"
;
import
store
from
"../store/store"
;
import
{
observer
,
render
}
from
"../store/decorators"
;
import
{
_asyncThrottle
}
from
"../Utils/Utils"
;
import
RankPanel
from
"../Panels/RankPanel"
;
import
{
UIMgr
}
from
"../../Module/UIMgr"
;
import
gameStore
from
"../store/gameStore"
;
import
GameResultPanel
from
"../Panels/GameResultPanel"
;
import
GamePosterPanel
from
"../Panels/GamePosterPanel"
;
import
ExchangeSuccess
from
"db://assets/Scripts/Panels/ExchangeSuccess"
;
import
ProPop
from
"db://assets/Scripts/Panels/ProPop"
;
import
{
sendWebNet
,
WebNetName
}
from
"db://assets/Scripts/Utils/WebNet/WebNet"
;
const
{
ccclass
,
property
}
=
_decorator
;
...
...
@@ -23,35 +19,91 @@ export class PropPage extends Scene {
static
skin
:
string
=
"PropPage"
;
// static group: string[] = ["HomeScene"];
@
property
(
Node
)
backBtn
:
Node
=
null
;
@
property
(
Label
)
prizeName
:
Label
=
null
;
@
property
(
Label
)
explain
:
Label
=
null
;
@
property
(
Label
)
num2
:
Label
=
null
;
@
property
(
Label
)
num
:
Label
=
null
;
@
property
(
Node
)
prize
:
Node
=
null
;
@
property
(
Label
)
credits
:
Label
=
null
;
@
property
(
Prefab
)
prizePrefab
:
Prefab
=
null
;
@
property
(
Node
)
content
:
Node
=
null
;
propPageInfo
:
any
=
{};
async
start
()
{
await
store
.
getPropPageInfo
()
await
this
.
getPropPageInfo
()
this
.
setCredits
()
this
.
setPrizeList
()
}
setCredits
(
num
:
number
)
{
async
getPropPageInfo
()
{
const
{
success
,
data
}
=
await
sendWebNet
(
WebNetName
.
propPag
);
if
(
!
success
)
{
return
;
}
this
.
propPageInfo
=
data
}
/** 积分数据*/
setCredits
()
{
this
.
credits
.
string
=
this
.
propPageInfo
.
credits
}
/** 道具卡*/
setPrizeList
()
{
const
conditions
=
this
.
propPageInfo
.
conditions
conditions
.
map
((
conditionsItem
,
conditionsIndex
)
=>
{
const
consumeSp
=
conditionsItem
.
consumeSps
[
0
]
const
item
=
conditionsItem
.
options
[
0
]
const
prize
=
instantiate
(
this
.
prizePrefab
)
this
.
content
.
addChild
(
prize
)
const
prizeName
=
prize
.
getChildByName
(
"prizeName"
)
prizeName
.
getComponent
(
Label
).
string
=
item
.
spName
const
prizeimg
=
prize
.
getChildByName
(
"prize"
)
prizeimg
.
getComponent
(
Sprite
).
spriteFrame
=
item
.
optionImg
const
explain
=
prize
.
getChildByName
(
"explain"
)
explain
.
getComponent
(
Label
).
string
=
item
.
spDetail
const
btn
=
prize
.
getChildByName
(
"btn"
)
const
num2
=
btn
.
getChildByName
(
"num2"
)
num2
.
getComponent
(
Label
).
string
=
consumeSp
.
quantity
;
btn
.
on
(
Button
.
EventType
.
CLICK
,
()
=>
this
.
clickToConfirm
(
conditionsIndex
)
)
})
//遍历conditions
//再遍历options
//item 获取道具卡数量,展示道具数量
//将数组内的图片、名字、道具说明加入到道具卡内
//遍历option
//将道具卡的预制体进行遍历
//预制体内的名字、解释、图片 进行更替
}
onLoad
()
{
this
.
backBtn
.
on
(
Button
.
EventType
.
CLICK
,
this
.
clickToBack
)
;
this
.
backBtn
.
on
(
Button
.
EventType
.
CLICK
,
this
.
clickToConfirm
)
;
this
.
backBtn
.
on
(
Button
.
EventType
.
CLICK
,
this
.
clickToBack
)
this
.
backBtn
.
on
(
Button
.
EventType
.
CLICK
,
this
.
clickToConfirm
)
}
// 点击返回按钮
clickToBack
()
{
// this.hidePanel();
}
clickToConfirm
()
{
showPanel
(
ProPop
);
}
}
clickToConfirm
(
index
)
{
showPanel
(
ProPop
,
index
);
console
.
log
(
index
)
}
}
\ No newline at end of file
assets/Scripts/Utils/WebNet/WebNet.ts
View file @
b3eb5305
...
...
@@ -83,7 +83,7 @@ export enum WebNetName {
/**
* 道具首页
*/
propPag
=
"
bag/index
.do"
,
propPag
=
"
excahng_1/listExchangeLimit
.do"
,
/**
* 道具_兑换
...
...
@@ -206,7 +206,6 @@ export function sendWebNet(
url
=
"mock/"
+
netName
+
".json"
;
}
let
data
=
parameter
||
{};
if
(
data
.
token
)
{
url
+=
"?token="
+
data
.
token
;
...
...
assets/Scripts/store/store.ts
View file @
b3eb5305
import
mobx
from
"mobx"
;
import
{
sendWebNet
,
WebNetName
}
from
"../Utils/WebNet/WebNet"
;
import
{
sendWebNet
,
WebNetName
}
from
"../Utils/WebNet/WebNet"
;
import
{
IStartInfo
}
from
"./gameStore"
;
const
{
makeAutoObservable
}
=
mobx
;
...
...
@@ -83,15 +83,20 @@ class Store {
this
.
ruleInfo
=
data
;
}
// 道具页接口
propPageInfo
:
""
;
async
getPropPageInfo
(){
const
{
success
,
data
}
=
await
sendWebNet
(
WebNetName
.
propPag
);
if
(
!
success
){
return
;
}
this
.
propPageInfo
=
data
}
// // 道具页接口
// propPageInfo: {}
//
// async getPropPageInfo(credits: string) {
// const param = {
// credits,
// };
// const {success, data} = await sendWebNet(WebNetName.propPag,param);
// if (!success) {
// return;
// }
// this.propPageInfo = data
//
// }
}
const
store
:
Store
=
makeAutoObservable
(
new
Store
());
...
...
assets/Start/Start.ts
View file @
b3eb5305
...
...
@@ -104,7 +104,7 @@ export class Start extends Component{
await
this
.
preload
(
list
,
0.3
,
1
);
await
changeScene
(
HomeScen
e
);
await
changeScene
(
PropPag
e
);
}
getPreLoadList
=
async
(
pkg
)
=>
{
...
...
preview-template/mock/excahng_1/listExchangeLimit.do.json
0 → 100644
View file @
b3eb5305
This diff is collapsed.
Click to expand it.
preview-template/mock/propPag/propPag.json
deleted
100644 → 0
View file @
bf848b10
{
"success"
:
true
,
"message"
:
"id adipisicing do"
,
"code"
:
"dolor"
,
"data"
:
{
"limitType"
:
80778217.69183573
,
"exchangeLimitCount"
:
12923173.435211942
,
"alreadyExchangeCount"
:
53391330.29073775
,
"extra"
:
"ex deserunt magna qui"
,
"conditions"
:
[
{
"gear"
:
-85094026.58193772
,
"consumeSps"
:
[
{
"spId"
:
"aute"
,
"quantity"
:
-5751627.1945296675
,
"spName"
:
"adipisicing et minim sunt commodo"
,
"spImg"
:
"quis Ut"
}
],
"options"
:
[
{
"ruleId"
:
"laboris tempor cillum proident veniam"
,
"optionId"
:
"in culpa pariatur exercitation"
,
"optionName"
:
"eiusmod sint"
,
"optionStock"
:
-95805647.02257654
,
"optionImg"
:
"dolor ea ullamco"
,
"prizeId"
:
"Ut"
,
"prizeType"
:
35080935.80956727
,
"userLimitCount"
:
29666988.491197005
,
"alreadyUserCount"
:
"commodo eu"
,
"limitTimeUnit"
:
32705222.785734415
,
"spDetail"
:
"anim tempor aliquip nostrud in"
},
{
"ruleId"
:
"dolore do deserunt proident"
,
"optionId"
:
"dolore in dolore velit Duis"
,
"optionName"
:
"non pariatur commodo enim cillum"
,
"optionStock"
:
69377954.54581428
,
"optionImg"
:
"do et"
,
"prizeId"
:
"ad incididunt eiusmod proident"
,
"prizeType"
:
-69704494.54662044
,
"userLimitCount"
:
74566655.60931498
,
"alreadyUserCount"
:
"voluptate do tempor"
,
"limitTimeUnit"
:
46505634.80187172
,
"spDetail"
:
"voluptate mollit culpa do"
}
]
},
{
"gear"
:
-65090456.67652913
,
"consumeSps"
:
[
{
"spId"
:
"fugiat pariatur nulla"
,
"quantity"
:
94587700.1997793
,
"spName"
:
"culpa veniam deserunt reprehenderit consectetur"
,
"spImg"
:
"aliqua ullamco voluptate id est"
},
{
"spId"
:
"esse mollit non"
,
"quantity"
:
74783118.5855251
,
"spName"
:
"eu id"
,
"spImg"
:
"in ad"
},
{
"spId"
:
"fugiat"
,
"quantity"
:
-53736334.29075957
,
"spName"
:
"voluptate id Lorem culpa Duis"
,
"spImg"
:
"in reprehenderit ea commodo"
},
{
"spId"
:
"magna ex consectetur"
,
"quantity"
:
-73875549.76878983
,
"spName"
:
"ullamco Lorem quis tempor"
,
"spImg"
:
"cillum est cupidatat culpa nostrud"
},
{
"spId"
:
"Lorem sit aliqua magna ea"
,
"quantity"
:
-61922428.02592887
,
"spName"
:
"ullamco minim"
,
"spImg"
:
"cillum dolore deserunt labore proident"
}
],
"options"
:
[
{
"ruleId"
:
"elit ad"
,
"optionId"
:
"ullamco"
,
"optionName"
:
"incididunt et"
,
"optionStock"
:
79159000.81549373
,
"optionImg"
:
"ipsum irure deserunt"
,
"prizeId"
:
"Lorem amet anim veniam irure"
,
"prizeType"
:
-9851975.22015287
,
"userLimitCount"
:
-39970117.988698475
,
"alreadyUserCount"
:
"magna adipisicing nulla in"
,
"limitTimeUnit"
:
-86971880.18759094
,
"spDetail"
:
"esse"
},
{
"ruleId"
:
"officia velit aute consectetur"
,
"optionId"
:
"cillum Lorem Excepteur sed"
,
"optionName"
:
"est aliqua"
,
"optionStock"
:
-61588316.759481065
,
"optionImg"
:
"Lorem tempor"
,
"prizeId"
:
"ipsum dolore"
,
"prizeType"
:
-91286388.65227728
,
"userLimitCount"
:
78639570.3655217
,
"alreadyUserCount"
:
"ullamco culpa incididunt velit veniam"
,
"limitTimeUnit"
:
66542381.01732117
,
"spDetail"
:
"cillum tempor"
},
{
"ruleId"
:
"ipsum officia"
,
"optionId"
:
"enim id"
,
"optionName"
:
"sit ut Excepteur culpa"
,
"optionStock"
:
-84837994.48394129
,
"optionImg"
:
"aute anim Lorem ipsum"
,
"prizeId"
:
"quis reprehenderit"
,
"prizeType"
:
14036841.281951144
,
"userLimitCount"
:
-94070571.4326465
,
"alreadyUserCount"
:
"in ad et"
,
"limitTimeUnit"
:
94092745.07003239
,
"spDetail"
:
"anim laborum mollit quis dolore"
}
]
},
{
"gear"
:
33300231.15859984
,
"consumeSps"
:
[
{
"spId"
:
"enim magna et ad in"
,
"quantity"
:
-48627485.68469159
,
"spName"
:
"sit dolore Lorem proident magna"
,
"spImg"
:
"et nostrud non id velit"
},
{
"spId"
:
"id consequat ad esse laborum"
,
"quantity"
:
-81665785.05235709
,
"spName"
:
"reprehenderit officia esse nostrud"
,
"spImg"
:
"in"
},
{
"spId"
:
"consequat sunt voluptate ullamco"
,
"quantity"
:
48471761.42944166
,
"spName"
:
"veniam exercitation"
,
"spImg"
:
"ipsum aute do et"
},
{
"spId"
:
"aute labore commodo veniam"
,
"quantity"
:
-26472330.779943928
,
"spName"
:
"sunt amet aute elit ipsum"
,
"spImg"
:
"Lorem deserunt quis"
}
],
"options"
:
[
{
"ruleId"
:
"eu in irure"
,
"optionId"
:
"pariatur"
,
"optionName"
:
"sint ex fugiat sed"
,
"optionStock"
:
25561875.572054937
,
"optionImg"
:
"Duis cillum dolor"
,
"prizeId"
:
"reprehenderit in culpa"
,
"prizeType"
:
-29688982.918216884
,
"userLimitCount"
:
-70100544.86563289
,
"alreadyUserCount"
:
"sunt tempor minim"
,
"limitTimeUnit"
:
81524718.63529968
,
"spDetail"
:
"consequat ipsum"
},
{
"ruleId"
:
"nulla dolor Ut"
,
"optionId"
:
"pariatur ipsum occaecat esse"
,
"optionName"
:
"sint nulla ex Lorem"
,
"optionStock"
:
-35406471.128617235
,
"optionImg"
:
"nulla"
,
"prizeId"
:
"eu veniam"
,
"prizeType"
:
-91684293.89863361
,
"userLimitCount"
:
-3121941.653978139
,
"alreadyUserCount"
:
"do mollit tempor non"
,
"limitTimeUnit"
:
57940680.54955882
,
"spDetail"
:
"aliqua reprehenderit"
},
{
"ruleId"
:
"culpa eu"
,
"optionId"
:
"esse commodo elit"
,
"optionName"
:
"velit commodo adipisicing sunt"
,
"optionStock"
:
22287192.116777986
,
"optionImg"
:
"do et enim laborum sit"
,
"prizeId"
:
"irure in proident"
,
"prizeType"
:
-70276923.81996982
,
"userLimitCount"
:
-27277444.484475538
,
"alreadyUserCount"
:
"cupidatat"
,
"limitTimeUnit"
:
-50110583.499353334
,
"spDetail"
:
"in eu adipisicing"
}
]
},
{
"gear"
:
-78680376.71289834
,
"consumeSps"
:
[
{
"spId"
:
"ut"
,
"quantity"
:
55530837.75567675
,
"spName"
:
"ut occaecat"
,
"spImg"
:
"id fugiat"
}
],
"options"
:
[
{
"ruleId"
:
"velit commodo in cupidatat cillum"
,
"optionId"
:
"elit sint adipisicing tempor non"
,
"optionName"
:
"in ut est"
,
"optionStock"
:
-91276037.7707956
,
"optionImg"
:
"aliqua"
,
"prizeId"
:
"Lorem elit laborum sint"
,
"prizeType"
:
66378983.62891525
,
"userLimitCount"
:
-62494971.225406416
,
"alreadyUserCount"
:
"mollit aute"
,
"limitTimeUnit"
:
27447950.785440683
,
"spDetail"
:
"eu labore minim"
},
{
"ruleId"
:
"dolore sit consectetur"
,
"optionId"
:
"Excepteur reprehenderit minim"
,
"optionName"
:
"officia voluptate sunt"
,
"optionStock"
:
-62517174.23725851
,
"optionImg"
:
"occaecat nostrud veniam"
,
"prizeId"
:
"do"
,
"prizeType"
:
-70591672.96814443
,
"userLimitCount"
:
-43552427.75995829
,
"alreadyUserCount"
:
"dolore do ea veniam eu"
,
"limitTimeUnit"
:
62672685.987672955
,
"spDetail"
:
"aute ullamco dolor"
},
{
"ruleId"
:
"laborum in cillum"
,
"optionId"
:
"et aute"
,
"optionName"
:
"aute"
,
"optionStock"
:
40906675.80066571
,
"optionImg"
:
"incididunt amet enim Ut sit"
,
"prizeId"
:
"culpa qui laboris ut"
,
"prizeType"
:
10554405.17065218
,
"userLimitCount"
:
47673586.51996374
,
"alreadyUserCount"
:
"ut nulla"
,
"limitTimeUnit"
:
-78645006.69364513
,
"spDetail"
:
"culpa mollit"
},
{
"ruleId"
:
"ad magna ut culpa"
,
"optionId"
:
"ullamco pariatur amet exercitation laboris"
,
"optionName"
:
"anim"
,
"optionStock"
:
99166350.93714944
,
"optionImg"
:
"sed consequat"
,
"prizeId"
:
"minim"
,
"prizeType"
:
44250403.56450358
,
"userLimitCount"
:
-27632104.446371704
,
"alreadyUserCount"
:
"reprehenderit"
,
"limitTimeUnit"
:
47450358.4694978
,
"spDetail"
:
"ea tempor"
}
]
},
{
"gear"
:
-71389143.52481814
,
"consumeSps"
:
[
{
"spId"
:
"amet sunt proident magna"
,
"quantity"
:
36037136.11806995
,
"spName"
:
"in minim commodo"
,
"spImg"
:
"fugiat qui aliquip"
},
{
"spId"
:
"ut sit in amet pariatur"
,
"quantity"
:
-9530859.006551042
,
"spName"
:
"irure occaecat Excepteur et amet"
,
"spImg"
:
"exercitation cupidatat non anim"
},
{
"spId"
:
"ut esse"
,
"quantity"
:
-37122364.19479962
,
"spName"
:
"elit laborum tempor sed et"
,
"spImg"
:
"magna"
},
{
"spId"
:
"aliquip"
,
"quantity"
:
-54177865.122537926
,
"spName"
:
"anim est"
,
"spImg"
:
"culpa"
},
{
"spId"
:
"anim eiusmod"
,
"quantity"
:
99069980.3702037
,
"spName"
:
"cillum ipsum aliqua"
,
"spImg"
:
"dolore sed dolor proident"
}
],
"options"
:
[
{
"ruleId"
:
"sed"
,
"optionId"
:
"qui laborum velit"
,
"optionName"
:
"nisi ut ex mollit"
,
"optionStock"
:
7380254.180370733
,
"optionImg"
:
"officia proident"
,
"prizeId"
:
"anim est non eu"
,
"prizeType"
:
-14942853.04045619
,
"userLimitCount"
:
-87314317.3693578
,
"alreadyUserCount"
:
"ea Lorem"
,
"limitTimeUnit"
:
54813810.92950049
,
"spDetail"
:
"in"
}
]
}
]
}
}
\ 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