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
7e292b95
Commit
7e292b95
authored
Mar 31, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of dev.jiuaoedu.com:hewenhao/GeekLearnMathWeapp
parents
a8d1dc29
a97f761d
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
502 additions
and
28 deletions
+502
-28
index.module.scss
src/components/Modal/index.module.scss
+3
-2
index.tsx
src/components/Modal/index.tsx
+11
-3
use-request.ts
src/hooks/use-request.ts
+1
-1
use-toggle.ts
src/hooks/use-toggle.ts
+1
-1
creator.module.scss
src/pages/group/components/creator.module.scss
+64
-0
creator.tsx
src/pages/group/components/creator.tsx
+42
-0
members.module.scss
src/pages/group/components/members.module.scss
+44
-0
members.tsx
src/pages/group/components/members.tsx
+93
-0
index.config.ts
src/pages/group/index.config.ts
+4
-0
index.module.scss
src/pages/group/index.module.scss
+32
-0
index.tsx
src/pages/group/index.tsx
+38
-4
index.tsx
src/pages/prepare/components/overview/index.tsx
+1
-1
launch-quest.tsx
src/pages/prepare/components/overview/launch-quest.tsx
+9
-2
index.tsx
src/pages/prepare/components/rank-list/index.tsx
+1
-1
index.module.scss
src/pages/prepare/index.module.scss
+6
-0
index.tsx
src/pages/prepare/index.tsx
+9
-2
answer-sheet.tsx
src/pages/study-market/components/answer-sheet.tsx
+5
-5
mystery-box.tsx
src/pages/study-market/components/mystery-box.tsx
+7
-6
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/components/Modal/index.module.scss
View file @
7e292b95
...
@@ -20,9 +20,9 @@
...
@@ -20,9 +20,9 @@
pointer-events
:
auto
;
pointer-events
:
auto
;
}
}
.
inner
{
.
body
{
background-color
:
#ffffff
;
background-color
:
#ffffff
;
padding
:
16px
;
padding
:
16px
;
border-radius
:
4px
;
border-radius
:
8
PX
;
box-shadow
:
0
4px
16px
rgba
(
0
,
0
,
0
,
0
.1
);
box-shadow
:
0
4px
16px
rgba
(
0
,
0
,
0
,
0
.1
);
}
}
\ No newline at end of file
src/components/Modal/index.tsx
View file @
7e292b95
...
@@ -4,10 +4,12 @@ import classNames from 'classnames'
...
@@ -4,10 +4,12 @@ import classNames from 'classnames'
import
styles
from
'./index.module.scss'
import
styles
from
'./index.module.scss'
interface
ModalProps
{
interface
ModalProps
{
isVisible
:
unknow
n
;
isVisible
:
boolea
n
;
wrapClassName
?:
string
;
wrapClassName
?:
string
;
bodyClassName
?:
string
;
children
:
React
.
ReactNode
;
children
:
React
.
ReactNode
;
maskClosable
?:
boolean
;
maskClosable
?:
boolean
;
coverNavigateBar
?:
boolean
;
onClose
?:
()
=>
void
;
onClose
?:
()
=>
void
;
}
}
...
@@ -16,6 +18,8 @@ const Modal: React.FC<ModalProps> = ({
...
@@ -16,6 +18,8 @@ const Modal: React.FC<ModalProps> = ({
onClose
,
onClose
,
children
,
children
,
wrapClassName
,
wrapClassName
,
bodyClassName
,
coverNavigateBar
=
true
,
// z-index 层级高于原生的bar
maskClosable
=
true
maskClosable
=
true
})
=>
{
})
=>
{
const
wrapClass
=
classNames
(
styles
.
wrapper
,
wrapClassName
,
{
const
wrapClass
=
classNames
(
styles
.
wrapper
,
wrapClassName
,
{
...
@@ -23,8 +27,12 @@ const Modal: React.FC<ModalProps> = ({
...
@@ -23,8 +27,12 @@ const Modal: React.FC<ModalProps> = ({
})
})
return
(
return
(
<
View
className=
{
wrapClass
}
onClick=
{
()
=>
maskClosable
&&
onClose
?.()
}
>
<
View
<
View
className=
{
classNames
(
styles
.
inner
)
}
onClick=
{
(
e
)
=>
e
.
stopPropagation
()
}
>
className=
{
wrapClass
}
style=
{
{
zIndex
:
coverNavigateBar
?
10001
:
100
}
}
onClick=
{
()
=>
maskClosable
&&
onClose
?.()
}
>
<
View
className=
{
classNames
(
styles
.
body
,
bodyClassName
)
}
onClick=
{
(
e
)
=>
e
.
stopPropagation
()
}
>
{
children
}
{
children
}
</
View
>
</
View
>
</
View
>
</
View
>
...
...
src/hooks/use-request.ts
View file @
7e292b95
...
@@ -26,7 +26,7 @@ interface Result<T, P> {
...
@@ -26,7 +26,7 @@ interface Result<T, P> {
updateData
:
(
newData
:
T
)
=>
void
;
updateData
:
(
newData
:
T
)
=>
void
;
}
}
export
default
function
useRequest
<
T
=
unknown
,
P
=
unknown
>
(
export
function
useRequest
<
T
=
unknown
,
P
=
unknown
>
(
service
:
(
params
?:
P
)
=>
Promise
<
T
>
,
service
:
(
params
?:
P
)
=>
Promise
<
T
>
,
options
:
Options
<
T
,
P
>
options
:
Options
<
T
,
P
>
):
Result
<
T
,
P
>
{
):
Result
<
T
,
P
>
{
...
...
src/hooks/use-toggle.ts
View file @
7e292b95
...
@@ -5,7 +5,7 @@ interface UseToggleOptions {
...
@@ -5,7 +5,7 @@ interface UseToggleOptions {
initialValue
?:
ToggleValue
;
initialValue
?:
ToggleValue
;
reverseValue
?:
ToggleValue
;
reverseValue
?:
ToggleValue
;
}
}
export
default
function
useToggle
({
export
function
useToggle
({
initialValue
=
false
,
initialValue
=
false
,
reverseValue
=
!
initialValue
,
reverseValue
=
!
initialValue
,
}:
UseToggleOptions
=
{})
{
}:
UseToggleOptions
=
{})
{
...
...
src/pages/group/components/creator.module.scss
0 → 100644
View file @
7e292b95
@import
'@/styles/mixins.scss'
;
.container
{
@include
flexLayout
(
column
);
.header
{
flex-grow
:
1
;
@include
flexLayout
(
column
,
center
,
center
);
.logo
{
width
:
120px
;
height
:
120px
;
}
.title
{
font-weight
:
bold
;
margin-top
:
16px
;
}
.subtitle
{
margin-top
:
8px
;
}
}
.content
{
flex-grow
:
1
;
@include
flexLayout
(
column
,
center
,
center
);
.promotion
{
font-weight
:
bold
;
margin-bottom
:
16px
;
}
.features
{
@include
flexLayout
(
_
,
_
,
space-between
);
width
:
100%
;
.leader
,
.rewards
,
.members
{
@include
flexLayout
(
column
,
center
);
width
:
33%
;
}
}
}
.more
{
margin-bottom
:
16px
;
text-align
:
center
;
}
.create
{
position
:
absolute
;
width
:
100%
;
left
:
0
;
bottom
:
10%
;
&
_btn
{
width
:
80%
;
background-color
:
#1976D2
;
color
:
#ffffff
;
padding
:
8px
16px
;
border-radius
:
4px
;
}
}
}
src/pages/group/components/creator.tsx
0 → 100644
View file @
7e292b95
import
{
View
,
Button
,
Text
,
Image
}
from
'@tarojs/components'
import
styles
from
'./creator.module.scss'
const
Creator
=
({
onClick
}:
{
onClick
:
()
=>
void
})
=>
{
return
(
<
View
className=
{
styles
.
container
}
>
<
View
className=
{
styles
.
header
}
>
<
Image
className=
{
styles
.
logo
}
src=
"https://cdn.jkwljy.com/pbb/6gkGHSsPmxc_coeGYahBkelo_2w_/96x96"
/>
<
Text
className=
{
styles
.
title
}
>
学习部落
</
Text
>
<
Text
className=
{
styles
.
subtitle
}
>
我的学习,我做主
</
Text
>
</
View
>
<
View
className=
{
styles
.
content
}
>
<
Text
className=
{
styles
.
promotion
}
>
组建你的部落,福利多多
</
Text
>
<
View
className=
{
styles
.
features
}
>
<
View
className=
{
styles
.
leader
}
>
<
Text
>
部落族长 与众不同
</
Text
>
<
Text
>
专属族长勋章与特权
</
Text
>
</
View
>
<
View
className=
{
styles
.
rewards
}
>
<
Text
>
壮大部落 奖励多多
</
Text
>
<
Text
>
每邀请一人加入 +100 水晶
</
Text
>
</
View
>
<
View
className=
{
styles
.
members
}
>
<
Text
>
部落有多少成员
</
Text
>
<
Text
>
每天就得多少颗
</
Text
>
</
View
>
</
View
>
</
View
>
<
Text
className=
{
styles
.
more
}
>
还有更多福利等待解锁...
</
Text
>
<
View
className=
{
styles
.
create
}
>
<
Button
className=
{
styles
.
create_btn
}
onClick=
{
onClick
}
>
立即创建你的部落+20⭐
</
Button
>
</
View
>
</
View
>
)
}
export
default
Creator
src/pages/group/components/members.module.scss
0 → 100644
View file @
7e292b95
@import
'@/styles/mixins.scss'
;
.container
{
@include
flexLayout
(
column
);
.header
{
padding
:
16px
;
.title
{
font-size
:
64px
;
font-weight
:
500
;
}
.sign_in
{
@include
flexLayout
();
gap
:
16px
;
border
:
1px
solid
red
;
padding
:
12px
24px
;
&
_today
,
&
_invite
{
padding
:
8px
12px
;
border
:
1px
solid
red
;
border-radius
:
12px
;
}
}
}
.invite_members
{
position
:
absolute
;
width
:
100%
;
left
:
0
;
bottom
:
150px
;
@include
flexLayout
(
column
,
center
,
center
);
gap
:
16px
;
&
_btn
{
width
:
80%
;
background-color
:
#1976D2
;
color
:
#ffffff
;
padding
:
8px
16px
;
border-radius
:
4px
;
}
}
}
\ No newline at end of file
src/pages/group/components/members.tsx
0 → 100644
View file @
7e292b95
import
{
useMemo
,
useState
,
useEffect
}
from
'react'
import
{
getSystemInfoSync
,
createSelectorQuery
}
from
'@tarojs/taro'
import
{
View
,
Button
,
Text
,
ScrollView
}
from
'@tarojs/components'
import
classNames
from
'classnames'
import
{
useBoolean
}
from
'@/hooks/use-boolean'
import
styles
from
'./members.module.scss'
const
screenHeight
=
getSystemInfoSync
().
windowHeight
const
membersCls
=
'_members_const_'
const
Members
=
({
tabBarHeight
}:
{
tabBarHeight
:
number
})
=>
{
const
[
isRefresh
,
{
setTrue
,
setFalse
}]
=
useBoolean
(
false
)
const
[
height
,
setHeight
]
=
useState
(
0
)
const
onRefresh
=
()
=>
{
setTrue
()
setTimeout
(()
=>
{
setFalse
()
},
1000
)
}
useEffect
(()
=>
{
const
query
=
createSelectorQuery
()
query
.
selectAll
(
`.
${
membersCls
}
`
)
.
boundingClientRect
()
.
exec
((
res
)
=>
{
if
(
res
[
0
])
{
setHeight
(
res
[
0
]?.[
0
].
height
+
res
[
0
]?.[
1
].
height
*
1.2
)
}
})
},
[])
const
scrollHeight
=
useMemo
(()
=>
{
return
`
${
screenHeight
-
tabBarHeight
-
height
-
60
}
px`
},
[
screenHeight
,
tabBarHeight
,
height
])
return
(
<
View
className=
{
styles
.
container
}
>
<
View
className=
{
classNames
(
styles
.
header
,
membersCls
)
}
>
<
Text
className=
{
styles
.
title
}
>
阳光学习帮
</
Text
>
<
View
className=
{
styles
.
sign_in
}
>
<
Text
className=
{
styles
.
sign_in_today
}
>
今日部落津贴 +2
</
Text
>
<
Text
className=
{
styles
.
sign_in_invite
}
>
成功邀请1人 +100
</
Text
>
</
View
>
</
View
>
<
ScrollView
scrollY
scrollWithAnimation
refresherEnabled
refresherTriggered=
{
isRefresh
}
onRefresherRefresh=
{
onRefresh
}
style=
{
{
height
:
scrollHeight
}
}
>
<
View
>
<
View
>
123
</
View
>
<
View
>
123
</
View
>
<
View
>
123
</
View
>
<
View
>
123
</
View
>
<
View
>
123
</
View
>
<
View
>
123
</
View
>
<
View
>
123
</
View
>
<
View
>
123
</
View
>
<
View
>
123
</
View
>
<
View
>
123
</
View
>
<
View
>
123
</
View
>
<
View
>
123
</
View
>
<
View
>
123
</
View
>
<
View
>
123
</
View
>
<
View
>
123
</
View
>
<
View
>
123
</
View
>
<
View
>
123
</
View
>
<
View
>
123
</
View
>
<
View
>
123
</
View
>
<
View
>
123
</
View
>
<
View
>
123
</
View
>
<
View
>
123
</
View
>
<
View
>
123
</
View
>
</
View
>
</
ScrollView
>
<
View
className=
{
classNames
(
styles
.
invite_members
,
membersCls
)
}
>
<
Button
className=
{
styles
.
invite_members_btn
}
>
邀请人加入部落 +5答题卡
</
Button
>
<
Text
>
赠送朋友5张答题卡,一起来进击
</
Text
>
<
Text
>
好友进入小程序通关1关+5
</
Text
>
</
View
>
</
View
>
)
}
export
default
Members
src/pages/group/index.config.ts
0 → 100644
View file @
7e292b95
export
default
definePageConfig
({
navigationBarTitleText
:
'pk-math'
,
navigationStyle
:
'custom'
})
src/pages/group/index.module.scss
0 → 100644
View file @
7e292b95
@import
'@/styles/mixins.scss'
;
.modal
{
padding
:
12
PX
24
PX
;
&
_label
{
color
:
#333
;
margin-bottom
:
8px
;
}
&
_input
{
@include
flexLayout
(
_
,
center
,
center
);
padding
:
8px
;
border-radius
:
4px
;
gap
:
12
PX
;
Input
{
flex-grow
:
1
;
border
:
1
PX
solid
blue
;
border-radius
:
6
PX
;
text-align
:
center
;
outline
:
none
;
padding
:
4
PX
6
PX
;
width
:
160px
;
background-color
:
transparent
;
}
Text
{
color
:
#999
;
}
}
}
src/pages/group/index.tsx
View file @
7e292b95
import
{
View
}
from
'@tarojs/components'
import
{
View
,
Text
,
Input
}
from
'@tarojs/components'
import
{
useDidShow
,
getCurrentInstance
,
getTabBar
}
from
'@tarojs/taro'
import
{
useDidShow
,
getCurrentInstance
,
getTabBar
,
getMenuButtonBoundingClientRect
}
from
'@tarojs/taro'
import
{
useMemo
}
from
'react'
import
{
useMemo
,
useState
}
from
'react'
import
Modal
from
'@/components/Modal'
import
{
useBoolean
}
from
'@/hooks/use-boolean'
import
MainHeader
from
'../main/components/header'
import
Creator
from
'./components/creator'
import
Members
from
'./components/members'
import
styles
from
'./index.module.scss'
const
Group
=
()
=>
{
const
Group
=
()
=>
{
const
page
=
useMemo
(()
=>
getCurrentInstance
().
page
,
[])
const
page
=
useMemo
(()
=>
getCurrentInstance
().
page
,
[])
const
[
nav
]
=
useState
(
getMenuButtonBoundingClientRect
())
const
[
isVisible
,
{
toggle
}]
=
useBoolean
(
false
)
const
[
value
,
setValue
]
=
useState
<
string
>
()
const
isCreator
=
false
const
tabBarHeight
=
useMemo
(()
=>
{
return
nav
.
height
+
nav
.
top
+
5
},
[
nav
])
useDidShow
(()
=>
{
useDidShow
(()
=>
{
const
tabbar
=
getTabBar
(
page
)
as
any
const
tabbar
=
getTabBar
(
page
)
as
any
tabbar
?.
setSelected
(
1
)
tabbar
?.
setSelected
(
1
)
})
})
return
(
return
(
<
View
>
group
</
View
>
<
View
>
<
MainHeader
/>
<
View
style=
{
{
paddingTop
:
`${tabBarHeight}px`
}
}
>
{
isCreator
?
<
Creator
onClick=
{
toggle
}
/>
:
<
Members
tabBarHeight=
{
tabBarHeight
}
/>
}
</
View
>
<
Modal
isVisible=
{
isVisible
}
onClose=
{
toggle
}
>
<
View
className=
{
styles
.
modal
}
>
<
Text
className=
{
styles
.
modal_label
}
>
学习部落名:
</
Text
>
<
View
className=
{
styles
.
modal_input
}
>
<
Input
value=
{
value
}
placeholder=
"请输入"
placeholderStyle=
"color: #999"
onInput=
{
(
e
)
=>
setValue
(
e
.
detail
.
value
)
}
/>
<
Text
>
学习帮
</
Text
>
</
View
>
</
View
>
</
Modal
>
</
View
>
)
)
}
}
...
...
src/pages/prepare/components/overview/index.tsx
View file @
7e292b95
import
{
memo
}
from
'react'
import
{
memo
}
from
'react'
import
{
View
,
Text
}
from
'@tarojs/components'
import
{
View
,
Text
}
from
'@tarojs/components'
import
Taro
from
'@tarojs/taro'
import
Taro
from
'@tarojs/taro'
import
useRequest
from
'@/hooks/use-request'
import
{
useRequest
}
from
'@/hooks/use-request'
import
TopLeftInfo
from
'./top-left-info'
import
TopLeftInfo
from
'./top-left-info'
import
LaunchQuest
from
'./launch-quest'
import
LaunchQuest
from
'./launch-quest'
...
...
src/pages/prepare/components/overview/launch-quest.tsx
View file @
7e292b95
import
React
from
'react'
import
React
from
'react'
import
{
View
,
Text
,
Button
}
from
'@tarojs/components'
import
{
View
,
Text
,
Button
}
from
'@tarojs/components'
// import Taro from '@tarojs/taro'
import
Modal
from
'@/components/Modal'
import
Modal
from
'@/components/Modal'
import
useToggle
from
'@/hooks/use-toggle'
import
{
useToggle
}
from
'@/hooks/use-toggle'
import
styles
from
'./index.module.scss'
import
styles
from
'./index.module.scss'
const
LaunchQuest
:
React
.
FC
=
()
=>
{
const
LaunchQuest
:
React
.
FC
=
()
=>
{
const
[
isVisible
,
toggleModal
]
=
useToggle
()
const
[
isVisible
,
toggleModal
]
=
useToggle
()
const
navigateTo
=
()
=>
{
toggleModal
(
false
)
// Taro.navigateTo('/')
}
return
(
return
(
<>
<>
<
View
className=
{
styles
.
launchQuest
}
>
<
View
className=
{
styles
.
launchQuest
}
>
<
Button
onClick=
{
()
=>
toggleModal
(
true
)
}
>
开始闯关
</
Button
>
<
Button
onClick=
{
navigateTo
}
>
开始闯关
</
Button
>
<
Text
className=
{
styles
.
tip
}
>
<
Text
className=
{
styles
.
tip
}
>
首次免答题卡
首次免答题卡
{
/* {hasFreePass ? '首次免答题卡' : '-1答题卡'} */
}
{
/* {hasFreePass ? '首次免答题卡' : '-1答题卡'} */
}
...
...
src/pages/prepare/components/rank-list/index.tsx
View file @
7e292b95
...
@@ -2,7 +2,7 @@ import { View, Button, Text, ScrollView } from '@tarojs/components'
...
@@ -2,7 +2,7 @@ import { View, Button, Text, ScrollView } from '@tarojs/components'
import
{
memo
}
from
'react'
import
{
memo
}
from
'react'
import
classNames
from
'classnames'
import
classNames
from
'classnames'
import
{
useStoreState
}
from
'@/store/hooks'
import
{
useStoreState
}
from
'@/store/hooks'
import
useToggle
from
'@/hooks/use-toggle'
import
{
useToggle
}
from
'@/hooks/use-toggle'
import
UserInfo
from
'./user-info'
import
UserInfo
from
'./user-info'
import
Timing
from
'./timing'
import
Timing
from
'./timing'
...
...
src/pages/prepare/index.module.scss
View file @
7e292b95
@import
'@/styles/mixins.scss'
;
.breakthrough
{
@include
flexLayout
(
_
,
center
,
space-around
);
}
\ No newline at end of file
src/pages/prepare/index.tsx
View file @
7e292b95
import
{
Button
,
View
}
from
'@tarojs/components'
import
{
useEffect
}
from
'react'
import
{
useEffect
}
from
'react'
import
Tabs
,
{
type
TabItem
}
from
'@/components/Tabs'
import
Tabs
,
{
type
TabItem
}
from
'@/components/Tabs'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
...
@@ -6,6 +7,8 @@ import Overview from './components/overview/index'
...
@@ -6,6 +7,8 @@ import Overview from './components/overview/index'
import
ScrollRankList
from
'./components/rank-list/index'
import
ScrollRankList
from
'./components/rank-list/index'
import
StudyLeagueRank
from
'./components/study-league-rank'
import
StudyLeagueRank
from
'./components/study-league-rank'
import
styles
from
'./index.module.scss'
const
Prepare
:
React
.
FC
=
()
=>
{
const
Prepare
:
React
.
FC
=
()
=>
{
const
{
list
:
users
}
=
useStoreState
((
state
)
=>
state
.
prepareModel
)
const
{
list
:
users
}
=
useStoreState
((
state
)
=>
state
.
prepareModel
)
const
refresh
=
useStoreActions
((
actions
)
=>
actions
.
prepareModel
.
refresh
)
const
refresh
=
useStoreActions
((
actions
)
=>
actions
.
prepareModel
.
refresh
)
...
@@ -20,10 +23,14 @@ const Prepare: React.FC = () => {
...
@@ -20,10 +23,14 @@ const Prepare: React.FC = () => {
]
]
return
(
return
(
<>
<
View
>
<
Overview
/>
<
Overview
/>
<
Tabs
items=
{
tabs
}
/>
<
Tabs
items=
{
tabs
}
/>
</>
<
View
className=
{
styles
.
breakthrough
}
>
<
Button
>
继续闯关
</
Button
>
<
Button
>
再次努力,变得更棒
</
Button
>
</
View
>
</
View
>
)
)
}
}
...
...
src/pages/study-market/components/answer-sheet.tsx
View file @
7e292b95
import
{
View
,
Text
,
Button
}
from
'@tarojs/components'
import
{
View
,
Text
,
Button
}
from
'@tarojs/components'
import
Modal
from
'@/components/Modal'
import
Modal
from
'@/components/Modal'
import
useToggle
from
'@/hooks/use-toggle
'
import
{
useBoolean
}
from
'@/hooks/use-boolean
'
import
CardMain
from
'./card-main'
import
CardMain
from
'./card-main'
const
AnswerSheet
:
React
.
FC
=
()
=>
{
const
AnswerSheet
:
React
.
FC
=
()
=>
{
const
[
isVisible
,
toggleModal
]
=
useToggle
(
)
const
[
isVisible
,
{
toggle
}]
=
useBoolean
(
false
)
const
onClick
=
()
=>
{
const
onClick
=
()
=>
{
toggle
Modal
(
false
)
toggle
(
)
}
}
return
(
return
(
...
@@ -17,9 +17,9 @@ const AnswerSheet: React.FC = () => {
...
@@ -17,9 +17,9 @@ const AnswerSheet: React.FC = () => {
title=
"答题卡"
title=
"答题卡"
subtitle=
"答题卡是不断追求更高档位与排名的必备道具答题卡是不断追求更高档位与排名的必备道具"
subtitle=
"答题卡是不断追求更高档位与排名的必备道具答题卡是不断追求更高档位与排名的必备道具"
extra=
{
<
Text
className=
"card-stock"
>
本月库存10
</
Text
>
}
extra=
{
<
Text
className=
"card-stock"
>
本月库存10
</
Text
>
}
onClick=
{
()
=>
toggleModal
(
true
)
}
onClick=
{
toggle
}
/>
/>
<
Modal
isVisible=
{
isVisible
}
onClose=
{
()
=>
toggleModal
(
false
)
}
>
<
Modal
isVisible=
{
isVisible
}
onClose=
{
toggle
}
>
<
View
>
<
View
>
<
Text
>
兑换几张
</
Text
>
<
Text
>
兑换几张
</
Text
>
<
Button
size=
"mini"
onClick=
{
onClick
}
>
兑换
</
Button
>
<
Button
size=
"mini"
onClick=
{
onClick
}
>
兑换
</
Button
>
...
...
src/pages/study-market/components/mystery-box.tsx
View file @
7e292b95
import
{
View
,
Text
,
Button
}
from
'@tarojs/components'
import
{
View
,
Text
,
Button
,
Input
}
from
'@tarojs/components'
import
Modal
from
'@/components/Modal'
import
Modal
from
'@/components/Modal'
import
useToggle
from
'@/hooks/use-toggle
'
import
{
useBoolean
}
from
'@/hooks/use-boolean
'
import
CardMain
from
'./card-main'
import
CardMain
from
'./card-main'
const
MysteryBox
=
()
=>
{
const
MysteryBox
=
()
=>
{
const
[
isVisible
,
toggleModal
]
=
useToggle
(
)
const
[
isVisible
,
{
toggle
}]
=
useBoolean
(
false
)
const
onClick
=
()
=>
{
const
onClick
=
()
=>
{
toggle
Modal
(
false
)
toggle
(
)
}
}
return
(
return
(
...
@@ -17,10 +17,11 @@ const MysteryBox = () => {
...
@@ -17,10 +17,11 @@ const MysteryBox = () => {
title=
"神秘大礼"
title=
"神秘大礼"
subtitle=
"兑换神秘大礼,线下领取超级大礼"
subtitle=
"兑换神秘大礼,线下领取超级大礼"
extra=
{
<
Text
className=
"card-stock"
>
本月库存10
</
Text
>
}
extra=
{
<
Text
className=
"card-stock"
>
本月库存10
</
Text
>
}
onClick=
{
()
=>
toggleModal
(
true
)
}
onClick=
{
toggle
}
/>
/>
<
Modal
isVisible=
{
isVisible
}
onClose=
{
()
=>
toggleModal
(
false
)
}
>
<
Modal
isVisible=
{
isVisible
}
onClose=
{
toggle
}
>
<
View
>
<
View
>
<
Input
type=
"number"
/>
<
Text
>
兑换礼物
</
Text
>
<
Text
>
兑换礼物
</
Text
>
<
Button
size=
"mini"
onClick=
{
onClick
}
>
兑换
</
Button
>
<
Button
size=
"mini"
onClick=
{
onClick
}
>
兑换
</
Button
>
</
View
>
</
View
>
...
...
src/pages/summary/index.config.ts
0 → 100644
View file @
7e292b95
src/pages/summary/index.scss
0 → 100644
View file @
7e292b95
.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 @
7e292b95
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