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
f04517f1
Commit
f04517f1
authored
Mar 30, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of dev.jiuaoedu.com:hewenhao/GeekLearnMathWeapp
parents
b5ddd076
b5b7e712
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
289 additions
and
32 deletions
+289
-32
index.tsx
src/components/Modal/index.tsx
+7
-8
index.scss
src/components/Skeleton/index.scss
+0
-1
index.tsx
src/components/Skeleton/index.tsx
+1
-1
index.tsx
src/pages/prepare/components/rank-list/index.tsx
+2
-7
index.config.ts
src/pages/prepare/index.config.ts
+4
-0
index.tsx
src/pages/prepare/index.tsx
+0
-2
answer-sheet.tsx
src/pages/study-market/components/answer-sheet.tsx
+32
-0
card-main.tsx
src/pages/study-market/components/card-main.tsx
+39
-0
card.module.scss
src/pages/study-market/components/card.module.scss
+27
-0
card.tsx
src/pages/study-market/components/card.tsx
+49
-0
mystery-box.tsx
src/pages/study-market/components/mystery-box.tsx
+32
-0
index.scss
src/pages/study-market/index.scss
+77
-0
index.tsx
src/pages/study-market/index.tsx
+16
-12
mixins.scss
src/styles/mixins.scss
+3
-1
No files found.
src/components/Modal/index.tsx
View file @
f04517f1
...
...
@@ -4,11 +4,11 @@ import classNames from 'classnames'
import
styles
from
'./index.module.scss'
interface
ModalProps
{
isVisible
:
boolea
n
;
isVisible
:
unknow
n
;
wrapClassName
?:
string
;
children
:
React
.
ReactNode
;
maskClosable
?:
boolean
;
onClose
:
()
=>
void
;
onClose
?
:
()
=>
void
;
}
const
Modal
:
React
.
FC
<
ModalProps
>
=
({
...
...
@@ -18,13 +18,12 @@ const Modal: React.FC<ModalProps> = ({
wrapClassName
,
maskClosable
=
true
})
=>
{
const
wrapClass
=
classNames
(
styles
.
wrapper
,
wrapClassName
,
isVisible
?
styles
.
visible
:
''
)
const
wrapClass
=
classNames
(
styles
.
wrapper
,
wrapClassName
,
{
[
styles
.
visible
]:
isVisible
})
return
(
<
View
className=
{
wrapClass
}
onClick=
{
()
=>
maskClosable
&&
onClose
()
}
>
<
View
className=
{
wrapClass
}
onClick=
{
()
=>
maskClosable
&&
onClose
?.
()
}
>
<
View
className=
{
classNames
(
styles
.
inner
)
}
onClick=
{
(
e
)
=>
e
.
stopPropagation
()
}
>
{
children
}
</
View
>
...
...
src/components/Skeleton/index.scss
View file @
f04517f1
.skeleton
{
display
:
flex
;
flex-direction
:
row
;
margin
:
8px
16px
;
gap
:
16px
;
&
-avatar
{
...
...
src/components/Skeleton/index.tsx
View file @
f04517f1
...
...
@@ -8,7 +8,7 @@ import SkeletonParagraph, { type SkeletonParagraphProps } from './components/par
import
'./index.scss'
interface
SkeletonProps
{
loading
:
boolean
;
loading
?
:
boolean
;
animate
?:
boolean
;
avatar
?:
SkeletonAvatarProps
|
boolean
;
title
?:
SkeletonTitleProps
|
boolean
;
...
...
src/pages/prepare/components/rank-list/index.tsx
View file @
f04517f1
import
{
View
,
Button
,
Text
,
ScrollView
}
from
'@tarojs/components'
import
{
memo
,
useMemo
}
from
'react'
import
{
memo
}
from
'react'
import
classNames
from
'classnames'
import
{
useStoreState
}
from
'@/store/hooks'
import
useToggle
from
'@/hooks/useToggle'
...
...
@@ -28,12 +28,7 @@ const ScrollRankList: React.FC<{ users: User[] }> = ({ users }) => {
const
hasNextPage
=
true
const
loading
=
false
const
computedUsers
=
useMemo
(()
=>
{
if
(
showAll
)
{
return
users
}
return
topThreeUsers
},
[
showAll
,
users
,
topThreeUsers
])
const
computedUsers
=
showAll
?
users
:
topThreeUsers
const
scrollStyle
=
{
height
:
'400px'
,
...
...
src/pages/prepare/index.config.ts
0 → 100644
View file @
f04517f1
// export default definePageConfig({
// navigationBarTitleText: 'pk-math',
// navigationStyle: 'custom'
// })
src/pages/prepare/index.tsx
View file @
f04517f1
import
{
useEffect
}
from
'react'
import
Tabs
,
{
type
TabItem
}
from
'@/components/Tabs'
import
Skeleton
from
'@/components/Skeleton'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
import
Overview
from
'./components/overview/index'
...
...
src/pages/study-market/components/answer-sheet.tsx
0 → 100644
View file @
f04517f1
import
{
View
,
Text
,
Button
}
from
'@tarojs/components'
import
Modal
from
'@/components/Modal'
import
useToggle
from
'@/hooks/useToggle'
import
CardMain
from
'./card-main'
const
AnswerSheet
:
React
.
FC
=
()
=>
{
const
[
isVisible
,
toggleModal
]
=
useToggle
()
const
onClick
=
()
=>
{
toggleModal
(
false
)
}
return
(
<
View
className=
"card-body"
>
<
CardMain
title=
"答题卡"
subtitle=
"答题卡是不断追求更高档位与排名的必备道具答题卡是不断追求更高档位与排名的必备道具"
extra=
{
<
Text
className=
"card-stock"
>
本月库存10
</
Text
>
}
onClick=
{
()
=>
toggleModal
(
true
)
}
/>
<
Modal
isVisible=
{
isVisible
}
onClose=
{
()
=>
toggleModal
(
false
)
}
>
<
View
>
<
Text
>
兑换几张
</
Text
>
<
Button
size=
"mini"
onClick=
{
onClick
}
>
兑换
</
Button
>
</
View
>
</
Modal
>
</
View
>
)
}
export
default
AnswerSheet
src/pages/study-market/components/card-main.tsx
0 → 100644
View file @
f04517f1
import
{
View
,
Image
,
Text
,
Button
}
from
'@tarojs/components'
interface
CardMainProps
{
onClick
:
()
=>
void
;
cover
?:
string
;
title
:
string
;
subtitle
:
string
;
extra
?:
React
.
ReactNode
}
export
default
({
title
,
cover
=
''
,
extra
,
subtitle
,
onClick
,
}:
CardMainProps
)
=>
{
return
(
<>
<
View
className=
"card-main"
>
<
Image
className=
"card-image"
src=
{
cover
}
defaultSource=
"https://cdn.jkwljy.com/pbb/6gkGHSsPmxc_coeGYahBkelo_2w_/96x96"
/>
{
extra
}
</
View
>
<
View
className=
"card-action"
>
<
View
className=
"card-description"
>
<
Text
className=
"card-title"
>
{
title
}
</
Text
>
<
Text
className=
"card-subtitle"
>
{
subtitle
}
</
Text
>
</
View
>
<
View
className=
"card-footer"
>
<
View
className=
"card-score"
>
<
Image
src=
{
require
(
'../../main/assets/score.png'
)
}
className=
"card-score-icon"
/>
<
Text
className=
"card-score-text"
>
积分271
</
Text
>
</
View
>
<
Button
className=
"card-exchange"
onClick=
{
onClick
}
>
兑换
</
Button
>
</
View
>
</
View
>
</>
)
}
src/pages/study-market/components/card.module.scss
0 → 100644
View file @
f04517f1
.card
{
position
:
relative
;
background-color
:
#fff
;
margin-bottom
:
12
PX
;
padding
:
12
PX
;
}
.bordered
{
border
:
1px
solid
#f0f0f0
;
}
.hoverable
{
&
:hover
{
box-shadow
:
0
2px
8px
rgba
(
0
,
0
,
0
,
0
.15
);
}
}
.head
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
margin-bottom
:
8
PX
;
}
.title
{
font-weight
:
500
;
}
src/pages/study-market/components/card.tsx
0 → 100644
View file @
f04517f1
import
{
View
}
from
'@tarojs/components'
import
classNames
from
'classnames'
import
Skeleton
from
'@/components/Skeleton'
import
styles
from
'./card.module.scss'
interface
CardProps
{
bordered
?:
boolean
;
headStyle
?:
React
.
CSSProperties
;
loading
?:
boolean
;
title
?:
React
.
ReactNode
;
hoverable
?:
boolean
;
extra
?:
React
.
ReactNode
;
bodyStyle
?:
React
.
CSSProperties
;
children
?:
React
.
ReactNode
;
}
const
Card
:
React
.
FC
<
CardProps
>
=
({
title
,
extra
,
loading
,
bordered
,
hoverable
,
headStyle
,
bodyStyle
,
children
,
})
=>
{
const
cardClass
=
classNames
(
styles
.
card
,
{
[
styles
.
bordered
]:
bordered
,
})
return
(
<
View
className=
{
cardClass
}
hoverClass=
{
hoverable
&&
styles
.
hoverable
}
>
{
(
title
||
extra
)
&&
(
<
View
className=
{
styles
.
head
}
style=
{
headStyle
}
>
{
title
&&
<
View
className=
{
styles
.
title
}
>
{
title
}
</
View
>
}
{
extra
&&
<
View
className=
{
styles
.
extra
}
>
{
extra
}
</
View
>
}
</
View
>
)
}
<
View
className=
{
styles
.
body
}
style=
{
bodyStyle
}
>
<
Skeleton
loading=
{
loading
}
avatar
>
{
children
}
</
Skeleton
>
</
View
>
</
View
>
)
}
export
default
Card
src/pages/study-market/components/mystery-box.tsx
0 → 100644
View file @
f04517f1
import
{
View
,
Text
,
Button
}
from
'@tarojs/components'
import
Modal
from
'@/components/Modal'
import
useToggle
from
'@/hooks/useToggle'
import
CardMain
from
'./card-main'
const
MysteryBox
=
()
=>
{
const
[
isVisible
,
toggleModal
]
=
useToggle
()
const
onClick
=
()
=>
{
toggleModal
(
false
)
}
return
(
<
View
className=
"card-body"
>
<
CardMain
title=
"神秘大礼"
subtitle=
"兑换神秘大礼,线下领取超级大礼"
extra=
{
<
Text
className=
"card-stock"
>
本月库存10
</
Text
>
}
onClick=
{
()
=>
toggleModal
(
true
)
}
/>
<
Modal
isVisible=
{
isVisible
}
onClose=
{
()
=>
toggleModal
(
false
)
}
>
<
View
>
<
Text
>
兑换礼物
</
Text
>
<
Button
size=
"mini"
onClick=
{
onClick
}
>
兑换
</
Button
>
</
View
>
</
Modal
>
</
View
>
)
}
export
default
MysteryBox
src/pages/study-market/index.scss
0 → 100644
View file @
f04517f1
@import
'../../styles/mixins.scss'
;
.wrapper
{
padding
:
16px
;
}
.card-body
{
display
:
flex
;
padding
:
12
PX
;
position
:
relative
;
border
:
1px
solid
red
;
.card-main
{
@include
flexLayout
(
column
,
_
,
space-between
);
min-width
:
160px
;
margin-right
:
12
PX
;
.card-image
{
width
:
100%
;
height
:
180px
;
background-color
:
#000
;
}
.card-stock
{
color
:
#666
;
font-size
:
14
PX
;
text-align
:
center
;
}
}
.card-action
{
@include
flexLayout
(
column
,
center
,
space-between
);
flex-grow
:
1
;
.card-description
{
flex-grow
:
1
;
@include
flexLayout
(
column
,
_
,
space-between
);
.card-title
{
color
:
#333
;
font-weight
:
500
;
margin-bottom
:
8px
;
}
.card-subtitle
{
color
:
#666
;
@include
multi-ellipsis
(
2
);
}
}
.card-footer
{
width
:
100%
;
margin-top
:
48px
;
@include
flexLayout
(
_
,
_
,
space-between
);
.card-score
{
@include
flexLayout
(
_
,
center
);
&
-icon
{
width
:
32
PX
;
height
:
32
PX
;
margin-right
:
4px
;
}
&
-text
{
color
:
#666
;
margin-right
:
8px
;
}
}
.card-exchange
{
@include
btn
();
}
}
}
}
\ No newline at end of file
src/pages/study-market/index.tsx
View file @
f04517f1
import
{
useState
,
useEffect
}
from
'react'
import
Taro
,
{
getMenuButtonBoundingClientRect
}
from
'@tarojs/taro'
import
{
useState
}
from
'react'
import
{
getMenuButtonBoundingClientRect
}
from
'@tarojs/taro'
import
{
View
}
from
'@tarojs/components'
import
Skeleton
from
'@/components/Skeleton'
import
MainHeader
from
'../main/components/header'
import
Card
from
'./components/card'
import
AnswerSheet
from
'./components/answer-sheet'
import
MysteryBox
from
'./components/mystery-box'
import
'./index.scss'
const
StudyMarket
:
React
.
FC
=
()
=>
{
const
[
nav
]
=
useState
(
getMenuButtonBoundingClientRect
())
Taro
.
showLoading
({
title
:
'加载中'
,
mask
:
true
})
const
paddingTop
=
`
${
nav
.
height
+
nav
.
top
+
5
}
px`
return
(
<
View
>
<
View
className=
"wrapper"
>
<
MainHeader
/>
<
View
style=
{
{
paddingTop
:
`${nav.height + nav.top + 5}px`
}
}
>
<
Skeleton
loading
/>
<
View
style=
{
{
paddingTop
}
}
>
<
Card
hoverable
loading
title=
"答题卡"
>
<
AnswerSheet
/>
</
Card
>
<
Card
hoverable
title=
"月度神秘大礼"
>
<
MysteryBox
/>
</
Card
>
</
View
>
</
View
>
)
...
...
src/styles/mixins.scss
View file @
f04517f1
...
...
@@ -57,8 +57,9 @@
text-overflow
:
ellipsis
;
}
@mixin
flexLayout
(
$direction
:
row
,
$align
:
stretch
)
{
@mixin
flexLayout
(
$direction
:
row
nowrap
,
$align
:
stretch
,
$justify
:
flex-start
)
{
display
:
flex
;
flex-flow
:
$direction
;
align-items
:
$align
;
justify-content
:
$justify
;
}
\ No newline at end of file
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