Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-app-customer-new-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lanbaoming
jiedao-app-customer-new-master
Commits
0aa317a6
Commit
0aa317a6
authored
Aug 08, 2024
by
lizhan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
📝
【TASK-20240808-03】TASK:地址页面增删改逻辑完善
parent
3a078783
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
234 additions
and
81 deletions
+234
-81
address.vue
src/pages/address/address.vue
+58
-14
address_add.vue
src/pages/address_add/address_add.vue
+76
-14
address_edit.vue
src/pages/address_edit/address_edit.vue
+39
-11
index.vue
src/pages/index/index.vue
+4
-0
site.vue
src/pages/site/site.vue
+3
-0
en.js
src/static/lang/en.js
+2
-1
zh.js
src/static/lang/zh.js
+2
-1
index.js
src/store/index.js
+50
-40
No files found.
src/pages/address/address.vue
View file @
0aa317a6
...
@@ -7,13 +7,13 @@
...
@@ -7,13 +7,13 @@
></dHeader>
></dHeader>
<view
class=
"container"
>
<view
class=
"container"
>
<view
class=
"address-list"
>
<view
class=
"address-list"
>
<view
class=
"address-item"
v-for=
"item in
3"
:key=
"item
"
>
<view
class=
"address-item"
v-for=
"item in
addressList"
:key=
"item.id
"
>
<view
class=
"item-header"
>
<view
class=
"item-header"
>
<view
class=
"item-name"
>
张三
</view>
<view
class=
"item-name"
>
{{
item
.
name
}}
</view>
<view
class=
"item-phone"
>
+
86 18888888888
</view>
<view
class=
"item-phone"
>
+
{{
item
.
areaCode
}}
 
