Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
GeekLearnMathWeapp
Project
Project
Details
Activity
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
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
frontend
GeekLearnMathWeapp
Commits
9f004b7c
Commit
9f004b7c
authored
Jun 20, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 拥有星星数量
parent
971a0708
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
game.ts
src/api/game.ts
+3
-0
stage.tsx
src/pages/main/main-underground/scene/stage.tsx
+3
-4
No files found.
src/api/game.ts
View file @
9f004b7c
...
...
@@ -72,6 +72,9 @@ export interface Stage {
/** 星星限制数量 */
limitStar
:
number
;
/** 拥有星星数量 */
holdStar
:
number
;
/** pk负 */
pkLoseNum
:
number
|
null
;
/** pk胜场 */
...
...
src/pages/main/main-underground/scene/stage.tsx
View file @
9f004b7c
...
...
@@ -153,7 +153,6 @@ const StageComp = (props: StageProps) => {
const
nextPkGuide
=
useStoreActions
(
state
=>
state
.
guideModel
.
nextPkGuide
)
const
showPkGuideFromHis
=
useStoreState
(
state
=>
state
.
guideModel
.
showPkGuideFromHis
)
const
updateGuideState
=
useStoreActions
(
state
=>
state
.
guideModel
.
updateState
)
const
pkDetails
=
useStoreState
(
state
=>
state
.
userModel
.
pkDetails
)
const
isSpecialRound
=
useMemo
(()
=>
{
return
stage
.
type
===
StageType
.
Special
...
...
@@ -174,7 +173,7 @@ const StageComp = (props: StageProps) => {
const
handleClick
=
()
=>
{
if
(
stage
.
status
!==
StageStatus
.
DISABLED
||
!
isProduction
)
{
if
(
isSpecialRound
)
{
if
((
pkDetails
?.
stars
??
0
)
<
stage
.
limitStar
)
{
if
((
stage
.
holdStar
??
0
)
<
stage
.
limitStar
)
{
showToast
({
title
:
'星星数量不够,快去收集吧~'
,
icon
:
'none'
})
return
}
...
...
@@ -218,7 +217,7 @@ const StageComp = (props: StageProps) => {
}
case
StageStatus
.
CURRENT
:
{
if
(
isSpecialRound
&&
(
pkDetails
?.
stars
??
0
)
<
stage
.
limitStar
)
{
if
(
isSpecialRound
&&
(
stage
.
holdStar
??
0
)
<
stage
.
limitStar
)
{
return
(
<
Image
src=
{
getLockedIcon
(
stage
.
type
).
u
}
className=
{
getIconClassNames
(
stage
.
type
)
}
/>
)
...
...
@@ -301,7 +300,7 @@ const StageComp = (props: StageProps) => {
{
isSpecialRound
?
(
<
View
className=
{
styles
.
special_name
}
>
<
Image
src=
{
assetsMainNext
[
'star.png'
].
u
}
className=
{
styles
.
special_star
}
/>
星星
{
pkDetails
?.
stars
??
0
}
/
{
stage
.
limitStar
}
星星
{
stage
.
holdStar
??
0
}
/
{
stage
.
limitStar
}
</
View
>
)
:
(
<
View
>
{
!
isProduction
?
`${stage.id}.`
:
''
}{
stage
.
name
}
</
View
>
...
...
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