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
1e26204f
Commit
1e26204f
authored
Apr 04, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of dev.jiuaoedu.com:hewenhao/GeekLearnMathWeapp
parents
0f5a2097
f1c49d87
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
612 additions
and
289 deletions
+612
-289
app.config.ts.tpl
scripts/app.config.ts.tpl
+2
-2
account.ts
src/api/account.ts
+8
-4
game.ts
src/api/game.ts
+3
-0
group.ts
src/api/group.ts
+10
-4
index.tsx
src/components/Button/index.tsx
+6
-3
header.module.scss
src/pages/group/components/header.module.scss
+4
-1
header.tsx
src/pages/group/components/header.tsx
+26
-26
members.module.scss
src/pages/group/components/members.module.scss
+2
-2
share-view.tsx
src/pages/group/components/share-view.tsx
+7
-5
answer-sheet.tsx
src/pages/market/components/answer-sheet.tsx
+2
-2
card-main.tsx
src/pages/market/components/card-main.tsx
+0
-0
card.module.scss
src/pages/market/components/card.module.scss
+0
-0
card.tsx
src/pages/market/components/card.tsx
+0
-0
mystery-box.tsx
src/pages/market/components/mystery-box.tsx
+0
-0
index.config.ts
src/pages/market/index.config.ts
+0
-0
index.scss
src/pages/market/index.scss
+0
-0
index.tsx
src/pages/market/index.tsx
+2
-2
types.ts
src/pages/market/types.ts
+0
-0
btn-disabled.png
src/pages/prepare/assets/btn-disabled.png
+0
-0
answer-card-modal.module.scss
src/pages/prepare/components/answer-card-modal.module.scss
+0
-8
answer-card-modal.tsx
src/pages/prepare/components/answer-card-modal.tsx
+1
-1
main-header.module.scss
src/pages/prepare/components/main-header.module.scss
+79
-15
main-header.tsx
src/pages/prepare/components/main-header.tsx
+137
-30
tabs.module.scss
src/pages/prepare/components/tabs.module.scss
+5
-6
top-bar.module.scss
src/pages/prepare/components/top-bar.module.scss
+11
-14
top-bar.tsx
src/pages/prepare/components/top-bar.tsx
+4
-13
constant.ts
src/pages/prepare/constant.ts
+14
-0
index.module.scss
src/pages/prepare/index.module.scss
+130
-51
index.tsx
src/pages/prepare/index.tsx
+81
-95
render.tsx
src/pages/prepare/render.tsx
+78
-0
utils.ts
src/pages/prepare/utils.ts
+0
-5
No files found.
scripts/app.config.ts.tpl
View file @
1e26204f
...
...
@@ -7,9 +7,9 @@
export default {
pages: [
'pages/main/main',
'pages/prepare/index',
'pages/group/index',
'pages/study-market/index',
'pages/prepare/index',
'pages/market/index',
'pages/game/play/index',
'pages/game/complete/index',
],
...
...
src/api/account.ts
View file @
1e26204f
import
{
requestAfterSilentLogin
}
from
'@/utils/request'
import
{
getStorage
,
StorageKeys
}
from
'@/utils/storage'
import
{
AccountOut
}
from
'./auth'
export
const
getPointToCard
=
()
=>
{
return
requestAfterSilentLogin
<
AccountOut
[],
{
userId
?:
number
}
>
({
// 积分兑换答题卡
export
const
pointToCard
=
({
num
}:
{
num
:
number
})
=>
{
return
requestAfterSilentLogin
<
AccountOut
[],
{
userId
?:
number
,
num
:
number
}
>
((
userInfo
)
=>
({
url
:
'/service-idea/account/pointToCard'
,
method
:
'GET'
,
data
:
{
userId
:
getStorage
(
StorageKeys
.
userInfo
)?.
userId
}
data
:
{
num
,
userId
:
userInfo
?.
userId
}
})
)
}
src/api/game.ts
View file @
1e26204f
...
...
@@ -68,6 +68,9 @@ export interface StageDetail extends Stage {
content
:
string
;
bestResultTime
:
number
;
ranks
?:
StageRank
[];
nextStep
:
string
;
nextStepReward
:
number
;
nextStepTime
:
number
}
/** 获取关卡详情 */
...
...
src/api/group.ts
View file @
1e26204f
...
...
@@ -23,11 +23,12 @@ export const createTribe = ({ groupNo }: Pick<CreateTribeParams, 'groupNo'>) =>
}
// 领取每日部落积分
export
const
getTribePoint
=
(
)
=>
{
return
requestAfterSilentLogin
<
{},
{
userId
?:
number
}
>
((
userInfo
)
=>
({
export
const
postTribePoint
=
({
type
}:
Pick
<
PointType
,
'type'
>
)
=>
{
return
requestAfterSilentLogin
<
{},
{
userId
?:
number
}
&
Pick
<
PointType
,
'type'
>
>
((
userInfo
)
=>
({
url
:
'/service-idea/group/getTribePoint'
,
method
:
'
GE
T'
,
method
:
'
POS
T'
,
data
:
{
type
,
userId
:
userInfo
?.
userId
,
}
}))
...
...
@@ -44,9 +45,14 @@ export const joinTribe = () => {
}))
}
export
type
PointType
=
{
point
:
number
;
type
:
'MEMBERNUM'
|
'MEMBERJOIN'
}
// 部落每日可领取积分查询
export
const
queryTribePoint
=
()
=>
{
return
requestAfterSilentLogin
<
number
,
{
userId
?:
number
}
>
((
userInfo
)
=>
({
return
requestAfterSilentLogin
<
PointType
[]
,
{
userId
?:
number
}
>
((
userInfo
)
=>
({
url
:
'/service-idea/group/queryTribePoint'
,
method
:
'GET'
,
data
:
{
...
...
src/components/Button/index.tsx
View file @
1e26204f
...
...
@@ -16,15 +16,17 @@ interface ButtonProps {
loading
?:
boolean
;
size
?:
ButtonSize
;
type
?:
ButtonType
;
className
?:
string
;
onClick
?:
()
=>
void
;
}
const
Button
=
({
size
=
'middle'
,
type
=
'primary'
,
block
,
disabled
,
loading
,
size
=
'middle'
,
type
=
'primary'
,
className
,
onClick
,
children
,
}:
PropsWithChildren
<
ButtonProps
>
)
=>
{
...
...
@@ -36,7 +38,8 @@ const Button = ({
[
styles
.
block
]:
block
,
[
styles
.
disabled
]:
disabled
,
[
styles
.
loading
]:
loading
,
}
},
className
)
const
handleClick
=
()
=>
{
...
...
src/pages/group/components/header.module.scss
View file @
1e26204f
...
...
@@ -77,10 +77,13 @@
@include
flexLayout
(
column
,
center
);
gap
:
6px
;
}
&
_disabled
{
opacity
:
0
.8
;
}
&
_today
{
margin-left
:
48px
;
opacity
:
0
.8
;
}
&
_invite
{
...
...
src/pages/group/components/header.tsx
View file @
1e26204f
...
...
@@ -3,7 +3,7 @@ import { showToast } from '@tarojs/taro'
import
classNames
from
'classnames'
import
{
useRequest
}
from
'@/hooks'
import
{
queryTribePoint
,
getTribePoint
}
from
'@/api/group'
import
{
queryTribePoint
,
postTribePoint
,
type
PointType
}
from
'@/api/group'
import
TextPrinter
from
'./text-printer'
import
styles
from
'./header.module.scss'
...
...
@@ -25,7 +25,7 @@ const CroupHeader = ({ isCreator }: { isCreator: boolean }) => {
immediate
:
!
isCreator
})
const
{
run
}
=
useRequest
(
ge
tTribePoint
,
{
const
{
run
}
=
useRequest
(
pos
tTribePoint
,
{
immediate
:
false
,
throttleDelay
:
1000
,
onSuccess
:
()
=>
{
...
...
@@ -34,36 +34,36 @@ const CroupHeader = ({ isCreator }: { isCreator: boolean }) => {
}
})
const
renderItem
=
(
item
:
PointType
)
=>
(
<
View
className=
{
classNames
({
[
styles
.
members_today
]:
item
.
type
===
'MEMBERNUM'
,
[
styles
.
members_invite
]:
item
.
type
===
'MEMBERJOIN'
,
[
styles
.
members_disabled
]:
!
item
.
point
,
})
}
onClick=
{
()
=>
item
.
point
&&
run
({
type
:
item
.
type
})
}
>
<
View
className=
{
styles
.
members_score
}
>
<
Image
src=
{
require
(
'@/pages/main/assets/score.png'
)
}
className=
{
classNames
(
styles
.
members_icon
,
item
.
point
?
styles
.
upDownAnimation
:
''
)
}
/>
<
Text
className=
{
classNames
(
styles
.
members_number
,
item
.
point
?
styles
.
upDownAnimation
:
''
)
}
>
+
{
item
.
point
||
0
}
</
Text
>
</
View
>
<
Text
className=
{
styles
.
members_stroke
}
>
{
item
.
type
===
'MEMBERNUM'
?
'今日部落津贴'
:
'成功邀请1人'
}
</
Text
>
</
View
>
)
const
renderMembers
=
()
=>
(
<
View
className=
{
styles
.
members
}
>
<
View
className=
{
styles
.
members_title
}
>
<
Text
className=
{
styles
.
members_text
}
>
阳光学习帮
</
Text
>
</
View
>
<
View
className=
{
styles
.
members_content
}
>
<
View
className=
{
styles
.
members_today
}
onClick=
{
()
=>
data
&&
run
()
}
>
<
View
className=
{
styles
.
members_score
}
>
<
Image
src=
{
require
(
'@/pages/main/assets/score.png'
)
}
className=
{
classNames
(
styles
.
members_icon
,
data
?
styles
.
upDownAnimation
:
''
)
}
/>
<
Text
className=
{
classNames
(
styles
.
members_number
,
data
?
styles
.
upDownAnimation
:
''
)
}
>
+
{
data
||
0
}
</
Text
>
</
View
>
<
Text
className=
{
styles
.
members_stroke
}
>
今日部落津贴
</
Text
>
</
View
>
<
View
className=
{
styles
.
members_invite
}
>
<
View
className=
{
styles
.
members_score
}
>
<
Image
className=
{
classNames
(
styles
.
members_icon
,
styles
.
upDownAnimation
)
}
src=
{
require
(
'@/pages/main/assets/score.png'
)
}
/>
<
Text
className=
{
classNames
(
styles
.
members_number
,
styles
.
upDownAnimation
)
}
>
+100
</
Text
>
</
View
>
<
Text
className=
{
styles
.
members_stroke
}
>
成功邀请1人
</
Text
>
</
View
>
{
/* {data?.map(renderItem)} */
}
{
[{
type
:
'MEMBERNUM'
,
point
:
1
},
{
type
:
'MEMBERJOIN'
,
point
:
0
}].
map
(
renderItem
)
}
</
View
>
</
View
>
)
...
...
src/pages/group/components/members.module.scss
View file @
1e26204f
...
...
@@ -114,8 +114,8 @@
}
&
_icon
{
width
:
64px
;
height
:
64px
;
width
:
32
PX
;
height
:
32
PX
;
}
&
_text
{
...
...
src/pages/group/components/share-view.tsx
View file @
1e26204f
...
...
@@ -3,12 +3,14 @@ import classNames from 'classnames'
import
styles
from
'./share-view.module.scss'
export
default
({
children
,
className
}:
{
children
:
React
.
ReactNode
,
className
?:
string
})
=>
{
export
default
({
children
,
className
}:
{
children
:
React
.
ReactNode
,
className
?:
string
})
=>
{
return
(
<
Button
openType=
"share"
plain
style=
{
{
border
:
'none'
}
}
className=
{
classNames
(
styles
.
wrapper
,
className
)
}
>
<
Button
plain
openType=
"share"
style=
{
{
border
:
'none'
}
}
className=
{
classNames
(
styles
.
wrapper
,
className
)
}
>
{
children
}
</
Button
>
)
...
...
src/pages/
study-
market/components/answer-sheet.tsx
→
src/pages/market/components/answer-sheet.tsx
View file @
1e26204f
import
{
View
,
Text
,
Button
}
from
'@tarojs/components'
import
Modal
from
'@/components/Modal'
import
{
useBoolean
}
from
'@/hooks/use-boolean'
import
{
MarketModalProps
}
from
'../types'
//
import { MarketModalProps } from '../types'
import
CardMain
from
'./card-main'
const
AnswerSheet
=
({
onConfirm
,
loading
}
:
MarketModalProps
)
=>
{
const
AnswerSheet
=
({
onConfirm
,
loading
})
=>
{
const
[
isVisible
,
{
setTrue
,
setFalse
}]
=
useBoolean
(
false
)
return
(
...
...
src/pages/
study-
market/components/card-main.tsx
→
src/pages/market/components/card-main.tsx
View file @
1e26204f
File moved
src/pages/
study-
market/components/card.module.scss
→
src/pages/market/components/card.module.scss
View file @
1e26204f
File moved
src/pages/
study-
market/components/card.tsx
→
src/pages/market/components/card.tsx
View file @
1e26204f
File moved
src/pages/
study-
market/components/mystery-box.tsx
→
src/pages/market/components/mystery-box.tsx
View file @
1e26204f
File moved
src/pages/
study-
market/index.config.ts
→
src/pages/market/index.config.ts
View file @
1e26204f
File moved
src/pages/
study-
market/index.scss
→
src/pages/market/index.scss
View file @
1e26204f
File moved
src/pages/
study-
market/index.tsx
→
src/pages/market/index.tsx
View file @
1e26204f
...
...
@@ -3,7 +3,7 @@ import { View, Text, Button } from '@tarojs/components'
import
{
getMenuButtonBoundingClientRect
,
showToast
,
showModal
}
from
'@tarojs/taro'
import
{
useBoolean
,
useToggle
,
useRequest
}
from
'@/hooks'
import
{
getP
ointToCard
}
from
'@/api/account'
import
{
p
ointToCard
}
from
'@/api/account'
import
Modal
from
'@/components/Modal'
import
MainHeader
from
'../main/components/header'
...
...
@@ -33,7 +33,7 @@ const StudyMarket = () => {
const
[
isVisible
,
{
setTrue
,
setFalse
}]
=
useBoolean
(
false
)
const
[
state
,
{
setDefault
,
setReverse
}]
=
useToggle
({
defaultValue
:
Demo
.
AnswerSheet
,
reverseValue
:
Demo
.
Mystery
})
const
{
loading
}
=
useRequest
(
getP
ointToCard
,
{
const
{
loading
}
=
useRequest
(
p
ointToCard
,
{
immediate
:
false
,
onSuccess
()
{
showToast
({
title
:
'成功'
})
...
...
src/pages/
study-
market/types.ts
→
src/pages/market/types.ts
View file @
1e26204f
File moved
src/pages/prepare/assets/btn-disabled.png
0 → 100644
View file @
1e26204f
1.72 KB
src/pages/prepare/components/answer-card-modal.module.scss
View file @
1e26204f
...
...
@@ -60,14 +60,6 @@
@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
;
...
...
src/pages/prepare/components/answer-card-modal.tsx
View file @
1e26204f
...
...
@@ -22,7 +22,7 @@ const AnswerSheetModal = (props: PropsWithChildren<ModalProps>) => {
<
View
className=
{
styles
.
title
}
>
你的答题卡已经用完啦
</
View
>
<
View
className=
{
styles
.
tips
}
>
可通过以下途径获得哦
</
View
>
<
View
className=
{
styles
.
footer
}
>
<
View
className=
{
styles
.
buy
}
>
{
children
}
</
View
>
{
children
}
<
View
className=
{
styles
.
studyTribe
}
onClick=
{
()
=>
switchTab
({
url
:
'/pages/group/index'
})
}
>
<
Text
>
建设学习部落,得更多答题卡
</
Text
>
</
View
>
...
...
src/pages/prepare/components/main-header.module.scss
View file @
1e26204f
...
...
@@ -9,7 +9,7 @@
.title
{
font-weight
:
bold
;
margin
:
20px
0
;
margin
:
40px
0
20px
;
font-size
:
26
PX
;
font-weight
:
600
;
color
:
#FFFFFF
;
...
...
@@ -40,30 +40,35 @@
.requirement
{
@include
flexLayout
(
column
);
&
>
.text
{
&
>
.header
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
margin-bottom
:
12
PX
;
text-align
:
center
;
font-size
:
16
PX
;
font-weight
:
500
;
color
:
#FFFFFF
;
position
:
relative
;
margin-bottom
:
12
PX
;
&
:
:
before
,
&::
after
{
content
:
""
;
position
:
absolute
;
width
:
36%
;
.line
{
flex-grow
:
1
;
height
:
1px
;
top
:
20px
;
transform
:
scaleY
(
0
.5
);
background-color
:
#fff
;
transform
:
scaleY
(
0
.5
);
&
:first-child
{
margin-right
:
10
PX
;
}
&
:last-child
{
margin-left
:
10
PX
;
}
}
&
:
:
before
{
left
:
0
;
}
&
:
:
after
{
right
:
0
;
.text
{
text-align
:
center
;
font-weight
:
500
;
color
:
#FFFFFF
;
}
}
...
...
@@ -118,4 +123,62 @@
}
}
}
.replay
{
background
:
rgba
(
226
,
233
,
255
,
0
.2
);
border-radius
:
30px
;
border
:
1px
solid
#FFFFFF
;
@include
flexLayout
(
row
,
center
);
font-size
:
15
PX
;
font-weight
:
500
;
color
:
#FFFFFF
;
padding
:
32px
0
;
position
:
relative
;
margin-bottom
:
48px
;
&
:
:
before
{
content
:
''
;
position
:
absolute
;
width
:
1px
;
transform
:
scaleY
(
0
.5
);
background-color
:
rgba
(
255
,
255
,
255
,
0
.4
);
right
:
50%
;
top
:
0
;
bottom
:
0
;
}
.performance
{
width
:
50%
;
.details
{
@include
flexLayout
(
row
,
center
,
center
);
gap
:
6
PX
;
margin-top
:
12
PX
;
.logo
{
width
:
24
PX
;
height
:
24
PX
;
}
.consume
{
font-size
:
20
PX
;
}
}
}
.achievement
{
width
:
50%
;
.details
{
margin-top
:
12
PX
;
@include
flexLayout
(
row
,
center
,
center
);
gap
:
20px
;
.logo
{
width
:
32
PX
;
height
:
32
PX
;
}
}
}
}
}
\ No newline at end of file
src/pages/prepare/components/main-header.tsx
View file @
1e26204f
import
{
View
,
Text
,
Image
}
from
'@tarojs/components'
import
assets
from
'@/assets/oss/assets-prepare
'
import
{
useMemo
}
from
'react
'
import
{
useStoreState
}
from
'@/store/hooks'
import
{
StageType
,
StageLevel
,
StageDetail
}
from
'@/api'
import
assets
from
'@/assets/oss/assets-prepare'
import
styles
from
'./main-header.module.scss'
const
scoreList
=
[
{
u
:
assets
[
'level-big-s.png'
].
u
},
{
u
:
assets
[
'level-big-a.png'
].
u
},
{
u
:
assets
[
'level-big-b.png'
].
u
},
]
const
renderItem
=
({
u
})
=>
(
<
View
key=
{
u
}
className=
{
styles
.
detail
}
>
<
View
className=
{
styles
.
content
}
>
<
Image
className=
{
styles
.
badge
}
src=
{
u
}
mode=
"widthFix"
/>
<
View
className=
{
styles
.
center
}
>
<
Image
className=
{
styles
.
icon
}
src=
{
assets
[
'hook.png'
].
u
}
mode=
"widthFix"
/>
<
Text
>
全对,
</
Text
>
const
MainHeader
=
()
=>
{
const
stageDetail
=
useStoreState
(
state
=>
state
.
gameModel
.
stageDetail
)
||
{}
as
StageDetail
const
isKing
=
useMemo
(()
=>
{
// 是王者了
return
stageDetail
.
level
===
'S'
&&
stageDetail
.
upGear
&&
stageDetail
.
gear
===
10
},
[
stageDetail
.
level
,
stageDetail
.
upGear
,
stageDetail
.
gear
])
const
type
=
useMemo
(()
=>
{
switch
(
stageDetail
.
type
)
{
case
StageType
.
OneStop
:
return
{
t
:
StageType
.
OneStop
,
u
:
assets
[
'fight.png'
].
u
,
}
case
StageType
.
Enhance
:
return
{
t
:
StageType
.
Enhance
,
u
:
assets
[
'book.png'
].
u
,
}
default
:
return
{
t
:
StageType
.
Strong
,
u
:
assets
[
'strong.png'
].
u
,
}
}
},
[
stageDetail
?.
type
])
const
topAchieve
=
useMemo
(()
=>
{
switch
(
stageDetail
.
gear
)
{
case
10
:
return
assets
[
'top-10.png'
].
u
case
20
:
return
assets
[
'top-20.png'
].
u
case
30
:
return
assets
[
'top-30.png'
].
u
default
:
return
assets
[
'top-un.png'
].
u
}
},
[
stageDetail
.
gear
])
const
levelAchieve
=
useMemo
(()
=>
{
switch
(
stageDetail
.
level
)
{
case
StageLevel
.
S
:
return
assets
[
'level-s.png'
].
u
case
StageLevel
.
A
:
return
assets
[
'level-a.png'
].
u
case
StageLevel
.
B
:
return
assets
[
'level-b.png'
].
u
default
:
return
assets
[
'level-b-un.png'
].
u
}
},
[
stageDetail
.
level
])
// const levelRequirement = useMemo(() => {
// switch (stageDetail.level) {
// case StageLevel.S:
// return {
// v: 10,
// u: assets['level-big-s.png'].u
// }
// case StageLevel.A:
// return {
// v: 5,
// u: assets['level-big-a.png'].u
// }
// case StageLevel.B:
// return {
// v: 1,
// u: assets['level-big-b.png'].u
// }
// }
// }, [stageDetail.level, stageDetail])
const
RequireItem
=
({
u
,
v
,
t
=
0
}:
{
u
:
string
,
v
:
number
,
t
:
number
})
=>
(
<
View
key=
{
u
}
className=
{
styles
.
detail
}
>
<
View
className=
{
styles
.
content
}
>
<
Image
className=
{
styles
.
badge
}
src=
{
u
}
mode=
"widthFix"
/>
<
View
className=
{
styles
.
center
}
>
<
Image
className=
{
styles
.
icon
}
src=
{
assets
[
'hook.png'
].
u
}
mode=
"widthFix"
/>
<
Text
>
全对,
</
Text
>
</
View
>
<
View
className=
{
styles
.
center
}
>
<
Image
className=
{
styles
.
icon
}
src=
{
stageDetail
.
firstTime
?
assets
[
'clock.png'
].
u
:
assets
[
'clock-up.png'
].
u
}
mode=
"widthFix"
/>
<
Text
>
{
stageDetail
.
firstTime
?
`用时 ≤${t}s`
:
`用时需提高${t}s`
}
</
Text
>
</
View
>
</
View
>
<
View
className=
{
styles
.
center
}
>
<
Image
className=
{
styles
.
icon
}
src=
{
assets
[
'
clock
.png'
].
u
}
mode=
"widthFix"
/>
<
Text
>
用时 ≤49s
</
Text
>
<
View
className=
{
styles
.
score
}
>
<
Image
className=
{
styles
.
icon
}
src=
{
assets
[
'
diamond
.png'
].
u
}
mode=
"widthFix"
/>
<
Text
className=
{
styles
.
text
}
>
+
{
v
}
</
Text
>
</
View
>
</
View
>
<
View
className=
{
styles
.
score
}
>
<
Image
className=
{
styles
.
icon
}
src=
{
assets
[
'diamond.png'
].
u
}
mode=
"widthFix"
/>
<
Text
className=
{
styles
.
text
}
>
+100
</
Text
>
)
const
renderFirst
=
()
=>
(
<
View
className=
{
styles
.
details
}
>
<
RequireItem
u=
{
assets
[
'level-big-s.png'
].
u
}
v=
{
10
}
t=
{
stageDetail
.
sTime
}
/>
<
RequireItem
u=
{
assets
[
'level-big-a.png'
].
u
}
v=
{
5
}
t=
{
stageDetail
.
aTime
}
/>
<
RequireItem
u=
{
assets
[
'level-big-b.png'
].
u
}
v=
{
1
}
t=
{
stageDetail
.
bTime
}
/>
</
View
>
</
View
>
)
)
const
renderAgain
=
()
=>
(
<
View
className=
{
styles
.
details
}
>
{
/* <RequireItem u={levelRequirement.u} v={levelRequirement.v} t={stageDetail.nextStepTime} /> */
}
{
/* <RequireItem u={stageDetail.upGear ? assets['upgear.png'].u : assets['upgear-un.png'].u} v={5} t={stageDetail.nextStepTime} /> */
}
{
/* <RequireItem u={stageDetail.upGear ? assets['upgear.png'].u : assets['upgear-un.png'].u} v={5} t={stageDetail.nextStepTime} /> */
}
</
View
>
)
const
MainHeader
=
()
=>
{
return
(
<
View
className=
{
styles
.
wrapper
}
>
<
View
className=
{
styles
.
title
}
>
表内除法
</
View
>
<
View
className=
{
styles
.
title
}
>
{
stageDetail
.
name
||
'-'
}
</
View
>
<
View
className=
{
styles
.
labels
}
>
<
View
className=
{
styles
.
label
}
>
<
Image
className=
{
styles
.
icon
}
src=
{
assets
[
'strong.png'
]
.
u
}
mode=
"widthFix"
/>
<
Text
>
强化
</
Text
>
<
Image
className=
{
styles
.
icon
}
src=
{
type
.
u
}
mode=
"widthFix"
/>
<
Text
>
{
type
.
t
}
</
Text
>
</
View
>
<
Text
className=
{
styles
.
label
}
>
计算达标1
</
Text
>
<
Text
className=
{
styles
.
label
}
>
{
stageDetail
.
content
||
'-'
}
</
Text
>
<
Text
className=
{
styles
.
label
}
>
共 10 题
</
Text
>
</
View
>
<
View
className=
{
styles
.
replay
}
>
<
View
className=
{
styles
.
performance
}
>
<
Text
>
最佳表现
</
Text
>
<
View
className=
{
styles
.
details
}
>
<
Image
src=
{
assets
[
'clock.png'
].
u
}
className=
{
styles
.
logo
}
/>
<
Text
className=
{
styles
.
consume
}
>
{
stageDetail
.
bestResultTime
||
0
}
s
</
Text
>
</
View
>
</
View
>
<
View
className=
{
styles
.
achievement
}
>
<
Text
>
勋章成就
</
Text
>
<
View
className=
{
styles
.
details
}
>
<
Image
src=
{
levelAchieve
}
className=
{
styles
.
logo
}
/>
<
Image
src=
{
topAchieve
}
className=
{
styles
.
logo
}
/>
<
Image
src=
{
stageDetail
.
upGear
?
assets
[
'upgear.png'
].
u
:
assets
[
'upgear-un.png'
].
u
}
className=
{
styles
.
logo
}
/>
</
View
>
</
View
>
</
View
>
<
View
className=
{
styles
.
requirement
}
>
<
Text
className=
{
styles
.
text
}
>
通关要求
</
Text
>
<
View
className=
{
styles
.
details
}
>
{
scoreList
.
map
(
renderItem
)
}
<
View
className=
{
styles
.
header
}
>
<
View
className=
{
styles
.
line
}
></
View
>
<
Text
className=
{
styles
.
text
}
>
{
stageDetail
.
firstTime
?
'通关要求'
:
'继续努力,赢更多成就'
}
</
Text
>
<
View
className=
{
styles
.
line
}
></
View
>
</
View
>
{
stageDetail
.
firstTime
?
renderFirst
()
:
isKing
?
null
:
renderAgain
()
}
</
View
>
</
View
>
)
...
...
src/pages/prepare/components/tabs.module.scss
View file @
1e26204f
...
...
@@ -9,9 +9,8 @@
.tabBar
{
display
:
flex
;
border-bottom
:
1px
solid
#ccc
;
height
:
176px
;
background-size
:
cover
;
height
:
88
PX
;
background-size
:
100%
100%
;
&
.active_1
{
background-image
:
url('../assets/tab-1.png')
;
...
...
@@ -24,7 +23,7 @@
.tab
{
flex
:
1
;
height
:
96px
;
height
:
48
PX
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
...
...
@@ -41,10 +40,10 @@
position
:
absolute
;
content
:
""
;
width
:
16
PX
;
bottom
:
0
;
bottom
:
6
PX
;
height
:
3
PX
;
background
:
#1786F7
;
border-radius
:
8
PX
;
border-radius
:
6
PX
;
}
}
}
...
...
src/pages/prepare/components/top-bar.module.scss
View file @
1e26204f
.
heade
r
{
.
topBa
r
{
position
:
fixed
;
color
:
#fff
;
left
:
0
;
top
:
0
;
right
:
0
;
z-index
:
999
;
}
.head_bg
{
position
:
absolute
;
left
:
0
;
right
:
0
;
width
:
100%
;
}
.content
{
position
:
relative
;
z-index
:
2
;
background-image
:
url(../assets/head-bg.png)
;
&
_bg
{
position
:
absolute
;
z-index
:
1
;
left
:
0
;
right
:
0
;
width
:
100%
;
}
.inner
{
display
:
flex
;
align-items
:
center
;
...
...
src/pages/prepare/components/top-bar.tsx
View file @
1e26204f
...
...
@@ -8,27 +8,18 @@ export default () => {
const
nav
=
getMenuButtonBoundingClientRect
()
const
sys
=
getSystemInfoSync
()
const
inne
rStyle
=
useMemo
(()
=>
{
const
topBa
rStyle
=
useMemo
(()
=>
{
return
{
height
:
`
${
nav
.
height
+
10
}
px`
,
padding
Right
:
`
${
nav
.
width
+
(
sys
.
windowWidth
-
nav
.
right
)
*
2
}
px`
padding
Top
:
`
${
nav
.
top
-
5
}
px`
}
},
[
sys
,
nav
])
return
(
<
View
className=
{
styles
.
header
}
>
<
Image
src=
{
require
(
'../assets/head-bg.png'
)
}
mode=
"widthFix"
className=
{
styles
.
head_bg
}
/>
<
View
className=
{
styles
.
content
}
style=
{
{
height
:
`${nav.height + 10}px`
,
paddingTop
:
`${nav.top - 5}px`
}
}
>
<
View
className=
{
styles
.
inner
}
style=
{
innerStyle
}
>
<
View
className=
{
styles
.
topBar
}
style=
{
topBarStyle
}
>
<
View
className=
{
styles
.
inner
}
>
<
Image
className=
{
styles
.
back_icon
}
src=
{
require
(
'../assets/back.png'
)
}
mode=
"widthFix"
onClick=
{
()
=>
navigateBack
()
}
/>
</
View
>
</
View
>
</
View
>
)
}
src/pages/prepare/constant.ts
0 → 100644
View file @
1e26204f
import
assets
from
'@/assets/oss/assets-prepare'
export
const
requirement
=
{
newcomer
:
{
title
:
'通关要求'
,
clock
:
assets
[
'clock.png'
].
u
,
text
:
'用时 ≤49s'
},
strive
:
{
title
:
'继续努力,赢更多成就'
,
clock
:
assets
[
'clock-up.png'
].
u
,
text
:
'用时需提高0.3s'
,
},
}
src/pages/prepare/index.module.scss
View file @
1e26204f
...
...
@@ -2,6 +2,14 @@
.wrapper
{
padding-bottom
:
80
PX
;
.inner
{
position
:
relative
;
z-index
:
10
;
background-image
:
url(./assets/head-bg.png)
;
background-size
:
100%
;
background-attachment
:
fixed
;
}
.tribe
{
&
_title
{
...
...
@@ -12,20 +20,48 @@
font-weight
:
600
;
color
:
#465164
;
}
&
_empty
{
@include
flexLayout
(
column
,
center
,
center
);
font-size
:
14
PX
;
font-weight
:
500
;
color
:
rgba
(
70
,
81
,
100
,
0
.5
);
margin
:
48px
0
;
&
_logo
{
width
:
220px
;
height
:
220px
;
margin-bottom
:
4
PX
;
}
&
_btn
{
border-radius
:
20px
;
width
:
272px
;
padding
:
10
PX
0
;
letter-spacing
:
1
PX
;
border
:
2
PX
solid
#465164
;
text-align
:
center
;
color
:
#FF7A18
;
margin-top
:
24
PX
;
}
}
}
.empty
{
color
:
#9999
;
font-size
:
1
2
PX
;
font-size
:
1
4
PX
;
margin-top
:
12
PX
;
text-align
:
center
;
}
.item
{
display
:
flex
;
padding
:
28px
32px
26
px
;
padding
:
30px
32
px
;
align-items
:
center
;
&
.active
{
background-color
:
#E4F1FF
;
}
&
_rank
{
margin-right
:
40px
;
@include
flexLayout
(
row
,
center
);
...
...
@@ -61,6 +97,8 @@
&
_crown
{
width
:
36px
;
height
:
36px
;
position
:
relative
;
top
:
-1
PX
;
}
}
&
_result
{
...
...
@@ -77,71 +115,111 @@
}
}
.
challenge
{
.
footer_bar
{
position
:
fixed
;
bottom
:
60px
;
left
:
16
PX
;
right
:
16
PX
;
height
:
100px
;
bottom
:
0
;
left
:
0
;
right
:
0
;
z-index
:
999
;
&
_text
{
font-size
:
40px
;
letter-spacing
:
1
PX
;
font-weight
:
600
;
background-color
:
#fff
;
padding
:
16
PX
0
24
PX
;
.tribe_share
{
border-radius
:
10
PX
;
margin
:
0
40
PX
;
margin-bottom
:
56px
;
height
:
44
PX
;
border
:
2
PX
solid
#465164
;
gap
:
8
PX
;
@include
flexLayout
(
row
,
center
,
center
);
}
.card
{
@include
flexLayout
(
row
,
center
);
position
:
absolute
;
right
:
100px
;
gap
:
4
PX
;
&
_icon
{
width
:
32
PX
;
height
:
32
PX
}
.challenge
{
margin
:
0
16
PX
;
position
:
relative
;
&
_text
{
font-size
:
18
PX
;
font-weight
:
500
;
color
:
#FFFFFF
;
font-size
:
40px
;
letter-spacing
:
1
PX
;
font-weight
:
600
;
}
}
.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
;
.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
:
-28
PX
;
right
:
-4
PX
;
height
:
42
PX
;
padding
:
0
13
PX
;
background-image
:
url('https://cdn.jkwljy.com/pk-math/4WgogFzhSYUSrvpmEE7JwoVg7SH5/122x42')
;
background-size
:
100%
100%
;
@include
flexLayout
(
row
,
center
);
&
_text
{
font-size
:
16
PX
;
font-weight
:
500
;
color
:
#FFFFFF
;
}
}
}
}
}
.modal
{
.buy_card
{
height
:
56
PX
;
@include
flexLayout
(
row
,
center
,
center
);
font-size
:
18
PX
;
background-size
:
100%
100%
;
background-image
:
url('./assets/btn-primary.png')
;
font-weight
:
500
;
color
:
#FFFFFF
;
&
>
{
.logo
{
width
:
32
PX
;
height
:
32
PX
;
margin-right
:
4
PX
;
}
.buy
{
margin
:
0
12
PX
;
}
&
_loading
{
opacity
:
0
.8
;
}
&
_spin
{
margin-right
:
8
PX
;
}
.inner
{
@include
flexLayout
(
row
,
center
,
center
);
font-size
:
18
PX
;
font-weight
:
500
;
.balance
{
font-weight
:
400
;
font-size
:
14
PX
;
&
>
{
.logo
{
width
:
32
PX
;
height
:
32
PX
;
margin-right
:
4
PX
;
}
.buy
{
margin
:
0
12
PX
;
}
.balance
{
font-weight
:
400
;
font-size
:
14
PX
;
}
}
}
}
.buy_card_disabled
{
background-image
:
url('./assets/btn-disabled.png')
;
color
:
#C2C8D1
;
}
\ No newline at end of file
src/pages/prepare/index.tsx
View file @
1e26204f
import
{
View
,
Text
,
Image
}
from
'@tarojs/components'
import
{
useEffect
}
from
'react'
import
{
useRouter
,
getMenuButtonBoundingClientRect
,
navigateTo
}
from
'@tarojs/taro'
import
{
useEffect
,
useMemo
,
useState
}
from
'react'
import
{
useRouter
,
getMenuButtonBoundingClientRect
,
useShareAppMessage
,
navigateTo
}
from
'@tarojs/taro'
import
classNames
from
'classnames'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
import
{
useBoolean
}
from
'@/hooks'
import
{
type
StageRank
}
from
'@/api/game'
import
assets
from
'@/assets/oss/assets-prepare'
import
Button
from
'@/components/Button'
import
Loading
from
'@/components/Loading'
import
ShareView
from
'@/pages/group/components/share-view'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
import
{
useBoolean
,
useRequest
}
from
'@/hooks'
import
{
pointToCard
}
from
'@/api/account'
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
{
renderList
,
renderTribePage
}
from
'./render'
import
styles
from
'./index.module.scss'
const
renderItem
=
(
item
:
StageRank
,
index
:
number
)
=>
{
return
(
<
View
key=
{
item
.
userId
}
className=
{
styles
.
item
}
>
<
View
className=
{
styles
.
item_rank
}
>
{
[
0
,
1
,
2
].
includes
(
index
)
?
<
Image
className=
{
styles
.
item_rank_icon
}
src=
{
require
(
`@/pages/group/assets/icons/rank-${index + 1}.png`
)
}
/>
:
<
Text
className=
{
styles
.
item_rank_index
}
>
{
index
}
</
Text
>
}
</
View
>
<
View
className=
{
styles
.
item_username
}
>
<
Text
className=
{
styles
.
item_username_text
}
>
{
item
.
nickName
||
'-'
}
</
Text
>
<
Image
className=
{
styles
.
item_username_crown
}
src=
{
require
(
'@/pages/group/assets/icons/crown-small.png'
)
}
/>
const
tabs
:
TabItem
[]
=
[
{
label
:
'成都排行榜'
,
children
:
renderList
()
},
{
label
:
'学习部落排行榜'
,
children
:
(
<
View
className=
{
styles
.
tribe
}
>
{
renderTribePage
()
}
</
View
>
<
View
className=
{
styles
.
item_result
}
>
<
Text
className=
{
styles
.
item_result_first
}
>
{
65.23
}
s
</
Text
>
<
Text
>
|
</
Text
>
<
Text
className=
{
styles
.
item_result_best
}
>
{
34.23
}
s
</
Text
>
</
View
>
</
View
>
)
}
)
}
]
const
Prepare
=
()
=>
{
const
nav
=
getMenuButtonBoundingClientRect
()
const
router
=
useRouter
<
{
id
:
string
}
>
()
const
[
currentTab
,
setCurrentTab
]
=
useState
(
0
)
const
[
isVisible
,
{
setTrue
,
setFalse
}]
=
useBoolean
(
false
)
const
stageDetail
=
useStoreState
(
state
=>
state
.
gameModel
.
stageDetail
)
const
getStageDetail
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
getStageDetail
)
const
getQuestionList
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
getQuestionList
)
const
cardNum
=
useStoreState
(
state
=>
state
.
userModel
.
cardNum
)
const
router
=
useRouter
<
{
id
:
string
}
>
()
const
{
run
:
exchange
,
loading
}
=
useRequest
(
pointToCard
,
{
immediate
:
false
})
const
innerStyle
=
useMemo
(()
=>
{
const
h
=
nav
.
height
+
nav
.
top
+
5
return
{
paddingTop
:
`
${
h
}
px`
,
}
},
[
nav
.
height
,
nav
.
top
])
useEffect
(()
=>
{
getStageDetail
(
+
router
.
params
.
id
||
1
)
},
[
router
,
getStageDetail
])
const
handleClick
=
()
=>
{
if
(
cardNum
<
1
)
{
setTrue
()
}
else
{
getQuestionList
(
+
router
.
params
.
id
||
1
).
then
(()
=>
{
navigateTo
({
url
:
`/pages/game/play/index?id=
${
router
.
params
.
id
}
`
})
})
}
}
const
renderList
=
(
list
=
[])
=>
{
const
isEmpty
=
list
.
length
<
1
return
(
<>
<
Thead
/>
{
list
.
map
(
renderItem
)
}
{
isEmpty
&&
<
View
className=
{
styles
.
empty
}
>
暂无数据
</
View
>
}
</>
)
}
const
tabs
:
TabItem
[]
=
[
{
label
:
'成都排行榜'
,
children
:
(
<>
{
renderList
()
}
</>
)
},
{
label
:
'学习部落排行榜'
,
children
:
(
<
View
className=
{
styles
.
tribe
}
>
<
Text
className=
{
styles
.
tribe_title
}
>
极客学霸俱乐部
</
Text
>
{
renderList
()
}
</
View
>
)
useShareAppMessage
(()
=>
{
return
{
title
:
'来看看这个有趣的页面!'
,
path
:
'pages/main/main?code=1111'
,
imageUrl
:
'https://picx.zhimg.com/v2-7b7b072d4bebd5ccf48c04ec1146e844_1440w.jpg?'
,
}
]
})
return
(
<>
<
View
className=
{
styles
.
wrapper
}
>
<
TopBar
/>
<
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=
{
handleClick
}
>
<
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
.
wrapper
}
>
<
TopBar
/>
<
View
className=
{
styles
.
inner
}
style=
{
innerStyle
}
>
<
MainHeader
/>
<
Tabs
initialIndex=
{
currentTab
}
items=
{
tabs
}
onChange=
{
setCurrentTab
}
/>
</
View
>
<
View
className=
{
styles
.
footer_bar
}
>
{
currentTab
===
1
&&
<
ShareView
>
<
View
className=
{
styles
.
tribe_share
}
>
<
Image
style=
{
{
width
:
32
,
height
:
32
}
}
src=
{
require
(
'@/pages/group/assets/icons/invite-small.png'
)
}
/>
<
Text
style=
{
{
color
:
'#FF7A18'
,
fontSize
:
16
}
}
>
邀请更多好友加入学习部落
</
Text
>
</
View
>
</
ShareView
>
}
<
Button
type=
"custom"
size=
"large"
onClick=
{
setTrue
}
className=
{
styles
.
challenge
}
>
<
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
>
{
true
&&
<
View
className=
{
styles
.
tip
}
>
<
Text
className=
{
styles
.
tip_text
}
>
首次免答题卡
</
Text
>
</
View
>
}
</
Button
>
</
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
className=
{
classNames
(
styles
.
buy_card
,
{
// [styles.buy_card_disabled]: true,
[
styles
.
buy_card_loading
]:
loading
,
})
}
// onClick={() => !loading && exchange({ num: 1 })}
onClick=
{
()
=>
navigateTo
({
url
:
'/pages/game/play/index'
})
}
>
<
Loading
size=
"small"
className=
{
styles
.
buy_card_spin
}
spinning=
{
loading
}
/>
<
View
className=
{
styles
.
inner
}
>
{
/* <Image className={styles.logo} src={false ? assets['diamond.png'].u : assets['diamond-un.png'].u} mode="widthFix" /> */
}
<
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
>
</
View
>
</
AnswerCardModal
>
</>
</
View
>
)
}
...
...
src/pages/prepare/render.tsx
0 → 100644
View file @
1e26204f
import
{
View
,
Text
,
Image
}
from
'@tarojs/components'
import
{
switchTab
}
from
'@tarojs/taro'
import
classNames
from
'classnames'
import
{
type
StageRank
}
from
'@/api/game'
import
assets
from
'@/assets/oss/assets-prepare'
import
Thead
from
'./components/thead'
import
styles
from
'./index.module.scss'
export
const
formatTime
=
(
time
:
number
)
=>
{
const
minutes
=
Math
.
floor
(
time
/
60
)
const
seconds
=
time
%
60
return
`
${
minutes
}
分
${
seconds
}
秒`
}
export
const
renderList
=
(
list
:
StageRank
[]
=
[])
=>
{
const
isEmpty
=
list
.
length
<
1
const
user
=
list
.
find
(
item
=>
item
.
me
)
return
(
<>
<
Thead
/>
{
user
&&
user
.
no
>
3
&&
renderItem
(
user
)
}
{
list
.
map
(
renderItem
)
}
{
isEmpty
&&
<
View
className=
{
styles
.
empty
}
>
暂无数据
</
View
>
}
</>
)
}
export
const
renderItem
=
(
item
:
StageRank
)
=>
{
return
(
<
View
key=
{
item
.
userId
}
className=
{
classNames
(
styles
.
item
,
{
[
styles
.
active
]:
item
.
me
})
}
>
<
View
className=
{
styles
.
item_rank
}
>
{
[
1
,
2
,
3
].
includes
(
item
.
no
)
?
<
Image
className=
{
styles
.
item_rank_icon
}
src=
{
require
(
`@/pages/group/assets/icons/rank-${item.no}.png`
)
}
/>
:
<
Text
className=
{
styles
.
item_rank_index
}
>
{
item
.
no
}
</
Text
>
}
</
View
>
<
View
className=
{
styles
.
item_username
}
>
<
Text
className=
{
styles
.
item_username_text
}
>
{
item
.
nickName
||
'-'
}
{
item
.
me
&&
<
Text
>
(你)
</
Text
>
}
</
Text
>
<
Image
className=
{
styles
.
item_username_crown
}
src=
{
require
(
'@/pages/group/assets/icons/crown-small.png'
)
}
/>
</
View
>
<
View
className=
{
styles
.
item_result
}
>
<
Text
className=
{
styles
.
item_result_first
}
>
{
65.23
}
s
</
Text
>
<
Text
>
|
</
Text
>
<
Text
className=
{
styles
.
item_result_best
}
>
{
34.23
}
s
</
Text
>
</
View
>
</
View
>
)
}
const
renderEmptyTribe
=
()
=>
(
<
View
className=
{
styles
.
tribe_empty
}
>
<
Image
className=
{
styles
.
tribe_empty_logo
}
src=
{
assets
[
'tribe.png'
].
u
}
mode=
"widthFix"
/>
<
Text
>
创建你的部落,和好友互相激励
</
Text
>
<
Text
>
还能获得非常多的奖励哦
</
Text
>
<
Text
className=
{
styles
.
tribe_empty_btn
}
onClick=
{
()
=>
switchTab
({
url
:
'/pages/group/index'
})
}
>
立即创建
</
Text
>
</
View
>
)
const
renderTribeList
=
()
=>
(
<
View
style=
{
{
paddingBottom
:
100
}
}
>
<
Text
className=
{
styles
.
tribe_title
}
>
极客学霸俱乐部
</
Text
>
{
renderList
()
}
</
View
>
)
export
const
renderTribePage
=
()
=>
{
return
(
<
View
className=
{
styles
.
tribe
}
>
{
[{}].
length
>
0
?
renderTribeList
()
:
renderEmptyTribe
()
}
</
View
>
)
}
src/pages/prepare/utils.ts
deleted
100644 → 0
View file @
0f5a2097
export
const
formatTime
=
(
time
:
number
)
=>
{
const
minutes
=
Math
.
floor
(
time
/
60
)
const
seconds
=
time
%
60
return
`
${
minutes
}
分
${
seconds
}
秒`
}
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