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
82cf6ed1
Commit
82cf6ed1
authored
Apr 23, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
3d3edd8b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
nickname-words.json
assets/setting/nickname-words.json
+3
-0
index.tsx
src/pages/main/components/tutorial/index.tsx
+10
-4
No files found.
assets/setting/nickname-words.json
View file @
82cf6ed1
...
@@ -306,6 +306,9 @@
...
@@ -306,6 +306,9 @@
"心善的"
,
"心善的"
,
"谦虚的"
,
"谦虚的"
,
"低调的"
,
"低调的"
,
"疯狂的"
,
"狂野的"
,
"奔放的"
,
"好客的"
,
"好客的"
,
"热心的"
,
"热心的"
,
"敬业的"
,
"敬业的"
,
...
...
src/pages/main/components/tutorial/index.tsx
View file @
82cf6ed1
import
{
useState
,
useCallback
,
useEffect
}
from
'react'
import
{
useState
,
useCallback
,
useEffect
,
useRef
}
from
'react'
import
{
getAreaAndGrades
,
type
AreaAndGrades
,
StageStatus
}
from
'@/api'
import
{
getAreaAndGrades
,
type
AreaAndGrades
,
StageStatus
}
from
'@/api'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
import
{
useFocus
}
from
'@/hooks'
import
{
useFocus
}
from
'@/hooks'
...
@@ -28,6 +28,7 @@ const Tutorial = () => {
...
@@ -28,6 +28,7 @@ const Tutorial = () => {
const
[
step
,
setStep
]
=
useState
(
0
)
const
[
step
,
setStep
]
=
useState
(
0
)
const
[
selected
,
setSelected
]
=
useState
({
area
:
''
,
grade
:
''
})
const
[
selected
,
setSelected
]
=
useState
({
area
:
''
,
grade
:
''
})
const
[
enable
,
setEnable
]
=
useState
(
false
)
const
[
enable
,
setEnable
]
=
useState
(
false
)
const
isLoadRef
=
useRef
(
false
)
const
isFocus
=
useFocus
()
const
isFocus
=
useFocus
()
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -48,10 +49,11 @@ const Tutorial = () => {
...
@@ -48,10 +49,11 @@ const Tutorial = () => {
const
handleConfirm
=
useCallback
(()
=>
{
const
handleConfirm
=
useCallback
(()
=>
{
setStep
(
0
)
setStep
(
0
)
if
(
!
isMainGuideComplete
)
{
const
index
=
stageList
.
findIndex
(
c
=>
c
.
status
===
StageStatus
.
CURRENT
)
if
(
!
isMainGuideComplete
&&
index
===
0
)
{
updateGuideActive
(
true
)
updateGuideActive
(
true
)
}
}
},
[
updateGuideActive
,
isMainGuideComplete
])
},
[
updateGuideActive
,
isMainGuideComplete
,
stageList
])
const
loadData
=
useCallback
(()
=>
{
const
loadData
=
useCallback
(()
=>
{
return
getAreaAndGrades
()
return
getAreaAndGrades
()
...
@@ -87,6 +89,10 @@ const Tutorial = () => {
...
@@ -87,6 +89,10 @@ const Tutorial = () => {
if
(
!
data
.
areas
.
length
)
{
if
(
!
data
.
areas
.
length
)
{
loadData
()
loadData
()
}
}
if
(
isLoadRef
.
current
)
{
return
}
isLoadRef
.
current
=
true
// 没选择城市
// 没选择城市
if
(
!
userInfo
.
city
)
{
if
(
!
userInfo
.
city
)
{
setStep
(
1
)
setStep
(
1
)
...
@@ -112,7 +118,7 @@ const Tutorial = () => {
...
@@ -112,7 +118,7 @@ const Tutorial = () => {
{
step
===
1
&&
<
ModalArea
options=
{
data
.
areas
}
onConfirm=
{
handleConfirmArea
}
loading=
{
updating
}
/>
}
{
step
===
1
&&
<
ModalArea
options=
{
data
.
areas
}
onConfirm=
{
handleConfirmArea
}
loading=
{
updating
}
/>
}
{
step
===
2
&&
!
userInfo
.
grade
&&
<
ModalGrade
options=
{
data
.
grades
}
onConfirm=
{
handleConfirmGrade
}
loading=
{
updating
}
/>
}
{
step
===
2
&&
!
userInfo
.
grade
&&
<
ModalGrade
options=
{
data
.
grades
}
onConfirm=
{
handleConfirmGrade
}
loading=
{
updating
}
/>
}
{
step
===
3
&&
<
ModalResult
grade=
{
selected
.
grade
}
onConfirm=
{
handleConfirm
}
/>
}
{
step
===
3
&&
<
ModalResult
grade=
{
selected
.
grade
}
onConfirm=
{
handleConfirm
}
/>
}
{
groupGuideActive
&&
!
isGroupGuideComplete
&&
groupGuideStep
===
0
&&
<
ModalGroupGuide
onConfirm=
{
nextGroupGuide
}
/>
}
{
step
===
0
&&
groupGuideActive
&&
!
isGroupGuideComplete
&&
groupGuideStep
===
0
&&
<
ModalGroupGuide
onConfirm=
{
nextGroupGuide
}
/>
}
</>
</>
)
)
}
}
...
...
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