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
0c073857
Commit
0c073857
authored
Apr 12, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
95dcb112
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
11 deletions
+18
-11
auth.ts
src/api/auth.ts
+1
-1
scene-6.tsx
src/pages/main/guide/scene-6.tsx
+15
-10
index.tsx
src/pages/prepare/index.tsx
+2
-0
No files found.
src/api/auth.ts
View file @
0c073857
...
@@ -92,6 +92,6 @@ export function getNickNameWords (url = 'nickname-words') {
...
@@ -92,6 +92,6 @@ export function getNickNameWords (url = 'nickname-words') {
method
:
'GET'
,
method
:
'GET'
,
url
:
`https://cdn.jkwljy.com/pk-math/setting/
${
url
}
.json?d=
${
Date
.
now
()}
`
,
url
:
`https://cdn.jkwljy.com/pk-math/setting/
${
url
}
.json?d=
${
Date
.
now
()}
`
,
header
:
{
'Cache-Control'
:
'no-cache'
},
header
:
{
'Cache-Control'
:
'no-cache'
},
timeout
:
8
00
timeout
:
300
00
}).
then
(({
data
})
=>
data
)
}).
then
(({
data
})
=>
data
)
}
}
src/pages/main/guide/scene-6.tsx
View file @
0c073857
...
@@ -29,7 +29,7 @@ const Scene6 = (props: Scene6Props) => {
...
@@ -29,7 +29,7 @@ const Scene6 = (props: Scene6Props) => {
const
genName
=
useCallback
(()
=>
{
const
genName
=
useCallback
(()
=>
{
const
{
noun
,
adj
}
=
dataRef
.
current
const
{
noun
,
adj
}
=
dataRef
.
current
const
nam
=
`
${
randomPick
(
adj
)}${
randomPick
(
noun
)}
`
const
nam
=
[
randomPick
(
adj
),
randomPick
(
noun
)].
filter
(
Boolean
).
join
(
''
)
setName
(
nam
)
setName
(
nam
)
},
[])
},
[])
...
@@ -52,9 +52,19 @@ const Scene6 = (props: Scene6Props) => {
...
@@ -52,9 +52,19 @@ const Scene6 = (props: Scene6Props) => {
})
})
},
[
updateNickNameAndPhone
,
onNext
,
name
])
},
[
updateNickNameAndPhone
,
onNext
,
name
])
const
_getNickNameWords
=
useCallback
(
async
()
=>
{
const
words
=
await
getNickNameWords
()
dataRef
.
current
=
words
genName
()
},
[
genName
])
const
handleGen
=
useCallback
(()
=>
{
const
handleGen
=
useCallback
(()
=>
{
genActions
.
setTrue
()
genActions
.
setTrue
()
genName
()
if
(
dataRef
.
current
.
adj
.
length
<
1
)
{
_getNickNameWords
()
}
else
{
genName
()
}
if
(
timerRef
.
current
)
{
if
(
timerRef
.
current
)
{
clearTimeout
(
timerRef
.
current
)
clearTimeout
(
timerRef
.
current
)
}
}
...
@@ -62,16 +72,11 @@ const Scene6 = (props: Scene6Props) => {
...
@@ -62,16 +72,11 @@ const Scene6 = (props: Scene6Props) => {
genActions
.
setFalse
()
genActions
.
setFalse
()
timerRef
.
current
=
null
timerRef
.
current
=
null
},
1000
)
},
1000
)
},
[
genName
,
genActions
])
},
[
genName
,
genActions
,
_getNickNameWords
])
useEffect
(()
=>
{
useEffect
(()
=>
{
const
fn
=
async
()
=>
{
_getNickNameWords
()
const
words
=
await
getNickNameWords
()
},
[
_getNickNameWords
])
dataRef
.
current
=
words
genName
()
}
fn
()
},
[
genName
])
return
(
return
(
<
View
className=
{
cs
.
viewport
}
>
<
View
className=
{
cs
.
viewport
}
>
...
...
src/pages/prepare/index.tsx
View file @
0c073857
...
@@ -38,6 +38,7 @@ const Prepare = () => {
...
@@ -38,6 +38,7 @@ const Prepare = () => {
const
tribeInfo
=
useStoreState
(
state
=>
state
.
groupModel
.
tribeInfo
)
const
tribeInfo
=
useStoreState
(
state
=>
state
.
groupModel
.
tribeInfo
)
const
stageList
=
useStoreState
(
state
=>
state
.
mainModel
.
stageList
)
const
stageList
=
useStoreState
(
state
=>
state
.
mainModel
.
stageList
)
const
setting
=
useStoreState
(
state
=>
state
.
userModel
.
setting
)
const
setting
=
useStoreState
(
state
=>
state
.
userModel
.
setting
)
const
fetchAccount
=
useStoreActions
(
actions
=>
actions
.
userModel
.
fetchAccount
)
const
getStageDetail
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
getStageDetail
)
const
getStageDetail
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
getStageDetail
)
const
getQuestionList
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
getQuestionList
)
const
getQuestionList
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
getQuestionList
)
const
updateState
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
updateState
)
const
updateState
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
updateState
)
...
@@ -66,6 +67,7 @@ const Prepare = () => {
...
@@ -66,6 +67,7 @@ const Prepare = () => {
}, [nav.height, nav.top])
}, [nav.height, nav.top])
useDidShow(async () => {
useDidShow(async () => {
fetchAccount()
toggleLoad()
toggleLoad()
await getStageDetail(+router.params.id || 1)
await getStageDetail(+router.params.id || 1)
toggleLoad()
toggleLoad()
...
...
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