personal_message.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <view class="container">
  3. <!-- 用户头像 -->
  4. <image :src="headImg" class="avatar"></image>
  5. <!-- 用户名及职位 -->
  6. <text class="username">{{ userInfo.name }}</text>
  7. <view class="position">
  8. {{ userInfo.position }}
  9. </view>
  10. <!-- 联系方式 -->
  11. <view class="contact-info">
  12. <view class="info-item">
  13. <view>
  14. <uni-icons type="phone" size="20"></uni-icons>
  15. <text>手机</text>
  16. </view>
  17. <text class="lastText">{{ userInfo.phone || '暂无' }}</text>
  18. </view>
  19. <view class="info-item">
  20. <view>
  21. <uni-icons type="email" size="20"></uni-icons>
  22. <text>邮箱</text>
  23. </view>
  24. <text class="lastText">{{ userInfo.email || '暂无' }}</text>
  25. </view>
  26. </view>
  27. <!-- 个人信息 -->
  28. <view class="personal-info">
  29. <view class="info-item">
  30. <view>
  31. <uni-icons type="person" size="20"></uni-icons>
  32. <text>性别</text>
  33. </view>
  34. <text class="lastText">{{ userInfo.gender || '暂无' }}</text>
  35. </view>
  36. <view class="info-item">
  37. <view>
  38. <uni-icons type="star" size="20"></uni-icons>
  39. <text>生日</text>
  40. </view>
  41. <text class="lastText">{{ userInfo.birthday || '暂无' }}</text>
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <script setup>
  47. import { reactive } from 'vue';
  48. import headImg from "/static/images/mine/headImg.jpg";
  49. const userInfo=reactive({
  50. name: "张三",
  51. position: "研发部-软件开发工程师",
  52. phone: "",
  53. email: "",
  54. gender: "男",
  55. birthday: "2000-01-10"
  56. });
  57. </script>
  58. <style lang="scss" scoped>
  59. .container {
  60. padding: 20px;
  61. background-color: #f8f8f8;
  62. height: 100vh;
  63. box-sizing: border-box;
  64. }
  65. .avatar {
  66. width: 80px;
  67. height: 80px;
  68. border-radius: 50%;
  69. margin-bottom: 15px;
  70. display: block;
  71. margin-left: auto;
  72. margin-right: auto;
  73. }
  74. .username {
  75. font-size: 18px;
  76. }
  77. .position {
  78. font-size: 14px;
  79. color: #666;
  80. margin: 10px auto;
  81. }
  82. .contact-info,
  83. .personal-info {
  84. background-color: #fff;
  85. border-radius: 8px;
  86. overflow: hidden;
  87. margin-bottom: 15px;
  88. }
  89. .info-item {
  90. padding: 12px 16px;
  91. border-top: 1px solid #eee;
  92. font-size: 16px;
  93. display: flex;
  94. justify-content: space-between;
  95. align-items: center;
  96. }
  97. .lastText {
  98. color: #999;
  99. }
  100. </style>