Files
city-store-transfer/pages/my/edit/edit.vue
2023-11-15 23:16:26 +08:00

67 lines
1.2 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<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>