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
de0e0051
Commit
de0e0051
authored
Apr 11, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of dev.jiuaoedu.com:hewenhao/GeekLearnMathWeapp
parents
31ec509c
3cca7b02
Hide 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 @
de0e0051
...
...
@@ -28,14 +28,15 @@ const CroupHeader = ({ groupNo }: { groupNo: string }) => {
const
[
hideIndex
,
setHideIndex
]
=
useState
(
-
1
)
const
queryTribePoint
=
useStoreActions
(
actions
=>
actions
.
groupModel
.
queryTribePoint
)
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
,
{
immediate
:
false
,
throttleDelay
:
1000
,
onSuccess
:
()
=>
{
showToast
({
title
:
'领取成功'
})
queryTribePoint
()
getSetting
()
fetchAccount
()
}
})
...
...
src/pages/group/index.tsx
View file @
de0e0051
...
...
@@ -39,6 +39,7 @@ const Group = () => {
const
tribeInfo
=
useStoreState
(
state
=>
state
.
groupModel
.
tribeInfo
)
const
fetchTribeInfo
=
useStoreActions
(
actions
=>
actions
.
groupModel
.
fetchTribeInfo
)
const
queryTribePoint
=
useStoreActions
(
actions
=>
actions
.
groupModel
.
queryTribePoint
)
const
fetchAccount
=
useStoreActions
(
actions
=>
actions
.
userModel
.
fetchAccount
)
const
tabBarHeight
=
useMemo
(()
=>
{
return
nav
.
height
+
nav
.
top
+
5
...
...
@@ -62,7 +63,7 @@ const Group = () => {
useDidShow
(
async
()
=>
{
const
tabbar
=
getTabBar
<
TabbarRef
>
(
page
)
tabbar
?.
setSelected
(
1
)
Promise
.
all
([
queryTribePoint
(),
fetchTribeInfo
()])
Promise
.
all
([
queryTribePoint
(),
fetchTribeInfo
()
,
fetchAccount
()
])
})
const
getShareParams
=
useCallback
(()
=>
{
...
...
@@ -103,7 +104,7 @@ const Group = () => {
const
onRefresher
=
async
()
=>
{
try
{
toggle
()
await
Promise
.
all
([
fetchTribeInfo
(),
queryTribePoint
()])
await
Promise
.
all
([
fetchTribeInfo
(),
queryTribePoint
()
,
fetchAccount
()
])
}
finally
{
setTimeout
(()
=>
toggle
(),
100
)
}
...
...
src/pages/prepare/components/main-header.module.scss
View file @
de0e0051
...
...
@@ -101,15 +101,25 @@
}
}
.noneDetails
{
animation
:
fadeOut
1
.6s
ease-in-out
forwards
;
animation-delay
:
1
.3s
;
}
.beforeDetails
{
position
:
absolute
;
right
:
0
;
left
:
0
;
.logo
{
// visibility: hidden;
opacity
:
0
;
}
.show
{
animation
:
fadeUp
1
.3s
ease-out
forwards
;
animation-delay
:
1s
;
opacity
:
0
;
visibility
:
visible
;
}
}
}
...
...
@@ -288,4 +298,14 @@
opacity
:
1
;
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 @
de0e0051
...
...
@@ -11,7 +11,6 @@ import { formatNextStep, formatLevelAchieve, formatTopAchieve, formatType } from
const
MainHeader
=
()
=>
{
const
stageDetail
=
useStoreState
(
state
=>
state
.
gameModel
.
stageDetail
)
const
stageDetailPre
=
useStoreState
(
state
=>
state
.
gameModel
.
stageDetailPre
)
// const stageDetailPre = { level: 'S', gear: 50, upGear: false }
const
isKing
=
useMemo
(()
=>
{
// 王者
return
stageDetail
?.
level
===
StageLevel
.
S
&&
String
(
stageDetail
?.
gear
)
===
StageGear
.
TOP10
...
...
@@ -81,6 +80,8 @@ const MainHeader = () => {
return
null
}
console
.
log
(
'stageDetailPre'
,
stageDetailPre
)
return
(
<
View
className=
{
styles
.
wrapper
}
>
<
View
className=
{
styles
.
title
}
>
{
stageDetail
.
name
||
'-'
}
</
View
>
...
...
@@ -109,15 +110,37 @@ const MainHeader = () => {
{
stageDetailPre
?
(
<>
<
View
className=
{
styles
.
details
}
>
<
Image
src=
{
formatLevelAchieve
(
stageDetailPre
?.
level
)
}
className=
{
styles
.
logo
}
/>
<
Image
src=
{
formatTopAchieve
(
stageDetailPre
?.
gear
.
toString
())
}
className=
{
styles
.
logo
}
/>
<
Image
src=
{
(
isKing
||
stageDetailPre
?.
upGear
)
?
assets
[
'upgear.png'
].
u
:
assets
[
'upgear-un.png'
].
u
}
className=
{
styles
.
logo
}
/>
<
View
className=
{
classNames
(
styles
.
details
,)
}
>
<
Image
src=
{
formatLevelAchieve
(
stageDetailPre
.
firstTime
?
stageDetail
?.
level
:
stageDetailPre
?.
level
)
}
className=
{
styles
.
logo
}
/>
<
Image
src=
{
formatTopAchieve
(
stageDetailPre
.
firstTime
?
stageDetail
?.
gear
?.
toString
()
:
stageDetailPre
?.
gear
?
.
toString
())
}
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
className=
{
styles
.
beforeDetails
}
>
{
stageDetailPre
?.
level
!==
stageDetail
?.
level
&&
<
Image
src=
{
formatLevelAchieve
(
stageDetail
?.
level
)
}
className=
{
classNames
(
styles
.
logo
,
styles
.
level
)
}
/>
}
{
stageDetailPre
?.
gear
!==
stageDetail
?.
gear
&&
<
Image
src=
{
formatTopAchieve
(
stageDetail
?.
gear
.
toString
())
}
className=
{
classNames
(
styles
.
logo
,
styles
.
gear
)
}
/>
}
{
stageDetailPre
?.
upGear
!==
stageDetail
?.
upGear
&&
<
Image
src=
{
assets
[
'upgear.png'
].
u
}
className=
{
classNames
(
styles
.
logo
,
styles
.
upgear
)
}
/>
}
<
Image
src=
{
formatLevelAchieve
(
stageDetail
?.
level
)
}
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
>
</>
)
...
...
src/pages/prepare/format.ts
View file @
de0e0051
...
...
@@ -21,17 +21,17 @@ export const formatNextStep = (item: NextStep) => {
}
case
StageGear
.
TOP10
:
return
{
t
:
`TOP
${
StageGear
.
TOP10
}
`
,
t
:
`TOP
${
StageGear
.
TOP10
}
%
`
,
u
:
assets
[
'top-big-10.png'
].
u
}
case
StageGear
.
TOP20
:
return
{
t
:
`TOP
${
StageGear
.
TOP20
}
`
,
t
:
`TOP
${
StageGear
.
TOP20
}
%
`
,
u
:
assets
[
'top-big-20.png'
].
u
}
case
StageGear
.
TOP30
:
return
{
t
:
`TOP
${
StageGear
.
TOP30
}
`
,
t
:
`TOP
${
StageGear
.
TOP30
}
%
`
,
u
:
assets
[
'top-big-30.png'
].
u
}
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