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
be1d099e
Commit
be1d099e
authored
Jun 20, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: pk历史查看逻辑优化
parent
4b4f12e0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
22 deletions
+22
-22
index.tsx
src/pages/battles/index.tsx
+18
-10
chapter.tsx
src/pages/main/main-underground/chapter.tsx
+4
-12
No files found.
src/pages/battles/index.tsx
View file @
be1d099e
...
...
@@ -10,6 +10,7 @@ import { View, Text, Image } from '@tarojs/components'
import
Button
from
'@/components/Button'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
import
assets
from
'@/assets/oss/assets-pk'
import
{
StageStatus
}
from
'@/api'
import
TopHeader
from
'./components/top-header'
import
PlayerDetails
from
'./components/player-details'
...
...
@@ -21,6 +22,11 @@ const Battles = () => {
const
addPkGuideTimes
=
useStoreActions
((
state
)
=>
state
.
guideModel
.
addPkGuideTimes
)
const
getSetting
=
useStoreActions
((
state
)
=>
state
.
userModel
.
getSetting
)
const
setting
=
useStoreState
((
state
)
=>
state
.
userModel
.
setting
)
const
stageList
=
useStoreState
(
state
=>
state
.
mainModel
.
stageList
)
const
hasPassed
=
useMemo
(()
=>
{
return
stageList
.
findIndex
(
c
=>
c
.
status
===
StageStatus
.
CURRENT
)
>
0
},
[
stageList
])
const
fetchUserSummary
=
useStoreActions
(
(
actions
)
=>
actions
.
battlesModel
.
fetchUserSummary
...
...
@@ -75,16 +81,18 @@ const Battles = () => {
<
pk
-
record
list=
{
summary
?.
records
||
[]
}
config=
{
setting
}
ref=
{
pkRecords
}
/>
</
View
>
</
View
>
<
View
className=
{
styles
.
bottom
}
>
<
Button
size=
"large"
image=
{
styles
.
bottomButton
}
onClick=
{
handleClick
}
hoverImage=
{
styles
.
bottomHoverButton
}
>
<
Image
src=
{
assets
[
'pk.png'
].
u
}
className=
{
styles
.
bottomText
}
/>
</
Button
>
</
View
>
{
hasPassed
&&
(
<
View
className=
{
styles
.
bottom
}
>
<
Button
size=
"large"
image=
{
styles
.
bottomButton
}
onClick=
{
handleClick
}
hoverImage=
{
styles
.
bottomHoverButton
}
>
<
Image
src=
{
assets
[
'pk.png'
].
u
}
className=
{
styles
.
bottomText
}
/>
</
Button
>
</
View
>
)
}
</
View
>
)
}
...
...
src/pages/main/main-underground/chapter.tsx
View file @
be1d099e
...
...
@@ -5,18 +5,12 @@ import { useStoreActions, useStoreState } from '@/store/hooks'
import
{
useMemo
}
from
'react'
import
styles
from
'./chapter.module.scss'
import
{
StageStatus
}
from
'./scene/constants'
const
MainHeader
=
()
=>
{
const
nav
=
useMemo
(
getMenuButtonBoundingClientRect
,
[])
const
sys
=
useMemo
(
getSystemInfoSync
,
[])
const
completeAddDeskGuide
=
useStoreActions
(
actions
=>
actions
.
guideModel
.
completeAddDeskGuide
)
const
isAddDeskTopGuideComplete
=
useStoreState
(
state
=>
state
.
guideModel
.
isAddDeskTopGuideComplete
)
const
stageList
=
useStoreState
(
state
=>
state
.
mainModel
.
stageList
)
const
hasPassed
=
useMemo
(()
=>
{
return
stageList
.
findIndex
(
c
=>
c
.
status
===
StageStatus
.
CURRENT
)
>
0
},
[
stageList
])
const
guideStyle
=
useMemo
(()
=>
{
return
{
...
...
@@ -52,12 +46,10 @@ const MainHeader = () => {
</
View
>
</
View
>
)
}
{
hasPassed
&&
(
<
View
className=
{
styles
.
pk
}
onClick=
{
()
=>
navigateTo
({
url
:
'/pages/battles/index'
})
}
>
{
/* <View className={styles.dot}></View> */
}
<
Image
src=
{
assetsMainNext
[
'pk-btn.png'
].
u
}
className=
{
styles
.
pkIcon
}
></
Image
>
</
View
>
)
}
<
View
className=
{
styles
.
pk
}
onClick=
{
()
=>
navigateTo
({
url
:
'/pages/battles/index'
})
}
>
{
/* <View className={styles.dot}></View> */
}
<
Image
src=
{
assetsMainNext
[
'pk-btn.png'
].
u
}
className=
{
styles
.
pkIcon
}
></
Image
>
</
View
>
</
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