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
5381bb5a
Commit
5381bb5a
authored
Apr 23, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
cf7c7825
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
27 deletions
+17
-27
config-env.js
scripts/config-env.js
+1
-1
main-component.tsx
src/pages/main/components/main-component.tsx
+0
-1
index.tsx
src/pages/main/components/tutorial/index.tsx
+16
-25
No files found.
scripts/config-env.js
View file @
5381bb5a
...
@@ -26,7 +26,7 @@ module.exports = function configEnv () {
...
@@ -26,7 +26,7 @@ module.exports = function configEnv () {
}
}
const
hash
=
crypto
.
createHash
(
'md5'
)
const
hash
=
crypto
.
createHash
(
'md5'
)
hash
.
update
(
'GEEK-
ONLINE-WEAPP-V4
'
)
hash
.
update
(
'GEEK-
PK-MATH-WEAPP-V1
'
)
hash
.
update
(
`build-
${
env
}
`
)
hash
.
update
(
`build-
${
env
}
`
)
hash
.
update
(
`build-
${
process
.
env
.
SERVER_ENDPOINT
||
''
}
`
)
hash
.
update
(
`build-
${
process
.
env
.
SERVER_ENDPOINT
||
''
}
`
)
process
.
env
.
TARO_STORAGE_KEY
=
hash
.
digest
(
'base64'
).
substring
(
0
,
5
)
process
.
env
.
TARO_STORAGE_KEY
=
hash
.
digest
(
'base64'
).
substring
(
0
,
5
)
...
...
src/pages/main/components/main-component.tsx
View file @
5381bb5a
...
@@ -83,7 +83,6 @@ const MainPage = () => {
...
@@ -83,7 +83,6 @@ const MainPage = () => {
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
isFocus
)
{
if
(
isFocus
)
{
player
.
play
()
player
.
play
()
tutorialRef
.
current
?.
start
()
}
}
},
[
player
,
isFocus
])
},
[
player
,
isFocus
])
...
...
src/pages/main/components/tutorial/index.tsx
View file @
5381bb5a
...
@@ -2,6 +2,7 @@ import { useState, useImperativeHandle, forwardRef, useCallback, useEffect } fro
...
@@ -2,6 +2,7 @@ import { useState, useImperativeHandle, forwardRef, useCallback, useEffect } fro
import
{
showToast
}
from
'@tarojs/taro'
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
ModalArea
from
'./modal-area'
import
ModalArea
from
'./modal-area'
import
ModalGrade
from
'./modal-grade'
import
ModalGrade
from
'./modal-grade'
import
ModalResult
from
'./modal-result'
import
ModalResult
from
'./modal-result'
...
@@ -27,6 +28,7 @@ const Tutorial = forwardRef<TutorialRef, {}>((_, ref) => {
...
@@ -27,6 +28,7 @@ const Tutorial = forwardRef<TutorialRef, {}>((_, ref) => {
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
isFocus
=
useFocus
()
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
!
joinDefered
)
{
if
(
!
joinDefered
)
{
...
@@ -81,34 +83,23 @@ const Tutorial = forwardRef<TutorialRef, {}>((_, ref) => {
...
@@ -81,34 +83,23 @@ const Tutorial = forwardRef<TutorialRef, {}>((_, ref) => {
},
[
updateUserInfo
])
},
[
updateUserInfo
])
useEffect
(()
=>
{
useEffect
(()
=>
{
loadData
()
if
(
isFocus
)
{
},
[
loadData
])
if
(
!
data
.
areas
.
length
)
{
loadData
()
useImperativeHandle
(
ref
,
()
=>
{
}
return
{
// 没选择城市
start
:
()
=>
{
if
(
!
userInfo
.
city
)
{
if
(
!
data
.
areas
.
length
)
{
setStep
(
1
)
loadData
().
catch
(()
=>
{
}
else
if
(
!
userInfo
.
grade
)
{
// 没选择年级
showToast
({
setStep
(
2
)
title
:
'加载数据失败'
,
}
else
{
icon
:
'none'
setStep
(
0
)
})
if
(
!
isMainGuideComplete
)
{
})
updateGuideActive
(
true
)
}
// 没选择城市
if
(
!
userInfo
.
city
)
{
setStep
(
1
)
}
else
if
(
!
userInfo
.
grade
)
{
// 没选择年级
setStep
(
2
)
}
else
{
setStep
(
0
)
if
(
!
isMainGuideComplete
)
{
updateGuideActive
(
true
)
}
}
}
}
}
}
}
})
}
,
[
isFocus
,
data
.
areas
,
isMainGuideComplete
,
updateGuideActive
,
loadData
,
userInfo
.
city
,
userInfo
.
grade
]
)
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