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
48f179ed
Commit
48f179ed
authored
Apr 23, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 更新账户
parent
565369f4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
4 deletions
+12
-4
auth.ts
src/api/auth.ts
+1
-1
index.tsx
src/pages/main/components/tutorial/index.tsx
+8
-1
receive-point.tsx
src/pages/market/components/tutorial/receive-point.tsx
+2
-2
guide.ts
src/store/modules/guide.ts
+1
-0
No files found.
src/api/auth.ts
View file @
48f179ed
...
@@ -113,7 +113,7 @@ export function getAreaAndGrades () {
...
@@ -113,7 +113,7 @@ export function getAreaAndGrades () {
}).
then
(({
data
})
=>
data
)
}).
then
(({
data
})
=>
data
)
}
}
export
const
completeGuide
=
()
=>
requestAfterSilentLogin
<
void
,
{
userId
?:
number
}
>
(
user
=>
({
export
const
receivePoint
=
()
=>
requestAfterSilentLogin
<
void
,
{
userId
?:
number
}
>
(
user
=>
({
method
:
'GET'
,
method
:
'GET'
,
url
:
'/service-idea/stage/user/receivePoint'
,
url
:
'/service-idea/stage/user/receivePoint'
,
data
:
{
userId
:
user
?.
userId
}
data
:
{
userId
:
user
?.
userId
}
...
...
src/pages/main/components/tutorial/index.tsx
View file @
48f179ed
...
@@ -52,7 +52,14 @@ const Tutorial = forwardRef<TutorialRef, {}>((_, ref) => {
...
@@ -52,7 +52,14 @@ const Tutorial = forwardRef<TutorialRef, {}>((_, ref) => {
},
[
updateGuideActive
,
isMainGuideComplete
])
},
[
updateGuideActive
,
isMainGuideComplete
])
const
loadData
=
useCallback
(()
=>
{
const
loadData
=
useCallback
(()
=>
{
return
getAreaAndGrades
().
then
(
setData
)
return
getAreaAndGrades
()
.
then
(
setData
)
.
catch
(()
=>
{
setData
({
areas
:
[
'成都'
,
'重庆'
,
'宜宾'
,
'自贡'
,
'乐山'
,
'南充'
,
'遂宁'
,
'德阳'
,
'其他'
],
grades
:
[
'一年级'
,
'二年级'
,
'三年级'
,
'四年级'
,
'五年级'
,
'六年级'
]
})
})
},
[])
},
[])
const
handleConfirmArea
=
useCallback
((
val
:
string
)
=>
{
const
handleConfirmArea
=
useCallback
((
val
:
string
)
=>
{
...
...
src/pages/market/components/tutorial/receive-point.tsx
View file @
48f179ed
import
{
View
,
RootPortal
,
Image
,
Button
}
from
'@tarojs/components'
import
{
View
,
RootPortal
,
Image
,
Button
}
from
'@tarojs/components'
import
{
showToast
}
from
'@tarojs/taro'
import
{
showToast
}
from
'@tarojs/taro'
import
{
useBoolean
}
from
'@/hooks'
import
{
useBoolean
}
from
'@/hooks'
import
{
completeGuide
}
from
'@/api'
import
{
receivePoint
}
from
'@/api'
import
giftAssets
from
'@/assets/oss/assets-gift'
import
giftAssets
from
'@/assets/oss/assets-gift'
import
styles
from
'./shared.module.scss'
import
styles
from
'./shared.module.scss'
...
@@ -17,7 +17,7 @@ const ModalReceivePoint = (props: ReceivePointProps) => {
...
@@ -17,7 +17,7 @@ const ModalReceivePoint = (props: ReceivePointProps) => {
if
(
loading
)
return
if
(
loading
)
return
loadingActions
.
setTrue
()
loadingActions
.
setTrue
()
try
{
try
{
await
completeGuide
()
await
receivePoint
()
loadingActions
.
setFalse
()
loadingActions
.
setFalse
()
onConfirm
&&
onConfirm
()
onConfirm
&&
onConfirm
()
}
catch
(
err
)
{
}
catch
(
err
)
{
...
...
src/store/modules/guide.ts
View file @
48f179ed
...
@@ -70,6 +70,7 @@ const guideModel: GuideModel = {
...
@@ -70,6 +70,7 @@ const guideModel: GuideModel = {
const
newUserInfo
=
{
...
userInfo
,
pointReceive
:
'Y'
}
as
UserInfo
const
newUserInfo
=
{
...
userInfo
,
pointReceive
:
'Y'
}
as
UserInfo
updateStorage
(
StorageKeys
.
userInfo
,
newUserInfo
)
updateStorage
(
StorageKeys
.
userInfo
,
newUserInfo
)
helpers
.
getStoreActions
().
userModel
.
updateState
({
userInfo
:
newUserInfo
})
helpers
.
getStoreActions
().
userModel
.
updateState
({
userInfo
:
newUserInfo
})
helpers
.
getStoreActions
().
userModel
.
fetchAccount
()
}),
}),
nextGroupGuide
:
action
(
state
=>
{
nextGroupGuide
:
action
(
state
=>
{
state
.
groupGuideStep
+=
1
state
.
groupGuideStep
+=
1
...
...
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