mine.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <div class="mine">
  3. <scroller>
  4. <div class="user">
  5. <!--<img class="head-background" :src="HeadBackground" alt="">-->
  6. <img :src="userInfo.avatar" alt="">
  7. <div>{{userInfo.user_name}}</div>
  8. </div>
  9. <!--选择-->
  10. <group>
  11. <cell :title="(item.name)" is-link v-for="item in userList" value-align="left" :link="{path: item.link}">
  12. <img slot="icon" width="20" style="display:block;margin-right:5px;" :src="item.icon">
  13. </cell>
  14. </group>
  15. </scroller>
  16. <navigation></navigation>
  17. </div>
  18. </template>
  19. <script type="text/javascript">
  20. import {mapActions} from 'vuex'
  21. import config from '../config/config'
  22. import {Cell, Group} from 'vux'
  23. export default({
  24. data () {
  25. return {
  26. userId: config.userId,
  27. userInfo: this.$store.state.user.userInfo,
  28. HeadBackground: 'http://odulvej8l.bkt.clouddn.com/mine-%E5%BA%95%E7%BA%B9.jpg',
  29. products: this.$store.state.product.products,
  30. userList: [
  31. {
  32. name: '地址',
  33. icon: 'http://odulvej8l.bkt.clouddn.com/mine-%E5%9C%B0%E5%9D%80icon-01-01.png',
  34. link: '/addressList'
  35. },
  36. {
  37. name: '订单',
  38. icon: 'http://odulvej8l.bkt.clouddn.com/mine-%E8%AE%A2%E5%8D%95icon-01.png',
  39. link: '/order'
  40. },
  41. {
  42. name: '用户余额',
  43. icon: 'http://odulvej8l.bkt.clouddn.com/mine-%E5%85%85%E5%80%BC%E5%8D%A1icon-01-01.png',
  44. link: '/balanceLog'
  45. },
  46. {
  47. name: '代金券',
  48. icon: 'http://odulvej8l.bkt.clouddn.com/mine-%E4%BB%A3%E9%87%91%E5%88%B8icon-01-01-01.png',
  49. link: '/userCoupon'
  50. },
  51. {
  52. name: '关于',
  53. icon: 'http://odulvej8l.bkt.clouddn.com/mine-%E5%85%B3%E4%BA%8Eicon-01-01-01.png',
  54. link: '/about'
  55. }
  56. ]
  57. }
  58. },
  59. components: {
  60. Group,
  61. Cell
  62. },
  63. beforeCreate () {
  64. console.log(this.$store.state.user.userInfo)
  65. },
  66. created () {
  67. },
  68. methods: {
  69. ...mapActions([]),
  70. btn: function (a) {
  71. }
  72. }
  73. })
  74. </script>
  75. <style type="text/css" lang="less" scoped>
  76. button {
  77. font-size: 2rem;
  78. border: 1px solid darkseagreen;
  79. }
  80. .user {
  81. width: 100%;
  82. position: relative;
  83. background: url("http://odulvej8l.bkt.clouddn.com/mine-%E5%BA%95%E7%BA%B9.jpg") no-repeat center;
  84. background-size: 100%;
  85. padding: 5% 0;
  86. margin-bottom: 1em;
  87. img:nth-child(1) {
  88. width: 25%;
  89. display: block;
  90. margin: 0 auto;
  91. border-radius: 50%;
  92. }
  93. & > div {
  94. color: white;
  95. margin-top: 1em;
  96. }
  97. }
  98. .mine-type {
  99. width: 100%;
  100. display: flex;
  101. -ms-flex-wrap: wrap;
  102. flex-wrap: wrap;
  103. & > div {
  104. float: left;
  105. width: 33.18%;
  106. box-sizing: border-box;
  107. text-align: center;
  108. background: #ffffff;
  109. &:nth-child(1) {
  110. div {
  111. border-left: 0;
  112. }
  113. }
  114. &:nth-child(3) {
  115. div {
  116. border-right: 0;
  117. }
  118. }
  119. & > div {
  120. width: 100%;
  121. border: 1px solid black;
  122. padding: 0;
  123. font-size: 18px;
  124. line-height: 20px;
  125. }
  126. img {
  127. display: block;
  128. width: 50%;
  129. margin: 15px auto;
  130. }
  131. }
  132. }
  133. @media (max-width: 320px) {
  134. .user {
  135. img:nth-child(2) {
  136. /*margin-top: 1em;*/
  137. }
  138. & > div {
  139. font-size: 15px;
  140. }
  141. }
  142. }
  143. </style>