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
2d023620
Commit
2d023620
authored
Jun 21, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 滚动完成后才显示引导
parent
70778009
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
8 deletions
+14
-8
main-component.tsx
src/pages/main/main-underground/main-component.tsx
+7
-4
stage.tsx
src/pages/main/main-underground/scene/stage.tsx
+5
-4
guide.ts
src/store/modules/guide.ts
+2
-0
No files found.
src/pages/main/main-underground/main-component.tsx
View file @
2d023620
...
...
@@ -37,6 +37,7 @@ const MainPage = () => {
const
fetchAccount
=
useStoreActions
(
actions
=>
actions
.
userModel
.
fetchAccount
)
const
updateGroupGuideActive
=
useStoreActions
(
actions
=>
actions
.
guideModel
.
updateGroupGuideActive
)
const
fetchTribeInfo
=
useStoreActions
(
actions
=>
actions
.
groupModel
.
fetchTribeInfo
)
const
updateGuideState
=
useStoreActions
(
actions
=>
actions
.
guideModel
.
updateState
)
const
userInfo
=
useStoreState
(
state
=>
state
.
userModel
.
userInfo
)
const
showPkGuideFromHis
=
useStoreState
(
state
=>
state
.
guideModel
.
showPkGuideFromHis
)
...
...
@@ -94,20 +95,22 @@ const MainPage = () => {
}
},
[
player
,
isFocus
])
const
scrollToLastPassed
=
useCallback
(()
=>
{
const
scrollToLastPassed
=
useCallback
((
cb
:
()
=>
void
)
=>
{
const
height
=
getSystemInfoSync
().
windowHeight
pageScrollTo
({
selector
:
`#
${
LastPassedStageId
}
`
,
offsetTop
:
-
height
/
2
,
complete
:
()
=>
{}
complete
:
cb
})
},
[])
useEffect
(()
=>
{
if
(
showPkGuideFromHis
)
{
scrollToLastPassed
()
scrollToLastPassed
(()
=>
{
updateGuideState
({
activePkGuideFromHis
:
true
})
})
}
},
[
showPkGuideFromHis
,
scrollToLastPassed
])
},
[
showPkGuideFromHis
,
scrollToLastPassed
,
updateGuideState
])
useEffect
(()
=>
{
if
(
isFocus
&&
userInfo
.
city
&&
userInfo
.
grade
)
{
...
...
src/pages/main/main-underground/scene/stage.tsx
View file @
2d023620
...
...
@@ -153,6 +153,7 @@ const StageComp = (props: StageProps) => {
const
nextPkGuide
=
useStoreActions
(
state
=>
state
.
guideModel
.
nextPkGuide
)
const
showPkGuideFromHis
=
useStoreState
(
state
=>
state
.
guideModel
.
showPkGuideFromHis
)
const
updateGuideState
=
useStoreActions
(
state
=>
state
.
guideModel
.
updateState
)
const
activePkGuideFromHis
=
useStoreState
(
state
=>
state
.
guideModel
.
activePkGuideFromHis
)
const
isSpecialRound
=
useMemo
(()
=>
{
return
stage
.
type
===
StageType
.
Special
...
...
@@ -166,9 +167,9 @@ const StageComp = (props: StageProps) => {
}
if
(
stage
.
$lastPassedStage
)
{
return
showPkGuideFromHis
return
showPkGuideFromHis
&&
activePkGuideFromHis
}
},
[
pkGuideActive
,
pkGuideStep
,
stage
,
showPkGuideFromHis
,
isSpecialRound
])
},
[
pkGuideActive
,
pkGuideStep
,
stage
,
showPkGuideFromHis
,
isSpecialRound
,
activePkGuideFromHis
])
const
handleClick
=
()
=>
{
if
(
stage
.
status
!==
StageStatus
.
DISABLED
||
!
isProduction
)
{
...
...
@@ -196,7 +197,7 @@ const StageComp = (props: StageProps) => {
if
(
isSpecialRound
)
return
if
(
showPkGuideFromHis
)
{
updateGuideState
({
showPkGuideFromHis
:
false
})
updateGuideState
({
showPkGuideFromHis
:
false
,
activePkGuideFromHis
:
false
})
}
else
{
nextPkGuide
()
}
...
...
@@ -254,7 +255,7 @@ const StageComp = (props: StageProps) => {
isActive=
{
isPkGuideShow
}
wrapClass=
{
styles
.
pk_guide_wrap
}
verticalPadding=
{
0
}
delay=
{
showPkGuideFromHis
?
300
:
0
}
delay=
{
10
0
}
horizonPadding=
{
0
}
guideViewId=
"first_pk_guide"
guideContent=
{
(
...
...
src/store/modules/guide.ts
View file @
2d023620
...
...
@@ -47,6 +47,7 @@ export interface GuideModel {
nextPkGuide
:
Action
<
GuideModel
>
;
addPkGuideTimes
:
Action
<
GuideModel
,
void
>
;
showPkGuideFromHis
:
boolean
;
activePkGuideFromHis
:
boolean
;
pointToCardNum
:
number
;
completeAddDeskGuide
:
Thunk
<
GuideModel
,
void
,
void
,
AppStoreModel
>
;
...
...
@@ -67,6 +68,7 @@ const guideModel: GuideModel = {
storeGuideStep
:
0
,
pointToCardNum
:
0
,
pkGuideStep
:
0
,
activePkGuideFromHis
:
false
,
showPkGuideFromHis
:
false
,
pkGuideTimes
:
getStorage
(
StorageKeys
.
pkGuideTimes
),
...
...
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