梁航:个人信息动态展示
This commit is contained in:
11
pages.json
11
pages.json
@@ -163,7 +163,16 @@
|
|||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
,{
|
||||||
|
"path" : "pages/my/edit/edit",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText": "修改个人信息",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
],
|
||||||
"tabBar": {
|
"tabBar": {
|
||||||
"color": "#CCCCCC",
|
"color": "#CCCCCC",
|
||||||
"borderStyle": "white",
|
"borderStyle": "white",
|
||||||
|
|||||||
66
pages/my/edit/edit.vue
Normal file
66
pages/my/edit/edit.vue
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="avatar">
|
||||||
|
<u-avatar @click="changeAvatar()" :src="avatar"></u-avatar>
|
||||||
|
</view>
|
||||||
|
<view class="name-edit">
|
||||||
|
<text>用户名:</text>
|
||||||
|
<u-input border="surround" v-model="username"></u-input>
|
||||||
|
</view>
|
||||||
|
<view class="send">
|
||||||
|
<u-button @click="editInfo" color="linear-gradient(to right, #E86262, #CC3333)">提交</u-button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
username:'',
|
||||||
|
avatar:''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
changeAvatar(){
|
||||||
|
// uni.uploadFile()
|
||||||
|
console.log(111);
|
||||||
|
},
|
||||||
|
editInfo(){
|
||||||
|
this.$api.editPersonInfo({
|
||||||
|
nickname:this.$data.nickname,
|
||||||
|
avatar:this.$data.avatar,
|
||||||
|
Headers:wx.getStorageSync('token')
|
||||||
|
}).then(res => {
|
||||||
|
console.log(res);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
let that = this
|
||||||
|
this.$data.username = wx.getStorageSync('nickname')
|
||||||
|
this.$data.avatar = wx.getStorageSync('avatar')
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.avatar{
|
||||||
|
width: 100%;
|
||||||
|
height: 200rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.name-edit{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.send{
|
||||||
|
width: 50%;
|
||||||
|
transform: translateX(50%) translateY(50%);
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -7,7 +7,8 @@
|
|||||||
<u-avatar :src="src"></u-avatar>
|
<u-avatar :src="src"></u-avatar>
|
||||||
</view>
|
</view>
|
||||||
<view class="username">{{username}}</view>
|
<view class="username">{{username}}</view>
|
||||||
<view class="account">账号:{{account}}</view>
|
<view class="account">账号:{{account}} <u-icon name="edit-pen" class="edit-icon" size="20" @click="toEdit"></u-icon></view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="publish">
|
<view class="publish">
|
||||||
<u-cell-group>
|
<u-cell-group>
|
||||||
@@ -42,8 +43,8 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
src: 'https://cdn.uviewui.com/uview/album/2.jpg',
|
src: 'https://cdn.uviewui.com/uview/album/2.jpg',
|
||||||
account: '123456',
|
account: '',
|
||||||
username: '用户名',
|
username: '',
|
||||||
isLoad: true
|
isLoad: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -53,6 +54,8 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.isLoad = true
|
this.isLoad = true
|
||||||
|
this.$data.account = wx.getStorageSync('account')
|
||||||
|
this.$data.username = wx.getStorageSync('nickname')
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
reOnLoad() {
|
reOnLoad() {
|
||||||
@@ -83,7 +86,17 @@
|
|||||||
url: '/pages/Partnerships/Partnerships'
|
url: '/pages/Partnerships/Partnerships'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
toEdit(){
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/my/edit/edit'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//---------页面调用接口示例------------
|
||||||
|
// getInfo() {
|
||||||
|
// this.$api.getUserInfo().then(res => {
|
||||||
|
// console.log('userInfo', res);
|
||||||
|
// })
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -119,6 +132,10 @@
|
|||||||
.account {
|
.account {
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
font-weight: 1rpx;
|
font-weight: 1rpx;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.edit-icon{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,6 +213,12 @@ const apiService = {
|
|||||||
resolve(service.get(url))
|
resolve(service.get(url))
|
||||||
>>>>>>> remotes/origin/master
|
>>>>>>> remotes/origin/master
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
editPersonInfo(data){
|
||||||
|
const url = `/center/userupdate`
|
||||||
|
return new Promise((resolve,reject) => {
|
||||||
|
resolve(service.post(url,data))
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export {
|
export {
|
||||||
|
|||||||
Reference in New Issue
Block a user