mine.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. <div class="mine-type">
  10. <div class="order"><img src="http://odulvej8l.bkt.clouddn.com/mine-%E8%AE%A2%E5%8D%95icon-01.png" alt="">
  11. <div>订单</div>
  12. </div>
  13. <div class="recharge"><img src="http://odulvej8l.bkt.clouddn.com/mine-%E8%AE%A2%E5%8D%95icon-01.png" alt="">
  14. <div>订单</div>
  15. </div>
  16. <div class="address-list"><img src="http://odulvej8l.bkt.clouddn.com/mine-%E8%AE%A2%E5%8D%95icon-01.png" alt="">
  17. <div>订单</div>
  18. </div>
  19. <div class="contact"><img src="http://odulvej8l.bkt.clouddn.com/mine-%E8%AE%A2%E5%8D%95icon-01.png" alt="">
  20. <div>订单</div>
  21. </div>
  22. <div class="coupon"><img src="http://odulvej8l.bkt.clouddn.com/mine-%E8%AE%A2%E5%8D%95icon-01.png" alt="">
  23. <div>订单</div>
  24. </div>
  25. <div class="about"><img src="http://odulvej8l.bkt.clouddn.com/mine-%E8%AE%A2%E5%8D%95icon-01.png" alt="">
  26. <div>订单</div>
  27. </div>
  28. </div>
  29. </scroller>
  30. <navigation></navigation>
  31. </div>
  32. </template>
  33. <script type="text/javascript">
  34. import {mapActions} from 'vuex'
  35. import config from '../config/config'
  36. export default({
  37. data () {
  38. return {
  39. userId: config.userId,
  40. userInfo: this.$store.state.user.userInfo,
  41. HeadBackground: 'http://odulvej8l.bkt.clouddn.com/mine-%E5%BA%95%E7%BA%B9.jpg',
  42. products: this.$store.state.product.products
  43. }
  44. },
  45. beforeCreate () {
  46. console.log(this.$store.state.user.userInfo)
  47. },
  48. created () {
  49. },
  50. methods: {
  51. ...mapActions([]),
  52. btn: function (a) {
  53. }
  54. }
  55. })
  56. </script>
  57. <style type="text/css" lang="less" scoped>
  58. button {
  59. font-size: 2rem;
  60. border: 1px solid darkseagreen;
  61. }
  62. .user {
  63. width: 100%;
  64. position: relative;
  65. background: url("http://odulvej8l.bkt.clouddn.com/mine-%E5%BA%95%E7%BA%B9.jpg") no-repeat center;
  66. background-size: 100%;
  67. padding: 5% 0;
  68. img:nth-child(1) {
  69. width: 25%;
  70. display: block;
  71. margin: 0 auto;
  72. border-radius: 50%;
  73. }
  74. & > div {
  75. color: white;
  76. margin-top: 1em;
  77. }
  78. }
  79. .mine-type {
  80. margin-top: 1em;
  81. width: 100%;
  82. display: -webkit-box;
  83. display: -ms-flexbox;
  84. display: flex;
  85. -ms-flex-wrap: wrap;
  86. flex-wrap: wrap;
  87. & > div {
  88. float: left;
  89. width: 33.33%;
  90. border: 1px solid black;
  91. padding-top: 5%;
  92. padding-bottom: 5%;
  93. text-align: center;
  94. background: #ffffff;
  95. &:nth-child(1){border-left: 0;}
  96. &:nth-child(2){border-left: 0;border-right: 0;}
  97. &:nth-child(3){border-left: 0;border-right: 0;}
  98. & > img {
  99. display: block;
  100. width: 50%;
  101. margin: 0 auto;
  102. }
  103. & > div {
  104. display: block;
  105. width: 100%;
  106. border: 0;
  107. padding: 0;
  108. }
  109. }
  110. }
  111. @media (max-width: 320px) {
  112. .user {
  113. img:nth-child(2) {
  114. /*margin-top: 1em;*/
  115. }
  116. & > div {
  117. font-size: 15px;
  118. }
  119. }
  120. }
  121. </style>