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
3cca7b02
Commit
3cca7b02
authored
Apr 11, 2023
by
raca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
77d23314
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
16 deletions
+62
-16
header.tsx
src/pages/group/components/header.tsx
+3
-2
index.tsx
src/pages/group/index.tsx
+3
-2
main-header.module.scss
src/pages/prepare/components/main-header.module.scss
+22
-1
main-header.tsx
src/pages/prepare/components/main-header.tsx
+31
-8
format.ts
src/pages/prepare/format.ts
+3
-3
No files found.
src/pages/group/components/header.tsx
View file @
3cca7b02
...
@@ -28,14 +28,15 @@ const CroupHeader = ({ groupNo }: { groupNo: string }) => {
...
@@ -28,14 +28,15 @@ const CroupHeader = ({ groupNo }: { groupNo: string }) => {
const
[
hideIndex
,
setHideIndex
]
=
useState
(
-
1
)
const
[
hideIndex
,
setHideIndex
]
=
useState
(
-
1
)
const
queryTribePoint
=
useStoreActions
(
actions
=>
actions
.
groupModel
.
queryTribePoint
)
const
queryTribePoint
=
useStoreActions
(
actions
=>
actions
.
groupModel
.
queryTribePoint
)
const
points
=
useStoreState
(
state
=>
state
.
groupModel
.
points
)
const
points
=
useStoreState
(
state
=>
state
.
groupModel
.
points
)
const
getSetting
=
useStoreActions
(
actions
=>
actions
.
userModel
.
getSetting
)
const
fetchAccount
=
useStoreActions
(
actions
=>
actions
.
userModel
.
fetchAccount
)
const
{
run
,
loading
}
=
useRequest
(
postTribePoint
,
{
const
{
run
,
loading
}
=
useRequest
(
postTribePoint
,
{
immediate
:
false
,
immediate
:
false
,
throttleDelay
:
1000
,
throttleDelay
:
1000
,
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
showToast
({
title
:
'领取成功'
})
showToast
({
title
:
'领取成功'
})
queryTribePoint
()
queryTribePoint
()
getSetting
()
fetchAccount
()
}
}
})
})
...
...
src/pages/group/index.tsx
View file @
3cca7b02
...
@@ -39,6 +39,7 @@ const Group = () => {
...
@@ -39,6 +39,7 @@ const Group = () => {
const
tribeInfo
=
useStoreState
(
state
=>
state
.
groupModel
.
tribeInfo
)
const
tribeInfo
=
useStoreState
(
state
=>
state
.
groupModel
.
tribeInfo
)
const
fetchTribeInfo
=
useStoreActions
(
actions
=>
actions
.
groupModel
.
fetchTribeInfo
)
const
fetchTribeInfo
=
useStoreActions
(
actions
=>
actions
.
groupModel
.
fetchTribeInfo
)
const
queryTribePoint
=
useStoreActions
(
actions
=>
actions
.
groupModel
.
queryTribePoint
)
const
queryTribePoint
=
useStoreActions
(
actions
=>
actions
.
groupModel
.
queryTribePoint
)
const
fetchAccount
=
useStoreActions
(
actions
=>
actions
.
userModel
.
fetchAccount
)
const
tabBarHeight
=
useMemo
(()
=>
{
const
tabBarHeight
=
useMemo
(()
=>
{
return
nav
.
height
+
nav
.
top
+
5
return
nav
.
height
+
nav
.
top
+
5
...
@@ -62,7 +63,7 @@ const Group = () => {
...
@@ -62,7 +63,7 @@ const Group = () => {
useDidShow
(
async
()
=>
{
useDidShow
(
async
()
=>
{
const
tabbar
=
getTabBar
<
TabbarRef
>
(
page
)
const
tabbar
=
getTabBar
<
TabbarRef
>
(
page
)
tabbar
?.
setSelected
(
1
)
tabbar
?.
setSelected
(
1
)
Promise
.
all
([
queryTribePoint
(),
fetchTribeInfo
()])
Promise
.
all
([
queryTribePoint
(),
fetchTribeInfo
()
,
fetchAccount
()
])
})
})
const
getShareParams
=
useCallback
(()
=>
{
const
getShareParams
=
useCallback
(()
=>
{
...
@@ -103,7 +104,7 @@ const Group = () => {
...
@@ -103,7 +104,7 @@ const Group = () => {
const
onRefresher
=
async
()
=>
{
const
onRefresher
=
async
()
=>
{
try
{
try
{
toggle
()
toggle
()
await
Promise
.
all
([
fetchTribeInfo
(),
queryTribePoint
()])
await
Promise
.
all
([
fetchTribeInfo
(),
queryTribePoint
()
,
fetchAccount
()
])
}
finally
{
}
finally
{
setTimeout
(()
=>
toggle
(),
100
)
setTimeout
(()
=>
toggle
(),
100
)
}
}
...
...
src/pages/prepare/components/main-header.module.scss
View file @
3cca7b02
...
@@ -101,15 +101,25 @@
...
@@ -101,15 +101,25 @@
}
}
}
}
.noneDetails
{
animation
:
fadeOut
1
.6s
ease-in-out
forwards
;
animation-delay
:
1
.3s
;
}
.beforeDetails
{
.beforeDetails
{
position
:
absolute
;
position
:
absolute
;
right
:
0
;
right
:
0
;
left
:
0
;
left
:
0
;
.logo
{
.logo
{
// visibility: hidden;
opacity
:
0
;
}
.show
{
animation
:
fadeUp
1
.3s
ease-out
forwards
;
animation
:
fadeUp
1
.3s
ease-out
forwards
;
animation-delay
:
1s
;
animation-delay
:
1s
;
opacity
:
0
;
visibility
:
visible
;
}
}
}
}
}
}
...
@@ -289,3 +299,13 @@
...
@@ -289,3 +299,13 @@
transform
:
scale
(
1
)
translateY
(
-44
PX
);
transform
:
scale
(
1
)
translateY
(
-44
PX
);
}
}
}
}
@keyframes
fadeOut
{
0
%
{
opacity
:
1
;
}
100
%
{
opacity
:
0
;
}
}
\ No newline at end of file
src/pages/prepare/components/main-header.tsx
View file @
3cca7b02
...
@@ -11,7 +11,6 @@ import { formatNextStep, formatLevelAchieve, formatTopAchieve, formatType } from
...
@@ -11,7 +11,6 @@ import { formatNextStep, formatLevelAchieve, formatTopAchieve, formatType } from
const
MainHeader
=
()
=>
{
const
MainHeader
=
()
=>
{
const
stageDetail
=
useStoreState
(
state
=>
state
.
gameModel
.
stageDetail
)
const
stageDetail
=
useStoreState
(
state
=>
state
.
gameModel
.
stageDetail
)
const
stageDetailPre
=
useStoreState
(
state
=>
state
.
gameModel
.
stageDetailPre
)
const
stageDetailPre
=
useStoreState
(
state
=>
state
.
gameModel
.
stageDetailPre
)
// const stageDetailPre = { level: 'S', gear: 50, upGear: false }
const
isKing
=
useMemo
(()
=>
{
// 王者
const
isKing
=
useMemo
(()
=>
{
// 王者
return
stageDetail
?.
level
===
StageLevel
.
S
&&
String
(
stageDetail
?.
gear
)
===
StageGear
.
TOP10
return
stageDetail
?.
level
===
StageLevel
.
S
&&
String
(
stageDetail
?.
gear
)
===
StageGear
.
TOP10
...
@@ -81,6 +80,8 @@ const MainHeader = () => {
...
@@ -81,6 +80,8 @@ const MainHeader = () => {
return
null
return
null
}
}
console
.
log
(
'stageDetailPre'
,
stageDetailPre
)
return
(
return
(
<
View
className=
{
styles
.
wrapper
}
>
<
View
className=
{
styles
.
wrapper
}
>
<
View
className=
{
styles
.
title
}
>
{
stageDetail
.
name
||
'-'
}
</
View
>
<
View
className=
{
styles
.
title
}
>
{
stageDetail
.
name
||
'-'
}
</
View
>
...
@@ -109,15 +110,37 @@ const MainHeader = () => {
...
@@ -109,15 +110,37 @@ const MainHeader = () => {
{
stageDetailPre
{
stageDetailPre
?
(
?
(
<>
<>
<
View
className=
{
styles
.
details
}
>
<
View
className=
{
classNames
(
styles
.
details
,)
}
>
<
Image
src=
{
formatLevelAchieve
(
stageDetailPre
?.
level
)
}
className=
{
styles
.
logo
}
/>
<
Image
src=
{
formatLevelAchieve
(
stageDetailPre
.
firstTime
?
stageDetail
?.
level
:
stageDetailPre
?.
level
)
}
className=
{
styles
.
logo
}
/>
<
Image
src=
{
formatTopAchieve
(
stageDetailPre
?.
gear
.
toString
())
}
className=
{
styles
.
logo
}
/>
<
Image
src=
{
formatTopAchieve
(
stageDetailPre
.
firstTime
?
stageDetail
?.
gear
?.
toString
()
:
stageDetailPre
?.
gear
?
.
toString
())
}
className=
{
styles
.
logo
}
/>
<
Image
src=
{
(
isKing
||
stageDetailPre
?.
upGear
)
?
assets
[
'upgear.png'
].
u
:
assets
[
'upgear-un.png'
].
u
}
className=
{
styles
.
logo
}
/>
<
Image
src=
{
(
isKing
||
(
stageDetailPre
.
firstTime
?
stageDetail
?.
upGear
:
stageDetailPre
?.
upGear
)
)
?
assets
[
'upgear.png'
].
u
:
assets
[
'upgear-un.png'
].
u
}
className=
{
styles
.
logo
}
/>
</
View
>
</
View
>
<
View
className=
{
styles
.
beforeDetails
}
>
<
View
className=
{
styles
.
beforeDetails
}
>
{
stageDetailPre
?.
level
!==
stageDetail
?.
level
&&
<
Image
src=
{
formatLevelAchieve
(
stageDetail
?.
level
)
}
className=
{
classNames
(
styles
.
logo
,
styles
.
level
)
}
/>
}
<
Image
{
stageDetailPre
?.
gear
!==
stageDetail
?.
gear
&&
<
Image
src=
{
formatTopAchieve
(
stageDetail
?.
gear
.
toString
())
}
className=
{
classNames
(
styles
.
logo
,
styles
.
gear
)
}
/>
}
src=
{
formatLevelAchieve
(
stageDetail
?.
level
)
}
{
stageDetailPre
?.
upGear
!==
stageDetail
?.
upGear
&&
<
Image
src=
{
assets
[
'upgear.png'
].
u
}
className=
{
classNames
(
styles
.
logo
,
styles
.
upgear
)
}
/>
}
className=
{
classNames
(
styles
.
logo
,
{
[
styles
.
show
]:
stageDetailPre
.
level
&&
stageDetail
?.
level
!==
stageDetailPre
?.
level
})
}
/>
<
Image
src=
{
formatTopAchieve
(
stageDetail
.
gear
?.
toString
())
}
className=
{
classNames
(
styles
.
logo
,
{
[
styles
.
show
]:
stageDetailPre
.
gear
&&
stageDetail
?.
gear
<=
30
&&
stageDetail
?.
gear
<
stageDetailPre
?.
gear
})
}
/>
<
Image
src=
{
assets
[
'upgear.png'
].
u
}
className=
{
classNames
(
styles
.
logo
,
{
[
styles
.
show
]:
stageDetail
?.
upGear
!==
stageDetailPre
?.
upGear
})
}
/>
</
View
>
</
View
>
</>
</>
)
)
...
...
src/pages/prepare/format.ts
View file @
3cca7b02
...
@@ -21,17 +21,17 @@ export const formatNextStep = (item: NextStep) => {
...
@@ -21,17 +21,17 @@ export const formatNextStep = (item: NextStep) => {
}
}
case
StageGear
.
TOP10
:
case
StageGear
.
TOP10
:
return
{
return
{
t
:
`TOP
${
StageGear
.
TOP10
}
`
,
t
:
`TOP
${
StageGear
.
TOP10
}
%
`
,
u
:
assets
[
'top-big-10.png'
].
u
u
:
assets
[
'top-big-10.png'
].
u
}
}
case
StageGear
.
TOP20
:
case
StageGear
.
TOP20
:
return
{
return
{
t
:
`TOP
${
StageGear
.
TOP20
}
`
,
t
:
`TOP
${
StageGear
.
TOP20
}
%
`
,
u
:
assets
[
'top-big-20.png'
].
u
u
:
assets
[
'top-big-20.png'
].
u
}
}
case
StageGear
.
TOP30
:
case
StageGear
.
TOP30
:
return
{
return
{
t
:
`TOP
${
StageGear
.
TOP30
}
`
,
t
:
`TOP
${
StageGear
.
TOP30
}
%
`
,
u
:
assets
[
'top-big-30.png'
].
u
u
:
assets
[
'top-big-30.png'
].
u
}
}
case
'upGear'
:
case
'upGear'
:
...
...
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