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
1e5570ed
Commit
1e5570ed
authored
Apr 08, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of dev.jiuaoedu.com:hewenhao/GeekLearnMathWeapp
parents
87507f15
6c2da8ab
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
393 additions
and
238 deletions
+393
-238
words.json
assets/setting/words.json
+225
-2
auth.ts
src/api/auth.ts
+2
-4
header.module.scss
src/pages/group/components/header.module.scss
+33
-6
header.tsx
src/pages/group/components/header.tsx
+21
-8
members.module.scss
src/pages/group/components/members.module.scss
+24
-0
members.tsx
src/pages/group/components/members.tsx
+33
-3
data.json
src/pages/group/data.json
+0
-172
index.module.scss
src/pages/group/index.module.scss
+1
-1
index.tsx
src/pages/group/index.tsx
+31
-27
main-header.tsx
src/pages/prepare/components/main-header.tsx
+7
-5
index.module.scss
src/pages/prepare/index.module.scss
+4
-1
index.tsx
src/pages/prepare/index.tsx
+4
-3
render.tsx
src/pages/prepare/render.tsx
+8
-6
No files found.
assets/setting/words.json
View file @
1e5570ed
{
{
"ad"
:
[
"你的"
],
"adj"
:
[
"none"
:
[
"我的"
]
"快乐的"
,
"智慧的"
,
"勤奋的"
,
"阳光的"
,
"活力的"
,
"奇妙的"
,
"积极的"
,
"友善的"
,
"有趣的"
,
"创新的"
,
"勇敢的"
,
"自信的"
,
"合作的"
,
"发现的"
,
"好奇的"
,
"探险的"
,
"快速的"
,
"乐观的"
,
"独特的"
,
"热情的"
,
"聪明的"
,
"热爱的"
,
"团结的"
,
"充满活力的"
,
"勤学的"
,
"有才华的"
,
"自主的"
,
"坚韧的"
,
"追求的"
,
"善良的"
,
"敏锐的"
,
"进取的"
,
"愉快的"
,
"研究的"
,
"专注的"
,
"激情的"
,
"奋斗的"
,
"互助的"
,
"关爱的"
,
"探索的"
,
"实践的"
,
"耐心的"
,
"鼓励的"
,
"领先的"
,
"美丽的"
,
"幸福的"
,
"快乐的"
,
"自由的"
,
"坚强的"
,
"勇敢的"
,
"温暖的"
,
"清新的"
,
"活力的"
,
"活泼的"
,
"青春的"
,
"智慧的"
,
"聪明的"
,
"热情的"
,
"真诚的"
,
"诚实的"
,
"安静的"
,
"优雅的"
,
"舒适的"
,
"轻松的"
,
"愉悦的"
,
"满足的"
,
"安心的"
,
"放松的"
,
"有趣的"
,
"充实的"
,
"丰富的"
,
"平静的"
,
"祥和的"
,
"融洽的"
,
"美好的"
,
"纯真的"
,
"温馨的"
,
"亲切的"
,
"体贴的"
,
"善良的"
,
"慷慨的"
,
"宽容的"
,
"心灵的"
,
"灵活的"
,
"灵敏的"
,
"灵感的"
,
"机智的"
,
"洞察的"
,
"求知的"
,
"独立的"
,
"坦率的"
,
"无畏的"
,
"勤奋的"
,
"拼搏的"
,
"奋斗的"
,
"努力的"
,
"好学的"
,
"有爱的"
,
"心善的"
,
"谦虚的"
,
"低调的"
,
"好客的"
,
"热心的"
,
"敬业的"
,
"专注的"
,
"睿智的"
,
"天才的"
,
"创新的"
,
"匠心的"
,
"有趣的"
,
"幽默的"
,
"可爱的"
,
"动人的"
,
"高尚的"
,
"现代的"
,
"前卫的"
,
"时尚的"
,
"独特的"
,
"初心的"
,
"好看的"
,
"优美的"
,
"精致的"
,
"细腻的"
,
"优秀的"
,
"卓越的"
,
"杰出的"
,
"无敌的"
,
"顶尖的"
,
"强大的"
,
"不败的"
,
"无限的"
,
"神奇的"
,
"无比的"
,
"神圣的"
,
"神秘的"
,
"神速的"
,
"惊人的"
,
"惊喜的"
,
"惊艳的"
,
"惊奇的"
],
"noun"
:
[
"小天才"
,
"求知者"
,
"小发现者"
,
"智者"
,
"探险家"
,
"发现者"
,
"领航员"
,
"建设者"
,
"实践家"
,
"创新者"
,
"勇敢者"
,
"智慧者"
,
"友谊园"
,
"进步站"
,
"学问堡"
,
"快乐屋"
,
"智慧树"
,
"成长苑"
,
"探索岛"
,
"进步园"
,
"奋斗湾"
,
"启迪坊"
,
"拓展区"
,
"创意轩"
,
"成功街"
,
"理想家"
,
"友爱巷"
,
"智者梯"
,
"合作楼"
,
"幸福阁"
,
"梦想窗"
,
"阳光河"
,
"绿色园"
,
"希望港"
,
"小探险家"
,
"小学者"
,
"小思考者"
,
"小解决者"
,
"小领导者"
,
"小战士"
,
"小导师"
,
"小启蒙者"
,
"小团队"
,
"小伙伴"
,
"小梦想家"
,
"小建设者"
,
"小创作者"
,
"小勇士"
,
"小超人"
,
"小明星"
,
"小实践者"
,
"小观察家"
,
"小发明家"
,
"小合作者"
,
"小成就者"
,
"小聆听者"
,
"小领袖"
,
"小改革者"
,
"小示范者"
,
"小敢于者"
,
"小尝试者"
,
"小协作者"
,
"小规划者"
,
"小目标者"
,
"小奋进者"
,
"小责任者"
,
"小挑战者"
,
"小乐观者"
,
"小学习者"
,
"小坚持者"
,
"小成长者"
,
"小表达者"
,
"小思维者"
,
"小引导者"
,
"小庆祝者"
,
"小鼓舞者"
,
"小突破者"
,
"小合群者"
,
"小原则者"
,
"小支持者"
]
}
}
src/api/auth.ts
View file @
1e5570ed
...
@@ -70,12 +70,10 @@ export type NickNameWord = {
...
@@ -70,12 +70,10 @@ export type NickNameWord = {
adj
:
string
[];
adj
:
string
[];
}
}
const
NickNameUrl
=
'https://cdn.jkwljy.com/pk-math/setting/nickname-words.json'
export
function
getNickNameWords
(
url
=
'nickname-words'
)
{
export
function
getNickNameWords
()
{
return
requesNative
<
NickNameWord
>
({
return
requesNative
<
NickNameWord
>
({
method
:
'GET'
,
method
:
'GET'
,
url
:
`
${
NickNameUrl
}
?d=
${
Date
.
now
()}
`
,
url
:
`
https://cdn.jkwljy.com/pk-math/setting/
${
url
}
.json
?d=
${
Date
.
now
()}
`
,
header
:
{
'Cache-Control'
:
'no-cache'
},
header
:
{
'Cache-Control'
:
'no-cache'
},
timeout
:
800
timeout
:
800
}).
then
(({
data
})
=>
data
)
}).
then
(({
data
})
=>
data
)
...
...
src/pages/group/components/header.module.scss
View file @
1e5570ed
...
@@ -59,8 +59,8 @@
...
@@ -59,8 +59,8 @@
padding
:
11px
28px
;
padding
:
11px
28px
;
background
:
rgba
(
0
,
0
,
0
,
0
.2
);
background
:
rgba
(
0
,
0
,
0
,
0
.2
);
border-radius
:
36px
;
border-radius
:
36px
;
}
}
&
_text
{
&
_text
{
color
:
#fff
;
color
:
#fff
;
font-size
:
40px
;
font-size
:
40px
;
...
@@ -74,12 +74,28 @@
...
@@ -74,12 +74,28 @@
}
}
&
_today
,
&
_invite
{
&
_today
,
&
_invite
{
opacity
:
0
;
@include
flexLayout
(
column
,
center
);
@include
flexLayout
(
column
,
center
);
gap
:
6px
;
gap
:
6px
;
}
}
&
_disabled
{
.is_show
{
opacity
:
0
.8
;
opacity
:
1
;
}
@keyframes
noneAnimate
{
0
%
{
transform
:
scale
(
1
);
opacity
:
1
;
}
100
%
{
transform
:
scale
(
0
);
opacity
:
0
;
}
}
.none
{
animation
:
noneAnimate
0
.6s
ease-out
forwards
;
}
}
&
_today
{
&
_today
{
...
@@ -124,13 +140,23 @@
...
@@ -124,13 +140,23 @@
transform
:
translateY
(
0
);
transform
:
translateY
(
0
);
}
}
50
%
{
50
%
{
transform
:
translateY
(
-
2
0px
);
transform
:
translateY
(
-
1
0px
);
}
}
100
%
{
100
%
{
transform
:
translateY
(
0
);
transform
:
translateY
(
0
);
}
}
}
}
.upDownAnimation
{
@keyframes
fadeIn
{
animation
:
upDown
2s
infinite
ease-in-out
;
0
%
{
opacity
:
0
;
}
100
%
{
opacity
:
1
;
}
}
.fadeInUpDowAnimate
{
animation
:
fadeIn
1
.2s
ease-in
backwards
,
upDown
2s
infinite
ease-in-out
;
animation-delay
:
0
.3s
;
}
}
\ No newline at end of file
src/pages/group/components/header.tsx
View file @
1e5570ed
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
}
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
assets
from
'@/assets/oss/assets-group'
import
assets
from
'@/assets/oss/assets-group'
import
audio
from
'@/assets/oss/assets-audio'
import
TextPrinter
from
'./text-printer'
import
TextPrinter
from
'./text-printer'
import
styles
from
'./header.module.scss'
import
styles
from
'./header.module.scss'
...
@@ -23,10 +25,11 @@ const renderCreator = () => (
...
@@ -23,10 +25,11 @@ 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
{
run
}
=
useRequest
(
postTribePoint
,
{
const
{
run
,
loading
}
=
useRequest
(
postTribePoint
,
{
immediate
:
false
,
immediate
:
false
,
throttleDelay
:
1000
,
throttleDelay
:
1000
,
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
...
@@ -35,21 +38,30 @@ const CroupHeader = ({ groupNo }: { groupNo: string }) => {
...
@@ -35,21 +38,30 @@ const CroupHeader = ({ groupNo }: { groupNo: string }) => {
}
}
})
})
const
renderItem
=
(
item
:
PointType
)
=>
(
const
renderItem
=
(
item
:
PointType
,
index
)
=>
{
return
(
<
View
<
View
className=
{
classNames
({
className=
{
classNames
({
[
styles
.
members_today
]:
item
.
type
===
'MEMBERNUM'
,
[
styles
.
members_today
]:
item
.
type
===
'MEMBERNUM'
,
[
styles
.
members_invite
]:
item
.
type
===
'MEMBERJOIN'
,
[
styles
.
members_invite
]:
item
.
type
===
'MEMBERJOIN'
,
[
styles
.
members_disabled
]:
!
item
.
point
,
[
styles
.
is_show
]:
item
.
point
,
[
styles
.
fadeInUpDowAnimate
]:
item
.
point
,
[
styles
.
none
]:
index
===
hideIndex
&&
!
loading
&&
!
item
.
point
,
})
}
})
}
onClick=
{
()
=>
item
.
point
&&
run
({
type
:
item
.
type
})
}
onClick=
{
()
=>
{
if
(
item
.
point
)
{
setHideIndex
(
index
)
palyAudio
(
audio
[
'点领取水晶部落.wav'
].
u
)
run
({
type
:
item
.
type
})
}
}
}
>
>
<
View
className=
{
styles
.
members_score
}
>
<
View
className=
{
classNames
(
styles
.
members_score
)
}
>
<
Image
<
Image
src=
{
require
(
'@/pages/main/assets/score.png'
)
}
src=
{
require
(
'@/pages/main/assets/score.png'
)
}
className=
{
classNames
(
styles
.
members_icon
,
item
.
point
?
styles
.
upDownAnimation
:
''
)
}
className=
{
classNames
(
styles
.
members_icon
)
}
/>
/>
<
Text
className=
{
classNames
(
styles
.
members_number
,
item
.
point
?
styles
.
upDownAnimation
:
''
)
}
>
<
Text
className=
{
classNames
(
styles
.
members_number
)
}
>
+
{
item
.
point
||
0
}
+
{
item
.
point
||
0
}
</
Text
>
</
Text
>
</
View
>
</
View
>
...
@@ -58,6 +70,7 @@ const CroupHeader = ({ groupNo }: { groupNo: string }) => {
...
@@ -58,6 +70,7 @@ const CroupHeader = ({ groupNo }: { groupNo: string }) => {
</
Text
>
</
Text
>
</
View
>
</
View
>
)
)
}
const
renderMembers
=
()
=>
(
const
renderMembers
=
()
=>
(
<
View
className=
{
styles
.
members
}
>
<
View
className=
{
styles
.
members
}
>
...
...
src/pages/group/components/members.module.scss
View file @
1e5570ed
...
@@ -39,6 +39,20 @@
...
@@ -39,6 +39,20 @@
padding
:
28px
32px
26px
;
padding
:
28px
32px
26px
;
align-items
:
center
;
align-items
:
center
;
opacity
:
0
;
transform
:
translateX
(
100%
);
transition
:
all
0
.3s
ease-out
;
&
.show
{
opacity
:
1
;
transform
:
translateX
(
0
);
}
&
.hide
{
opacity
:
0
;
transform
:
translateX
(
100%
);
}
&
.active
{
&
.active
{
background-color
:
#E4F1FF
;
background-color
:
#E4F1FF
;
}
}
...
@@ -96,6 +110,15 @@
...
@@ -96,6 +110,15 @@
}
}
}
}
@keyframes
fadeIn
{
0
%
{
opacity
:
0
;
}
100
%
{
opacity
:
1
;
}
}
&
_invite
{
&
_invite
{
position
:
fixed
;
position
:
fixed
;
left
:
60px
;
left
:
60px
;
...
@@ -108,6 +131,7 @@
...
@@ -108,6 +131,7 @@
padding
:
0
30px
;
padding
:
0
30px
;
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
animation
:
fadeIn
1s
ease-in-out
forwards
;
}
}
&
_share
{
&
_share
{
...
...
src/pages/group/components/members.tsx
View file @
1e5570ed
import
{
useEffect
,
useState
}
from
'react'
import
{
View
,
Image
,
Text
}
from
'@tarojs/components'
import
{
View
,
Image
,
Text
}
from
'@tarojs/components'
import
classNames
from
'classnames'
import
classNames
from
'classnames'
import
{
type
MemberItem
}
from
'@/api/group'
import
{
type
MemberItem
}
from
'@/api/group'
import
{
useStoreState
}
from
'@/store/hooks'
import
{
useStoreState
}
from
'@/store/hooks'
import
{
palyAudio
}
from
'@/utils/play-audio'
import
assets
from
'@/assets/oss/assets-group'
import
assets
from
'@/assets/oss/assets-group'
import
audio
from
'@/assets/oss/assets-audio'
import
styles
from
'./members.module.scss'
import
styles
from
'./members.module.scss'
const
Members
=
()
=>
{
const
Members
=
()
=>
{
const
[
showIndex
,
setShowIndex
]
=
useState
<
number
>
(
-
1
)
const
userInfo
=
useStoreState
(
state
=>
state
.
userModel
.
userInfo
)
const
userInfo
=
useStoreState
(
state
=>
state
.
userModel
.
userInfo
)
const
{
groupMembers
,
isEmpty
}
=
useStoreState
(
state
=>
state
.
groupModel
)
const
{
groupMembers
,
isEmpty
}
=
useStoreState
(
state
=>
state
.
groupModel
)
useEffect
(()
=>
{
palyAudio
(
audio
[
'部门排行榜出现.wav'
].
u
)
startAnimation
(
showIndex
)
},
[])
const
startAnimation
=
(
currentIndex
)
=>
{
if
(
currentIndex
<
groupMembers
.
length
-
1
)
{
requestAnimationFrame
(()
=>
{
const
timer
=
setTimeout
(()
=>
{
setShowIndex
(
currentIndex
+
1
)
startAnimation
(
currentIndex
+
1
)
},
300
)
return
()
=>
clearTimeout
(
timer
)
})
}
}
const
renderItem
=
(
item
:
MemberItem
,
index
:
number
)
=>
{
const
renderItem
=
(
item
:
MemberItem
,
index
:
number
)
=>
{
const
isCurrent
=
userInfo
.
userId
===
item
.
memberId
const
me
=
userInfo
.
userId
===
item
.
memberId
return
(
return
(
<
View
key=
{
item
.
memberId
}
className=
{
classNames
(
styles
.
item
,
{
[
styles
.
active
]:
isCurrent
})
}
>
<
View
key=
{
item
.
memberId
}
className=
{
classNames
(
styles
.
item
,
{
[
styles
.
active
]:
me
,
[
styles
.
show
]:
index
<=
showIndex
,
}
)
}
>
<
View
className=
{
styles
.
item_rank
}
>
<
View
className=
{
styles
.
item_rank
}
>
{
[
1
,
2
,
3
].
includes
(
index
+
1
)
{
[
1
,
2
,
3
].
includes
(
index
+
1
)
?
<
Image
className=
{
styles
.
item_rank_icon
}
src=
{
assets
[
`rank-${index + 1}.png`
].
u
}
/>
?
<
Image
className=
{
styles
.
item_rank_icon
}
src=
{
assets
[
`rank-${index + 1}.png`
].
u
}
/>
...
@@ -25,7 +55,7 @@ const Members = () => {
...
@@ -25,7 +55,7 @@ const Members = () => {
<
View
className=
{
styles
.
avatar
}
>
<
View
className=
{
styles
.
avatar
}
>
<
Text
className=
{
styles
.
nickname
}
>
<
Text
className=
{
styles
.
nickname
}
>
{
item
.
memberName
||
'-'
}
{
item
.
memberName
||
'-'
}
{
isCurrent
&&
<
Text
>
(你)
</
Text
>
}
{
me
&&
<
Text
>
(你)
</
Text
>
}
</
Text
>
</
Text
>
{
item
.
identity
===
'LEADER'
&&
<
Image
className=
{
styles
.
crown
}
src=
{
assets
[
'crown-small.png'
].
u
}
/>
}
{
item
.
identity
===
'LEADER'
&&
<
Image
className=
{
styles
.
crown
}
src=
{
assets
[
'crown-small.png'
].
u
}
/>
}
</
View
>
</
View
>
...
...
src/pages/group/data.json
deleted
100644 → 0
View file @
87507f15
[
"快乐学堂"
,
"小天才俱乐部"
,
"阳光小学霸"
,
"知识小勇士"
,
"童话学习园"
,
"学习小精灵"
,
"天才小书虫"
,
"梦想学习园"
,
"童心书屋"
,
"快乐成长树"
,
"学习的小蜜蜂"
,
"小小探险家"
,
"彩虹学习园"
,
"知识小花园"
,
"童趣学习宝"
,
"笑脸学习站"
,
"阳光小学堂"
,
"学习宝贝岛"
,
"智慧小博士"
,
"成长快车道"
,
"快乐学习团"
,
"童年学习梦"
,
"稚趣学园"
,
"学习小蜗牛"
,
"智力小超人"
,
"小小地球村"
,
"学习乐园"
,
"梦想小舞台"
,
"小小数学家"
,
"知识小火车"
,
"爱心学习站"
,
"快乐学习家"
,
"学习小翅膀"
,
"童年智慧树"
,
"快乐小天使"
,
"学习的小精灵"
,
"阳光学习园"
,
"快乐读书房"
,
"童梦学习园"
,
"智慧的种子"
,
"爱学习的小熊"
,
"学习小动力"
,
"彩虹小学者"
,
"幸福学习屋"
,
"快乐小导航"
,
"学习的小苹果"
,
"知识小宇宙"
,
"笑声学习岛"
,
"学习小奇迹"
,
"学习小小鸟"
,
"勇敢学习者"
,
"童话小学者"
,
"智慧小花朵"
,
"快乐成长班"
,
"快乐学习派"
,
"快乐学习小组"
,
"成长的脚印"
,
"智慧之光"
,
"勤学好问团"
,
"阳光小伙伴"
,
"小小智者"
,
"知识宝石"
,
"快乐成长园"
,
"智慧小鸟"
,
"梦想之船"
,
"学习天地"
,
"小状元家"
,
"知识小宝藏"
,
"快乐蜜蜂"
,
"智慧小农场"
,
"学海探险队"
,
"快乐小学堂"
,
"奇思妙想团"
,
"成长快乐屋"
,
"智慧星空"
,
"宝贝学习站"
,
"知识探险家"
,
"勇敢小学霸"
,
"快乐学习岛"
,
"成长奇迹"
,
"智慧之星"
,
"快乐小蜜蜂"
,
"宝贝学习园"
,
"学习小导航"
,
"智慧之树"
,
"学习小战士"
,
"知识小天地"
,
"快乐探索家"
,
"智慧之路"
,
"学习快车"
,
"成长幸福园"
,
"快乐小学者"
,
"知识小宇宙"
,
"学习之旅"
,
"发现之星"
,
"梦想成真"
,
"学习小天地"
,
"知识小导航"
,
"学习之星"
,
"勤奋小蜗牛"
,
"智慧小花园"
,
"成长之梦"
,
"快乐学习舞台"
,
"知识小岛"
,
"学习之路"
,
"勇敢的小学者"
,
"快乐小王子"
,
"知识宝库"
,
"智慧之源"
,
"成长快乐站"
,
"快乐学习宝"
,
"知识小精灵"
,
"学习小天使"
,
"智慧小神童"
,
"成长快乐家"
,
"快乐学习园"
,
"知识小飞侠"
,
"学习小助手"
,
"智慧小导航"
,
"成长快乐岛"
,
"快乐学习派"
,
"学习小能手"
,
"智慧小熊"
,
"成长的天空"
,
"快乐小书虫"
,
"知识小助手"
,
"学习小飞侠"
,
"智慧小花朵"
,
"成长的舞台"
,
"快乐学习星"
,
"知识小导航"
,
"学习小蜜蜂"
,
"智慧小太阳"
,
"成长的翅膀"
,
"快乐小学习"
,
"知识小天才"
,
"学习小超人"
,
"智慧小奇迹"
,
"成长的日记"
,
"知识小状元"
,
"学习小梦想"
,
"智慧小神童"
,
"成长的足迹"
,
"快乐小状元"
,
"知识小舞台"
,
"学习小宝贝"
,
"智慧小蜜蜂"
,
"成长的歌声"
,
"快乐学习园"
,
"知识小能手"
,
"学习小快乐"
,
"智慧小天空"
,
"成长的种子"
,
"快乐小智者"
,
"知识小战士"
,
"学习小发现"
,
"智慧小冒险家"
,
"成长的航道"
,
"快乐小发现"
,
"知识小探险家"
,
"学习小太阳"
,
"智慧小星星"
,
"成长的瞬间"
,
"快乐小小熊"
,
"知识小英雄"
,
"学习小快车"
,
"智慧小脚印"
,
"成长的花园"
,
"快乐小奇迹"
]
\ No newline at end of file
src/pages/group/index.module.scss
View file @
1e5570ed
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
@include
flexLayout
(
_
,
center
,
space-between
);
@include
flexLayout
(
_
,
center
,
space-between
);
background-color
:
#F0F2F9
;
background-color
:
#F0F2F9
;
border-radius
:
48px
;
border-radius
:
48px
;
padding
:
18px
32px
18
px
40px
;
padding
:
20px
32px
19
px
40px
;
}
}
&
_input
{
&
_input
{
...
...
src/pages/group/index.tsx
View file @
1e5570ed
import
{
View
,
Image
,
Input
,
ScrollView
,
Text
}
from
'@tarojs/components'
import
{
View
,
Image
,
Input
,
ScrollView
,
Text
}
from
'@tarojs/components'
import
{
useDidShow
,
getCurrentInstance
,
getTabBar
,
getMenuButtonBoundingClientRect
,
showModal
,
useShareAppMessage
,
showLoading
,
hideLoading
}
from
'@tarojs/taro'
import
{
useDidShow
,
getCurrentInstance
,
getTabBar
,
getMenuButtonBoundingClientRect
,
showModal
,
useShareAppMessage
}
from
'@tarojs/taro'
import
{
useMemo
,
useState
,
useEffect
}
from
'react'
import
{
useMemo
,
useState
,
useEffect
,
useRef
,
useCallback
}
from
'react'
import
Modal
from
'@/components/Modal'
import
Modal
from
'@/components/Modal'
import
Button
from
'@/components/Button'
import
Button
from
'@/components/Button'
...
@@ -8,6 +8,7 @@ import { useBoolean, useRequest } from '@/hooks'
...
@@ -8,6 +8,7 @@ import { useBoolean, useRequest } from '@/hooks'
import
{
createTribe
}
from
'@/api/group'
import
{
createTribe
}
from
'@/api/group'
import
{
useStoreActions
,
useStoreState
}
from
'@/store/hooks'
import
{
useStoreActions
,
useStoreState
}
from
'@/store/hooks'
import
type
{
TabbarRef
}
from
'@/custom-tab-bar/index'
import
type
{
TabbarRef
}
from
'@/custom-tab-bar/index'
import
{
getNickNameWords
,
type
NickNameWord
}
from
'@/api'
import
assets
from
'@/assets/oss/assets-group'
import
assets
from
'@/assets/oss/assets-group'
...
@@ -20,16 +21,19 @@ import ShareButton from './components/share-button'
...
@@ -20,16 +21,19 @@ import ShareButton from './components/share-button'
import
styles
from
'./index.module.scss'
import
styles
from
'./index.module.scss'
import
memberStyles
from
'./components/members.module.scss'
import
memberStyles
from
'./components/members.module.scss'
import
groupNames
from
'./data.json'
const
randomPick
=
(
arr
:
string
[])
=>
{
const
len
=
arr
.
length
const
randomIndex
=
Math
.
floor
(
Math
.
random
()
*
len
)
return
arr
[
randomIndex
]
}
const
Group
=
()
=>
{
const
Group
=
()
=>
{
const
randomIndex
=
Math
.
floor
(
Math
.
random
()
*
groupNames
.
length
)
const
page
=
useMemo
(()
=>
getCurrentInstance
().
page
,
[])
const
page
=
useMemo
(()
=>
getCurrentInstance
().
page
,
[])
const
[
nav
]
=
useState
(
getMenuButtonBoundingClientRect
())
const
[
nav
]
=
useState
(
getMenuButtonBoundingClientRect
())
const
[
isVisible
,
{
setTrue
,
setFalse
}]
=
useBoolean
(
false
)
const
[
isVisible
,
{
setTrue
,
setFalse
}]
=
useBoolean
(
false
)
const
[
groupNo
,
setGroupNo
]
=
useState
<
string
>
(
groupNames
[
randomIndex
])
const
dataRef
=
useRef
<
NickNameWord
>
({
noun
:
[],
adj
:
[]
})
const
[
groupNo
,
setGroupNo
]
=
useState
(
''
)
const
[
refresher
,
{
toggle
}]
=
useBoolean
(
false
)
const
[
refresher
,
{
toggle
}]
=
useBoolean
(
false
)
const
[
isLoad
,
{
toggle
:
toggleLoad
}]
=
useBoolean
(
true
)
const
userInfo
=
useStoreState
(
state
=>
state
.
userModel
.
userInfo
)
const
userInfo
=
useStoreState
(
state
=>
state
.
userModel
.
userInfo
)
const
tribeInfo
=
useStoreState
(
state
=>
state
.
groupModel
.
tribeInfo
)
const
tribeInfo
=
useStoreState
(
state
=>
state
.
groupModel
.
tribeInfo
)
...
@@ -40,17 +44,30 @@ const Group = () => {
...
@@ -40,17 +44,30 @@ const Group = () => {
return
nav
.
height
+
nav
.
top
+
5
return
nav
.
height
+
nav
.
top
+
5
},
[
nav
])
},
[
nav
])
const
getGroupNo
=
useCallback
(()
=>
{
const
{
noun
,
adj
}
=
dataRef
.
current
const
nam
=
`
${
randomPick
(
adj
)}${
randomPick
(
noun
)}
`
setGroupNo
(
nam
)
},
[])
useEffect
(()
=>
{
const
fn
=
async
()
=>
{
const
words
=
await
getNickNameWords
(
'words'
)
dataRef
.
current
=
words
getGroupNo
()
}
fn
()
},
[
getGroupNo
])
useDidShow
(
async
()
=>
{
useDidShow
(
async
()
=>
{
const
tabbar
=
getTabBar
<
TabbarRef
>
(
page
)
const
tabbar
=
getTabBar
<
TabbarRef
>
(
page
)
tabbar
?.
setSelected
(
1
)
tabbar
?.
setSelected
(
1
)
queryTribePoint
()
toggleLoad
()
await
fetchTribeInfo
()
toggleLoad
()
})
})
useEffect
(()
=>
{
Promise
.
all
([
queryTribePoint
(),
fetchTribeInfo
()])
},
[
queryTribePoint
,
fetchTribeInfo
])
useShareAppMessage
(()
=>
{
useShareAppMessage
(()
=>
{
return
{
return
{
title
:
'来看看这个有趣的页面!'
,
title
:
'来看看这个有趣的页面!'
,
...
@@ -84,14 +101,6 @@ const Group = () => {
...
@@ -84,14 +101,6 @@ const Group = () => {
}
}
}
}
useEffect(() => {
isLoad && hideLoading()
}, [isLoad, hideLoading])
if (!isLoad) {
return showLoading()
}
return (
return (
<View>
<View>
<TopHeader />
<TopHeader />
...
@@ -114,14 +123,9 @@ const Group = () => {
...
@@ -114,14 +123,9 @@ const Group = () => {
<Modal isVisible={isVisible} tilte="学习部落名" onClose={setFalse}>
<Modal isVisible={isVisible} tilte="学习部落名" onClose={setFalse}>
<View className={styles.modal}>
<View className={styles.modal}>
<View className={styles.modal_body}>
<View className={styles.modal_body}
onClick={getGroupNo}
>
<Input className={styles.modal_input} disabled value={groupNo} />
<Input className={styles.modal_input} disabled value={groupNo} />
<Image
<Image className={styles.modal_refresh} mode="widthFix" src={assets['refresh.png'].u} />
className={styles.modal_refresh}
mode="widthFix"
src={assets['refresh.png'].u}
onClick={() => setGroupNo(groupNames[randomIndex])}
/>
</View>
</View>
<Text className={styles.modal_description}>
<Text className={styles.modal_description}>
* 可点击右侧按钮随机生成名字
* 可点击右侧按钮随机生成名字
...
...
src/pages/prepare/components/main-header.tsx
View file @
1e5570ed
...
@@ -117,7 +117,7 @@ const MainHeader = () => {
...
@@ -117,7 +117,7 @@ const MainHeader = () => {
<
RequireItem
u=
{
assets
[
'level-big-a.png'
].
u
}
v=
{
5
}
t=
{
stageDetail
.
aTime
}
/>
<
RequireItem
u=
{
assets
[
'level-big-a.png'
].
u
}
v=
{
5
}
t=
{
stageDetail
.
aTime
}
/>
<
RequireItem
u=
{
assets
[
'level-big-b.png'
].
u
}
v=
{
1
}
t=
{
stageDetail
.
bTime
}
/>
<
RequireItem
u=
{
assets
[
'level-big-b.png'
].
u
}
v=
{
1
}
t=
{
stageDetail
.
bTime
}
/>
</
View
>
</
View
>
),
[
stageDetail
?.
sTime
,
stageDetail
?.
aTime
,
stageDetail
?.
bTime
])
),
[
stageDetail
,
stageDetail
?.
sTime
,
stageDetail
?.
aTime
,
stageDetail
?.
bTime
])
const
renderAgain
=
useCallback
(()
=>
(
const
renderAgain
=
useCallback
(()
=>
(
<
View
className=
{
styles
.
details
}
>
<
View
className=
{
styles
.
details
}
>
...
@@ -125,7 +125,7 @@ const MainHeader = () => {
...
@@ -125,7 +125,7 @@ const MainHeader = () => {
<
RequireItem
key=
{
item
.
nextStep
}
u=
{
renderNextStep
(
item
)
}
v=
{
item
.
nextStepReward
}
t=
{
item
.
nextStepTime
}
/>
<
RequireItem
key=
{
item
.
nextStep
}
u=
{
renderNextStep
(
item
)
}
v=
{
item
.
nextStepReward
}
t=
{
item
.
nextStepTime
}
/>
))
}
))
}
</
View
>
</
View
>
),
[
stageDetail
?.
nextSteps
])
),
[
stageDetail
?.
nextSteps
,
renderNextStep
])
if
(
!
stageDetail
)
{
if
(
!
stageDetail
)
{
return
null
return
null
...
@@ -144,7 +144,9 @@ const MainHeader = () => {
...
@@ -144,7 +144,9 @@ const MainHeader = () => {
<
Text
className=
{
styles
.
label
}
>
共
{
stageDetail
.
questionNum
}
题
</
Text
>
<
Text
className=
{
styles
.
label
}
>
共
{
stageDetail
.
questionNum
}
题
</
Text
>
</
View
>
</
View
>
{
!
stageDetail
.
firstTime
&&
<
View
className=
{
styles
.
replay
}
>
{
(
stageDetail
.
firstTime
||
!
stageDetail
.
level
)
?
null
:
<
View
className=
{
styles
.
replay
}
>
<
View
className=
{
styles
.
performance
}
>
<
View
className=
{
styles
.
performance
}
>
<
Text
>
最佳表现
</
Text
>
<
Text
>
最佳表现
</
Text
>
<
View
className=
{
styles
.
details
}
>
<
View
className=
{
styles
.
details
}
>
...
@@ -166,11 +168,11 @@ const MainHeader = () => {
...
@@ -166,11 +168,11 @@ const MainHeader = () => {
<
View
className=
{
styles
.
header
}
>
<
View
className=
{
styles
.
header
}
>
<
View
className=
{
styles
.
line
}
></
View
>
<
View
className=
{
styles
.
line
}
></
View
>
<
Text
className=
{
styles
.
text
}
>
<
Text
className=
{
styles
.
text
}
>
{
stageDetail
.
firstTime
?
'通关要求'
:
'继续努力,赢更多成就'
}
{
stageDetail
.
firstTime
||
!
stageDetail
.
level
?
'通关要求'
:
'继续努力,赢更多成就'
}
</
Text
>
</
Text
>
<
View
className=
{
styles
.
line
}
></
View
>
<
View
className=
{
styles
.
line
}
></
View
>
</
View
>
</
View
>
{
stageDetail
.
firstTime
?
renderFirst
()
:
isKing
?
null
:
renderAgain
()
}
{
stageDetail
.
firstTime
||
!
stageDetail
.
level
?
renderFirst
()
:
isKing
?
null
:
renderAgain
()
}
</
View
>
}
</
View
>
}
</
View
>
</
View
>
)
)
...
...
src/pages/prepare/index.module.scss
View file @
1e5570ed
...
@@ -128,7 +128,7 @@
...
@@ -128,7 +128,7 @@
.tribe_share
{
.tribe_share
{
border-radius
:
10
PX
;
border-radius
:
10
PX
;
margin
:
0
80px
;
margin
:
0
80px
;
margin-bottom
:
56
px
;
margin-bottom
:
32
px
;
height
:
88px
;
height
:
88px
;
border
:
2
PX
solid
#465164
;
border
:
2
PX
solid
#465164
;
gap
:
8
PX
;
gap
:
8
PX
;
...
@@ -218,6 +218,7 @@
...
@@ -218,6 +218,7 @@
&
_loading
{
&
_loading
{
opacity
:
0
.8
;
opacity
:
0
.8
;
pointer-events
:
none
;
}
}
&
_spin
{
&
_spin
{
...
@@ -249,6 +250,7 @@
...
@@ -249,6 +250,7 @@
}
}
.buy_card_disabled
{
.buy_card_disabled
{
pointer-events
:
none
;
background-image
:
url('./assets/btn-disabled.png')
;
background-image
:
url('./assets/btn-disabled.png')
;
color
:
#C2C8D1
;
color
:
#C2C8D1
;
}
}
\ No newline at end of file
src/pages/prepare/index.tsx
View file @
1e5570ed
...
@@ -35,11 +35,11 @@ const Prepare = () => {
...
@@ -35,11 +35,11 @@ const Prepare = () => {
const
isSubmit
=
useStoreState
(
state
=>
state
.
gameModel
.
isSubmit
)
const
isSubmit
=
useStoreState
(
state
=>
state
.
gameModel
.
isSubmit
)
const
tribeInfo
=
useStoreState
(
state
=>
state
.
groupModel
.
tribeInfo
)
const
tribeInfo
=
useStoreState
(
state
=>
state
.
groupModel
.
tribeInfo
)
const
stageList
=
useStoreState
(
state
=>
state
.
mainModel
.
stageList
)
const
stageList
=
useStoreState
(
state
=>
state
.
mainModel
.
stageList
)
const
setting
=
useStoreState
(
state
=>
state
.
userModel
.
setting
)
const
getStageDetail
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
getStageDetail
)
const
getStageDetail
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
getStageDetail
)
const
getQuestionList
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
getQuestionList
)
const
getQuestionList
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
getQuestionList
)
const
updateState
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
updateState
)
const
updateState
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
updateState
)
const
getSetting
=
useStoreActions
(
actions
=>
actions
.
userModel
.
getSetting
)
const
getSetting
=
useStoreActions
(
actions
=>
actions
.
userModel
.
getSetting
)
const
setting
=
useStoreState
(
state
=>
state
.
userModel
.
setting
)
const
tabs
:
TabItem
[]
=
[
const
tabs
:
TabItem
[]
=
[
{
{
...
@@ -50,7 +50,7 @@ const Prepare = () => {
...
@@ -50,7 +50,7 @@ const Prepare = () => {
label
:
'学习部落排行榜'
,
label
:
'学习部落排行榜'
,
children
:
(
children
:
(
<
View
className=
{
styles
.
tribe
}
>
<
View
className=
{
styles
.
tribe
}
>
{
renderTribePage
(
stageDetail
?.
groupRanks
||
[])
}
{
renderTribePage
(
stageDetail
?.
groupRanks
||
[]
,
tribeInfo
?.
groupNo
)
}
</
View
>
</
View
>
)
)
}
}
...
@@ -85,6 +85,7 @@ const Prepare = () => {
...
@@ -85,6 +85,7 @@ const Prepare = () => {
const { run: exchange, loading: spinning } = useRequest(pointToCard, {
const { run: exchange, loading: spinning } = useRequest(pointToCard, {
immediate: false,
immediate: false,
throttleDelay: 1000,
onSuccess: () => {
onSuccess: () => {
getQuestionList(+router.params.id || 1).then(() => {
getQuestionList(+router.params.id || 1).then(() => {
setFalse()
setFalse()
...
@@ -166,7 +167,7 @@ const Prepare = () => {
...
@@ -166,7 +167,7 @@ const Prepare = () => {
useEffect(() => {
useEffect(() => {
isLoad && hideLoading()
isLoad && hideLoading()
}, [isLoad
, hideLoading
])
}, [isLoad])
if (!isLoad) {
if (!isLoad) {
return showLoading()
return showLoading()
...
...
src/pages/prepare/render.tsx
View file @
1e5570ed
...
@@ -57,17 +57,19 @@ const renderEmptyTribe = () => (
...
@@ -57,17 +57,19 @@ const renderEmptyTribe = () => (
</
View
>
</
View
>
)
)
const
renderTribeList
=
(
list
:
StageRank
[])
=>
(
const
renderTribeList
=
(
list
:
StageRank
[],
groupNo
?:
string
)
=>
{
<
View
style=
{
{
paddingBottom
:
100
}
}
>
return
(
<
Text
className=
{
styles
.
tribe_title
}
>
极客学霸俱乐部
</
Text
>
<
View
style=
{
{
paddingBottom
:
70
}
}
>
<
Text
className=
{
styles
.
tribe_title
}
>
{
groupNo
}
部落
</
Text
>
{
renderList
(
list
)
}
{
renderList
(
list
)
}
</
View
>
</
View
>
)
)
}
export
const
renderTribePage
=
(
list
:
StageRank
[]
=
[])
=>
{
export
const
renderTribePage
=
(
list
:
StageRank
[]
=
[]
,
groupNo
?:
string
)
=>
{
return
(
return
(
<
View
className=
{
styles
.
tribe
}
>
<
View
className=
{
styles
.
tribe
}
>
{
list
.
length
>
0
?
renderTribeList
(
list
)
:
renderEmptyTribe
()
}
{
list
.
length
>
0
?
renderTribeList
(
list
,
groupNo
)
:
renderEmptyTribe
()
}
</
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