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
0022e130
Commit
0022e130
authored
Mar 30, 2023
by
m
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
a69d0710
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
156 additions
and
4 deletions
+156
-4
launch-quest.tsx
src/pages/prepare/components/overview/launch-quest.tsx
+8
-1
index.module.scss
src/pages/prepare/index.module.scss
+6
-0
index.tsx
src/pages/prepare/index.tsx
+9
-2
mystery-box.tsx
src/pages/study-market/components/mystery-box.tsx
+2
-1
index.config.ts
src/pages/summary/index.config.ts
+0
-0
index.scss
src/pages/summary/index.scss
+54
-0
index.tsx
src/pages/summary/index.tsx
+77
-0
No files found.
src/pages/prepare/components/overview/launch-quest.tsx
View file @
0022e130
import
React
from
'react'
import
{
View
,
Text
,
Button
}
from
'@tarojs/components'
// import Taro from '@tarojs/taro'
import
Modal
from
'@/components/Modal'
import
useToggle
from
'@/hooks/use-toggle'
...
...
@@ -7,10 +8,16 @@ import styles from './index.module.scss'
const
LaunchQuest
:
React
.
FC
=
()
=>
{
const
[
isVisible
,
toggleModal
]
=
useToggle
()
const
navigateTo
=
()
=>
{
toggleModal
(
false
)
// Taro.navigateTo('/')
}
return
(
<>
<
View
className=
{
styles
.
launchQuest
}
>
<
Button
onClick=
{
()
=>
toggleModal
(
true
)
}
>
开始闯关
</
Button
>
<
Button
onClick=
{
navigateTo
}
>
开始闯关
</
Button
>
<
Text
className=
{
styles
.
tip
}
>
首次免答题卡
{
/* {hasFreePass ? '首次免答题卡' : '-1答题卡'} */
}
...
...
src/pages/prepare/index.module.scss
View file @
0022e130
@import
'@/styles/mixins.scss'
;
.breakthrough
{
@include
flexLayout
(
_
,
center
,
space-around
);
}
\ No newline at end of file
src/pages/prepare/index.tsx
View file @
0022e130
import
{
Button
,
View
}
from
'@tarojs/components'
import
{
useEffect
}
from
'react'
import
Tabs
,
{
type
TabItem
}
from
'@/components/Tabs'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
...
...
@@ -6,6 +7,8 @@ import Overview from './components/overview/index'
import
ScrollRankList
from
'./components/rank-list/index'
import
StudyLeagueRank
from
'./components/study-league-rank'
import
styles
from
'./index.module.scss'
const
Prepare
:
React
.
FC
=
()
=>
{
const
{
list
:
users
}
=
useStoreState
((
state
)
=>
state
.
prepareModel
)
const
refresh
=
useStoreActions
((
actions
)
=>
actions
.
prepareModel
.
refresh
)
...
...
@@ -20,10 +23,14 @@ const Prepare: React.FC = () => {
]
return
(
<>
<
View
>
<
Overview
/>
<
Tabs
items=
{
tabs
}
/>
</>
<
View
className=
{
styles
.
breakthrough
}
>
<
Button
>
继续闯关
</
Button
>
<
Button
>
再次努力,变得更棒
</
Button
>
</
View
>
</
View
>
)
}
...
...
src/pages/study-market/components/mystery-box.tsx
View file @
0022e130
import
{
View
,
Text
,
Button
}
from
'@tarojs/components'
import
{
View
,
Text
,
Button
,
Input
}
from
'@tarojs/components'
import
Modal
from
'@/components/Modal'
import
useToggle
from
'@/hooks/use-toggle'
...
...
@@ -21,6 +21,7 @@ const MysteryBox = () => {
/>
<
Modal
isVisible=
{
isVisible
}
onClose=
{
()
=>
toggleModal
(
false
)
}
>
<
View
>
<
Input
type=
"number"
/>
<
Text
>
兑换礼物
</
Text
>
<
Button
size=
"mini"
onClick=
{
onClick
}
>
兑换
</
Button
>
</
View
>
...
...
src/pages/summary/index.config.ts
0 → 100644
View file @
0022e130
src/pages/summary/index.scss
0 → 100644
View file @
0022e130
.container
{
display
:
flex
;
flex-direction
:
column
;
justify-content
:
space-between
;
height
:
100%
;
.score
{
font-size
:
3rem
;
font-weight
:
bold
;
text-align
:
center
;
&
.zoom-in-animate
{
animation
:
fade-zoom-in
1s
ease-in-out
;
}
}
.stats
{
display
:
flex
;
justify-content
:
space-between
;
padding
:
0
1rem
;
}
.glorys
{
display
:
flex
;
flex-direction
:
column
;
gap
:
0
.5rem
;
padding
:
0
1rem
;
}
.continue-btn
{
display
:
flex
;
justify-content
:
center
;
padding-bottom
:
1rem
;
}
}
@keyframes
fade-zoom-in
{
0
%
{
transform
:
scale
(
1
);
opacity
:
1
;
}
50
%
{
transform
:
scale
(
1
.5
);
opacity
:
0
.5
;
}
100
%
{
transform
:
scale
(
1
);
opacity
:
1
;
}
}
\ No newline at end of file
src/pages/summary/index.tsx
0 → 100644
View file @
0022e130
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
View
,
Text
,
Button
}
from
'@tarojs/components'
import
classNames
from
'classnames'
import
'./index.scss'
interface
ResultProps
{
score
:
'S'
|
'A'
|
'B'
;
correctRate
:
string
;
timeSpent
:
number
;
isFirstTime
:
boolean
;
ranking
:
number
;
promoted
:
boolean
;
onContinue
:
()
=>
void
;
}
const
SummaryResult
:
React
.
FC
<
ResultProps
>
=
({
score
=
'B'
,
correctRate
=
'全队'
,
timeSpent
=
30
,
isFirstTime
,
ranking
,
promoted
,
onContinue
,
})
=>
{
const
[
result
,
setResult
]
=
useState
({
score
,
isFirstTime
,
ranking
})
const
[
animateScore
,
setAnimateScore
]
=
useState
(
false
)
const
bonusPoints
=
100
const
selfRank
=
100
const
allRanks
=
1000
useEffect
(()
=>
{
setAnimateScore
(
true
)
setResult
({
score
,
isFirstTime
,
ranking
})
const
timer
=
setTimeout
(()
=>
{
setAnimateScore
(
false
)
},
500
)
return
()
=>
{
clearTimeout
(
timer
)
}
},
[
score
,
isFirstTime
,
ranking
])
return
(
<
View
className=
"container"
>
<
View
className=
{
classNames
(
'score'
,
{
'zoom-in-animate'
:
animateScore
})
}
>
<
Text
>
{
result
.
score
}
</
Text
>
</
View
>
<
View
className=
"stats"
>
<
Text
>
正确率:
{
correctRate
}
%
</
Text
>
<
Text
>
耗时:
{
timeSpent
}
秒
</
Text
>
</
View
>
<
View
className=
"glorys"
>
<
Text
>
成绩首次达成:
{
result
.
score
}
</
Text
>
{
result
.
isFirstTime
?
(
<
Text
>
排名首次达成:
{
result
.
ranking
}
</
Text
>
)
:
(
<
Text
>
排名再次达成:
{
result
.
ranking
}
</
Text
>
)
}
{
promoted
&&
<
Text
>
升档成功:
{
bonusPoints
}
积分
</
Text
>
}
{
selfRank
>
0
&&
(
<
Text
>
排名:
{
selfRank
}
/
{
allRanks
}
</
Text
>
)
}
</
View
>
<
View
className=
"continue-btn"
>
<
Button
onClick=
{
onContinue
}
>
继续
</
Button
>
</
View
>
</
View
>
)
}
export
default
SummaryResult
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