personalCenter.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <view class="container">
  3. <view class="topBox">
  4. <u-navbar title="个人中心" :autoBack="false" leftIcon="" titleStyle="color:#ffffff">
  5. </u-navbar>
  6. <view class="userInfo">
  7. <image :src="userInfo.user.avatar||'/static/profile.jpg'" mode=""></image>
  8. <view>{{userInfo.user.nickName}}</view>
  9. </view>
  10. </view>
  11. <view class="list">
  12. <view class="item">
  13. <view class="item_l">
  14. <view class="item_l_icon" style="background: #AD5825;">
  15. <image src="/static/img/dept.png" mode=""></image>
  16. </view>
  17. <view class="item_l_title">所属部门</view>
  18. </view>
  19. <view class="item_r">{{userInfo.user.dept.deptName}} / {{userInfo.roleGroup}}</view>
  20. </view>
  21. <view class="item">
  22. <view class="item_l">
  23. <view class="item_l_icon" style="background: #FF9D34;">
  24. <image src="/static/img/phone.png" mode=""></image>
  25. </view>
  26. <view class="item_l_title">手机号</view>
  27. </view>
  28. <view class="item_r">{{userInfo.user.phonenumber}}</view>
  29. </view>
  30. <view class="item" @click="goDetail('pages/personalCenter/myFavorite')">
  31. <view class="item_l">
  32. <view class="item_l_icon" style="background: #E67B00;">
  33. <image src="/static/img/collect.png" mode=""></image>
  34. </view>
  35. <view class="item_l_title">我的收藏</view>
  36. </view>
  37. <view class="item_r"></view>
  38. </view>
  39. <view class="item" @click="goDetail('pages/personalCenter/trail')">
  40. <view class="item_l">
  41. <view class="item_l_icon" style="background: #E67300;">
  42. <image src="/static/img/browse.png" mode=""></image>
  43. </view>
  44. <view class="item_l_title">浏览记录</view>
  45. </view>
  46. <view class="item_r"></view>
  47. </view>
  48. </view>
  49. </view>
  50. </template>
  51. <script>
  52. import {
  53. userInfo
  54. } from "@/api/index.js"
  55. export default {
  56. data() {
  57. return {
  58. userInfo:{
  59. user:{
  60. dept:{}
  61. }
  62. }
  63. }
  64. },
  65. onShow(){
  66. this.getUserInfo()
  67. },
  68. methods: {
  69. goDetail(path) {
  70. uni.$u.route(path)
  71. },
  72. getUserInfo(){
  73. userInfo().then(res=>{
  74. this.userInfo=res.data
  75. })
  76. }
  77. }
  78. }
  79. </script>
  80. <style lang="scss">
  81. .topBox {
  82. width: 100vw;
  83. height: 430rpx;
  84. background: linear-gradient(103deg, #e83a27, #a42517 86%);
  85. .userInfo {
  86. text-align: center;
  87. color: #FFFFFF;
  88. margin-top: 110rpx;
  89. image {
  90. width: 126rpx;
  91. height: 126rpx;
  92. border-radius: 50%;
  93. }
  94. }
  95. }
  96. /deep/ .u-navbar__content {
  97. background: transparent !important;
  98. }
  99. .list {
  100. min-height: 50vh;
  101. background: url('../../static/img/myBg.png');
  102. background-size: cover;
  103. position: relative;
  104. top: -50rpx;
  105. padding: 100rpx 60rpx 0;
  106. .item {
  107. display: flex;
  108. justify-content: space-between;
  109. align-items: center;
  110. padding: 20rpx 0;
  111. border-bottom: 1rpx solid rgba(230, 230, 230, 0.6);
  112. .item_l {
  113. display: flex;
  114. align-items: center;
  115. font-size: 28rpx;
  116. color: #1A1A1A;
  117. .item_l_icon {
  118. width: 57rpx;
  119. height: 57rpx;
  120. border-radius: 50%;
  121. text-align: center;
  122. line-height: 70rpx;
  123. margin-right: 25rpx;
  124. image {
  125. width: 36rpx;
  126. height: 36rpx;
  127. }
  128. }
  129. .item_l_title {}
  130. }
  131. .item_r {
  132. font-size: 28rpx;
  133. color: #808080;
  134. }
  135. }
  136. }
  137. </style>