index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <view class="content">
  3. <view class="user-info">
  4. <view class="user-data">
  5. <view class="user-name">{{userData.nickName}}</view>
  6. <view class="user-phone">{{userData.phone}}</view>
  7. </view>
  8. <view class="user-img">
  9. <u-avatar :src="userData.headImage" size="160"></u-avatar>
  10. </view>
  11. </view>
  12. <view class="user-handle" v-for="(item, index) in handleList" :key="index" @click="goToHandle(item)">
  13. <view class="handle-icon">
  14. <u-image :src="item.icon" mode="aspectFit" width="28px" height="28px"></u-image>
  15. </view>
  16. <view class="handle-label">{{item.label}}</view>
  17. <view class="handle-arrow">
  18. <u-icon name="arrow-right" color="#cccccc" size="32"></u-icon>
  19. </view>
  20. </view>
  21. <u-top-tips ref="uTips"></u-top-tips>
  22. </view>
  23. </template>
  24. <script>
  25. const NET = require('@/utils/request')
  26. const API = require('@/config/api')
  27. export default {
  28. data() {
  29. return {
  30. userData: {
  31. headImage: '',
  32. userId: '',
  33. nickName: '',
  34. userName: '',
  35. phone: '',
  36. },
  37. handleList: [{
  38. label: '我的评价',
  39. path: 'evaluateList',
  40. icon: API.getServerImg + 'pingjia.png'
  41. },
  42. {
  43. label: '补课记录',
  44. path: 'extraLessonsList',
  45. icon: API.getServerImg + 'dingdanguanli.png'
  46. },
  47. {
  48. label: '请假记录',
  49. path: 'leaveLessonsList',
  50. icon: API.getServerImg + 'qingjia.png'
  51. },
  52. {
  53. label: '续费率/签到率排行',
  54. path: 'ratioRank',
  55. icon: API.getServerImg + 'paihang.png'
  56. },
  57. {
  58. label: '续费提醒',
  59. path: 'renewList',
  60. icon: API.getServerImg + 'xufeitixing.png'
  61. },
  62. {
  63. label: '签到提醒',
  64. path: 'signList',
  65. icon: API.getServerImg + 'xiaoxi.png'
  66. },
  67. {
  68. label: '退出登录',
  69. path: 'logout',
  70. icon: API.getServerImg + 'xiaoxi.png'
  71. },
  72. ]
  73. }
  74. },
  75. onLoad() {
  76. if (uni.getStorageSync('userData')) {
  77. this.userData = uni.getStorageSync('userData')
  78. }
  79. },
  80. methods: {
  81. // 跳转我的各列表界面
  82. goToHandle(site) {
  83. if(site.path == 'logout'){
  84. uni.removeStorageSync('token')
  85. uni.navigateTo({
  86. url: '/pages/login/index'
  87. });
  88. }else{
  89. uni.navigateTo({
  90. url: '/pagesMain/' + site.path
  91. });
  92. }
  93. },
  94. }
  95. }
  96. </script>
  97. <style lang='scss'>
  98. @import "@/static/css/themes.scss";
  99. .content {
  100. width: 100%;
  101. height: 100vh;
  102. float: left;
  103. .user-info {
  104. width: 100%;
  105. height: 110px;
  106. margin-bottom: 20px;
  107. float: left;
  108. background-color: $mainColor;
  109. .user-data {
  110. width: calc(100% - 110px);
  111. height: 110px;
  112. padding: 15px 0 15px 15px;
  113. float: left;
  114. .user-name {
  115. width: 100%;
  116. float: left;
  117. font-size: 24px;
  118. color: #FFFFFF;
  119. line-height: 30px;
  120. margin: 10px 0;
  121. white-space: nowrap;
  122. overflow: hidden;
  123. text-overflow: ellipsis;
  124. }
  125. .user-phone {
  126. width: 100%;
  127. color: #FFFFFF;
  128. line-height: 20px;
  129. float: left;
  130. white-space: nowrap;
  131. overflow: hidden;
  132. text-overflow: ellipsis;
  133. }
  134. }
  135. .user-img {
  136. width: 110px;
  137. height: 110px;
  138. padding: 15px;
  139. float: left;
  140. display: flex;
  141. align-items: center;
  142. justify-content: center;
  143. }
  144. }
  145. .user-handle {
  146. width: 100vw;
  147. height: 40px;
  148. float: left;
  149. padding: 0 15px;
  150. margin-bottom: 10px;
  151. display: flex;
  152. align-items: center;
  153. .handle-icon {
  154. width: 40px;
  155. height: 40px;
  156. text-align: center;
  157. line-height: 40px;
  158. display: flex;
  159. align-items: center;
  160. }
  161. .handle-label {
  162. height: 40px;
  163. flex: 1;
  164. margin-left: 10px;
  165. line-height: 40px;
  166. font-size: 15px;
  167. }
  168. .handle-arrow {
  169. line-height: 40px;
  170. }
  171. }
  172. }
  173. </style>