person.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template>
  2. <view class="u-flex f-d-c u-col-center u-relative person-config" style="overflow: hidden;">
  3. <view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30 u-col-top">
  4. <view class="u-flex u-m-t-30">
  5. <view class="u-m-r-10 ">
  6. <u-avatar mode="circle" size="110"></u-avatar>
  7. </view>
  8. <view v-if="user != null" class="u-flex-1">
  9. <view class="u-font-18 u-p-b-10 rigt-font u-font-32">{{user.username}}</view>
  10. <view class=" rigt-font u-font-24">部门:{{user.deptName}}</view>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="u-m-t-20 meu-list u-relative">
  15. <u-cell-group>
  16. <navigator hover-class="none" :url="index.url" v-for="(index,key) in obj" :key="key">
  17. <u-cell-item :title="index.title" :icon-style="{color:'#000000'}"
  18. :title-style="{margin:'0rpx 0rpx 0rpx 14rpx',fontSize:'32rpx',color:'#000000'}" :icon-size='50'>
  19. <u-icon slot="icon" size="50" :name="index.img"></u-icon>
  20. </u-cell-item>
  21. </navigator>
  22. </u-cell-group>
  23. </view>
  24. <u-tabbar v-if="tabbar" :before-switch="beforeSwitch" :height="tabheight" :list="tabbar" :mid-button="true">
  25. </u-tabbar>
  26. </view>
  27. </template>
  28. <script>
  29. import {
  30. mapState
  31. } from 'vuex'
  32. import pwd from '@/static/img/person/pwd.png'
  33. import td from '@/static/img/person/td.png'
  34. import qh from '@/static/img/person/qh.png'
  35. export default {
  36. data() {
  37. return {
  38. ifOnShow:false,
  39. user: null,
  40. obj: [
  41. {
  42. title: "我的团队",
  43. icon: 'man-add-fill',
  44. url: '/pages/myteam/myteam',
  45. img: td,
  46. }, {
  47. title: "修改密码",
  48. icon: 'lock-fill',
  49. url: '/pages/login/forgetpwd/index',
  50. img: pwd
  51. }, {
  52. title: "切换账户",
  53. icon: 'coupon',
  54. url: '/pages/login/login/index',
  55. img: qh
  56. }
  57. ],
  58. tabheight: 0
  59. }
  60. },
  61. computed: {
  62. ...mapState({
  63. tabbar: state => state.tabbar.tabbar
  64. })
  65. },
  66. onHide(){
  67. this.ifOnShow=true
  68. },
  69. onShow(){
  70. if(this.ifOnShow){
  71. this.user = uni.getStorageSync("user")
  72. this.tabheight = getApp().globalData.tabhei
  73. }
  74. },
  75. onShow() {
  76. this.user = uni.getStorageSync("user")
  77. this.tabheight = getApp().globalData.tabhei
  78. },
  79. methods: {
  80. beforeSwitch(id) {
  81. if (id == 1) {
  82. this.$store.dispatch("user/gettasklist");
  83. return false
  84. } else {
  85. return true
  86. }
  87. },
  88. }
  89. }
  90. </script>
  91. <style lang="scss">
  92. page {
  93. background-color: #ededed;
  94. overflow: hidden;
  95. }
  96. .person-config {
  97. overflow: hidden;
  98. }
  99. .rigt-font {
  100. color: #FFFFFF;
  101. }
  102. .camera {
  103. width: 54px;
  104. height: 44px;
  105. &:active {
  106. background-color: #ededed;
  107. }
  108. }
  109. .user-box {
  110. width: 751rpx;
  111. height: 300rpx;
  112. position: relative;
  113. z-index: -1;
  114. &::after {
  115. content: '';
  116. width: 140%;
  117. height: 350rpx;
  118. position: absolute;
  119. left: -20%;
  120. top: 0;
  121. z-index: -1;
  122. border-radius: 0 0 45% 45%;
  123. background: #4A8BFF;
  124. }
  125. }
  126. .meu-list {
  127. width: 690rpx;
  128. top: -100rpx;
  129. height: 100vh;
  130. background: #FFFFFF;
  131. }
  132. </style>