shopUserDetail.js
1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import {getUserInfo, save} from '@/api/shop/shopUser'
import {getList} from '@/api/shop/address'
import {getApiUrl} from '@/utils/utils'
export default {
data() {
return {
userInfo: {info:{}},
idUser: '',
apiUrl: getApiUrl(),
addressList:[],
avatarUrl:''
}
},
created() {
this.idUser = this.$route.query.id
this.init()
},
methods: {
init() {
this.fetchData()
},
fetchData() {
if (this.idUser) {
getUserInfo(this.idUser).then(response => {
this.userInfo = response.data
if(this.userInfo.info.avatar!=='') {
this.avatarUrl = this.apiUrl + '/file/getImgStream?idFile=' + this.userInfo.info.avatar
}else{
this.avatarUrl = this.userInfo.info.wechatHeadImgUrl
}
})
getList({
page: 1,
limit: 20, idUser: this.idUser
}).then(response => {
this.addressList = response.data.records
})
}
}
}
}