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
5e8ed125
Commit
5e8ed125
authored
Apr 08, 2023
by
m
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
b3f19187
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
header.tsx
src/pages/group/components/header.tsx
+12
-8
No files found.
src/pages/group/components/header.tsx
View file @
5e8ed125
import
{
useState
}
from
'react'
import
{
View
,
Text
,
Image
}
from
'@tarojs/components'
import
{
View
,
Text
,
Image
}
from
'@tarojs/components'
import
{
showToast
}
from
'@tarojs/taro'
import
{
showToast
}
from
'@tarojs/taro'
import
classNames
from
'classnames'
import
classNames
from
'classnames'
import
{
useStoreActions
,
useStoreState
}
from
'@/store/hooks'
import
{
useStoreActions
,
useStoreState
}
from
'@/store/hooks'
import
{
useRequest
,
useBoolean
}
from
'@/hooks'
import
{
useRequest
}
from
'@/hooks'
import
{
postTribePoint
,
type
PointType
}
from
'@/api/group'
import
{
postTribePoint
,
type
PointType
}
from
'@/api/group'
import
{
palyAudio
}
from
'@/utils/play-audio'
import
{
palyAudio
}
from
'@/utils/play-audio'
import
assets
from
'@/assets/oss/assets-group'
import
assets
from
'@/assets/oss/assets-group'
...
@@ -25,22 +25,21 @@ const renderCreator = () => (
...
@@ -25,22 +25,21 @@ const renderCreator = () => (
)
)
const
CroupHeader
=
({
groupNo
}:
{
groupNo
:
string
})
=>
{
const
CroupHeader
=
({
groupNo
}:
{
groupNo
:
string
})
=>
{
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
[
active
,
{
setTrue
}]
=
useBoolean
(
false
)
const
{
run
}
=
useRequest
(
postTribePoint
,
{
const
{
run
,
loading
}
=
useRequest
(
postTribePoint
,
{
immediate
:
false
,
immediate
:
false
,
throttleDelay
:
1000
,
throttleDelay
:
1000
,
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
palyAudio
(
audio
[
'点领取水晶部落.wav'
].
u
)
palyAudio
(
audio
[
'点领取水晶部落.wav'
].
u
)
setTrue
()
showToast
({
title
:
'领取成功'
})
showToast
({
title
:
'领取成功'
})
queryTribePoint
()
queryTribePoint
()
}
}
})
})
const
renderItem
=
(
item
:
PointType
)
=>
{
const
renderItem
=
(
item
:
PointType
,
index
)
=>
{
return
(
return
(
<
View
<
View
className=
{
classNames
({
className=
{
classNames
({
...
@@ -48,9 +47,14 @@ const CroupHeader = ({ groupNo }: { groupNo: string }) => {
...
@@ -48,9 +47,14 @@ const CroupHeader = ({ groupNo }: { groupNo: string }) => {
[
styles
.
members_invite
]:
item
.
type
===
'MEMBERJOIN'
,
[
styles
.
members_invite
]:
item
.
type
===
'MEMBERJOIN'
,
[
styles
.
is_show
]:
item
.
point
,
[
styles
.
is_show
]:
item
.
point
,
[
styles
.
fadeInUpDowAnimate
]:
item
.
point
,
[
styles
.
fadeInUpDowAnimate
]:
item
.
point
,
[
styles
.
none
]:
active
&&
!
item
.
point
,
[
styles
.
none
]:
index
===
hideIndex
&&
!
loading
&&
!
item
.
point
,
})
}
})
}
onClick=
{
()
=>
item
.
point
&&
run
({
type
:
item
.
type
})
}
onClick=
{
()
=>
{
if
(
item
.
point
)
{
setHideIndex
(
index
)
run
({
type
:
item
.
type
})
}
}
}
>
>
<
View
className=
{
classNames
(
styles
.
members_score
)
}
>
<
View
className=
{
classNames
(
styles
.
members_score
)
}
>
<
Image
<
Image
...
...
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