index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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 class="function-item" @click="handleButtonClick5">
  46. <image :src="waitWork" class="icon"></image>
  47. <text class="title">打卡</text>
  48. <text class="desc">></text>
  49. </view>
  50. </view>
  51. </view>
  52. </template>
  53. <script setup>
  54. import {
  55. ref,
  56. reactive,
  57. onMounted
  58. } from 'vue';
  59. import headImg from "/static/images/mine/headImg.jpg"
  60. import setting from "/static/images/mine/setting.png"
  61. import checkIn from "/static/images/mine/checkIn.png"
  62. import waitWork from "/static/images/mine/waitWork.png"
  63. import messageEdit from "/static/images/mine/edit.png"
  64. import $tab from "../../plugins/tab.js"
  65. const userInfo = reactive({
  66. id: '123',
  67. name: '张三',
  68. department: [{
  69. value: 0,
  70. text: "研发部",
  71. position: '软件开发工程师'
  72. },
  73. {
  74. value: 1,
  75. text: "业务部",
  76. position: '销售经理'
  77. },
  78. ],
  79. });
  80. const value = ref(0);
  81. function changeS1(e) {
  82. //部门切换事件
  83. console.log(e)
  84. };
  85. function lookMsg() {
  86. $tab.navigateTo('/pages/mine/personal_message/personal_message')
  87. };
  88. function handleButtonClick1() {
  89. $tab.navigateTo('/pages/mine/edit/edit')
  90. };
  91. function handleButtonClick2(){
  92. $tab.navigateTo('/pages/mine/waitWork/waitWork')
  93. }
  94. function handleButtonClick3(){
  95. $tab.navigateTo('/pages/mine/checkIn/checkIn')
  96. }
  97. function handleButtonClick4() {
  98. $tab.navigateTo('/pages/mine/setting/setting')
  99. };
  100. function handleButtonClick5() {
  101. $tab.navigateTo('/pages/mine/clockIn/clockIn')
  102. };
  103. </script>
  104. <style lang="scss">
  105. .content {
  106. display: flex;
  107. flex-direction: column;
  108. }
  109. //样式穿透
  110. ::v-deep .uni-select__selector-item text,.uni-select__input-text {
  111. font-size: larger;
  112. }
  113. .user-info {
  114. display: flex;
  115. align-items: center;
  116. padding: 20rpx;
  117. border-bottom: 1rpx solid #ddd;
  118. }
  119. .avatar {
  120. width: 120rpx;
  121. height: 120rpx;
  122. margin-right: 20rpx;
  123. border-radius: 50%;
  124. }
  125. .info-detail {
  126. flex-grow: 1;
  127. }
  128. .function-list {
  129. margin-bottom: 60rpx;
  130. }
  131. .function-item {
  132. display: flex;
  133. align-items: center;
  134. justify-content: space-between;
  135. padding: 20rpx;
  136. background-color: #f5f5f5;
  137. border-radius: 10rpx;
  138. margin-bottom: 20rpx;
  139. border-bottom: 1px solid gainsboro;
  140. }
  141. .icon {
  142. width: 50rpx;
  143. height: 50rpx;
  144. margin-right: 20rpx;
  145. }
  146. .title {
  147. flex-grow: 1;
  148. font-size: 32rpx;
  149. }
  150. .desc {
  151. color: #999;
  152. margin-right: 20rpx;
  153. }
  154. .select1 {
  155. display: inline-block;
  156. width: 50%;
  157. }
  158. </style>