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
981cc69e
Commit
981cc69e
authored
Apr 04, 2023
by
666
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
14cd9484
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
234 additions
and
256 deletions
+234
-256
app.config.ts.tpl
scripts/app.config.ts.tpl
+1
-1
btn-border.png
src/pages/prepare/assets/btn-border.png
+0
-0
btn-primary.png
src/pages/prepare/assets/btn-primary.png
+0
-0
close.png
src/pages/prepare/assets/close.png
+0
-0
answer-card-modal.module.scss
src/pages/prepare/components/answer-card-modal.module.scss
+83
-0
answer-card-modal.tsx
src/pages/prepare/components/answer-card-modal.tsx
+35
-0
cd-rank.tsx
src/pages/prepare/components/cd-rank.tsx
+0
-17
index.module.scss
src/pages/prepare/components/rank-list/index.module.scss
+0
-70
index.tsx
src/pages/prepare/components/rank-list/index.tsx
+0
-92
timing.tsx
src/pages/prepare/components/rank-list/timing.tsx
+0
-16
user-info.tsx
src/pages/prepare/components/rank-list/user-info.tsx
+0
-19
study-league-rank.tsx
src/pages/prepare/components/study-league-rank.tsx
+0
-15
tabs.module.scss
src/pages/prepare/components/tabs.module.scss
+2
-2
top-bar.tsx
src/pages/prepare/components/top-bar.tsx
+2
-2
tribe-rank.scss
src/pages/prepare/components/tribe-rank.scss
+0
-0
tribe-rank.tsx
src/pages/prepare/components/tribe-rank.tsx
+0
-0
index.module.scss
src/pages/prepare/index.module.scss
+63
-3
index.tsx
src/pages/prepare/index.tsx
+48
-19
No files found.
scripts/app.config.ts.tpl
View file @
981cc69e
...
...
@@ -6,8 +6,8 @@
export default {
pages: [
'pages/prepare/index',
'pages/main/main',
'pages/prepare/index',
'pages/group/index',
'pages/study-market/index',
'pages/game/play/index',
...
...
src/pages/prepare/assets/btn-border.png
0 → 100644
View file @
981cc69e
2.38 KB
src/pages/prepare/assets/btn-primary.png
0 → 100644
View file @
981cc69e
2.18 KB
src/
components/Modal/assets/close-dark
.png
→
src/
pages/prepare/assets/close
.png
View file @
981cc69e
File moved
src/pages/prepare/components/answer-card-modal.module.scss
0 → 100644
View file @
981cc69e
@import
'@/styles/mixins.scss'
;
.mask
{
position
:
fixed
;
left
:
0
;
top
:
0
;
bottom
:
0
;
right
:
0
;
background
:
rgba
(
0
,
0
,
0
,
0
.5
);
z-index
:
2000
;
opacity
:
0
;
pointer-events
:
none
;
transition
:
opacity
.5s
cubic-bezier
(
0
.175
,
0
.885
,
0
.32
,
1
.0
);
&
.visible
{
opacity
:
1
;
pointer-events
:
all
;
}
}
.modal
{
position
:
fixed
;
bottom
:
0
;
left
:
0
;
right
:
0
;
z-index
:
2001
;
background-color
:
#fff
;
transform
:
translateY
(
100%
);
transition
:
transform
.5s
cubic-bezier
(
0
.175
,
0
.885
,
0
.32
,
1
.0
);
border-radius
:
32px
32px
0px
0px
;
text-align
:
center
;
padding
:
32
PX
24
PX
;
&
.visible
{
transform
:
translateY
(
0
);
}
.close
{
position
:
absolute
;
width
:
20
PX
;
height
:
20
PX
;
top
:
12
PX
;
right
:
24
PX
;
}
.title
{
font-size
:
24
PX
;
font-weight
:
600
;
color
:
#586170
;
margin-bottom
:
32px
;
}
.tips
{
font-size
:
18
PX
;
font-weight
:
400
;
color
:
#586170
;
margin-bottom
:
24
PX
;
}
.footer
{
@include
flexLayout
(
column
);
gap
:
12
PX
;
.buy
{
height
:
56
PX
;
@include
flexLayout
(
row
,
center
,
center
);
background-size
:
100%
100%
;
background-image
:
url('../assets/btn-primary.png')
;
font-weight
:
500
;
}
.studyTribe
{
@include
flexLayout
(
row
,
center
,
center
);
height
:
56
PX
;
background-image
:
url('../assets/btn-border.png')
;
background-size
:
100%
100%
;
text-align
:
center
;
font-size
:
18
PX
;
font-weight
:
500
;
color
:
#1786F7
;
}
}
}
src/pages/prepare/components/answer-card-modal.tsx
0 → 100644
View file @
981cc69e
import
{
PropsWithChildren
}
from
'react'
import
{
View
,
RootPortal
,
Image
,
Text
}
from
'@tarojs/components'
import
{
switchTab
}
from
'@tarojs/taro'
import
classNames
from
'classnames'
import
styles
from
'./answer-card-modal.module.scss'
type
ModalProps
=
{
isVisible
:
boolean
;
onClose
:
()
=>
void
;
}
const
AnswerSheetModal
=
(
props
:
PropsWithChildren
<
ModalProps
>
)
=>
{
const
{
isVisible
,
children
,
onClose
}
=
props
return
(
<
RootPortal
>
<
View
className=
{
classNames
(
styles
.
mask
,
isVisible
&&
styles
.
visible
)
}
onClick=
{
onClose
}
>
</
View
>
<
View
className=
{
classNames
(
styles
.
modal
,
isVisible
&&
styles
.
visible
)
}
>
<
Image
className=
{
styles
.
close
}
onClick=
{
onClose
}
src=
{
require
(
'../assets/close.png'
)
}
/>
<
View
className=
{
styles
.
title
}
>
你的答题卡已经用完啦
</
View
>
<
View
className=
{
styles
.
tips
}
>
可通过以下途径获得哦
</
View
>
<
View
className=
{
styles
.
footer
}
>
<
View
className=
{
styles
.
buy
}
>
{
children
}
</
View
>
<
View
className=
{
styles
.
studyTribe
}
onClick=
{
()
=>
switchTab
({
url
:
'/pages/group/index'
})
}
>
<
Text
>
建设学习部落,得更多答题卡
</
Text
>
</
View
>
</
View
>
</
View
>
</
RootPortal
>
)
}
export
default
AnswerSheetModal
src/pages/prepare/components/cd-rank.tsx
deleted
100644 → 0
View file @
14cd9484
import
{
View
,
Text
}
from
'@tarojs/components'
export
default
()
=>
{
return
(
<
View
>
<
View
>
<
Text
>
名次
</
Text
>
<
Text
>
用户名
</
Text
>
<
View
>
<
Text
>
首次
</
Text
>
<
Text
>
|
</
Text
>
<
Text
>
最佳
</
Text
>
</
View
>
</
View
>
</
View
>
)
}
src/pages/prepare/components/rank-list/index.module.scss
deleted
100644 → 0
View file @
14cd9484
.wrapper
{
display
:
flex
;
flex-direction
:
column
;
}
.head
{
display
:
flex
;
justify-content
:
flex-end
;
&
_text
{
width
:
160px
;
text-align
:
center
;
}
}
.timing
{
min-width
:
320px
;
display
:
flex
;
align-items
:
center
;
Text
{
flex
:
1
;
text-align
:
center
;
}
}
.list
{
min-height
:
300px
;
max-height
:
400px
;
overflow
:
hidden
;
overflow-y
:
auto
;
display
:
flex
;
flex-direction
:
column
;
row-gap
:
24px
;
}
.item
{
padding
:
16px
0
;
display
:
flex
;
justify-content
:
space-between
;
}
.highlight
{
background-color
:
yellow
;
}
.noTopThree
{
border
:
1px
solid
red
;
margin
:
24px
0
;
}
.userInfo
{
display
:
flex
;
column-gap
:
16px
;
}
.avatar
{
width
:
60px
;
height
:
60px
;
border-radius
:
50%
;
background-color
:
pink
;
}
.userDetails
{
display
:
flex
;
flex-direction
:
column
;
row-gap
:
16px
;
line-height
:
1
;
}
\ No newline at end of file
src/pages/prepare/components/rank-list/index.tsx
deleted
100644 → 0
View file @
14cd9484
import
{
View
,
Button
,
Text
,
ScrollView
}
from
'@tarojs/components'
import
classNames
from
'classnames'
import
{
useStoreState
}
from
'@/store/hooks'
import
{
useBoolean
}
from
'@/hooks'
import
{
StageRank
}
from
'@/api/game'
import
styles
from
'./index.module.scss'
interface
ScrollListProps
<
T
>
{
users
:
T
[]
}
const
ScrollRankList
=
<
T
extends
StageRank
>
(
{
users
}
: ScrollListProps
<
T
>
) =
>
{
const
[
showAll
,
{
toggle
}]
=
useBoolean
(
false
)
const
currentUser
=
useStoreState
((
state
)
=>
state
.
userModel
.
userInfo
)
const
renderItem
=
(
rank
:
T
)
=>
{
const
isCurrentUser
=
currentUser
.
userId
===
rank
.
userId
const
itemClass
=
classNames
(
styles
.
item
,
{
[
styles
.
highlight
]:
isCurrentUser
,
})
return
(
<
View
key=
{
rank
.
userId
}
className=
{
itemClass
}
>
<
View
className=
{
styles
.
userInfo
}
>
<
View
className=
{
styles
.
avatar
}
/>
{
/* <Image className='avatar' src={avatar} /> */
}
<
View
className=
{
styles
.
userDetails
}
>
<
Text
className=
"nickname"
>
{
rank
.
nickName
}
</
Text
>
<
Text
className=
"school"
>
{
rank
.
secondName
}
</
Text
>
</
View
>
</
View
>
<
View
className=
{
styles
.
timing
}
>
<
Text
>
{
rank
.
firstResultTime
}
秒
</
Text
>
<
Text
>
{
rank
.
bestResultTime
}
秒
</
Text
>
</
View
>
</
View
>
)
}
// const hasNextPage = true
// const loading = false
// const computedUsers = showAll ? users : topThreeUsers
const
scrollStyle
=
{
height
:
'400px'
,
background
:
'red'
}
const
loadMore
=
()
=>
{
console
.
log
(
'loadMore'
)
}
return
(
<
View
className=
{
styles
.
wrapper
}
>
<
View
className=
{
styles
.
header
}
>
<
Text
className=
{
styles
.
header_text
}
>
首次
</
Text
>
<
Text
className=
{
styles
.
header_text
}
>
最佳
</
Text
>
</
View
>
{
currentUser
.
userId
&&
renderItem
(
currentUser
as
T
)
}
<
ScrollView
scrollY
enableFlex
scrollWithAnimation
style=
{
scrollStyle
}
onScrollToLower=
{
loadMore
}
>
<
View
style=
{
{
height
:
'300px'
}
}
>
A
</
View
>
<
View
style=
{
{
height
:
'300px'
}
}
>
B
</
View
>
<
View
style=
{
{
height
:
'300px'
}
}
>
C
</
View
>
{
/* {hasNextPage && !loading && <Text>加载更多</Text>} */
}
</
ScrollView
>
<
View
className=
{
styles
.
list
}
>
{
[].
map
(
renderItem
)
}
</
View
>
{
!
showAll
&&
(
<
Button
className=
{
styles
.
loadMore
}
onClick=
{
()
=>
toggle
()
}
>
查看更多
</
Button
>
)
}
</
View
>
)
}
export default ScrollRankList
src/pages/prepare/components/rank-list/timing.tsx
deleted
100644 → 0
View file @
14cd9484
import
{
View
,
Text
}
from
'@tarojs/components'
import
{
TimingProps
}
from
'../../types'
// import { formatTime } from '../../utils'
import
styles
from
'./index.module.scss'
const
Timing
=
({
time
=
0
}:
TimingProps
)
=>
{
return
(
<
View
className=
{
styles
.
timing
}
>
<
Text
>
34.23秒
</
Text
>
<
Text
>
21.23秒
</
Text
>
</
View
>
)
}
export
default
Timing
src/pages/prepare/components/rank-list/user-info.tsx
deleted
100644 → 0
View file @
14cd9484
import
{
View
,
Text
}
from
'@tarojs/components'
import
{
UserInfoProps
}
from
'../../types'
import
styles
from
'./index.module.scss'
const
UserInfo
=
({
avatar
,
nickname
,
schoolName
}:
UserInfoProps
)
=>
{
return
(
<
View
className=
{
styles
.
userInfo
}
>
<
View
className=
{
styles
.
avatar
}
/>
{
/* <Image className='avatar' src={avatar} /> */
}
<
View
className=
{
styles
.
userDetails
}
>
<
Text
className=
"nickname"
>
{
nickname
}
</
Text
>
<
Text
className=
"school"
>
{
schoolName
}
</
Text
>
</
View
>
</
View
>
)
}
export
default
UserInfo
src/pages/prepare/components/study-league-rank.tsx
deleted
100644 → 0
View file @
14cd9484
import
{
View
,
Text
}
from
'@tarojs/components'
import
{
StageRank
}
from
'@/api/game'
import
ScrollRankList
from
'./rank-list/index'
const
StudyLeagueRank
=
<
T
extends
StageRank
>
(
{
users
}
:
{
users
:
T
[]
}
) =
>
{
return
(
<
View
>
<
ScrollRankList
<
T
>
users=
{
users
}
/
>
<
Text
>
立即创建
</
Text
>
</
View
>
)
}
export default StudyLeagueRank
src/pages/prepare/components/tabs.module.scss
View file @
981cc69e
...
...
@@ -4,6 +4,7 @@
width
:
100%
;
flex-direction
:
column
;
z-index
:
999
;
overflow
:
visible
;
}
.tabBar
{
...
...
@@ -57,14 +58,13 @@
background-color
:
#fff
;
position
:
relative
;
top
:
-40
PX
;
height
:
100%
;
margin-bottom
:
-40
PX
;
.tabPane
{
height
:
auto
;
grid-row
:
1
;
grid-column
:
1
;
transition
:
transform
0
.3s
ease-in-out
;
will-change
:
transform
;
pointer-events
:
none
;
&
.active
{
...
...
src/pages/prepare/components/top-bar.tsx
View file @
981cc69e
import
{
View
,
Image
}
from
'@tarojs/components'
import
{
useMemo
}
from
'react'
import
{
getMenuButtonBoundingClientRect
,
getSystemInfoSync
}
from
'@tarojs/taro'
import
{
getMenuButtonBoundingClientRect
,
navigateBack
,
getSystemInfoSync
}
from
'@tarojs/taro'
import
styles
from
'./top-bar.module.scss'
...
...
@@ -26,7 +26,7 @@ export default () => {
}
}
>
<
View
className=
{
styles
.
inner
}
style=
{
innerStyle
}
>
<
Image
className=
{
styles
.
back_icon
}
src=
{
require
(
'../assets/back.png'
)
}
mode=
"widthFix"
/>
<
Image
className=
{
styles
.
back_icon
}
src=
{
require
(
'../assets/back.png'
)
}
mode=
"widthFix"
onClick=
{
()
=>
navigateBack
()
}
/>
</
View
>
</
View
>
</
View
>
...
...
src/pages/prepare/components/tribe-rank.scss
deleted
100644 → 0
View file @
14cd9484
src/pages/prepare/components/tribe-rank.tsx
deleted
100644 → 0
View file @
14cd9484
src/pages/prepare/index.module.scss
View file @
981cc69e
...
...
@@ -14,6 +14,13 @@
}
}
.empty
{
color
:
#9999
;
font-size
:
12
PX
;
margin-top
:
12
PX
;
text-align
:
center
;
}
.item
{
display
:
flex
;
padding
:
28px
32px
26px
;
...
...
@@ -79,8 +86,62 @@
z-index
:
999
;
&
_text
{
font-size
:
40px
;
letter-spacing
:
2
PX
;
letter-spacing
:
1
PX
;
font-weight
:
600
;
}
.card
{
@include
flexLayout
(
row
,
center
);
position
:
absolute
;
right
:
100px
;
gap
:
4
PX
;
&
_icon
{
width
:
32
PX
;
height
:
32
PX
}
&
_text
{
font-size
:
18
PX
;
font-weight
:
500
;
color
:
#FFFFFF
;
}
}
.tip
{
position
:
absolute
;
top
:
-32
PX
;
right
:
-9
PX
;
padding
:
8
PX
13
PX
12
PX
;
background-image
:
url('https://cdn.jkwljy.com/pk-math/4WgogFzhSYUSrvpmEE7JwoVg7SH5/122x42')
;
background-size
:
100%
100%
;
&
_text
{
font-size
:
16
PX
;
font-weight
:
500
;
color
:
#FFFFFF
;
}
}
}
}
.modal
{
@include
flexLayout
(
row
,
center
,
center
);
font-size
:
18
PX
;
font-weight
:
500
;
color
:
#FFFFFF
;
&
>
{
.logo
{
width
:
32
PX
;
height
:
32
PX
;
margin-right
:
4
PX
;
}
.buy
{
margin
:
0
12
PX
;
}
.balance
{
font-weight
:
400
;
font-size
:
14
PX
;
}
}
}
\ No newline at end of file
}
src/pages/prepare/index.tsx
View file @
981cc69e
import
{
View
,
Text
,
Image
}
from
'@tarojs/components'
import
{
useEffect
}
from
'react'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
import
{
useRouter
,
getMenuButtonBoundingClientRect
}
from
'@tarojs/taro'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
import
{
useBoolean
}
from
'@/hooks'
import
{
type
StageRank
}
from
'@/api/game'
import
Button
from
'@/components/Button
'
import
assets
from
'@/assets/oss/assets-prepare
'
import
Button
from
'@/components/Button'
import
Tabs
,
{
type
TabItem
}
from
'./components/tabs'
import
TopBar
from
'./components/top-bar'
import
MainHeader
from
'./components/main-header'
import
Thead
from
'./components/thead'
import
AnswerCardModal
from
'./components/answer-card-modal'
import
styles
from
'./index.module.scss'
...
...
@@ -37,6 +40,7 @@ const renderItem = (item: StageRank, index: number) => {
const
Prepare
=
()
=>
{
const
nav
=
getMenuButtonBoundingClientRect
()
const
[
isVisible
,
{
setTrue
,
setFalse
}]
=
useBoolean
(
false
)
const
stageDetail
=
useStoreState
(
state
=>
state
.
gameModel
.
stageDetail
)
const
getStageDetail
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
getStageDetail
)
...
...
@@ -47,14 +51,22 @@ const Prepare = () => {
getStageDetail
(
+
router
.
params
.
id
||
1
)
},
[
router
,
getStageDetail
])
const
renderList
=
(
list
=
[])
=>
{
const
isEmpty
=
list
.
length
<
1
return
(
<>
<
Thead
/>
{
list
.
map
(
renderItem
)
}
{
isEmpty
&&
<
View
className=
{
styles
.
empty
}
>
暂无数据
</
View
>
}
</>
)
}
const
tabs
:
TabItem
[]
=
[
{
label
:
'成都排行榜'
,
children
:
(
<>
<
Thead
/>
{
[].
map
(
renderItem
)
}
</>
<>
{
renderList
()
}
</>
)
},
{
...
...
@@ -62,28 +74,45 @@ const Prepare = () => {
children
:
(
<
View
className=
{
styles
.
tribe
}
>
<
Text
className=
{
styles
.
tribe_title
}
>
极客学霸俱乐部
</
Text
>
<
Thead
/>
{
[].
map
(
renderItem
)
}
{
renderList
()
}
</
View
>
)
}
]
return
(
<
View
className=
{
styles
.
wrapper
}
>
<
TopBar
/>
<>
<
View
className=
{
styles
.
wrapper
}
>
<
TopBar
/>
<
View
style=
{
{
paddingTop
:
`${nav.height + nav.top + 5}px`
}
}
>
<
MainHeader
/>
<
Tabs
initialIndex=
{
1
}
items=
{
tabs
}
/>
</
View
>
<
View
style=
{
{
position
:
'relative'
,
paddingTop
:
`${nav.height + nav.top + 5}px`
}
}
>
<
MainHeader
/>
<
Tabs
items=
{
tabs
}
/>
</
View
>
<
View
className=
{
styles
.
challenge
}
>
<
Button
type=
"custom"
size=
"large"
onClick=
{
setTrue
}
>
<
Text
className=
{
styles
.
challenge_text
}
>
开始闯关
</
Text
>
<
View
className=
{
styles
.
card
}
>
<
Image
className=
{
styles
.
card_icon
}
src=
{
require
(
'@/pages/main/assets/ph.png'
)
}
/>
<
Text
className=
{
styles
.
card_text
}
>
-1
</
Text
>
</
View
>
{
false
&&
<
View
className=
{
styles
.
tip
}
>
<
Text
className=
{
styles
.
tip_text
}
>
首次免答题卡
</
Text
>
</
View
>
}
</
Button
>
</
View
>
<
View
className=
{
styles
.
challenge
}
>
<
Button
type=
"custom"
size=
"large"
>
<
Text
className=
{
styles
.
challenge_text
}
>
开始闯关
</
Text
>
</
Button
>
</
View
>
</
View
>
<
AnswerCardModal
isVisible=
{
isVisible
}
onClose=
{
setFalse
}
>
<
View
className=
{
styles
.
modal
}
>
<
Image
className=
{
styles
.
logo
}
src=
{
assets
[
'diamond.png'
].
u
}
mode=
"widthFix"
/>
<
Text
>
-30
</
Text
>
<
Text
className=
{
styles
.
buy
}
>
购买
</
Text
>
<
Text
className=
{
styles
.
balance
}
>
(当前剩余 120)
</
Text
>
</
View
>
</
AnswerCardModal
>
</>
)
}
...
...
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