personal_message.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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" v-for="(item,index) in userInfo.department">
  8. {{ item.departmentName }}--{{item.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. department: [{
  52. value: 0,
  53. departmentName: "研发部",
  54. position: '软件开发工程师'
  55. },
  56. {
  57. value: 1,
  58. departmentName: "业务部",
  59. position: '销售经理'
  60. },
  61. ],
  62. phone: "",
  63. email: "",
  64. gender: "男",
  65. birthday: "2000-01-10"
  66. });
  67. </script>
  68. <style lang="scss" scoped>
  69. .container {
  70. padding: 20px;
  71. background-color: #f8f8f8;
  72. height: 100vh;
  73. box-sizing: border-box;
  74. }
  75. .avatar {
  76. width: 80px;
  77. height: 80px;
  78. border-radius: 50%;
  79. margin-bottom: 15px;
  80. display: block;
  81. margin-left: auto;
  82. margin-right: auto;
  83. }
  84. .username {
  85. font-size: 18px;
  86. }
  87. .position {
  88. font-size: 14px;
  89. color: #666;
  90. margin: 10px auto;
  91. }
  92. .contact-info,
  93. .personal-info {
  94. background-color: #fff;
  95. border-radius: 8px;
  96. overflow: hidden;
  97. margin-bottom: 15px;
  98. }
  99. .info-item {
  100. padding: 12px 16px;
  101. border-top: 1px solid #eee;
  102. font-size: 16px;
  103. display: flex;
  104. justify-content: space-between;
  105. align-items: center;
  106. }
  107. .lastText {
  108. color: #999;
  109. }
  110. </style>