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
ec748e03
Commit
ec748e03
authored
Apr 06, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of dev.jiuaoedu.com:hewenhao/GeekLearnMathWeapp
parents
61c653ff
a6f9870c
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
111 additions
and
91 deletions
+111
-91
game.ts
src/api/game.ts
+1
-0
group.ts
src/api/group.ts
+2
-2
header.tsx
src/pages/group/components/header.tsx
+9
-7
members.tsx
src/pages/group/components/members.tsx
+1
-1
index.tsx
src/pages/group/index.tsx
+3
-6
index.ts
src/pages/group/model/index.ts
+22
-8
main.tsx
src/pages/main/main.tsx
+9
-44
use-show-share-modal.ts
src/pages/main/use-show-share-modal.ts
+48
-0
main-header.module.scss
src/pages/prepare/components/main-header.module.scss
+5
-5
tabs.module.scss
src/pages/prepare/components/tabs.module.scss
+0
-1
thead.module.scss
src/pages/prepare/components/thead.module.scss
+2
-2
index.module.scss
src/pages/prepare/index.module.scss
+7
-7
render.tsx
src/pages/prepare/render.tsx
+2
-8
No files found.
src/api/game.ts
View file @
ec748e03
...
@@ -58,6 +58,7 @@ export type StageRank = {
...
@@ -58,6 +58,7 @@ export type StageRank = {
no
:
number
;
no
:
number
;
secondName
:
string
;
secondName
:
string
;
userId
:
number
;
userId
:
number
;
identity
?:
'LEADER'
|
'NORMAL'
;
}
}
export
type
NextStep
=
{
export
type
NextStep
=
{
...
...
src/api/group.ts
View file @
ec748e03
...
@@ -83,12 +83,12 @@ export interface TribeInfo {
...
@@ -83,12 +83,12 @@ export interface TribeInfo {
}
}
// 部落详情
// 部落详情
export
const
getTribeInfo
=
()
=>
{
export
const
getTribeInfo
=
(
{
memberId
}:
{
memberId
?:
number
}
)
=>
{
return
requestAfterSilentLogin
<
TribeInfo
,
{
memberId
?:
number
}
>
((
userInfo
)
=>
({
return
requestAfterSilentLogin
<
TribeInfo
,
{
memberId
?:
number
}
>
((
userInfo
)
=>
({
url
:
'/service-idea/group/tribeInfo'
,
url
:
'/service-idea/group/tribeInfo'
,
method
:
'POST'
,
method
:
'POST'
,
data
:
{
data
:
{
memberId
:
userInfo
?.
userId
,
memberId
:
memberId
||
userInfo
?.
userId
,
}
}
}))
}))
}
}
src/pages/group/components/header.tsx
View file @
ec748e03
...
@@ -2,8 +2,9 @@ import { View, Text, Image } from '@tarojs/components'
...
@@ -2,8 +2,9 @@ import { View, Text, Image } from '@tarojs/components'
import
{
showToast
}
from
'@tarojs/taro'
import
{
showToast
}
from
'@tarojs/taro'
import
classNames
from
'classnames'
import
classNames
from
'classnames'
import
{
useStoreActions
,
useStoreState
}
from
'@/store/hooks'
import
{
useRequest
}
from
'@/hooks'
import
{
useRequest
}
from
'@/hooks'
import
{
queryTribePoint
,
postTribePoint
,
type
PointType
}
from
'@/api/group'
import
{
postTribePoint
,
type
PointType
}
from
'@/api/group'
import
assets
from
'@/assets/oss/assets-group'
import
assets
from
'@/assets/oss/assets-group'
import
TextPrinter
from
'./text-printer'
import
TextPrinter
from
'./text-printer'
...
@@ -22,16 +23,15 @@ const renderCreator = () => (
...
@@ -22,16 +23,15 @@ const renderCreator = () => (
)
)
const
CroupHeader
=
({
groupNo
}:
{
groupNo
:
string
})
=>
{
const
CroupHeader
=
({
groupNo
}:
{
groupNo
:
string
})
=>
{
const
{
data
,
run
:
refresh
}
=
useRequest
(
queryTribePoint
,
{
const
queryTribePoint
=
useStoreActions
(
actions
=>
actions
.
groupModel
.
queryTribePoint
)
immediate
:
!!
groupNo
const
points
=
useStoreState
(
state
=>
state
.
groupModel
.
points
)
})
const
{
run
}
=
useRequest
(
postTribePoint
,
{
const
{
run
}
=
useRequest
(
postTribePoint
,
{
immediate
:
false
,
immediate
:
false
,
throttleDelay
:
1000
,
throttleDelay
:
1000
,
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
showToast
({
title
:
'领取成功'
})
showToast
({
title
:
'领取成功'
})
refresh
()
queryTribePoint
()
}
}
})
})
...
@@ -53,7 +53,9 @@ const CroupHeader = ({ groupNo }: { groupNo: string }) => {
...
@@ -53,7 +53,9 @@ const CroupHeader = ({ groupNo }: { groupNo: string }) => {
+
{
item
.
point
||
0
}
+
{
item
.
point
||
0
}
</
Text
>
</
Text
>
</
View
>
</
View
>
<
Text
className=
{
styles
.
members_stroke
}
>
{
item
.
type
===
'MEMBERNUM'
?
'今日部落津贴'
:
'成功邀请1人'
}
</
Text
>
<
Text
className=
{
styles
.
members_stroke
}
>
{
item
.
type
===
'MEMBERNUM'
?
'今日部落津贴'
:
'成功邀请1人'
}
</
Text
>
</
View
>
</
View
>
)
)
...
@@ -63,7 +65,7 @@ const CroupHeader = ({ groupNo }: { groupNo: string }) => {
...
@@ -63,7 +65,7 @@ const CroupHeader = ({ groupNo }: { groupNo: string }) => {
<
Text
className=
{
styles
.
members_text
}
>
{
groupNo
}
部落
</
Text
>
<
Text
className=
{
styles
.
members_text
}
>
{
groupNo
}
部落
</
Text
>
</
View
>
</
View
>
<
View
className=
{
styles
.
members_content
}
>
<
View
className=
{
styles
.
members_content
}
>
{
data
?.
map
(
renderItem
)
}
{
points
?.
map
(
renderItem
)
}
</
View
>
</
View
>
</
View
>
</
View
>
)
)
...
...
src/pages/group/components/members.tsx
View file @
ec748e03
...
@@ -27,7 +27,7 @@ const Members = () => {
...
@@ -27,7 +27,7 @@ const Members = () => {
{
item
.
memberName
||
'-'
}
{
item
.
memberName
||
'-'
}
{
isCurrent
&&
<
Text
>
(你)
</
Text
>
}
{
isCurrent
&&
<
Text
>
(你)
</
Text
>
}
</
Text
>
</
Text
>
{
i
sCurrent
&&
<
Image
className=
{
styles
.
crown
}
src=
{
assets
[
'crown-small.png'
].
u
}
/>
}
{
i
tem
.
identity
===
'LEADER'
&&
<
Image
className=
{
styles
.
crown
}
src=
{
assets
[
'crown-small.png'
].
u
}
/>
}
</
View
>
</
View
>
<
Text
className=
{
styles
.
schoolName
}
>
{
item
.
schoolName
}
</
Text
>
<
Text
className=
{
styles
.
schoolName
}
>
{
item
.
schoolName
}
</
Text
>
</
View
>
</
View
>
...
...
src/pages/group/index.tsx
View file @
ec748e03
...
@@ -5,7 +5,7 @@ import { useMemo, useState } from 'react'
...
@@ -5,7 +5,7 @@ import { useMemo, useState } from 'react'
import
Modal
from
'@/components/Modal'
import
Modal
from
'@/components/Modal'
import
Button
from
'@/components/Button'
import
Button
from
'@/components/Button'
import
{
useBoolean
,
useRequest
}
from
'@/hooks'
import
{
useBoolean
,
useRequest
}
from
'@/hooks'
import
{
createTribe
,
queryTribePoint
}
from
'@/api/group'
import
{
createTribe
}
from
'@/api/group'
import
{
useStoreActions
,
useStoreState
}
from
'@/store/hooks'
import
{
useStoreActions
,
useStoreState
}
from
'@/store/hooks'
import
type
{
TabbarRef
}
from
'@/custom-tab-bar/index'
import
type
{
TabbarRef
}
from
'@/custom-tab-bar/index'
...
@@ -30,6 +30,7 @@ const Group = () => {
...
@@ -30,6 +30,7 @@ const Group = () => {
const
userInfo
=
useStoreState
(
state
=>
state
.
userModel
.
userInfo
)
const
userInfo
=
useStoreState
(
state
=>
state
.
userModel
.
userInfo
)
const
tribeInfo
=
useStoreState
(
state
=>
state
.
groupModel
.
tribeInfo
)
const
tribeInfo
=
useStoreState
(
state
=>
state
.
groupModel
.
tribeInfo
)
const
fetchTribeInfo
=
useStoreActions
(
actions
=>
actions
.
groupModel
.
fetchTribeInfo
)
const
fetchTribeInfo
=
useStoreActions
(
actions
=>
actions
.
groupModel
.
fetchTribeInfo
)
const
queryTribePoint
=
useStoreActions
(
actions
=>
actions
.
groupModel
.
queryTribePoint
)
const
tabBarHeight
=
useMemo
(()
=>
{
const
tabBarHeight
=
useMemo
(()
=>
{
return
nav
.
height
+
nav
.
top
+
5
return
nav
.
height
+
nav
.
top
+
5
...
@@ -56,10 +57,6 @@ const Group = () => {
...
@@ -56,10 +57,6 @@ const Group = () => {
}
}
})
})
const { run: refresh } = useRequest(queryTribePoint, {
immediate: false
})
const onConfirm = () => {
const onConfirm = () => {
if (!groupNo) {
if (!groupNo) {
showModal({ title: '部落名不能为空' })
showModal({ title: '部落名不能为空' })
...
@@ -71,7 +68,7 @@ const Group = () => {
...
@@ -71,7 +68,7 @@ const Group = () => {
const onRefresher = async () => {
const onRefresher = async () => {
try {
try {
toggle()
toggle()
await Promise.all([fetchTribeInfo(),
refresh
()])
await Promise.all([fetchTribeInfo(),
queryTribePoint
()])
} finally {
} finally {
setTimeout(() => toggle(), 600)
setTimeout(() => toggle(), 600)
}
}
...
...
src/pages/group/model/index.ts
View file @
ec748e03
import
Taro
from
'@tarojs/taro'
import
Taro
from
'@tarojs/taro'
import
{
import
{
action
,
Action
,
computed
,
Computed
,
Thunk
,
thunk
action
,
Action
,
computed
,
Computed
,
Thunk
,
thunk
,
State
}
from
'easy-peasy'
}
from
'easy-peasy'
import
{
getTribeInfo
,
type
TribeInfo
,
type
MemberItem
}
from
'@/api/group'
import
{
getTribeInfo
,
queryTribePoint
,
type
PointType
,
type
TribeInfo
,
type
MemberItem
}
from
'@/api/group'
import
{
AppStoreModel
}
from
'@/store/store-model'
import
{
AppStoreModel
}
from
'@/store/store-model'
export
interface
GroupModel
{
export
interface
GroupModel
{
points
:
PointType
[],
tribeInfo
:
TribeInfo
|
null
;
tribeInfo
:
TribeInfo
|
null
;
groupMembers
:
Computed
<
GroupModel
,
MemberItem
[]
>
;
groupMembers
:
Computed
<
GroupModel
,
MemberItem
[]
>
;
isEmpty
:
Computed
<
GroupModel
,
boolean
>
;
isEmpty
:
Computed
<
GroupModel
,
boolean
>
;
updateState
:
Action
<
GroupModel
,
TribeInfo
|
null
>
;
updateState
:
Action
<
GroupModel
,
Partial
<
State
<
GroupModel
>>>
;
fetchTribeInfo
:
Thunk
<
GroupModel
,
void
,
void
,
AppStoreModel
,
Promise
<
TribeInfo
>>
;
fetchTribeInfo
:
Thunk
<
GroupModel
,
{
memberId
?:
number
}
|
undefined
,
void
,
AppStoreModel
,
Promise
<
TribeInfo
>>
;
queryTribePoint
:
Thunk
<
GroupModel
>
;
}
}
const
groupModel
:
GroupModel
=
{
const
groupModel
:
GroupModel
=
{
tribeInfo
:
null
,
tribeInfo
:
null
,
points
:
[],
groupMembers
:
computed
((
state
)
=>
state
.
tribeInfo
?.
groupMembers
||
[]),
groupMembers
:
computed
((
state
)
=>
state
.
tribeInfo
?.
groupMembers
||
[]),
isEmpty
:
computed
((
state
)
=>
state
.
groupMembers
.
length
<
1
),
isEmpty
:
computed
((
state
)
=>
state
.
groupMembers
.
length
<
1
),
updateState
:
action
((
state
,
payload
)
=>
{
updateState
:
action
((
state
,
payload
)
=>
{
state
.
tribeInfo
=
payload
for
(
const
key
in
payload
)
{
state
[
key
]
=
payload
[
key
]
}
}),
}),
fetchTribeInfo
:
thunk
(
async
(
actions
)
=>
{
fetchTribeInfo
:
thunk
(
async
(
actions
,
payload
)
=>
{
let
ret
:
TribeInfo
=
{}
let
ret
:
TribeInfo
=
{}
try
{
try
{
Taro
.
showLoading
()
Taro
.
showLoading
()
const
{
data
}
=
await
getTribeInfo
()
const
{
data
}
=
await
getTribeInfo
(
{
memberId
:
payload
?.
memberId
}
)
ret
=
data
ret
=
data
}
catch
(
err
)
{
}
catch
(
err
)
{
ret
=
{}
ret
=
{}
...
@@ -34,8 +39,17 @@ const groupModel: GroupModel = {
...
@@ -34,8 +39,17 @@ const groupModel: GroupModel = {
}
finally
{
}
finally
{
setTimeout
(()
=>
Taro
.
hideLoading
(),
300
)
setTimeout
(()
=>
Taro
.
hideLoading
(),
300
)
}
}
actions
.
updateState
(
ret
)
actions
.
updateState
(
{
tribeInfo
:
ret
}
)
return
ret
return
ret
}),
queryTribePoint
:
thunk
(
async
(
actions
)
=>
{
try
{
const
{
data
}
=
await
queryTribePoint
()
actions
.
updateState
({
points
:
data
})
}
catch
(
err
)
{
actions
.
updateState
({
points
:
[]
})
Taro
.
showModal
({
title
:
err
.
message
})
}
})
})
}
}
...
...
src/pages/main/main.tsx
View file @
ec748e03
import
{
View
,
Button
}
from
'@tarojs/components'
import
{
View
}
from
'@tarojs/components'
import
{
import
{
useRouter
,
showToast
,
getMenuButtonBoundingClientRect
,
useDidShow
,
getMenuButtonBoundingClientRect
,
useDidShow
,
getCurrentInstance
,
getTabBar
,
pageScrollTo
,
getSystemInfoSync
,
showModal
,
getCurrentInstance
,
getTabBar
,
pageScrollTo
,
getSystemInfoSync
,
nextTick
nextTick
}
from
'@tarojs/taro'
}
from
'@tarojs/taro'
import
{
useState
,
useMemo
,
useCallback
}
from
'react'
import
{
useState
,
useMemo
,
useCallback
}
from
'react'
import
{
useStoreActions
,
useStoreState
}
from
'@/store/hooks'
import
{
useStoreActions
,
useStoreState
}
from
'@/store/hooks'
import
{
getTribeInfo
,
joinTribe
}
from
'@/api/group'
import
{
useRequest
}
from
'@/hooks'
import
type
{
TabbarRef
}
from
'../../custom-tab-bar/index'
import
type
{
TabbarRef
}
from
'../../custom-tab-bar/index'
import
{
CurrentRoundId
,
SceneContext
,
StageStatus
}
from
'./components/scene/constants'
import
{
CurrentRoundId
,
SceneContext
,
StageStatus
}
from
'./components/scene/constants'
...
@@ -15,19 +13,20 @@ import MainHeader from './components/header'
...
@@ -15,19 +13,20 @@ import MainHeader from './components/header'
import
MainChapter
from
'./components/chapter'
import
MainChapter
from
'./components/chapter'
import
MainScene
from
'./components/scene'
import
MainScene
from
'./components/scene'
import
MainShortCut
from
'./components/short-cut'
import
MainShortCut
from
'./components/short-cut'
import
useShowShareModal
from
'./use-show-share-modal'
import
styles
from
'./main.module.scss'
import
styles
from
'./main.module.scss'
const
MainPage
=
()
=>
{
const
MainPage
=
()
=>
{
const
page
=
useMemo
(()
=>
getCurrentInstance
().
page
,
[])
const
page
=
useMemo
(()
=>
getCurrentInstance
().
page
,
[])
const
[
isReady
,
setIsReady
]
=
useState
(
false
)
const
[
isReady
,
setIsReady
]
=
useState
(
false
)
const
userInfo
=
useStoreState
(
state
=>
state
.
userModel
.
userInfo
)
const
fetchStage
=
useStoreActions
(
actions
=>
actions
.
mainModel
.
fetchStage
)
const
fetchStage
=
useStoreActions
(
actions
=>
actions
.
mainModel
.
fetchStage
)
const
stageList
=
useStoreState
(
state
=>
state
.
mainModel
.
stageList
)
const
stageList
=
useStoreState
(
state
=>
state
.
mainModel
.
stageList
)
const
fetchAccount
=
useStoreActions
(
actions
=>
actions
.
userModel
.
fetchAccount
)
const
fetchAccount
=
useStoreActions
(
actions
=>
actions
.
userModel
.
fetchAccount
)
const
fetchTribeInfo
=
useStoreActions
(
actions
=>
actions
.
groupModel
.
fetchTribeInfo
)
const
nav
=
useMemo
(
getMenuButtonBoundingClientRect
,
[])
const
[
nav
]
=
useState
(
getMenuButtonBoundingClientRect
())
const
router
=
useRouter
<
{
groupId
:
string
,
inviteId
:
string
}
>
()
useShowShareModal
()
const
{
groupId
,
inviteId
}
=
router
.
params
const
scrollToCurrent
=
useCallback
((
callback
?:
()
=>
void
)
=>
{
const
scrollToCurrent
=
useCallback
((
callback
?:
()
=>
void
)
=>
{
const
height
=
getSystemInfoSync
().
windowHeight
const
height
=
getSystemInfoSync
().
windowHeight
...
@@ -55,42 +54,8 @@ const MainPage = () => {
...
@@ -55,42 +54,8 @@ const MainPage = () => {
}
}
})
})
})
})
fetchTribeInfo
().
then
((
res
)
=>
{
if
(
!
res
||
!
res
.
id
)
{
joinTribeByCode
()
}
})
})
})
// 加入部落
const
{
run
}
=
useRequest
(
joinTribe
,
{
immediate
:
false
,
onSuccess
:
()
=>
{
showToast
({
title
:
'加入成功'
})
fetchTribeInfo
()
},
onError
:
()
=>
{
fetchTribeInfo
()
}
})
// 邀请弹框
const
joinTribeByCode
=
useCallback
(()
=>
{
if
(
groupId
&&
inviteId
&&
+
inviteId
!==
userInfo
.
userId
)
{
// 邀请人是不是自己
showModal
({
title
:
'加入部落'
,
success
:
({
confirm
})
=>
{
confirm
&&
run
({
groupId
:
+
groupId
})
}
})
}
},
[
groupId
,
inviteId
,
userInfo
.
userId
])
const
handleClick
=
(
e
)
=>
{
console
.
log
(
e
)
}
return
(
return
(
<>
<>
<
MainHeader
/>
<
MainHeader
/>
...
...
src/pages/main/use-show-share-modal.ts
0 → 100644
View file @
ec748e03
import
{
useCallback
,
useEffect
}
from
'react'
import
{
useRouter
,
showToast
,
showModal
,
useDidShow
}
from
'@tarojs/taro'
import
{
useStoreActions
,
useStoreState
}
from
'@/store/hooks'
import
{
joinTribe
}
from
'@/api/group'
import
{
useRequest
}
from
'@/hooks'
export
default
function
useShowShareModal
()
{
const
userInfo
=
useStoreState
(
state
=>
state
.
userModel
.
userInfo
)
const
fetchTribeInfo
=
useStoreActions
(
actions
=>
actions
.
groupModel
.
fetchTribeInfo
)
const
queryTribePoint
=
useStoreActions
(
actions
=>
actions
.
groupModel
.
queryTribePoint
)
const
router
=
useRouter
<
{
groupId
:
string
,
inviteId
:
string
}
>
()
const
{
groupId
,
inviteId
}
=
router
.
params
useDidShow
(()
=>
{
Promise
.
all
([
queryTribePoint
(),
fetchTribeInfo
().
then
((
res
)
=>
{
if
(
!
res
||
!
res
.
id
)
{
joinTribeWithCode
()
}
})
])
})
// 加入部落
const
{
run
}
=
useRequest
(
joinTribe
,
{
immediate
:
false
,
onSuccess
:
()
=>
{
showToast
({
title
:
'加入成功'
,
icon
:
'none'
})
fetchTribeInfo
()
}
})
// 邀请弹框
const
joinTribeWithCode
=
useCallback
(
async
()
=>
{
if
(
groupId
&&
inviteId
&&
+
inviteId
!==
userInfo
.
userId
)
{
// 邀请人是不是自己
const
res
=
await
fetchTribeInfo
({
memberId
:
+
inviteId
})
const
memberName
=
res
.
groupMembers
?.
find
(
item
=>
item
.
identity
===
'LEADER'
)?.
memberName
showModal
({
title
:
`
${
memberName
}
邀请你加入《
${
res
.
groupNo
}
》部落!`
,
success
:
({
confirm
})
=>
{
confirm
&&
run
({
groupId
:
+
groupId
})
}
})
}
},
[
groupId
,
inviteId
,
userInfo
.
userId
,
fetchTribeInfo
])
}
src/pages/prepare/components/main-header.module.scss
View file @
ec748e03
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
.title
{
.title
{
font-weight
:
bold
;
font-weight
:
bold
;
margin
:
40px
0
20px
;
margin
:
40px
0
20px
;
font-size
:
26
PX
;
font-size
:
52px
;
font-weight
:
600
;
font-weight
:
600
;
color
:
#FFFFFF
;
color
:
#FFFFFF
;
}
}
...
@@ -86,9 +86,9 @@
...
@@ -86,9 +86,9 @@
@include
flexLayout
(
row
,
center
);
@include
flexLayout
(
row
,
center
);
.badge
{
.badge
{
width
:
42
PX
;
width
:
84px
;
height
:
42
PX
;
height
:
84px
;
margin-right
:
16
PX
;
margin-right
:
32px
;
}
}
.center
{
.center
{
...
@@ -116,7 +116,7 @@
...
@@ -116,7 +116,7 @@
background
:
#0084FF
;
background
:
#0084FF
;
border-radius
:
14px
;
border-radius
:
14px
;
font-size
:
10
PX
;
font-size
:
10
PX
;
width
:
36
PX
;
width
:
72px
;
padding
:
1
PX
6
PX
;
padding
:
1
PX
6
PX
;
}
}
}
}
...
...
src/pages/prepare/components/tabs.module.scss
View file @
ec748e03
...
@@ -57,7 +57,6 @@
...
@@ -57,7 +57,6 @@
background-color
:
#fff
;
background-color
:
#fff
;
position
:
relative
;
position
:
relative
;
top
:
-40
PX
;
top
:
-40
PX
;
margin-bottom
:
-40
PX
;
.tabPane
{
.tabPane
{
height
:
auto
;
height
:
auto
;
...
...
src/pages/prepare/components/thead.module.scss
View file @
ec748e03
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
color
:
rgba
(
70
,
81
,
100
,
0
.5
);
color
:
rgba
(
70
,
81
,
100
,
0
.5
);
&
_index
{
&
_index
{
width
:
30
PX
;
width
:
60px
;
padding-left
:
3
PX
;
padding-left
:
3
PX
;
margin-right
:
23
PX
;
margin-right
:
23
PX
;
}
}
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
color
:
rgba
(
70
,
81
,
100
,
0
.7
);
color
:
rgba
(
70
,
81
,
100
,
0
.7
);
&
_best
{
&
_best
{
font-size
:
14
PX
;
font-size
:
32px
;
font-weight
:
600
;
font-weight
:
600
;
color
:
#FE9B45
;
color
:
#FE9B45
;
}
}
...
...
src/pages/prepare/index.module.scss
View file @
ec748e03
@import
'@/styles/mixins.scss'
;
@import
'@/styles/mixins.scss'
;
.wrapper
{
.wrapper
{
padding-bottom
:
80
PX
;
padding-bottom
:
105px
;
.inner
{
.inner
{
position
:
relative
;
position
:
relative
;
...
@@ -67,14 +67,14 @@
...
@@ -67,14 +67,14 @@
@include
flexLayout
(
row
,
center
);
@include
flexLayout
(
row
,
center
);
&
_icon
{
&
_icon
{
width
:
30
PX
;
width
:
60px
;
height
:
30
PX
;
height
:
60px
;
}
}
&
_index
{
&
_index
{
display
:
block
;
display
:
block
;
text-align
:
center
;
text-align
:
center
;
width
:
30
PX
;
width
:
60px
;
font-size
:
36px
;
font-size
:
36px
;
font-weight
:
500
;
font-weight
:
500
;
color
:
rgba
(
70
,
81
,
100
,
0
.5
);
color
:
rgba
(
70
,
81
,
100
,
0
.5
);
...
@@ -108,7 +108,7 @@
...
@@ -108,7 +108,7 @@
gap
:
6
PX
;
gap
:
6
PX
;
color
:
rgba
(
70
,
81
,
100
,
0
.7
);
color
:
rgba
(
70
,
81
,
100
,
0
.7
);
&
_best
{
&
_best
{
font-size
:
16
PX
;
font-size
:
32px
;
font-weight
:
600
;
font-weight
:
600
;
color
:
#FE9B45
;
color
:
#FE9B45
;
}
}
...
@@ -126,9 +126,9 @@
...
@@ -126,9 +126,9 @@
.tribe_share
{
.tribe_share
{
border-radius
:
10
PX
;
border-radius
:
10
PX
;
margin
:
0
40
PX
;
margin
:
0
80px
;
margin-bottom
:
56px
;
margin-bottom
:
56px
;
height
:
44
PX
;
height
:
88px
;
border
:
2
PX
solid
#465164
;
border
:
2
PX
solid
#465164
;
gap
:
8
PX
;
gap
:
8
PX
;
@include
flexLayout
(
row
,
center
,
center
);
@include
flexLayout
(
row
,
center
,
center
);
...
...
src/pages/prepare/render.tsx
View file @
ec748e03
...
@@ -10,12 +10,6 @@ import Thead from './components/thead'
...
@@ -10,12 +10,6 @@ import Thead from './components/thead'
import
styles
from
'./index.module.scss'
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
[])
=>
{
export
const
renderList
=
(
list
:
StageRank
[])
=>
{
const
isEmpty
=
list
.
length
<
1
const
isEmpty
=
list
.
length
<
1
const
user
=
list
.
find
(
item
=>
item
.
me
)
const
user
=
list
.
find
(
item
=>
item
.
me
)
...
@@ -43,7 +37,7 @@ export const renderItem = (item: StageRank) => {
...
@@ -43,7 +37,7 @@ export const renderItem = (item: StageRank) => {
{
item
.
nickName
||
'-'
}
{
item
.
nickName
||
'-'
}
{
item
.
me
&&
<
Text
>
(你)
</
Text
>
}
{
item
.
me
&&
<
Text
>
(你)
</
Text
>
}
</
Text
>
</
Text
>
<
Image
className=
{
styles
.
item_username_crown
}
src=
{
assetsGroup
[
'crown-small.png'
].
u
}
/>
{
item
.
identity
===
'LEADER'
&&
<
Image
className=
{
styles
.
item_username_crown
}
src=
{
assetsGroup
[
'crown-small.png'
].
u
}
/>
}
</
View
>
</
View
>
<
View
className=
{
styles
.
item_result
}
>
<
View
className=
{
styles
.
item_result
}
>
<
Text
className=
{
styles
.
item_result_first
}
>
{
item
.
firstResultTime
}
s
</
Text
>
<
Text
className=
{
styles
.
item_result_first
}
>
{
item
.
firstResultTime
}
s
</
Text
>
...
@@ -73,7 +67,7 @@ const renderTribeList = (list: StageRank[]) => (
...
@@ -73,7 +67,7 @@ const renderTribeList = (list: StageRank[]) => (
export
const
renderTribePage
=
(
list
:
StageRank
[]
=
[])
=>
{
export
const
renderTribePage
=
(
list
:
StageRank
[]
=
[])
=>
{
return
(
return
(
<
View
className=
{
styles
.
tribe
}
>
<
View
className=
{
styles
.
tribe
}
>
{
[{}]
.
length
>
0
?
renderTribeList
(
list
)
:
renderEmptyTribe
()
}
{
list
.
length
>
0
?
renderTribeList
(
list
)
:
renderEmptyTribe
()
}
</
View
>
</
View
>
)
)
}
}
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