UserCenter.vue 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <div class="User-box flex flex-column">
  3. <div class="user-card flex-0">
  4. <div class="profile flex" v-if="divShow">
  5. <img class="flex-0" src="@/assets/userImag/userImag.jpg" />
  6. <div class="info-name flex-1">
  7. <div class="title">
  8. {{person.name}}
  9. </div>
  10. <div class="subtitle">
  11. {{person.phone}}
  12. </div>
  13. <div class="userInfo-button">一期架空线路工1班</div>
  14. </div>
  15. </div>
  16. <div v-else class="userInfo-button-zhuce" @click="seeUserInfo()">注册</div>
  17. </div>
  18. <div class="menu-list flex-1">
  19. <van-cell-group>
  20. <van-cell
  21. v-for="menu in menus"
  22. :key="menu.title"
  23. :icon="menu.icon"
  24. :title="menu.title"
  25. is-link
  26. :to="menu.path"
  27. title-class="menu-title"
  28. />
  29. </van-cell-group>
  30. </div>
  31. </div>
  32. </template>
  33. <script>
  34. import { mapState } from 'vuex'
  35. // import {SetUser} from '../util/api'
  36. export default {
  37. data() {
  38. return {
  39. register: require('@/assets/icon/register.svg'),
  40. buttonShow: true,
  41. menus: [
  42. {
  43. icon: require('@/assets/userImag/userInfo.png'),
  44. title: '我的信息',
  45. path: '/SetUser',
  46. },
  47. {
  48. icon: require('@/assets/userImag/shoucang.png'),
  49. title: '我的收藏',
  50. path: '/MyCollection',
  51. },
  52. {
  53. icon: require('@/assets/userImag/wenjuan.png'),
  54. title: '我的问卷',
  55. path: '',
  56. }
  57. ]
  58. }
  59. },
  60. computed: {
  61. ...mapState({
  62. person: s => s.user,
  63. }),
  64. divShow() {
  65. return false; // !!this.person?.phone
  66. }
  67. },
  68. mounted() {
  69. },
  70. methods: {
  71. }
  72. }
  73. </script>
  74. <style lang="less" scoped>
  75. .User-box {
  76. width: 100%;
  77. height: 100%;
  78. background-color: #fff;
  79. background-image: url('~@/assets/userImag/backImag.png');
  80. background-size: 100%;
  81. background-repeat: no-repeat;
  82. .user-card {
  83. display: flex;
  84. align-items: center;
  85. width: 100vw;
  86. box-sizing: border-box;
  87. padding: 2em;
  88. position: relative;
  89. min-height: 136px;
  90. .profile {
  91. width: 100%;
  92. > img {
  93. width: 70px;
  94. height: 70px;
  95. border-radius: 50%;
  96. position: relative;
  97. box-shadow: 0px 8px 38px 0px rgba(0, 0, 0, 0.2);
  98. }
  99. .info-name {
  100. margin-left: 1em;
  101. position: relative;
  102. > div {
  103. margin-top: 10px;
  104. color: #fff;
  105. }
  106. .title {
  107. font-size: 17px;
  108. font-weight: 700;
  109. }
  110. .subtitle {
  111. font-size: 16px;
  112. letter-spacing: 1px;
  113. }
  114. .userInfo-button {
  115. color: rgb(255, 255, 255);
  116. font-weight: 100;
  117. border-top-left-radius: 20px; /* 左上角 */
  118. border-bottom-left-radius: 20px; /* 左下角 */
  119. position: absolute;
  120. padding: 8px 10px;
  121. right: -3em;
  122. top: 1em;
  123. font-size: 10px;
  124. letter-spacing: 1px;
  125. background-color: #2cb698;
  126. }
  127. }
  128. }
  129. .userInfo-button-zhuce {
  130. width: 80px;
  131. letter-spacing: 4px;
  132. color: #fff;
  133. border-radius: 20px;
  134. line-height: 30px;
  135. background-color: #2cb798;
  136. margin: 0 auto;
  137. text-align: center;
  138. }
  139. }
  140. .menu-list {
  141. width: 90%;
  142. border-radius: 20px;
  143. margin: 0 auto;
  144. box-shadow: 0px 0 2px 2px rgba(0, 0, 0, 0.12);
  145. background-color: #fff;
  146. overflow: hidden;
  147. position: relative;
  148. .menu-title {
  149. margin-left: 1em;
  150. font-size: 18px;
  151. }
  152. .van-cell {
  153. padding-top: 28px;
  154. padding-bottom: 28px;
  155. }
  156. .van-icon {
  157. font-size: 20px;
  158. & > img {
  159. padding-top: 2px;
  160. }
  161. }
  162. }
  163. }
  164. </style>