{{
item
.
phone
}}
</view>
</view>
</view>
<view
class=
"item-content"
>
<view
class=
"item-content"
>
辽宁省大连市甘井子区广贤路56号星光大道甘井子区广贤路56号星光大道
{{
item
.
address
}}
</view>
</view>
<view
class=
"item-footer"
>
<view
class=
"item-footer"
>
<view
<view
...
@@ -25,18 +25,17 @@
...
@@ -25,18 +25,17 @@
><radio
><radio
class=
"radio"
class=
"radio"
color=
"#ff4d4f"
color=
"#ff4d4f"
value=
"r1"
:checked=
"check == item.id"
:value=
"item + ''"
:value=
"item.name"
:checked=
"check == item"
/>
设为默认地址
</label
/>
设为默认地址
</label
>
>
</view>
</view>
<view
class=
"item-footer-right"
>
<view
class=
"item-footer-right"
>
<view
class=
"right-box"
@
click=
"toEditAddress"
>
<view
class=
"right-box"
@
click=
"toEditAddress
(item.id)
"
>
<image
class=
"item-img"
src=
"../../static/img/edit.png"
></image>
<image
class=
"item-img"
src=
"../../static/img/edit.png"
></image>
编辑
</view
编辑
</view
>
>
<view
class=
"right-box"
>
<view
class=
"right-box"
@
click=
"deleteAddress(item.id)"
>
<image
class=
"item-img"
src=
"../../static/img/delete_pail.png"
></image>
<image
class=
"item-img"
src=
"../../static/img/delete_pail.png"
></image>
删除
</view
删除
</view
>
>
...
@@ -56,23 +55,68 @@ export default {
...
@@ -56,23 +55,68 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
check
:
1
check
:
null
,
addressList
:
[]
}
}
},
},
onShow
()
{
this
.
getAddressList
()
},
methods
:
{
methods
:
{
toAddressAdd
()
{
toAddressAdd
()
{
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
'
/pages/address_add/address_add
'
url
:
'
/pages/address_add/address_add
'
})
})
},
},
toEditAddress
()
{
toEditAddress
(
id
)
{
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
'
/pages/address_edit/address_edit
'
url
:
'
/pages/address_edit/address_edit
?id=
'
+
id
})
})
},
},
// 切换默认地址
// 切换默认地址
bindCheck
(
e
,
item
)
{
async
bindCheck
(
e
,
item
)
{
this
.
check
=
item
this
.
check
=
item
.
id
try
{
await
this
.
$request
.
post
(
'
/app-api/member/user-address/update
'
,
{
...
item
,
isDefault
:
0
})
}
catch
(
err
)
{}
},
// 获取地址列表
async
getAddressList
()
{
try
{
const
id
=
this
.
$store
.
getters
.
id
const
{
code
,
data
}
=
await
this
.
$request
.
get
(
'
/app-api/member/user-address/member/list
'
,
{
id
})
if
(
code
==
0
&&
data
)
{
// console.log(data)
this
.
addressList
=
data
const
i
=
this
.
addressList
.
findIndex
((
item
)
=>
item
.
isDefault
===
0
)
if
(
i
>=
0
)
this
.
check
=
this
.
addressList
[
i
].
id
}
}
catch
(
err
)
{}
},
// 删除地址
async
deleteAddress
(
id
)
{
const
that
=
this
uni
.
showModal
({
title
:
that
.
$lang
.
lang
.
notices
.
notice
,
content
:
that
.
$lang
.
lang
.
notices
.
delAddress
,
success
:
async
(
res
)
=>
{
if
(
res
.
confirm
)
{
try
{
const
{
code
}
=
await
that
.
$request
.
post
(
`/app-api/member/user-address/delete?id=
${
id
}
`
)
if
(
code
==
0
)
{
that
.
getAddressList
()
}
}
catch
(
err
)
{}
}
}
})
}
}
}
}
}
}
...
...
src/pages/address_add/address_add.vue
View file @
0aa317a6
...
@@ -3,18 +3,23 @@
...
@@ -3,18 +3,23 @@
<dHeader
:title=
"$lang.lang.addressInfo.addInfo"
></dHeader>
<dHeader
:title=
"$lang.lang.addressInfo.addInfo"
></dHeader>
<view
class=
"container"
>
<view
class=
"container"
>
<uni-forms
ref=
"form"
:model=
"form"
:label-width=
"80"
:rules=
"rules"
>
<uni-forms
ref=
"form"
:model=
"form"
:label-width=
"80"
:rules=
"rules"
>
<uni-forms-item
:label=
"$lang.lang.addressInfo.consignee"
required
name=
"
consigne
e"
>
<uni-forms-item
:label=
"$lang.lang.addressInfo.consignee"
required
name=
"
nam
e"
>
<uni-easyinput
<uni-easyinput
class=
"input"
class=
"input"
:trim=
"true"
:trim=
"true"
:inputBorder=
"false"
:inputBorder=
"false"
v-model=
"form.
consigne
e"
v-model=
"form.
nam
e"
:placeholder=
"$lang.lang.notices.consignee"
:placeholder=
"$lang.lang.notices.consignee"
/>
/>
</uni-forms-item>
</uni-forms-item>
<uni-forms-item
:label=
"$lang.lang.addressInfo.phone"
required
name=
"phone"
>
<uni-forms-item
:label=
"$lang.lang.addressInfo.phone"
required
name=
"phone"
>
<view
class=
"phone-box"
>
<view
class=
"phone-box"
>
<view
class=
"phone-code"
>
+86
</view>
<picker
:value=
"areaIndex"
:range=
"areaName"
@
change=
"areaChange"
>
<view
class=
"phone-code"
>
+
{{
areaCode
}}
<uni-icons
type=
"down"
class=
"code-icon"
size=
"10"
></uni-icons>
</view>
</picker>
<uni-easyinput
<uni-easyinput
class=
"input"
class=
"input"
:trim=
"true"
:trim=
"true"
...
@@ -28,7 +33,7 @@
...
@@ -28,7 +33,7 @@
class=
"item"
class=
"item"
:label=
"$lang.lang.addressInfo.fullAddress"
:label=
"$lang.lang.addressInfo.fullAddress"
required
required
name=
"
fullA
ddress"
name=
"
a
ddress"
>
>
<view
class=
"textarea-box"
>
<view
class=
"textarea-box"
>
<uni-easyinput
<uni-easyinput
...
@@ -38,7 +43,7 @@
...
@@ -38,7 +43,7 @@
autoHeight
autoHeight
:inputBorder=
"false"
:inputBorder=
"false"
:maxlength=
"100"
:maxlength=
"100"
v-model.trim=
"form.
fullA
ddress"
v-model.trim=
"form.
a
ddress"
:placeholder=
"$lang.lang.notices.fullAddress"
:placeholder=
"$lang.lang.notices.fullAddress"
>
>
</uni-easyinput>
</uni-easyinput>
...
@@ -60,22 +65,31 @@ export default {
...
@@ -60,22 +65,31 @@ export default {
data
()
{
data
()
{
return
{
return
{
form
:
{
form
:
{
consigne
e
:
''
,
nam
e
:
''
,
phone
:
''
,
phone
:
''
,
fullAddress
:
''
address
:
''
}
},
areaCode
:
this
.
$store
.
getters
.
areaCode
,
areaIndex
:
0
,
areaName
:
[]
}
}
},
},
computed
:
{
computed
:
{
rules
()
{
rules
()
{
return
{
return
{
consigne
e
:
{
nam
e
:
{
rules
:
[{
required
:
true
,
errorMessage
:
this
.
$lang
.
lang
.
notices
.
consignee
}]
rules
:
[{
required
:
true
,
errorMessage
:
this
.
$lang
.
lang
.
notices
.
consignee
}]
},
},
phone
:
{
phone
:
{
rules
:
[{
required
:
true
,
errorMessage
:
this
.
$lang
.
lang
.
notices
.
phone
}]
rules
:
[
{
required
:
true
,
errorMessage
:
this
.
$lang
.
lang
.
notices
.
phone
},
{
validateFunction
:
(
rule
,
value
)
=>
/^
\d
+$/
.
test
(
value
),
errorMessage
:
this
.
$lang
.
lang
.
notices
.
nophone
}
]
},
},
fullA
ddress
:
{
a
ddress
:
{
rules
:
[
rules
:
[
{
required
:
true
,
errorMessage
:
this
.
$lang
.
lang
.
notices
.
fullAddress
},
{
required
:
true
,
errorMessage
:
this
.
$lang
.
lang
.
notices
.
fullAddress
},
{
maxLength
:
100
,
errorMessage
:
this
.
$lang
.
lang
.
notices
.
fullAddressLength
}
{
maxLength
:
100
,
errorMessage
:
this
.
$lang
.
lang
.
notices
.
fullAddressLength
}
...
@@ -84,12 +98,55 @@ export default {
...
@@ -84,12 +98,55 @@ export default {
}
}
}
}
},
},
created
()
{
this
.
getCountry
()
},
methods
:
{
methods
:
{
saveAddress
()
{
saveAddress
()
{
// console.log(this.form)
this
.
$refs
.
form
.
validate
().
then
(
async
(
valid
)
=>
{
this
.
$refs
.
form
.
validate
().
then
((
res
)
=>
{
if
(
valid
)
{
console
.
log
(
res
)
try
{
const
params
=
{
...
this
.
form
,
areaCode
:
this
.
areaCode
,
memberId
:
this
.
$store
.
getters
.
id
}
const
{
code
,
data
}
=
await
this
.
$request
.
post
(
'
/app-api/member/user-address/create
'
,
params
)
if
(
code
==
0
)
{
this
.
$router
.
back
()
}
}
catch
(
error
)
{}
}
})
})
},
// 获取国家区号
async
getCountry
()
{
try
{
const
{
code
,
data
}
=
await
this
.
$request
.
get
(
'
/app-api/ecw/country/list-all
'
)
if
(
code
==
0
&&
data
.
length
>
0
)
{
// 查询用户区号下标
const
i
=
data
.
findIndex
((
item
)
=>
{
return
item
.
tel
==
this
.
areaCode
})
if
(
i
>=
0
)
this
.
areaIndex
=
i
data
.
forEach
((
item
)
=>
{
const
str
=
item
.
tel
+
'
'
+
item
.
nameZh
if
(
this
.
$lang
.
locale
==
'
zh
'
)
{
this
.
areaName
.
push
(
str
)
}
else
{
this
.
areaName
.
push
(
str
)
}
})
}
}
catch
(
error
)
{}
},
// 区号选择切换
areaChange
(
e
)
{
this
.
areaIndex
=
e
.
detail
.
value
this
.
areaCode
=
this
.
areaName
[
this
.
areaIndex
].
split
(
'
'
)[
0
]
}
}
}
}
}
}
...
@@ -134,12 +191,17 @@ page {
...
@@ -134,12 +191,17 @@ page {
align-items
:
center
;
align-items
:
center
;
}
}
.phone-code
{
.phone-code
{
display
:
flex
;
align-items
:
center
;
margin-right
:
10
upx
;
margin-right
:
10
upx
;
padding-right
:
10
upx
;
padding-right
:
10
upx
;
border-right
:
1px
solid
#e6e6e6
;
border-right
:
1px
solid
#e6e6e6
;
font-size
:
24
upx
;
font-size
:
24
upx
;
color
:
#000
;
color
:
#000
;
}
}
.code-icon
{
margin-left
:
6
upx
;
}
.btn
{
.btn
{
width
:
100%
;
width
:
100%
;
height
:
80
upx
;
height
:
80
upx
;
...
...
src/pages/address_edit/address_edit.vue
View file @
0aa317a6
...
@@ -3,12 +3,12 @@
...
@@ -3,12 +3,12 @@
<dHeader
:title=
"$lang.lang.addressInfo.editInfo"
></dHeader>
<dHeader
:title=
"$lang.lang.addressInfo.editInfo"
></dHeader>
<view
class=
"container"
>
<view
class=
"container"
>
<uni-forms
ref=
"form"
:model=
"form"
:label-width=
"80"
:rules=
"rules"
>
<uni-forms
ref=
"form"
:model=
"form"
:label-width=
"80"
:rules=
"rules"
>
<uni-forms-item
:label=
"$lang.lang.addressInfo.consignee"
required
name=
"
consigne
e"
>
<uni-forms-item
:label=
"$lang.lang.addressInfo.consignee"
required
name=
"
nam
e"
>
<uni-easyinput
<uni-easyinput
class=
"input"
class=
"input"
:trim=
"true"
:trim=
"true"
:inputBorder=
"false"
:inputBorder=
"false"
v-model=
"form.
consigne
e"
v-model=
"form.
nam
e"
:placeholder=
"$lang.lang.notices.consignee"
:placeholder=
"$lang.lang.notices.consignee"
/>
/>
</uni-forms-item>
</uni-forms-item>
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
class=
"item"
class=
"item"
:label=
"$lang.lang.addressInfo.fullAddress"
:label=
"$lang.lang.addressInfo.fullAddress"
required
required
name=
"
fullA
ddress"
name=
"
a
ddress"
>
>
<view
class=
"textarea-box"
>
<view
class=
"textarea-box"
>
<uni-easyinput
<uni-easyinput
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
autoHeight
autoHeight
:inputBorder=
"false"
:inputBorder=
"false"
:maxlength=
"100"
:maxlength=
"100"
v-model.trim=
"form.
fullA
ddress"
v-model.trim=
"form.
a
ddress"
:placeholder=
"$lang.lang.notices.fullAddress"
:placeholder=
"$lang.lang.notices.fullAddress"
>
>
</uni-easyinput>
</uni-easyinput>
...
@@ -60,22 +60,31 @@ export default {
...
@@ -60,22 +60,31 @@ export default {
data
()
{
data
()
{
return
{
return
{
form
:
{
form
:
{
consigne
e
:
''
,
nam
e
:
''
,
phone
:
''
,
phone
:
''
,
fullA
ddress
:
''
a
ddress
:
''
}
}
}
}
},
},
onLoad
(
route
)
{
this
.
getAddress
(
route
.
id
)
},
computed
:
{
computed
:
{
rules
()
{
rules
()
{
return
{
return
{
consigne
e
:
{
nam
e
:
{
rules
:
[{
required
:
true
,
errorMessage
:
this
.
$lang
.
lang
.
notices
.
consignee
}]
rules
:
[{
required
:
true
,
errorMessage
:
this
.
$lang
.
lang
.
notices
.
consignee
}]
},
},
phone
:
{
phone
:
{
rules
:
[{
required
:
true
,
errorMessage
:
this
.
$lang
.
lang
.
notices
.
phone
}]
rules
:
[
{
required
:
true
,
errorMessage
:
this
.
$lang
.
lang
.
notices
.
phone
},
{
validateFunction
:
(
rule
,
value
)
=>
/^
\d
+$/
.
test
(
value
),
errorMessage
:
this
.
$lang
.
lang
.
notices
.
nophone
}
]
},
},
fullA
ddress
:
{
a
ddress
:
{
rules
:
[
rules
:
[
{
required
:
true
,
errorMessage
:
this
.
$lang
.
lang
.
notices
.
fullAddress
},
{
required
:
true
,
errorMessage
:
this
.
$lang
.
lang
.
notices
.
fullAddress
},
{
maxLength
:
100
,
errorMessage
:
this
.
$lang
.
lang
.
notices
.
fullAddressLength
}
{
maxLength
:
100
,
errorMessage
:
this
.
$lang
.
lang
.
notices
.
fullAddressLength
}
...
@@ -87,9 +96,28 @@ export default {
...
@@ -87,9 +96,28 @@ export default {
methods
:
{
methods
:
{
saveAddress
()
{
saveAddress
()
{
// console.log(this.form)
// console.log(this.form)
this
.
$refs
.
form
.
validate
().
then
((
res
)
=>
{
this
.
$refs
.
form
.
validate
().
then
(
async
(
res
)
=>
{
console
.
log
(
res
)
if
(
res
)
{
try
{
const
{
code
}
=
await
this
.
$request
.
post
(
'
/app-api/member/user-address/update
'
,
this
.
form
)
if
(
code
==
0
)
{
this
.
$router
.
back
()
}
}
catch
(
err
)
{}
}
})
})
},
// 获取地址信息 回显
async
getAddress
(
id
)
{
try
{
const
{
code
,
data
}
=
await
this
.
$request
.
get
(
'
/app-api/member/user-address/get
'
,
{
id
})
if
(
code
==
0
&&
data
)
{
this
.
form
=
data
}
}
catch
(
err
)
{}
}
}
}
}
}
}
...
...
src/pages/index/index.vue
View file @
0aa317a6
...
@@ -381,6 +381,10 @@ export default {
...
@@ -381,6 +381,10 @@ export default {
// #endif
// #endif
}
}
that
.
userInfo
=
res
.
data
that
.
userInfo
=
res
.
data
// 存储信息节点
const
{
id
,
areaCode
}
=
res
.
data
that
.
$store
.
commit
(
'
SET_ID
'
,
id
)
that
.
$store
.
commit
(
'
SET_AREACODE
'
,
areaCode
)
}
}
})
})
},
},
...
...
src/pages/site/site.vue
View file @
0aa317a6
...
@@ -233,6 +233,7 @@
...
@@ -233,6 +233,7 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
storage
from
'
../../utils/storage
'
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
...
@@ -445,6 +446,7 @@ export default {
...
@@ -445,6 +446,7 @@ export default {
},
},
loginOut
()
{
loginOut
()
{
uni
.
removeStorageSync
(
'
Authorization
'
)
uni
.
removeStorageSync
(
'
Authorization
'
)
storage
.
clean
()
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
'
../login/login
'
url
:
'
../login/login
'
})
})
...
@@ -564,6 +566,7 @@ export default {
...
@@ -564,6 +566,7 @@ export default {
if
(
res
.
confirm
)
{
if
(
res
.
confirm
)
{
that
.
$request
.
deleted
(
'
/app-api/member/member/cancellation
'
).
then
((
res
)
=>
{
that
.
$request
.
deleted
(
'
/app-api/member/member/cancellation
'
).
then
((
res
)
=>
{
if
(
res
.
code
==
0
&&
res
.
data
)
{
if
(
res
.
code
==
0
&&
res
.
data
)
{
storage
.
clean
()
uni
.
showToast
({
uni
.
showToast
({
title
:
that
.
$lang
.
lang
.
site
.
offSuccess
,
title
:
that
.
$lang
.
lang
.
site
.
offSuccess
,
icon
:
'
none
'
icon
:
'
none
'
...
...
src/static/lang/en.js
View file @
0aa317a6
...
@@ -134,7 +134,8 @@ export default {
...
@@ -134,7 +134,8 @@ export default {
country
:
'
Please select a country
'
,
country
:
'
Please select a country
'
,
city
:
'
Please select a city
'
,
city
:
'
Please select a city
'
,
fullAddress
:
'
Please enter the detailed address
'
,
fullAddress
:
'
Please enter the detailed address
'
,
fullAddressLength
:
'
Enter up to 100 words
'
fullAddressLength
:
'
Enter up to 100 words
'
,
delAddress
:
'
Are you sure you want to delete the address?
'
},
},
auth
:
{
auth
:
{
auth
:
'
Real-name certification
'
,
auth
:
'
Real-name certification
'
,
...
...
src/static/lang/zh.js
View file @
0aa317a6
...
@@ -133,7 +133,8 @@ export default {
...
@@ -133,7 +133,8 @@ export default {
country
:
'
请选择国家
'
,
country
:
'
请选择国家
'
,
city
:
'
请选择城市
'
,
city
:
'
请选择城市
'
,
fullAddress
:
'
请输入详细地址
'
,
fullAddress
:
'
请输入详细地址
'
,
fullAddressLength
:
'
最多输入100字
'
fullAddressLength
:
'
最多输入100字
'
,
delAddress
:
'
确定删除地址吗?
'
},
},
auth
:
{
auth
:
{
auth
:
'
实名认证
'
,
auth
:
'
实名认证
'
,
...
...
src/store/index.js
View file @
0aa317a6
import
Vue
from
'
vue
'
import
Vue
from
'
vue
'
import
Vuex
from
'
vuex
'
import
Vuex
from
'
vuex
'
import
http
from
'
@/utils/request
'
import
http
from
'
@/utils/request
'
import
user
from
'
./modules/user
'
import
storage
from
'
../utils/storage
'
Vue
.
use
(
Vuex
)
Vue
.
use
(
Vuex
)
let
userInfo
=
null
let
userInfo
=
null
...
@@ -16,13 +17,14 @@ try {
...
@@ -16,13 +17,14 @@ try {
const
store
=
new
Vuex
.
Store
({
const
store
=
new
Vuex
.
Store
({
state
:
{
state
:
{
userInfo
:
userInfo
||
null
,
userInfo
:
userInfo
||
null
,
config
:
null
,
config
:
null
},
},
mutations
:
{
mutations
:
{
logout
(
state
)
{
logout
(
state
)
{
state
.
userInfo
=
null
state
.
userInfo
=
null
uni
.
removeStorageSync
(
'
userInfo
'
);
uni
.
removeStorageSync
(
'
userInfo
'
)
uni
.
removeStorageSync
(
'
token
'
);
uni
.
removeStorageSync
(
'
token
'
)
storage
.
clean
()
// uni.switchTab({
// uni.switchTab({
// url: '/pages/tabbar/user/user.vue'
// url: '/pages/tabbar/user/user.vue'
// })
// })
...
@@ -38,16 +40,24 @@ const store = new Vuex.Store({
...
@@ -38,16 +40,24 @@ const store = new Vuex.Store({
}
}
},
},
actions
:
{
actions
:
{
updateUserInfo
(
{
updateUserInfo
({
commit
})
{
commit
http
})
{
.
get
(
'
/profile
'
)
http
.
get
(
"
/profile
"
).
then
(
res
=>
{
.
then
((
res
)
=>
{
console
.
log
(
'
更新用户信息
'
,
res
)
console
.
log
(
'
更新用户信息
'
,
res
)
commit
(
'
setUser
'
,
res
.
data
)
commit
(
'
setUser
'
,
res
.
data
)
}).
catch
(
res
=>
{
})
console
.
log
(
"
更新用户信息error
"
,
res
)
.
catch
((
res
)
=>
{
console
.
log
(
'
更新用户信息error
'
,
res
)
})
})
}
}
},
getters
:
{
id
:
(
state
)
=>
state
.
user
.
id
,
areaCode
:
(
state
)
=>
state
.
user
.
areaCode
},
modules
:
{
user
}
}
})
})
export
default
store
export
default
store
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