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
536b967c
Commit
536b967c
authored
Apr 23, 2023
by
raca
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/2023-04-19-iter' of…
Merge branch 'feature/2023-04-19-iter' of
https://118.24.71.244/hewenhao/GeekLearnMathWeapp
into feature/2023-04-19-iter
parents
9b3652cc
e90d4cf8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
main-component.tsx
src/pages/main/components/main-component.tsx
+4
-3
user.ts
src/store/modules/user.ts
+3
-1
No files found.
src/pages/main/components/main-component.tsx
View file @
536b967c
...
@@ -29,7 +29,6 @@ const MainPage = () => {
...
@@ -29,7 +29,6 @@ const MainPage = () => {
const
stageList
=
useStoreState
(
state
=>
state
.
mainModel
.
stageList
)
const
stageList
=
useStoreState
(
state
=>
state
.
mainModel
.
stageList
)
const
player
=
useStoreState
(
state
=>
state
.
mainModel
.
player
)
const
player
=
useStoreState
(
state
=>
state
.
mainModel
.
player
)
const
isReady
=
useStoreState
(
state
=>
state
.
mainModel
.
isReady
)
const
isReady
=
useStoreState
(
state
=>
state
.
mainModel
.
isReady
)
const
point
=
useStoreState
(
state
=>
state
.
userModel
.
point
)
const
isGroupGuideComplete
=
useStoreState
(
state
=>
state
.
guideModel
.
isGroupGuideComplete
)
const
isGroupGuideComplete
=
useStoreState
(
state
=>
state
.
guideModel
.
isGroupGuideComplete
)
const
isMainGuideComplete
=
useStoreState
(
state
=>
state
.
guideModel
.
isMainGuideComplete
)
const
isMainGuideComplete
=
useStoreState
(
state
=>
state
.
guideModel
.
isMainGuideComplete
)
const
fetchAccount
=
useStoreActions
(
actions
=>
actions
.
userModel
.
fetchAccount
)
const
fetchAccount
=
useStoreActions
(
actions
=>
actions
.
userModel
.
fetchAccount
)
...
@@ -58,12 +57,14 @@ const MainPage = () => {
...
@@ -58,12 +57,14 @@ const MainPage = () => {
isGroupGuideComplete
||
isGroupGuideComplete
||
userInfo
.
pointReceive
===
'N'
||
userInfo
.
pointReceive
===
'N'
||
!
userInfo
.
city
||
!
userInfo
.
city
||
!
userInfo
.
grade
!
userInfo
.
grade
||
stageList
.
length
<
1
)
{
)
{
return
return
}
}
const
currentIndex
=
stageList
.
findIndex
(
c
=>
c
.
status
===
StageStatus
.
CURRENT
)
const
currentIndex
=
stageList
.
findIndex
(
c
=>
c
.
status
===
StageStatus
.
CURRENT
)
const
point
=
await
fetchAccount
()
if
(
point
<
50
||
currentIndex
>=
3
)
{
if
(
point
<
50
||
currentIndex
>=
3
)
{
const
res
=
await
fetchTribeInfo
()
const
res
=
await
fetchTribeInfo
()
...
@@ -73,7 +74,7 @@ const MainPage = () => {
...
@@ -73,7 +74,7 @@ const MainPage = () => {
}
}
}
}
fn
()
fn
()
},
[
poi
nt
,
isGroupGuideComplete
,
stageList
,
updateGroupGuideActive
,
userInfo
,
fetchTribeInfo
,
isMainGuideComplete
,
isFocus
])
},
[
fetchAccou
nt
,
isGroupGuideComplete
,
stageList
,
updateGroupGuideActive
,
userInfo
,
fetchTribeInfo
,
isMainGuideComplete
,
isFocus
])
onAppHide
(()
=>
{
onAppHide
(()
=>
{
player
.
pause
()
player
.
pause
()
...
...
src/store/modules/user.ts
View file @
536b967c
...
@@ -18,7 +18,7 @@ export interface UserModel {
...
@@ -18,7 +18,7 @@ export interface UserModel {
updating
:
boolean
;
updating
:
boolean
;
isEyeProtectionMode
:
boolean
;
isEyeProtectionMode
:
boolean
;
updateState
:
Action
<
UserModel
,
Partial
<
State
<
UserModel
>>>
;
updateState
:
Action
<
UserModel
,
Partial
<
State
<
UserModel
>>>
;
fetchAccount
:
Thunk
<
UserModel
,
void
,
void
,
AppStoreModel
>
;
fetchAccount
:
Thunk
<
UserModel
,
void
,
void
,
AppStoreModel
,
Promise
<
number
>
>
;
setting
:
SettintType
;
setting
:
SettintType
;
getSetting
:
Thunk
<
UserModel
,
void
,
void
,
AppStoreModel
>
;
getSetting
:
Thunk
<
UserModel
,
void
,
void
,
AppStoreModel
>
;
updateUserInfo
:
Thunk
<
UserModel
,
Partial
<
UpdateUserInfoIn
>
,
void
,
AppStoreModel
>
;
updateUserInfo
:
Thunk
<
UserModel
,
Partial
<
UpdateUserInfoIn
>
,
void
,
AppStoreModel
>
;
...
@@ -144,8 +144,10 @@ const userModel: UserModel = {
...
@@ -144,8 +144,10 @@ const userModel: UserModel = {
const
cardNum
=
list
.
find
(
c
=>
c
.
accountType
===
'CARD'
)?.
amount
??
0
const
cardNum
=
list
.
find
(
c
=>
c
.
accountType
===
'CARD'
)?.
amount
??
0
const
point
=
list
.
find
(
c
=>
c
.
accountType
===
'POINT'
)?.
amount
??
0
const
point
=
list
.
find
(
c
=>
c
.
accountType
===
'POINT'
)?.
amount
??
0
actions
.
updateState
({
cardNum
,
point
})
actions
.
updateState
({
cardNum
,
point
})
return
point
}
catch
(
err
)
{
}
catch
(
err
)
{
actions
.
updateState
({
cardNum
:
0
,
point
:
0
})
actions
.
updateState
({
cardNum
:
0
,
point
:
0
})
return
0
}
}
})
})
}
}
...
...
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