邓洁 : 修改个人信息接口对接
This commit is contained in:
@@ -7,8 +7,10 @@
|
||||
<u-avatar :src="src"></u-avatar>
|
||||
</view>
|
||||
<view class="username">{{username}}</view>
|
||||
<view class="account">账号:{{account}} <u-icon name="edit-pen" class="edit-icon" size="20" @click="toEdit"></u-icon></view>
|
||||
|
||||
<view class="account">账号:{{account}}
|
||||
<u-icon name="edit-pen" class="edit-icon" size="20" color="#fff" @click="toEdit"></u-icon>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="publish">
|
||||
<u-cell-group>
|
||||
@@ -43,8 +45,8 @@
|
||||
data() {
|
||||
return {
|
||||
src: 'https://cdn.uviewui.com/uview/album/2.jpg',
|
||||
account: '',
|
||||
username: '',
|
||||
account: '123',
|
||||
username: '用户名',
|
||||
isLoad: true
|
||||
}
|
||||
},
|
||||
@@ -54,8 +56,9 @@
|
||||
return
|
||||
}
|
||||
this.isLoad = true
|
||||
this.$data.account = wx.getStorageSync('account')
|
||||
this.$data.username = wx.getStorageSync('nickname')
|
||||
// this.$data.account = wx.getStorageSync('account')
|
||||
// this.$data.username = wx.getStorageSync('nickname')
|
||||
this.getInfo()
|
||||
},
|
||||
methods: {
|
||||
reOnLoad() {
|
||||
@@ -86,17 +89,22 @@
|
||||
url: '/pages/Partnerships/Partnerships'
|
||||
})
|
||||
},
|
||||
toEdit(){
|
||||
toEdit() {
|
||||
uni.navigateTo({
|
||||
url:'/pages/my/edit/edit'
|
||||
url: '/pages/my/edit/edit'
|
||||
})
|
||||
},
|
||||
//---------页面调用接口示例------------
|
||||
getInfo() {
|
||||
this.$api.getUser().then(res => {
|
||||
console.log('userInfo', res);
|
||||
var data = res.data.data
|
||||
if (data) {
|
||||
this.src = uni.getStorageSync('img_url') + data.avatar
|
||||
this.username = data.nickname
|
||||
}
|
||||
})
|
||||
}
|
||||
//---------页面调用接口示例------------
|
||||
// getInfo() {
|
||||
// this.$api.getUserInfo().then(res => {
|
||||
// console.log('userInfo', res);
|
||||
// })
|
||||
// }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -134,9 +142,8 @@
|
||||
font-weight: 1rpx;
|
||||
display: flex;
|
||||
}
|
||||
.edit-icon{
|
||||
|
||||
}
|
||||
|
||||
.edit-icon {}
|
||||
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user