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
d973bc39
Commit
d973bc39
authored
Jun 16, 2023
by
raca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
96888dd1
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
361 additions
and
45 deletions
+361
-45
.eslintrc.js
.eslintrc.js
+2
-1
.oss
assets/gift/.oss
+6
-0
tool-2.png
assets/gift/tool-2.png
+0
-0
auth.ts
src/api/auth.ts
+30
-0
assets-gift.ts
src/assets/oss/assets-gift.ts
+5
-0
modal-name.tsx
src/pages/accept-pk/components/modal-name.tsx
+0
-1
exchange-rename-card.module.scss
src/pages/market/components/exchange-rename-card.module.scss
+76
-0
exchange-rename-card.tsx
src/pages/market/components/exchange-rename-card.tsx
+111
-0
index.tsx
src/pages/market/index.tsx
+94
-40
user.ts
src/store/modules/user.ts
+37
-3
No files found.
.eslintrc.js
View file @
d973bc39
...
...
@@ -2,7 +2,8 @@ module.exports = {
extends
:
[
'standard'
,
'taro/preact'
,
'plugin:react/jsx-runtime'
],
rules
:
{
'comma-dangle'
:
0
,
'jsx-quotes'
:
[
'error'
,
'prefer-double'
]
'jsx-quotes'
:
[
'error'
,
'prefer-double'
],
'multiline-ternary'
:
'off'
,
},
overrides
:
[
{
...
...
assets/gift/.oss
View file @
d973bc39
...
...
@@ -46,5 +46,11 @@
"w": 328,
"h": 104,
"ossName": "/pk-math/29QTjXfLwPrvQMiHpxDGME1yW2P7/328x104"
},
"tool-2.png": {
"u": "https://cdn.jkwljy.com/pk-math/44JWotM3WUWtuLKnFe1ZvvacU7MD/140x140",
"w": 140,
"h": 140,
"ossName": "/pk-math/44JWotM3WUWtuLKnFe1ZvvacU7MD/140x140"
}
}
src/pages/market/assets/rename-card
.png
→
assets/gift/tool-2
.png
View file @
d973bc39
File moved
src/api/auth.ts
View file @
d973bc39
...
...
@@ -58,6 +58,7 @@ export function updateUserInfo (opts: UpdateUserInfoIn) {
export
type
SettintType
=
{
pointToCard
:
number
,
pointToNameCard
:
number
,
aPoint
?:
number
,
bPoint
?:
number
,
sPoint
?:
number
,
...
...
@@ -118,3 +119,32 @@ export const receivePoint = () => requestAfterSilentLogin<void, { userId?: numbe
url
:
'/service-idea/stage/user/receivePoint'
,
data
:
{
userId
:
user
?.
userId
}
}))
export
type
ExchangeParams
=
{
accountTo
:
'POINT'
|
'NAME_CARD'
|
'CARD'
,
accountFrom
:
'POINT'
|
'NAME_CARD'
|
'CARD'
,
num
:
number
;
userId
?:
number
;
}
export
function
accountExchange
(
data
:
ExchangeParams
)
{
return
requestAfterSilentLogin
<
void
,
ExchangeParams
>
(
userInfo
=>
({
method
:
'POST'
,
url
:
'/service-idea/stage/user/accountExchange'
,
data
:
{
...
data
,
userId
:
userInfo
?.
userId
}
}))
}
export
function
changeNickName
(
nickName
:
string
)
{
return
requestAfterSilentLogin
<
void
,
{
nickName
:
string
,
userId
?:
number
}
>
(
userInfo
=>
({
method
:
'GET'
,
url
:
'/service-idea/stage/user/changeNickName'
,
data
:
{
nickName
,
userId
:
userInfo
?.
userId
}
}))
}
src/assets/oss/assets-gift.ts
View file @
d973bc39
...
...
@@ -40,5 +40,10 @@ export default {
"u"
:
"https://cdn.jkwljy.com/pk-math/29QTjXfLwPrvQMiHpxDGME1yW2P7/328x104"
,
"w"
:
328
,
"h"
:
104
},
"tool-2.png"
:
{
"u"
:
"https://cdn.jkwljy.com/pk-math/44JWotM3WUWtuLKnFe1ZvvacU7MD/140x140"
,
"w"
:
140
,
"h"
:
140
}
}
as
const
src/pages/accept-pk/components/modal-name.tsx
View file @
d973bc39
...
...
@@ -82,7 +82,6 @@ const ModalName = ({
generating
&&
styles
.
generating
)
}
onClick=
{
handleGenerate
}
data
-
name=
""
></
Image
>
</
View
>
<
View
className=
{
styles
.
footer
}
>
...
...
src/pages/market/components/exchange-rename-card.module.scss
0 → 100644
View file @
d973bc39
.description
{
font-size
:
28px
;
font-weight
:
400
;
color
:
#586170
;
margin-top
:
32px
;
line-height
:
50px
;
text-align
:
center
;
}
.input
{
display
:
flex
;
align-items
:
center
;
padding
:
24px
28px
24px
48px
;
margin
:
12px
32px
;
background
:
#F4F6F8
;
border-radius
:
56px
;
}
.inputName
{
flex
:
1
;
text-align
:
left
;
font-size
:
36px
;
font-weight
:
600
;
color
:
#465164
;
line-height
:
50px
;
}
.inputIcon
{
width
:
64px
;
height
:
64px
;
display
:
block
;
}
.generating
{
animation-name
:
rotate_3d
;
animation-duration
:
.3s
;
animation-timing-function
:
ease-in-out
;
animation-iteration-count
:
infinite
;
}
.tips_val
{
color
:
#1786F7
;
}
.tips
{
margin-top
:
16px
;
margin-bottom
:
48px
;
text-align
:
center
;
font-size
:
28px
;
font-weight
:
400
;
color
:
rgba
(
88
,
97
,
112
,
0
.5
);
}
@keyframes
rotate_3d
{
0
%
{
transform
:
rotate
(
0deg
);
}
25
%
{
transform
:
rotate
(
90deg
);
}
50
%
{
transform
:
rotate
(
180deg
);
}
75
%
{
transform
:
rotate
(
270deg
);
}
100
%
{
transform
:
rotate
(
360deg
);
}
}
\ No newline at end of file
src/pages/market/components/exchange-rename-card.tsx
0 → 100644
View file @
d973bc39
import
{
useCallback
,
useRef
,
useState
}
from
'react'
import
{
View
,
Image
,
Text
,
Input
}
from
'@tarojs/components'
import
{
showToast
}
from
'@tarojs/taro'
import
{
useStoreActions
,
useStoreState
}
from
'@/store/hooks'
import
classNames
from
'classnames'
import
{
useBoolean
}
from
'@/hooks'
import
{
getNickNameWords
,
type
NickNameWord
}
from
'@/api'
import
assetsGuide
from
'@/assets/oss/assets-guide'
import
styles
from
'./exchange-item.module.scss'
import
styles2
from
'./exchange-rename-card.module.scss'
type
ExchangeItemProps
=
{
title
:
string
;
stepValue
:
number
;
// onConfirm: (arg: number) => void;
onCancel
:
()
=>
void
;
}
const
randomPick
=
(
arr
:
string
[])
=>
{
const
len
=
arr
.
length
const
randomIndex
=
Math
.
floor
(
Math
.
random
()
*
len
)
return
arr
[
randomIndex
]
}
const
ExchangeRenameCard
=
(
props
:
ExchangeItemProps
)
=>
{
const
{
onCancel
,
stepValue
}
=
props
const
userInfo
=
useStoreState
(
state
=>
state
.
userModel
.
userInfo
)
const
[
name
,
setName
]
=
useState
(
userInfo
.
nickName
)
const
[
generating
,
{
setTrue
,
setFalse
}]
=
useBoolean
(
false
)
const
dataRef
=
useRef
<
NickNameWord
>
({
noun
:
[],
adj
:
[]
})
const
timerRef
=
useRef
<
NodeJS
.
Timer
|
null
>
(
null
)
const
accountExchange
=
useStoreActions
(
actions
=>
actions
.
userModel
.
accountExchange
)
const
changeNickName
=
useStoreActions
(
actions
=>
actions
.
userModel
.
changeNickName
)
const
generateName
=
useCallback
(()
=>
{
const
{
noun
,
adj
}
=
dataRef
.
current
const
nam
=
[
randomPick
(
adj
),
randomPick
(
noun
)].
filter
(
Boolean
).
join
(
''
)
setName
(
nam
)
},
[])
const
getNameWords
=
useCallback
(
async
()
=>
{
const
words
=
await
getNickNameWords
()
dataRef
.
current
=
words
generateName
()
},
[
generateName
])
const
handleGenerate
=
useCallback
(()
=>
{
setTrue
()
if
(
dataRef
.
current
.
adj
.
length
<
1
)
{
getNameWords
()
}
else
{
generateName
()
}
if
(
timerRef
.
current
)
{
clearTimeout
(
timerRef
.
current
)
}
timerRef
.
current
=
setTimeout
(()
=>
{
setFalse
()
timerRef
.
current
=
null
},
1000
)
},
[
generateName
,
setTrue
,
setFalse
,
getNameWords
])
const
handleConfirm
=
()
=>
{
if
(
!
name
)
{
return
showToast
({
title
:
'请输入角色名~'
,
icon
:
'none'
})
}
if
(
name
.
length
>
7
)
{
return
showToast
({
title
:
'角色名太长了~'
,
icon
:
'none'
})
}
accountExchange
({
num
:
1
,
accountTo
:
'NAME_CARD'
,
accountFrom
:
'POINT'
,
}).
then
(()
=>
{
changeNickName
(
name
).
then
(()
=>
{
showToast
({
title
:
'操作成功'
,
icon
:
'success'
})
})
}).
catch
(()
=>
{
})
}
return
(
<>
<
View
className=
{
styles2
.
description
}
>
请输入您的角色名(7字以内)
</
View
>
<
View
className=
{
styles2
.
input
}
>
<
Input
className=
{
styles2
.
inputName
}
value=
{
name
as
string
}
onInput=
{
e
=>
setName
(
e
.
detail
.
value
)
}
/>
<
Image
src=
{
assetsGuide
[
'touzi.png'
].
u
}
className=
{
classNames
(
styles2
.
inputIcon
,
generating
&&
styles2
.
generating
)
}
onClick=
{
handleGenerate
}
></
Image
>
</
View
>
<
View
className=
{
styles2
.
tips
}
>
将消耗
<
Text
className=
{
styles2
.
tips_val
}
>
{
stepValue
}
</
Text
>
水晶
</
View
>
<
View
className=
{
styles
.
footer
}
>
<
View
className=
{
styles
.
cancel
}
onClick=
{
()
=>
onCancel
()
}
id=
"market_exchange_cancel"
>
取消
</
View
>
<
View
className=
{
styles
.
confirm
}
onClick=
{
handleConfirm
}
data
-
name=
"兑换改名卡"
>
确定
</
View
>
</
View
>
</>
)
}
export
default
ExchangeRenameCard
src/pages/market/index.tsx
View file @
d973bc39
...
...
@@ -13,20 +13,21 @@ import tutorialAssets from '@/assets/oss/assets-tutorial'
import
Tutorial
from
'./components/tutorial'
import
TopHeader
from
'./components/top-header'
import
ExchangeItem
from
'./components/exchange-item'
import
ExchangeRenameCard
from
'./components/exchange-rename-card'
import
Card
from
'./components/card'
import
CardMain
from
'./components/card-main'
import
styles
from
'./index.module.scss'
type
ExchangeGoods
=
{
title
?:
string
;
subTitle
:
string
;
isUpComing
?:
boolean
;
description
:
string
;
price
:
number
;
isGuideCard
?:
boolean
;
stock
:
number
|
null
;
img
:
string
;
title
?:
string
subTitle
:
string
isUpComing
?:
boolean
description
:
string
price
:
number
isGuideCard
?:
boolean
stock
:
number
|
null
img
:
string
}
const
itemList
:
ExchangeGoods
[]
=
[
...
...
@@ -78,16 +79,28 @@ const StudyMarket = () => {
const
nav
=
useMemo
(
getMenuButtonBoundingClientRect
,
[])
const
[
isVisible
,
{
setTrue
,
setFalse
}]
=
useBoolean
(
false
)
const
[
currentGoods
,
setCurrentGoods
]
=
useState
<
ExchangeGoods
|
null
>
(
null
)
const
point
=
useStoreState
(
state
=>
state
.
userModel
.
point
)
const
setting
=
useStoreState
(
state
=>
state
.
userModel
.
setting
)
const
storeGuideStep
=
useStoreState
(
state
=>
state
.
guideModel
.
storeGuideStep
)
const
storeGuideActive
=
useStoreState
(
state
=>
state
.
guideModel
.
storeGuideActive
)
const
isStoreGuideComplete
=
useStoreState
(
state
=>
state
.
guideModel
.
isStoreGuideComplete
)
const
userInfo
=
useStoreState
(
state
=>
state
.
userModel
.
userInfo
)
const
fetchAccount
=
useStoreActions
(
actions
=>
actions
.
userModel
.
fetchAccount
)
const
getSetting
=
useStoreActions
(
actions
=>
actions
.
userModel
.
getSetting
)
const
nextStoreGuide
=
useStoreActions
(
actions
=>
actions
.
guideModel
.
nextStoreGuide
)
const
updateStoreGuideActive
=
useStoreActions
(
actions
=>
actions
.
guideModel
.
updateStoreGuideActive
)
const
point
=
useStoreState
((
state
)
=>
state
.
userModel
.
point
)
const
setting
=
useStoreState
((
state
)
=>
state
.
userModel
.
setting
)
const
storeGuideStep
=
useStoreState
(
(
state
)
=>
state
.
guideModel
.
storeGuideStep
)
const
storeGuideActive
=
useStoreState
(
(
state
)
=>
state
.
guideModel
.
storeGuideActive
)
const
isStoreGuideComplete
=
useStoreState
(
(
state
)
=>
state
.
guideModel
.
isStoreGuideComplete
)
const
userInfo
=
useStoreState
((
state
)
=>
state
.
userModel
.
userInfo
)
const
fetchAccount
=
useStoreActions
(
(
actions
)
=>
actions
.
userModel
.
fetchAccount
)
const
getSetting
=
useStoreActions
((
actions
)
=>
actions
.
userModel
.
getSetting
)
const
nextStoreGuide
=
useStoreActions
(
(
actions
)
=>
actions
.
guideModel
.
nextStoreGuide
)
const
updateStoreGuideActive
=
useStoreActions
(
(
actions
)
=>
actions
.
guideModel
.
updateStoreGuideActive
)
useDidShow
(()
=>
{
getSetting
()
...
...
@@ -114,19 +127,21 @@ const StudyMarket = () => {
{
subTitle
:
'改名卡'
,
description
:
'用于更改个人角色名称'
,
price
:
100
,
price
:
setting
.
pointToNameCard
,
stock
:
null
,
isGuideCard
:
true
,
img
:
assets
[
'tool-1.png'
].
u
,
img
:
assets
[
'tool-2.png'
].
u
,
},
...
itemList
...
itemList
,
]
},
[
setting
])
const
open
=
useCallback
((
goods
:
ExchangeGoods
)
=>
{
const
open
=
useCallback
(
(
goods
:
ExchangeGoods
)
=>
{
setCurrentGoods
(
goods
)
setTrue
()
},
[
setTrue
])
},
[
setTrue
]
)
const
isMaskActive
=
useMemo
(()
=>
{
return
(
storeGuideStep
===
0
||
storeGuideStep
===
3
)
&&
storeGuideActive
...
...
@@ -139,19 +154,26 @@ const StudyMarket = () => {
return
(
<>
<
TopHeader
hasMask=
{
isMaskActive
}
/>
{
isMaskActive
&&
(
<
View
className=
{
styles
.
guide_mask
}
></
View
>
)
}
<
EyeProtectionView
className=
{
styles
.
container
}
style=
{
{
paddingTop
:
`${nav.height + nav.top + 5}px`
}
}
>
{
isMaskActive
&&
<
View
className=
{
styles
.
guide_mask
}
></
View
>
}
<
EyeProtectionView
className=
{
styles
.
container
}
style=
{
{
paddingTop
:
`${nav.height + nav.top + 5}px`
}
}
>
<
View
className=
{
styles
.
head
}
>
<
View
className=
{
styles
.
score_text
}
>
{
point
}
<
Text
className=
{
styles
.
unit
}
>
水晶
</
Text
></
View
>
<
Image
src=
{
require
(
'./assets/score.png'
)
}
className=
{
styles
.
score_icon
}
></
Image
>
<
View
className=
{
styles
.
score_text
}
>
{
point
}
<
Text
className=
{
styles
.
unit
}
>
水晶
</
Text
>
</
View
>
<
Image
src=
{
require
(
'./assets/score.png'
)
}
className=
{
styles
.
score_icon
}
></
Image
>
</
View
>
<
View
className=
{
styles
.
card_list
}
>
{
list
.
map
((
item
,
index
)
=>
{
const
pric
=
item
.
price
let
disabledText
=
'积分不足'
let
disabled
=
point
<
pric
||
(
item
.
stock
!==
null
&&
item
.
stock
<
1
)
let
disabled
=
point
<
pric
||
(
item
.
stock
!==
null
&&
item
.
stock
<
1
)
if
(
item
.
isUpComing
)
{
disabled
=
true
if
(
point
>=
pric
)
{
...
...
@@ -161,24 +183,40 @@ const StudyMarket = () => {
return
(
<
Card
title=
{
item
.
title
}
key=
{
item
.
title
}
>
<
View
className=
{
classNames
(
styles
[
'card-body'
],
item
.
isGuideCard
&&
isStep1Active
&&
styles
.
is_guide_card
)
}
>
<
View
className=
{
classNames
(
styles
[
'card-body'
],
item
.
isGuideCard
&&
isStep1Active
&&
styles
.
is_guide_card
)
}
>
{
index
===
0
&&
isStep1Active
&&
(
<
View
className=
{
styles
.
guide_content
}
>
<
Image
src=
{
tutorialAssets
[
'cat-2.png'
].
u
}
className=
{
styles
.
guide_cat
}
/>
<
Image
src=
{
tutorialAssets
[
'cat-2.png'
].
u
}
className=
{
styles
.
guide_cat
}
/>
<
View
className=
{
styles
.
guide_main
}
>
<
View
className=
{
classNames
(
styles
.
dialog
)
}
onClick=
{
()
=>
nextStoreGuide
()
}
id=
"market_guide_1"
>
<
View
className=
{
classNames
(
styles
.
dialog
)
}
onClick=
{
()
=>
nextStoreGuide
()
}
id=
"market_guide_1"
>
<
View
>
在这里,可以兑换闯关消耗的
<
Text
className=
{
styles
.
em
}
>
答题卡
</
Text
>
,以及
在这里,可以兑换闯关消耗的
<
Text
className=
{
styles
.
em
}
>
答题卡
</
Text
>
,以及
<
Text
className=
{
styles
.
em
}
>
成长奖励
</
Text
>
哦~
</
View
>
<
View
className=
{
styles
.
continue
}
>
<
View
className=
{
styles
.
continue_btn
}
>
继续
<
Image
src=
{
tutorialAssets
[
'continue-arrow.png'
].
u
}
className=
{
styles
.
continue_icon
}
/>
继续
<
Image
src=
{
tutorialAssets
[
'continue-arrow.png'
].
u
}
className=
{
styles
.
continue_icon
}
/>
</
View
>
</
View
>
</
View
>
</
View
>
</
View
>
)
}
<
CardMain
...
...
@@ -186,10 +224,12 @@ const StudyMarket = () => {
cover=
{
item
.
img
}
stock=
{
item
.
stock
}
price=
{
pric
}
disabled=
{
(
!
(
item
.
isGuideCard
&&
isStep1Active
)
)
&&
disabled
}
disabled=
{
!
(
item
.
isGuideCard
&&
isStep1Active
)
&&
disabled
}
subtitle=
{
item
.
description
}
disabledText=
{
disabledText
}
isGuideActive=
{
isMaskActive
&&
storeGuideStep
===
3
&&
index
===
0
}
isGuideActive=
{
isMaskActive
&&
storeGuideStep
===
3
&&
index
===
0
}
onClick=
{
()
=>
{
open
(
item
)
}
}
...
...
@@ -200,7 +240,20 @@ const StudyMarket = () => {
})
}
</
View
>
<
Modal
isVisible=
{
isVisible
}
bodyClassName=
{
styles
.
moal_body
}
onClose=
{
setFalse
}
maskClosable=
{
false
}
tilte=
{
`兑换${currentGoods?.title ?? ''}`
}
>
<
Modal
isVisible=
{
isVisible
}
bodyClassName=
{
styles
.
moal_body
}
onClose=
{
setFalse
}
maskClosable=
{
false
}
tilte=
{
`兑换${currentGoods?.subTitle ?? currentGoods?.title ?? ''}`
}
>
{
currentGoods
?.
subTitle
===
'改名卡'
?
(
<
ExchangeRenameCard
title=
{
currentGoods
.
subTitle
}
stepValue=
{
currentGoods
.
price
??
Infinity
}
onCancel=
{
setFalse
}
/>
)
:
(
<
ExchangeItem
title=
{
currentGoods
?.
title
??
''
}
stepValue=
{
currentGoods
?.
price
??
Infinity
}
...
...
@@ -208,6 +261,7 @@ const StudyMarket = () => {
visible=
{
isVisible
}
onCancel=
{
setFalse
}
/>
)
}
</
Modal
>
</
EyeProtectionView
>
<
Tutorial
/>
...
...
src/store/modules/user.ts
View file @
d973bc39
import
{
action
,
Action
,
Thunk
,
thunk
,
State
}
from
'easy-peasy'
import
{
getAccountInfo
,
getSetting
,
type
SettintType
,
updateUserInfo
,
type
UpdateUserInfoIn
,
updateUserPhone
}
from
'@/api'
import
{
getAccountInfo
,
getSetting
,
accountExchange
,
changeNickName
,
type
ExchangeParams
,
type
SettintType
,
updateUserInfo
,
type
UpdateUserInfoIn
,
updateUserPhone
}
from
'@/api'
import
type
{
UserInfo
}
from
'@/types'
import
{
pointToCard
}
from
'@/api/account'
import
{
showModal
,
showToast
,
showLoading
,
hideLoading
}
from
'@tarojs/taro'
...
...
@@ -26,6 +26,9 @@ export interface UserModel {
exchangeItem
:
Thunk
<
UserModel
,
{
name
:
string
;
num
:
number
;
},
void
,
AppStoreModel
>
;
updateNickNameAndPhone
:
Thunk
<
UserModel
,
{
code
?:
string
;
name
?:
string
},
void
,
AppStoreModel
>
;
accountExchange
:
Thunk
<
UserModel
,
ExchangeParams
>
;
changeNickName
:
Thunk
<
UserModel
,
string
>
;
}
const
userModel
:
UserModel
=
{
...
...
@@ -35,7 +38,7 @@ const userModel: UserModel = {
cardNum
:
0
,
point
:
0
,
updating
:
false
,
setting
:
{
pointToCard
:
Infinity
,
aPoint
:
0
,
bPoint
:
0
,
sPoint
:
0
},
setting
:
{
pointToCard
:
Infinity
,
pointToNameCard
:
Infinity
,
aPoint
:
0
,
bPoint
:
0
,
sPoint
:
0
},
updateUserInfo
:
thunk
(
async
(
actions
,
payload
,
helpers
)
=>
{
try
{
if
(
helpers
.
getState
().
updating
)
return
...
...
@@ -114,7 +117,7 @@ const userModel: UserModel = {
const
{
data
}
=
await
getSetting
()
actions
.
updateState
({
setting
:
data
})
}
catch
(
err
)
{
actions
.
updateState
({
setting
:
{
pointToCard
:
Infinity
}
})
actions
.
updateState
({
setting
:
{
pointToCard
:
Infinity
,
pointToNameCard
:
Infinity
}
})
}
}),
...
...
@@ -168,7 +171,38 @@ const userModel: UserModel = {
actions
.
updateState
({
cardNum
:
0
,
point
:
0
})
return
0
}
}),
accountExchange
:
thunk
(
async
(
actions
,
payload
)
=>
{
try
{
showLoading
({
mask
:
true
,
title
:
'操作中...'
})
const
{
data
}
=
await
accountExchange
(
payload
)
console
.
log
(
data
)
hideLoading
()
}
catch
(
err
)
{
hideLoading
()
showModal
({
title
:
'提示'
,
content
:
err
.
message
,
showCancel
:
false
})
throw
err
}
}),
changeNickName
:
thunk
(
async
(
_
,
payload
)
=>
{
try
{
const
{
data
}
=
await
changeNickName
(
payload
)
console
.
log
(
data
)
}
catch
(
err
)
{
showModal
({
title
:
'提示'
,
content
:
err
.
message
,
showCancel
:
false
})
throw
err
}
}),
}
export
default
userModel
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