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
d8bb0190
Commit
d8bb0190
authored
Apr 19, 2024
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 优化引导
parent
479ce5c8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
index.tsx
src/pages/main/components/tutorial/index.tsx
+9
-6
No files found.
src/pages/main/components/tutorial/index.tsx
View file @
d8bb0190
...
@@ -26,7 +26,7 @@ export type TutorialRef = {
...
@@ -26,7 +26,7 @@ export type TutorialRef = {
}
}
const
Tutorial
=
()
=>
{
const
Tutorial
=
()
=>
{
const
joinDefered
=
useStoreState
(
state
=>
state
.
userModel
.
joinDefered
)
const
joinDefer
r
ed
=
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
)
const
isMainGuideComplete
=
useStoreState
(
state
=>
state
.
guideModel
.
isMainGuideComplete
)
const
isMainGuideComplete
=
useStoreState
(
state
=>
state
.
guideModel
.
isMainGuideComplete
)
...
@@ -46,10 +46,10 @@ const Tutorial = () => {
...
@@ -46,10 +46,10 @@ const Tutorial = () => {
const
isFocus
=
useFocus
()
const
isFocus
=
useFocus
()
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
!
joinDefered
)
{
if
(
!
joinDefer
r
ed
)
{
setEnable
(
false
)
setEnable
(
false
)
}
else
{
}
else
{
joinDefered
.
getPromise
().
then
(()
=>
{
joinDefer
r
ed
.
getPromise
().
then
(()
=>
{
setEnable
(
true
)
setEnable
(
true
)
})
})
}
}
...
@@ -57,7 +57,7 @@ const Tutorial = () => {
...
@@ -57,7 +57,7 @@ const Tutorial = () => {
return
()
=>
{
return
()
=>
{
setEnable
(
false
)
setEnable
(
false
)
}
}
},
[
joinDefered
])
},
[
joinDefer
r
ed
])
const
[
data
,
setData
]
=
useState
<
AreaAndGrades
>
({
areas
:
[],
grades
:
[]
})
const
[
data
,
setData
]
=
useState
<
AreaAndGrades
>
({
areas
:
[],
grades
:
[]
})
...
@@ -107,7 +107,9 @@ const Tutorial = () => {
...
@@ -107,7 +107,9 @@ const Tutorial = () => {
if
(
isLoadRef
.
current
)
{
if
(
isLoadRef
.
current
)
{
return
return
}
}
isLoadRef
.
current
=
true
if
(
!
userInfo
.
city
||
!
userInfo
.
grade
)
{
isLoadRef
.
current
=
true
}
// 没选择城市
// 没选择城市
if
(
!
userInfo
.
city
)
{
if
(
!
userInfo
.
city
)
{
setStep
(
1
)
setStep
(
1
)
...
@@ -119,13 +121,14 @@ const Tutorial = () => {
...
@@ -119,13 +121,14 @@ const Tutorial = () => {
if
(
stageList
.
length
<
1
)
{
if
(
stageList
.
length
<
1
)
{
return
return
}
}
isLoadRef
.
current
=
true
const
index
=
stageList
.
findIndex
(
c
=>
c
.
status
===
StageStatus
.
CURRENT
)
const
index
=
stageList
.
findIndex
(
c
=>
c
.
status
===
StageStatus
.
CURRENT
)
if
(
!
isMainGuideComplete
&&
index
===
0
)
{
if
(
!
isMainGuideComplete
&&
index
===
0
)
{
updateGuideActive
(
true
)
updateGuideActive
(
true
)
}
}
}
}
}
}
},
[
isFocus
,
data
.
areas
,
isMainGuideComplete
,
updateGuideActive
,
loadData
,
userInfo
.
city
,
userInfo
.
grade
,
stageList
])
},
[
isFocus
,
data
.
areas
,
isMainGuideComplete
,
updateGuideActive
,
loadData
,
userInfo
.
city
,
userInfo
,
stageList
])
if
(
!
enable
)
{
if
(
!
enable
)
{
return
null
return
null
...
...
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