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
b3f19187
Commit
b3f19187
authored
Apr 08, 2023
by
m
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
e1f2de98
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
312 additions
and
203 deletions
+312
-203
words.json
assets/setting/words.json
+225
-2
auth.ts
src/api/auth.ts
+2
-4
header.tsx
src/pages/group/components/header.tsx
+3
-0
members.module.scss
src/pages/group/components/members.module.scss
+14
-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
+30
-21
index.module.scss
src/pages/prepare/index.module.scss
+3
-0
index.tsx
src/pages/prepare/index.tsx
+1
-0
No files found.
assets/setting/words.json
View file @
b3f19187
{
"ad"
:
[
"你的"
],
"none"
:
[
"我的"
]
"adj"
:
[
"快乐的"
,
"智慧的"
,
"勤奋的"
,
"阳光的"
,
"活力的"
,
"奇妙的"
,
"积极的"
,
"友善的"
,
"有趣的"
,
"创新的"
,
"勇敢的"
,
"自信的"
,
"合作的"
,
"发现的"
,
"好奇的"
,
"探险的"
,
"快速的"
,
"乐观的"
,
"独特的"
,
"热情的"
,
"聪明的"
,
"热爱的"
,
"团结的"
,
"充满活力的"
,
"勤学的"
,
"有才华的"
,
"自主的"
,
"坚韧的"
,
"追求的"
,
"善良的"
,
"敏锐的"
,
"进取的"
,
"愉快的"
,
"研究的"
,
"专注的"
,
"激情的"
,
"奋斗的"
,
"互助的"
,
"关爱的"
,
"探索的"
,
"实践的"
,
"耐心的"
,
"鼓励的"
,
"领先的"
,
"美丽的"
,
"幸福的"
,
"快乐的"
,
"自由的"
,
"坚强的"
,
"勇敢的"
,
"温暖的"
,
"清新的"
,
"活力的"
,
"活泼的"
,
"青春的"
,
"智慧的"
,
"聪明的"
,
"热情的"
,
"真诚的"
,
"诚实的"
,
"安静的"
,
"优雅的"
,
"舒适的"
,
"轻松的"
,
"愉悦的"
,
"满足的"
,
"安心的"
,
"放松的"
,
"有趣的"
,
"充实的"
,
"丰富的"
,
"平静的"
,
"祥和的"
,
"融洽的"
,
"美好的"
,
"纯真的"
,
"温馨的"
,
"亲切的"
,
"体贴的"
,
"善良的"
,
"慷慨的"
,
"宽容的"
,
"心灵的"
,
"灵活的"
,
"灵敏的"
,
"灵感的"
,
"机智的"
,
"洞察的"
,
"求知的"
,
"独立的"
,
"坦率的"
,
"无畏的"
,
"勤奋的"
,
"拼搏的"
,
"奋斗的"
,
"努力的"
,
"好学的"
,
"有爱的"
,
"心善的"
,
"谦虚的"
,
"低调的"
,
"好客的"
,
"热心的"
,
"敬业的"
,
"专注的"
,
"睿智的"
,
"天才的"
,
"创新的"
,
"匠心的"
,
"有趣的"
,
"幽默的"
,
"可爱的"
,
"动人的"
,
"高尚的"
,
"现代的"
,
"前卫的"
,
"时尚的"
,
"独特的"
,
"初心的"
,
"好看的"
,
"优美的"
,
"精致的"
,
"细腻的"
,
"优秀的"
,
"卓越的"
,
"杰出的"
,
"无敌的"
,
"顶尖的"
,
"强大的"
,
"不败的"
,
"无限的"
,
"神奇的"
,
"无比的"
,
"神圣的"
,
"神秘的"
,
"神速的"
,
"惊人的"
,
"惊喜的"
,
"惊艳的"
,
"惊奇的"
],
"noun"
:
[
"小天才"
,
"求知者"
,
"小发现者"
,
"智者"
,
"探险家"
,
"发现者"
,
"领航员"
,
"建设者"
,
"实践家"
,
"创新者"
,
"勇敢者"
,
"智慧者"
,
"友谊园"
,
"进步站"
,
"学问堡"
,
"快乐屋"
,
"智慧树"
,
"成长苑"
,
"探索岛"
,
"进步园"
,
"奋斗湾"
,
"启迪坊"
,
"拓展区"
,
"创意轩"
,
"成功街"
,
"理想家"
,
"友爱巷"
,
"智者梯"
,
"合作楼"
,
"幸福阁"
,
"梦想窗"
,
"阳光河"
,
"绿色园"
,
"希望港"
,
"小探险家"
,
"小学者"
,
"小思考者"
,
"小解决者"
,
"小领导者"
,
"小战士"
,
"小导师"
,
"小启蒙者"
,
"小团队"
,
"小伙伴"
,
"小梦想家"
,
"小建设者"
,
"小创作者"
,
"小勇士"
,
"小超人"
,
"小明星"
,
"小实践者"
,
"小观察家"
,
"小发明家"
,
"小合作者"
,
"小成就者"
,
"小聆听者"
,
"小领袖"
,
"小改革者"
,
"小示范者"
,
"小敢于者"
,
"小尝试者"
,
"小协作者"
,
"小规划者"
,
"小目标者"
,
"小奋进者"
,
"小责任者"
,
"小挑战者"
,
"小乐观者"
,
"小学习者"
,
"小坚持者"
,
"小成长者"
,
"小表达者"
,
"小思维者"
,
"小引导者"
,
"小庆祝者"
,
"小鼓舞者"
,
"小突破者"
,
"小合群者"
,
"小原则者"
,
"小支持者"
]
}
src/api/auth.ts
View file @
b3f19187
...
...
@@ -70,12 +70,10 @@ export type NickNameWord = {
adj
:
string
[];
}
const
NickNameUrl
=
'https://cdn.jkwljy.com/pk-math/setting/nickname-words.json'
export
function
getNickNameWords
()
{
export
function
getNickNameWords
(
url
=
'nickname-words'
)
{
return
requesNative
<
NickNameWord
>
({
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'
},
timeout
:
800
}).
then
(({
data
})
=>
data
)
...
...
src/pages/group/components/header.tsx
View file @
b3f19187
...
...
@@ -5,7 +5,9 @@ import classNames from 'classnames'
import
{
useStoreActions
,
useStoreState
}
from
'@/store/hooks'
import
{
useRequest
,
useBoolean
}
from
'@/hooks'
import
{
postTribePoint
,
type
PointType
}
from
'@/api/group'
import
{
palyAudio
}
from
'@/utils/play-audio'
import
assets
from
'@/assets/oss/assets-group'
import
audio
from
'@/assets/oss/assets-audio'
import
TextPrinter
from
'./text-printer'
import
styles
from
'./header.module.scss'
...
...
@@ -31,6 +33,7 @@ const CroupHeader = ({ groupNo }: { groupNo: string }) => {
immediate
:
false
,
throttleDelay
:
1000
,
onSuccess
:
()
=>
{
palyAudio
(
audio
[
'点领取水晶部落.wav'
].
u
)
setTrue
()
showToast
({
title
:
'领取成功'
})
queryTribePoint
()
...
...
src/pages/group/components/members.module.scss
View file @
b3f19187
...
...
@@ -39,6 +39,20 @@
padding
:
28px
32px
26px
;
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
{
background-color
:
#E4F1FF
;
}
...
...
src/pages/group/components/members.tsx
View file @
b3f19187
import
{
useEffect
,
useState
}
from
'react'
import
{
View
,
Image
,
Text
}
from
'@tarojs/components'
import
classNames
from
'classnames'
import
{
type
MemberItem
}
from
'@/api/group'
import
{
useStoreState
}
from
'@/store/hooks'
import
{
palyAudio
}
from
'@/utils/play-audio'
import
assets
from
'@/assets/oss/assets-group'
import
audio
from
'@/assets/oss/assets-audio'
import
styles
from
'./members.module.scss'
const
Members
=
()
=>
{
const
[
showIndex
,
setShowIndex
]
=
useState
<
number
>
(
-
1
)
const
userInfo
=
useStoreState
(
state
=>
state
.
userModel
.
userInfo
)
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
isCurrent
=
userInfo
.
userId
===
item
.
memberId
const
me
=
userInfo
.
userId
===
item
.
memberId
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
}
>
{
[
1
,
2
,
3
].
includes
(
index
+
1
)
?
<
Image
className=
{
styles
.
item_rank_icon
}
src=
{
assets
[
`rank-${index + 1}.png`
].
u
}
/>
...
...
@@ -25,7 +55,7 @@ const Members = () => {
<
View
className=
{
styles
.
avatar
}
>
<
Text
className=
{
styles
.
nickname
}
>
{
item
.
memberName
||
'-'
}
{
isCurrent
&&
<
Text
>
(你)
</
Text
>
}
{
me
&&
<
Text
>
(你)
</
Text
>
}
</
Text
>
{
item
.
identity
===
'LEADER'
&&
<
Image
className=
{
styles
.
crown
}
src=
{
assets
[
'crown-small.png'
].
u
}
/>
}
</
View
>
...
...
src/pages/group/data.json
deleted
100644 → 0
View file @
e1f2de98
[
"快乐学堂"
,
"小天才俱乐部"
,
"阳光小学霸"
,
"知识小勇士"
,
"童话学习园"
,
"学习小精灵"
,
"天才小书虫"
,
"梦想学习园"
,
"童心书屋"
,
"快乐成长树"
,
"学习的小蜜蜂"
,
"小小探险家"
,
"彩虹学习园"
,
"知识小花园"
,
"童趣学习宝"
,
"笑脸学习站"
,
"阳光小学堂"
,
"学习宝贝岛"
,
"智慧小博士"
,
"成长快车道"
,
"快乐学习团"
,
"童年学习梦"
,
"稚趣学园"
,
"学习小蜗牛"
,
"智力小超人"
,
"小小地球村"
,
"学习乐园"
,
"梦想小舞台"
,
"小小数学家"
,
"知识小火车"
,
"爱心学习站"
,
"快乐学习家"
,
"学习小翅膀"
,
"童年智慧树"
,
"快乐小天使"
,
"学习的小精灵"
,
"阳光学习园"
,
"快乐读书房"
,
"童梦学习园"
,
"智慧的种子"
,
"爱学习的小熊"
,
"学习小动力"
,
"彩虹小学者"
,
"幸福学习屋"
,
"快乐小导航"
,
"学习的小苹果"
,
"知识小宇宙"
,
"笑声学习岛"
,
"学习小奇迹"
,
"学习小小鸟"
,
"勇敢学习者"
,
"童话小学者"
,
"智慧小花朵"
,
"快乐成长班"
,
"快乐学习派"
,
"快乐学习小组"
,
"成长的脚印"
,
"智慧之光"
,
"勤学好问团"
,
"阳光小伙伴"
,
"小小智者"
,
"知识宝石"
,
"快乐成长园"
,
"智慧小鸟"
,
"梦想之船"
,
"学习天地"
,
"小状元家"
,
"知识小宝藏"
,
"快乐蜜蜂"
,
"智慧小农场"
,
"学海探险队"
,
"快乐小学堂"
,
"奇思妙想团"
,
"成长快乐屋"
,
"智慧星空"
,
"宝贝学习站"
,
"知识探险家"
,
"勇敢小学霸"
,
"快乐学习岛"
,
"成长奇迹"
,
"智慧之星"
,
"快乐小蜜蜂"
,
"宝贝学习园"
,
"学习小导航"
,
"智慧之树"
,
"学习小战士"
,
"知识小天地"
,
"快乐探索家"
,
"智慧之路"
,
"学习快车"
,
"成长幸福园"
,
"快乐小学者"
,
"知识小宇宙"
,
"学习之旅"
,
"发现之星"
,
"梦想成真"
,
"学习小天地"
,
"知识小导航"
,
"学习之星"
,
"勤奋小蜗牛"
,
"智慧小花园"
,
"成长之梦"
,
"快乐学习舞台"
,
"知识小岛"
,
"学习之路"
,
"勇敢的小学者"
,
"快乐小王子"
,
"知识宝库"
,
"智慧之源"
,
"成长快乐站"
,
"快乐学习宝"
,
"知识小精灵"
,
"学习小天使"
,
"智慧小神童"
,
"成长快乐家"
,
"快乐学习园"
,
"知识小飞侠"
,
"学习小助手"
,
"智慧小导航"
,
"成长快乐岛"
,
"快乐学习派"
,
"学习小能手"
,
"智慧小熊"
,
"成长的天空"
,
"快乐小书虫"
,
"知识小助手"
,
"学习小飞侠"
,
"智慧小花朵"
,
"成长的舞台"
,
"快乐学习星"
,
"知识小导航"
,
"学习小蜜蜂"
,
"智慧小太阳"
,
"成长的翅膀"
,
"快乐小学习"
,
"知识小天才"
,
"学习小超人"
,
"智慧小奇迹"
,
"成长的日记"
,
"知识小状元"
,
"学习小梦想"
,
"智慧小神童"
,
"成长的足迹"
,
"快乐小状元"
,
"知识小舞台"
,
"学习小宝贝"
,
"智慧小蜜蜂"
,
"成长的歌声"
,
"快乐学习园"
,
"知识小能手"
,
"学习小快乐"
,
"智慧小天空"
,
"成长的种子"
,
"快乐小智者"
,
"知识小战士"
,
"学习小发现"
,
"智慧小冒险家"
,
"成长的航道"
,
"快乐小发现"
,
"知识小探险家"
,
"学习小太阳"
,
"智慧小星星"
,
"成长的瞬间"
,
"快乐小小熊"
,
"知识小英雄"
,
"学习小快车"
,
"智慧小脚印"
,
"成长的花园"
,
"快乐小奇迹"
]
\ No newline at end of file
src/pages/group/index.module.scss
View file @
b3f19187
...
...
@@ -7,7 +7,7 @@
@include
flexLayout
(
_
,
center
,
space-between
);
background-color
:
#F0F2F9
;
border-radius
:
48px
;
padding
:
18px
32px
18
px
40px
;
padding
:
20px
32px
19
px
40px
;
}
&
_input
{
...
...
src/pages/group/index.tsx
View file @
b3f19187
import
{
View
,
Image
,
Input
,
ScrollView
,
Text
}
from
'@tarojs/components'
import
{
useDidShow
,
getCurrentInstance
,
getTabBar
,
getMenuButtonBoundingClientRect
,
showModal
,
useShareAppMessage
,
showLoading
,
hideLoading
}
from
'@tarojs/taro'
import
{
useMemo
,
useState
,
useEffect
}
from
'react'
import
{
useDidShow
,
getCurrentInstance
,
getTabBar
,
getMenuButtonBoundingClientRect
,
showModal
,
useShareAppMessage
}
from
'@tarojs/taro'
import
{
useMemo
,
useState
,
useEffect
,
useRef
,
useCallback
}
from
'react'
import
Modal
from
'@/components/Modal'
import
Button
from
'@/components/Button'
...
...
@@ -8,6 +8,7 @@ import { useBoolean, useRequest } from '@/hooks'
import
{
createTribe
}
from
'@/api/group'
import
{
useStoreActions
,
useStoreState
}
from
'@/store/hooks'
import
type
{
TabbarRef
}
from
'@/custom-tab-bar/index'
import
{
getNickNameWords
,
type
NickNameWord
}
from
'@/api'
import
assets
from
'@/assets/oss/assets-group'
...
...
@@ -20,16 +21,19 @@ import ShareButton from './components/share-button'
import
styles
from
'./index.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
randomIndex
=
Math
.
floor
(
Math
.
random
()
*
groupNames
.
length
)
const
page
=
useMemo
(()
=>
getCurrentInstance
().
page
,
[])
const
[
nav
]
=
useState
(
getMenuButtonBoundingClientRect
())
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
[
isLoad
,
{
toggle
:
toggleLoad
}]
=
useBoolean
(
true
)
const
userInfo
=
useStoreState
(
state
=>
state
.
userModel
.
userInfo
)
const
tribeInfo
=
useStoreState
(
state
=>
state
.
groupModel
.
tribeInfo
)
...
...
@@ -40,17 +44,30 @@ const Group = () => {
return
nav
.
height
+
nav
.
top
+
5
},
[
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
()
=>
{
const
tabbar
=
getTabBar
<
TabbarRef
>
(
page
)
tabbar
?.
setSelected
(
1
)
queryTribePoint
()
toggleLoad
()
await
fetchTribeInfo
()
toggleLoad
()
})
useEffect
(()
=>
{
Promise
.
all
([
queryTribePoint
(),
fetchTribeInfo
()])
},
[
queryTribePoint
,
fetchTribeInfo
])
useShareAppMessage
(()
=>
{
return
{
title
:
'来看看这个有趣的页面!'
,
...
...
@@ -84,14 +101,6 @@ const Group = () => {
}
}
useEffect(() => {
isLoad && hideLoading()
}, [isLoad])
if (!isLoad) {
return showLoading()
}
return (
<View>
<TopHeader />
...
...
@@ -114,7 +123,7 @@ const Group = () => {
<Modal isVisible={isVisible} tilte="学习部落名" onClose={setFalse}>
<View className={styles.modal}>
<View className={styles.modal_body} onClick={
() => setGroupNo(groupNames[randomIndex])
}>
<View className={styles.modal_body} onClick={
getGroupNo
}>
<Input className={styles.modal_input} disabled value={groupNo} />
<Image className={styles.modal_refresh} mode="widthFix" src={assets['refresh.png'].u} />
</View>
...
...
src/pages/prepare/index.module.scss
View file @
b3f19187
...
...
@@ -218,6 +218,7 @@
&
_loading
{
opacity
:
0
.8
;
pointer-events
:
none
;
}
&
_spin
{
...
...
@@ -249,6 +250,7 @@
}
.buy_card_disabled
{
pointer-events
:
none
;
background-image
:
url('./assets/btn-disabled.png')
;
color
:
#C2C8D1
;
}
\ No newline at end of file
src/pages/prepare/index.tsx
View file @
b3f19187
...
...
@@ -85,6 +85,7 @@ const Prepare = () => {
const { run: exchange, loading: spinning } = useRequest(pointToCard, {
immediate: false,
throttleDelay: 1000,
onSuccess: () => {
getQuestionList(+router.params.id || 1).then(() => {
setFalse()
...
...
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