index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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. </view>
  22. </template>
  23. <script>
  24. const NET = require('@/utils/request')
  25. const API = require('@/config/api')
  26. export default {
  27. onShow() {
  28. if (uni.getStorageSync('userData')) {
  29. this.userData = uni.getStorageSync('userData')
  30. }
  31. },
  32. data() {
  33. return {
  34. userData: {
  35. headImage: '',
  36. userId: '',
  37. nickName: '',
  38. userName: '',
  39. phone: '',
  40. },
  41. handleList: [{
  42. label: '全部客户',
  43. path: 'customerList',
  44. icon: API.getServerImg + 'kehu.png'
  45. },
  46. {
  47. label: '营销业绩排行',
  48. path: 'marketRankList',
  49. icon: API.getServerImg + 'paihang.png'
  50. },
  51. {
  52. label: '续费提醒',
  53. path: 'renewList',
  54. icon: API.getServerImg + 'xufeitixing.png'
  55. },
  56. {
  57. label: '消息通知',
  58. path: 'messageList',
  59. icon: API.getServerImg + 'xiaoxi.png'
  60. },
  61. {
  62. label: '数据统计',
  63. path: 'dataCensus',
  64. icon: API.getServerImg + 'shujutongji.png'
  65. },
  66. {
  67. label: '我的二维码',
  68. path: 'shareInfo',
  69. icon: API.getServerImg + 'erweima.png'
  70. },
  71. {
  72. label: '赠品申请',
  73. path: 'giftApply',
  74. icon: API.getServerImg + 'paihang.png'
  75. },
  76. {
  77. label: '退出登录',
  78. path: 'logout',
  79. icon: API.getServerImg + 'kehu.png'
  80. },
  81. ],
  82. }
  83. },
  84. methods: {
  85. // 跳转我的各列表界面
  86. goToHandle(site) {
  87. if(site.path == 'logout'){
  88. uni.removeStorageSync('token')
  89. uni.navigateTo({
  90. url: '/pages/login/index'
  91. });
  92. }else{
  93. uni.navigateTo({
  94. url: '/pagesMain/' + site.path
  95. });
  96. }
  97. }
  98. }
  99. }
  100. </script>
  101. <style lang="scss" scoped>
  102. @import "@/static/css/themes.scss";
  103. .content {
  104. width: 100%;
  105. min-height: 100vh;
  106. float: left;
  107. background-color: #f5f6f8;
  108. // .swiper-item {
  109. // width: 100%;
  110. // height: calc(100vh - 50px);
  111. // position: relative;
  112. // }
  113. .user-info {
  114. width: 100%;
  115. height: 110px;
  116. margin-bottom: 10px;
  117. float: left;
  118. background-color: $mainColor;
  119. .user-data {
  120. width: calc(100% - 110px);
  121. height: 110px;
  122. padding: 15px 0 15px 15px;
  123. float: left;
  124. .user-name {
  125. width: 100%;
  126. float: left;
  127. font-size: 24px;
  128. color: #FFFFFF;
  129. line-height: 30px;
  130. margin: 10px 0;
  131. white-space: nowrap;
  132. overflow: hidden;
  133. text-overflow: ellipsis;
  134. }
  135. .user-phone {
  136. width: 100%;
  137. color: #FFFFFF;
  138. line-height: 20px;
  139. float: left;
  140. white-space: nowrap;
  141. overflow: hidden;
  142. text-overflow: ellipsis;
  143. }
  144. }
  145. .user-img {
  146. width: 110px;
  147. height: 110px;
  148. padding: 15px;
  149. float: left;
  150. display: flex;
  151. align-items: center;
  152. justify-content: center;
  153. }
  154. }
  155. .user-handle {
  156. width: 100vw;
  157. height: 40px;
  158. float: left;
  159. padding: 0 15px;
  160. margin-bottom: 10px;
  161. display: flex;
  162. align-items: center;
  163. .handle-icon {
  164. width: 40px;
  165. height: 40px;
  166. text-align: center;
  167. line-height: 40px;
  168. display: flex;
  169. align-items: center;
  170. }
  171. .handle-label {
  172. height: 40px;
  173. flex: 1;
  174. margin-left: 10px;
  175. line-height: 40px;
  176. font-size: 15px;
  177. }
  178. .handle-arrow {
  179. line-height: 40px;
  180. }
  181. }
  182. }
  183. </style>