YNUtdPlatform/pages/YNEduApp/user/editProfile.vue

97 lines
2.0 KiB
Vue

<template>
<view class="page">
<u-cell-group
style="width: 100%;
margin: 15rpx auto;
background-color: #fff;
box-sizing: border-box;
padding: 10rpx 20rpx;
box-shadow: #EFEFEF 2px 2px;
border-radius: 15rpx"
:border="false"
>
<u-cell
title="头像"
:isLink="true"
:border="false"
style="border-bottom: 1px solid #E9E9E9"
@click="handleAvatar"
>
<image
:src="infos.avatar"
slot="value"
style="width: 5vh; height: 5vh; border-radius: 50%"
></image>
</u-cell>
<u-cell
title="姓名"
:isLink="true"
:border="false"
>
<span slot="value">{{ infos.username }}</span>
</u-cell>
</u-cell-group>
<u-cell-group
style="width: 100%;
margin: 15rpx auto;
background-color: #fff;
box-sizing: border-box;
padding: 10rpx 20rpx;
box-shadow: #EFEFEF 2px 2px;
border-radius: 15rpx"
:border="false"
>
<u-cell
title="工作单位"
:isLink="true"
:border="false"
>
<span slot="value">{{ infos.unit }}</span>
</u-cell>
</u-cell-group>
</view>
</template>
<script>
export default {
data() {
return {
infos: {
avatar: '',
username: '',
unit: ''
}
}
},
onLoad(opt) {
console.log('🚀 ~ onLoad')
opt = JSON.parse(opt.params)
this.infos.username = opt.userName
this.infos.unit = opt.className
this.infos.avatar = uni.getStorageSync('facePath')
},
methods: {
// 点击头像
handleAvatar() {
uni.navigateTo({
url: '/pages/YNEduApp/user/faceScan'
})
}
}
}
</script>
<style lang="scss">
.page{
width: 100vw;
height: 100vh;
background-color: #F8F8F8;
box-sizing: border-box;
padding: 5vw;
}
</style>