index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <view class="content">
  3. <!-- 用户信息部分 -->
  4. <view class="user-info">
  5. <image :src="headImg" class="avatar"></image>
  6. <view class="info-detail">
  7. <view>
  8. <text>{{ userInfo.name}}</text>
  9. </view>
  10. <view>
  11. <text>ID: {{ userInfo.id }}</text>
  12. </view>
  13. <view>部门:
  14. <uni-data-select v-model="value" :localdata="userInfo.department" @change="changeS1" :clear="false"
  15. class="select1"></uni-data-select>
  16. </view>
  17. <view>
  18. <text> 职务: {{ userInfo.department[value].position }}</text>
  19. </view>
  20. </view>
  21. <uni-icons @click="lookMsg()" type="forward" size="50" style="margin-right: 30rpx;"></uni-icons>
  22. </view>
  23. <!-- 功能按钮区 -->
  24. <view class="function-list">
  25. <view class="function-item" @click="handleButtonClick1">
  26. <image :src="messageEdit" class="icon"></image>
  27. <text class="title">编辑资料</text>
  28. <text class="desc">></text>
  29. </view>
  30. <view class="function-item" @click="handleButtonClick2">
  31. <image :src="waitWork" class="icon"></image>
  32. <text class="title">待办事项</text>
  33. <text class="desc">></text>
  34. </view>
  35. <view class="function-item" @click="handleButtonClick3">
  36. <image :src="checkIn" class="icon"></image>
  37. <text class="title">我的考勤</text>
  38. <text class="desc">></text>
  39. </view>
  40. <view class="function-item" @click="handleButtonClick4">
  41. <image :src="setting" class="icon"></image>
  42. <text class="title">应用设置</text>
  43. <text class="desc">></text>
  44. </view>
  45. </view>
  46. </view>
  47. </template>
  48. <script setup>
  49. import {
  50. ref,
  51. reactive,
  52. onMounted
  53. } from 'vue';
  54. import headImg from "/static/images/mine/headImg.jpg"
  55. import setting from "/static/images/mine/setting.png"
  56. import checkIn from "/static/images/mine/checkIn.png"
  57. import waitWork from "/static/images/mine/waitWork.png"
  58. import messageEdit from "/static/images/mine/edit.png"
  59. import $tab from "../../plugins/tab.js"
  60. const userInfo = reactive({
  61. id: '123',
  62. name: '张三',
  63. department: [{
  64. value: 0,
  65. text: "研发部",
  66. position: '软件开发工程师'
  67. },
  68. {
  69. value: 1,
  70. text: "业务部",
  71. position: '销售经理'
  72. },
  73. ],
  74. });
  75. const value = ref(0);
  76. function changeS1(e) {
  77. //部门切换事件
  78. console.log(e)
  79. };
  80. function lookMsg() {
  81. $tab.navigateTo('/pages/mine/personal_message/personal_message')
  82. };
  83. function handleButtonClick1() {
  84. $tab.navigateTo('/pages/mine/edit/edit')
  85. };
  86. function handleButtonClick2(){
  87. $tab.navigateTo('/pages/mine/test/test')
  88. }
  89. function handleButtonClick3(){
  90. $tab.navigateTo('/pages/mine/checkIn/checkIn')
  91. }
  92. function handleButtonClick4() {
  93. $tab.navigateTo('/pages/mine/setting/setting')
  94. };
  95. </script>
  96. <style lang="scss">
  97. .content {
  98. display: flex;
  99. flex-direction: column;
  100. }
  101. //样式穿透
  102. ::v-deep .uni-select__selector-item text,.uni-select__input-text {
  103. font-size: larger;
  104. }
  105. .user-info {
  106. display: flex;
  107. align-items: center;
  108. padding: 20rpx;
  109. border-bottom: 1rpx solid #ddd;
  110. }
  111. .avatar {
  112. width: 120rpx;
  113. height: 120rpx;
  114. margin-right: 20rpx;
  115. border-radius: 50%;
  116. }
  117. .info-detail {
  118. flex-grow: 1;
  119. }
  120. .function-list {
  121. margin-bottom: 60rpx;
  122. }
  123. .function-item {
  124. display: flex;
  125. align-items: center;
  126. justify-content: space-between;
  127. padding: 20rpx;
  128. background-color: #f5f5f5;
  129. border-radius: 10rpx;
  130. margin-bottom: 20rpx;
  131. border-bottom: 1px solid gainsboro;
  132. }
  133. .icon {
  134. width: 50rpx;
  135. height: 50rpx;
  136. margin-right: 20rpx;
  137. }
  138. .title {
  139. flex-grow: 1;
  140. font-size: 32rpx;
  141. }
  142. .desc {
  143. color: #999;
  144. margin-right: 20rpx;
  145. }
  146. .select1 {
  147. display: inline-block;
  148. width: 50%;
  149. }
  150. </style>