| | |
| | | <!-- 个人资料 --> |
| | | <template> |
| | | <view> 基础 </view> |
| | | <view class="infoBox"> |
| | | <div class="avatarBox"> |
| | | <u-avatar :src="userInfo.avatar" size="114" mode="aspectFill" /> |
| | | </div> |
| | | |
| | | </view> |
| | | <viewclass="detailBox"> |
| | | 111 |
| | | </view> |
| | | </template> |
| | | |
| | | <script setup></script> |
| | | <script setup> |
| | | import { getUserInfo, updateInfo, updatePassword } from '@/api/user/index.js'; |
| | | |
| | | <style lang="scss" scoped></style> |
| | | const userInfo = ref({ |
| | | id: '', |
| | | avatar: '', |
| | | realName: '', |
| | | name: '', |
| | | phone: '', |
| | | email: '', |
| | | deptName: '', |
| | | }); |
| | | const getUserInfoData = () => { |
| | | getUserInfo().then(res => { |
| | | const user = res.data.data; |
| | | |
| | | userInfo.value = { |
| | | id: user.id, |
| | | avatar: user.avatar, |
| | | name: user.name, |
| | | realName: user.realName, |
| | | phone: user.phone, |
| | | email: user.email, |
| | | deptName: user.deptName, |
| | | }; |
| | | console.log('用户信息',userInfo.value) |
| | | }); |
| | | }; |
| | | onShow(async () => { |
| | | getUserInfoData() |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .infoBox { |
| | | width: 100%; |
| | | height: 298px; |
| | | background: url('/src/static/images/user/userBg.svg') no-repeat center; |
| | | background-size: 100% 100%; |
| | | display: flex; |
| | | justify-content: center; |
| | | |
| | | .avatarBox { |
| | | width: 114px; |
| | | height: 114px; |
| | | margin: 38px 0; |
| | | |
| | | } |
| | | |
| | | } |
| | | .detailBox { |
| | | width: 351px; |
| | | height: 215px; |
| | | background: #FFFFFF; |
| | | border-radius: 6px 6px 6px 6px; |
| | | } |
| | | </style> |