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
bfac4025
Commit
bfac4025
authored
Apr 23, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: fix bug
parent
2d755480
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
10 deletions
+9
-10
main-component.tsx
src/pages/main/components/main-component.tsx
+3
-5
share-modal.tsx
src/pages/main/components/share-modal.tsx
+3
-1
index.tsx
src/pages/main/components/tutorial/index.tsx
+3
-4
No files found.
src/pages/main/components/main-component.tsx
View file @
bfac4025
...
@@ -5,11 +5,11 @@ import {
...
@@ -5,11 +5,11 @@ import {
nextTick
,
nextTick
,
onAppHide
,
onAppHide
,
}
from
'@tarojs/taro'
}
from
'@tarojs/taro'
import
{
useMemo
,
useCallback
,
useEffect
,
useRef
}
from
'react'
import
{
useMemo
,
useCallback
,
useEffect
}
from
'react'
import
{
useStoreActions
,
useStoreState
}
from
'@/store/hooks'
import
{
useStoreActions
,
useStoreState
}
from
'@/store/hooks'
import
{
useFocus
}
from
'@/hooks/use-focus'
import
{
useFocus
}
from
'@/hooks/use-focus'
import
{
EyeProtectionView
}
from
'@/components'
import
{
EyeProtectionView
}
from
'@/components'
import
Tutorial
,
{
type
TutorialRef
}
from
'./tutorial'
import
Tutorial
from
'./tutorial'
import
type
{
TabbarRef
}
from
'../../../custom-tab-bar/index'
import
type
{
TabbarRef
}
from
'../../../custom-tab-bar/index'
import
{
CurrentRoundId
,
StageStatus
}
from
'./scene/constants'
import
{
CurrentRoundId
,
StageStatus
}
from
'./scene/constants'
...
@@ -39,8 +39,6 @@ const MainPage = () => {
...
@@ -39,8 +39,6 @@ const MainPage = () => {
const
nav
=
useMemo
(
getMenuButtonBoundingClientRect
,
[])
const
nav
=
useMemo
(
getMenuButtonBoundingClientRect
,
[])
const
tutorialRef
=
useRef
<
TutorialRef
|
null
>
(
null
)
const
scrollToCurrent
=
useCallback
((
callback
?:
()
=>
void
)
=>
{
const
scrollToCurrent
=
useCallback
((
callback
?:
()
=>
void
)
=>
{
const
height
=
getSystemInfoSync
().
windowHeight
const
height
=
getSystemInfoSync
().
windowHeight
pageScrollTo
({
pageScrollTo
({
...
@@ -128,7 +126,7 @@ const MainPage = () => {
...
@@ -128,7 +126,7 @@ const MainPage = () => {
<
MainShortCut
onClick=
{
()
=>
scrollToCurrent
()
}
/>
<
MainShortCut
onClick=
{
()
=>
scrollToCurrent
()
}
/>
)
}
)
}
<
ShareModal
/>
<
ShareModal
/>
<
Tutorial
ref=
{
tutorialRef
}
/>
<
Tutorial
/>
</>
</>
)
)
}
}
...
...
src/pages/main/components/share-modal.tsx
View file @
bfac4025
...
@@ -27,7 +27,6 @@ export default function ShareModal () {
...
@@ -27,7 +27,6 @@ export default function ShareModal () {
const
deferRef
=
useRef
<
Deferred
<
void
>
|
null
>
(
null
)
const
deferRef
=
useRef
<
Deferred
<
void
>
|
null
>
(
null
)
const
userInfo
=
useStoreState
(
state
=>
state
.
userModel
.
userInfo
)
const
userInfo
=
useStoreState
(
state
=>
state
.
userModel
.
userInfo
)
const
joinDefered
=
useStoreState
(
state
=>
state
.
userModel
.
joinDefered
)
const
updateState
=
useStoreActions
(
actions
=>
actions
.
userModel
.
updateState
)
const
updateState
=
useStoreActions
(
actions
=>
actions
.
userModel
.
updateState
)
const
fetchTribeInfo
=
useStoreActions
(
actions
=>
actions
.
groupModel
.
fetchTribeInfo
)
const
fetchTribeInfo
=
useStoreActions
(
actions
=>
actions
.
groupModel
.
fetchTribeInfo
)
...
@@ -51,6 +50,8 @@ export default function ShareModal () {
...
@@ -51,6 +50,8 @@ export default function ShareModal () {
const
res
=
await
fetchTribeInfo
()
const
res
=
await
fetchTribeInfo
()
if
(
!
res
||
!
res
.
id
)
{
// 没有加入过部落
if
(
!
res
||
!
res
.
id
)
{
// 没有加入过部落
joinTribeWithCode
()
joinTribeWithCode
()
}
else
{
deferRef
.
current
?.
resolve
()
}
}
},
[
joinTribeWithCode
,
fetchTribeInfo
])
},
[
joinTribeWithCode
,
fetchTribeInfo
])
...
@@ -65,6 +66,7 @@ export default function ShareModal () {
...
@@ -65,6 +66,7 @@ export default function ShareModal () {
showShareModal
()
showShareModal
()
return
()
=>
{
return
()
=>
{
deferRef
.
current
=
null
updateState
({
joinDefered
:
null
})
updateState
({
joinDefered
:
null
})
}
}
},
[
showShareModal
,
updateState
])
},
[
showShareModal
,
updateState
])
...
...
src/pages/main/components/tutorial/index.tsx
View file @
bfac4025
import
{
useState
,
useImperativeHandle
,
forwardRef
,
useCallback
,
useEffect
}
from
'react'
import
{
useState
,
useCallback
,
useEffect
}
from
'react'
import
{
showToast
}
from
'@tarojs/taro'
import
{
getAreaAndGrades
,
type
AreaAndGrades
}
from
'@/api'
import
{
getAreaAndGrades
,
type
AreaAndGrades
}
from
'@/api'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
import
{
useFocus
}
from
'@/hooks'
import
{
useFocus
}
from
'@/hooks'
...
@@ -12,7 +11,7 @@ export type TutorialRef = {
...
@@ -12,7 +11,7 @@ export type TutorialRef = {
start
:
()
=>
void
;
start
:
()
=>
void
;
}
}
const
Tutorial
=
forwardRef
<
TutorialRef
,
{}
>
((
_
,
ref
)
=>
{
const
Tutorial
=
(
)
=>
{
const
joinDefered
=
useStoreState
(
state
=>
state
.
userModel
.
joinDefered
)
const
joinDefered
=
useStoreState
(
state
=>
state
.
userModel
.
joinDefered
)
const
updateUserInfo
=
useStoreActions
(
actions
=>
actions
.
userModel
.
updateUserInfo
)
const
updateUserInfo
=
useStoreActions
(
actions
=>
actions
.
userModel
.
updateUserInfo
)
const
updateGuideActive
=
useStoreActions
(
actions
=>
actions
.
guideModel
.
updateGuideActive
)
const
updateGuideActive
=
useStoreActions
(
actions
=>
actions
.
guideModel
.
updateGuideActive
)
...
@@ -113,6 +112,6 @@ const Tutorial = forwardRef<TutorialRef, {}>((_, ref) => {
...
@@ -113,6 +112,6 @@ const Tutorial = forwardRef<TutorialRef, {}>((_, ref) => {
{
groupGuideActive
&&
!
isGroupGuideComplete
&&
groupGuideStep
===
0
&&
<
ModalGroupGuide
onConfirm=
{
nextGroupGuide
}
/>
}
{
groupGuideActive
&&
!
isGroupGuideComplete
&&
groupGuideStep
===
0
&&
<
ModalGroupGuide
onConfirm=
{
nextGroupGuide
}
/>
}
</>
</>
)
)
}
)
}
export
default
Tutorial
export
default
Tutorial
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