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
c3a97075
Commit
c3a97075
authored
Apr 05, 2023
by
m
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
f52b7c02
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
16 deletions
+19
-16
group.ts
src/api/group.ts
+5
-4
index.tsx
src/pages/group/index.tsx
+4
-2
main.tsx
src/pages/main/main.tsx
+7
-6
index.tsx
src/pages/prepare/index.tsx
+2
-2
render.tsx
src/pages/prepare/render.tsx
+1
-2
No files found.
src/api/group.ts
View file @
c3a97075
...
...
@@ -35,15 +35,16 @@ export const postTribePoint = ({ type }: Pick<PointType, 'type'>) => {
}
// 加入部落
export
const
joinTribe
=
({
groupId
}:
{
groupId
:
number
})
=>
{
return
requestAfterSilentLogin
<
{},
{
userId
?:
number
,
groupId
:
number
}
>
((
userInfo
)
=>
({
export
const
joinTribe
=
({
groupId
,
memberId
,
memberName
}:
{
groupId
:
number
,
memberId
:
number
,
memberName
:
string
})
=>
{
return
requestAfterSilentLogin
<
{},
{
memberName
:
string
,
groupId
:
number
,
memberId
:
number
}
>
({
url
:
'/service-idea/group/joinTribe'
,
method
:
'POST'
,
data
:
{
groupId
,
userId
:
userInfo
?.
userId
,
memberId
,
memberName
}
})
)
})
}
export
type
PointType
=
{
...
...
src/pages/group/index.tsx
View file @
c3a97075
...
...
@@ -36,11 +36,13 @@ const Group = () => {
const
tabbar
=
getTabBar
<
TabbarRef
>
(
page
)
tabbar
?.
setSelected
(
1
)
})
console
.
log
(
`pages/main/main?groupId=
${
tribeInfo
?.
id
}
&
userId
=
$
{
userInfo
.
userId
}
&
memberName
=
$
{
userInfo
.
nickname
}
`,
)
useShareAppMessage(() => {
return {
title: '来看看这个有趣的页面!',
path
:
`pages/main/main?groupId=
${
tribeInfo
?.
id
}
&
userId
=
$
{
userInfo
.
userId
}
`,
path: `
pages
/
main
/
main
?
groupId
=
$
{
tribeInfo
?.
id
}
&
userId
=
$
{
userInfo
.
userId
}
&
memberName
=
$
{
userInfo
.
nickname
}
`,
imageUrl: 'https://picx.zhimg.com/v2-7b7b072d4bebd5ccf48c04ec1146e844_1440w.jpg?',
}
})
...
...
src/pages/main/main.tsx
View file @
c3a97075
...
...
@@ -21,8 +21,8 @@ const MainPage = () => {
const
stageList
=
useStoreState
(
state
=>
state
.
mainModel
.
stageList
)
const
fetchAccount
=
useStoreActions
(
actions
=>
actions
.
userModel
.
fetchAccount
)
const
[
nav
]
=
useState
(
getMenuButtonBoundingClientRect
())
const
router
=
useRouter
<
{
groupId
:
string
,
userId
:
string
}
>
()
const
{
groupId
,
userId
}
=
router
.
params
const
router
=
useRouter
<
{
groupId
:
string
,
memberId
:
string
,
memberName
:
string
}
>
()
const
{
groupId
,
memberId
,
memberName
}
=
router
.
params
const
{
run
}
=
useRequest
(
joinTribe
,
{
immediate
:
false
,
...
...
@@ -62,15 +62,16 @@ const MainPage = () => {
})
const
joinTribeByCode
=
useCallback
(()
=>
{
if
(
groupId
&&
+
userId
!==
userInfo
.
userId
)
{
if
(
groupId
&&
memberId
&&
+
memberId
!==
userInfo
.
userId
)
{
showToast
({
title
:
`
${
groupId
}
-
${
memberId
}
-
${
memberName
}
`
})
showModal
({
title
:
'加入部落'
,
success
:
()
=>
{
r
un
({
groupId
:
+
groupId
})
success
:
(
res
)
=>
{
r
es
.
confirm
&&
run
({
groupId
:
+
groupId
,
memberId
:
+
memberId
,
memberName
:
memberName
||
'🐂'
})
}
})
}
},
[
groupId
,
userId
,
userInfo
.
userId
])
},
[
groupId
,
memberId
,
memberName
])
return
(
<>
...
...
src/pages/prepare/index.tsx
View file @
c3a97075
...
...
@@ -37,13 +37,13 @@ const Prepare = () => {
const
tabs
:
TabItem
[]
=
[
{
label
:
'成都排行榜'
,
children
:
renderList
(
stageDetail
?.
ranks
)
children
:
renderList
(
stageDetail
?.
ranks
||
[]
)
},
{
label
:
'学习部落排行榜'
,
children
:
(
<
View
className=
{
styles
.
tribe
}
>
{
renderTribePage
(
stageDetail
?.
groupRanks
)
}
{
renderTribePage
(
stageDetail
?.
groupRanks
||
[]
)
}
</
View
>
)
}
...
...
src/pages/prepare/render.tsx
View file @
c3a97075
...
...
@@ -16,8 +16,7 @@ export const formatTime = (time: number) => {
return
`
${
minutes
}
分
${
seconds
}
秒`
}
export
const
renderList
=
(
list
:
StageRank
[]
=
[])
=>
{
console
.
log
(
'---'
,
list
)
export
const
renderList
=
(
list
:
StageRank
[])
=>
{
const
isEmpty
=
list
.
length
<
1
const
user
=
list
.
find
(
item
=>
item
.
me
)
return
(
...
...
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