index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <template>
  2. <div
  3. class="mine-conatainer"
  4. ref="fbyMine">
  5. <div>
  6. <div class="header">
  7. <div class="avatar">
  8. <img
  9. :src="userInfo.user_head_img_url"
  10. alt="">
  11. </div>
  12. </div>
  13. <div class="income-wrap">
  14. <div>
  15. <p>上月预估收入(元)</p>
  16. <p>¥{{ userInfo.last_month_money | fen2Yuan }}</p>
  17. </div>
  18. <div>
  19. <p>本月预估收入(元)</p>
  20. <p>¥{{ userInfo.month_money | fen2Yuan }}</p>
  21. </div>
  22. </div>
  23. <ul>
  24. <li @click="$router.push({name: 'Order'})">
  25. <p class="left">
  26. <i class="label icon-order"></i>
  27. <span class="label">下单记录</span>
  28. </p>
  29. <p class="right">
  30. <i class="arrow"></i>
  31. </p>
  32. </li>
  33. <li @click="$router.push({name: 'Wallet'})">
  34. <p class="left">
  35. <i class="label icon-wallet"></i>
  36. <span class="label">可提现余额</span>
  37. </p>
  38. <p class="right">
  39. <span class="value">{{ userInfo.user_balance | fen2Yuan }}</span>
  40. <i class="arrow"></i>
  41. </p>
  42. </li>
  43. <li @click="$router.push({name: 'Fans'})">
  44. <p class="left">
  45. <i class="label icon-wallet"></i>
  46. <span class="label">粉丝</span>
  47. </p>
  48. <p class="right">
  49. <span class="value">{{ userInfo.user_fans_num }}</span>
  50. <i class="arrow"></i>
  51. </p>
  52. </li>
  53. </ul>
  54. <router-link
  55. class="jump-recommend"
  56. :to="{name: 'Recommend'}"></router-link>
  57. </div>
  58. </div>
  59. </template>
  60. <script>
  61. import BScroll from 'better-scroll'
  62. import { mapGetters } from 'vuex'
  63. export default {
  64. name: 'index',
  65. data () {
  66. return {
  67. scroll: null
  68. }
  69. },
  70. computed: {
  71. ...mapGetters({
  72. userInfo: 'common/userinfo'
  73. })
  74. },
  75. activated () {
  76. if (!this.$route.meta.isUseCache) {
  77. setTimeout(() => {
  78. this.scroll = new BScroll(this.$refs.fbyMine, {
  79. click: true,
  80. scrollbar: true
  81. })
  82. }, 500)
  83. } else {
  84. if (this.scroll) {
  85. this.scroll.refresh()
  86. }
  87. }
  88. }
  89. }
  90. </script>
  91. <style lang="scss" scoped>
  92. .mine-conatainer {
  93. position: absolute;
  94. left: 0;
  95. top: 0;
  96. right: 0;
  97. bottom: 50px;
  98. width: 100%;
  99. overflow: hidden;
  100. & > div {
  101. padding-bottom: 50px;
  102. }
  103. }
  104. .header {
  105. width: 100%;
  106. padding-top: 59px;
  107. background: url("./image/bg_header@2x.png") center top/100% 94px no-repeat;
  108. }
  109. .avatar {
  110. width: 73px;
  111. height: 73px;
  112. margin: 0 auto;
  113. border-radius: 50%;
  114. overflow: hidden;
  115. img {
  116. display: block;
  117. width: 100%;
  118. }
  119. }
  120. .income-wrap {
  121. display: flex;
  122. align-items: center;
  123. width: 335px;
  124. margin: 17px auto;
  125. padding: 16px 0;
  126. border-radius: 10px;
  127. background: #FFFFFF;
  128. box-shadow: 0 2px 4px 0 rgba(31, 49, 74, 0.12);
  129. & > div {
  130. position: relative;
  131. left: 0;
  132. top: 0;
  133. flex: 1;
  134. &:nth-of-type(2) {
  135. &:before {
  136. @include vertical-center;
  137. left: 0;
  138. height: 86%;
  139. content: '';
  140. border-left: 1px solid #ccc;
  141. }
  142. }
  143. }
  144. p {
  145. width: 100%;
  146. font-size: 14px;
  147. color: #333333;
  148. line-height: 20px;
  149. text-align: center;
  150. &:nth-of-type(2) {
  151. margin-top: 4px;
  152. }
  153. }
  154. }
  155. ul {
  156. width: 335px;
  157. margin: 0 auto;
  158. li {
  159. display: flex;
  160. align-items: center;
  161. width: 100%;
  162. padding: 16px 0;
  163. background: #FFFFFF;
  164. box-shadow: 0 2px 4px 0 rgba(31, 49, 74, 0.12);
  165. border-radius: 10px;
  166. margin-top: 17px;
  167. &:nth-of-type(1) {
  168. margin-top: 4px;
  169. }
  170. }
  171. .left,
  172. .right {
  173. display: flex;
  174. align-items: center;
  175. width: 50%;
  176. }
  177. .left {
  178. padding-left: 19px;
  179. }
  180. .right {
  181. justify-content: flex-end;
  182. padding-right: 14px;
  183. }
  184. i.label {
  185. width: 20px;
  186. height: 20px;
  187. margin-right: 8px;
  188. background-position: center center;
  189. background-size: 20px 20px;
  190. background-repeat: no-repeat;
  191. &.icon-order {
  192. background-image: url("./image/ic_order@2x.png");
  193. }
  194. &.icon-wallet {
  195. background-image: url("./image/ic_wallet@2x.png");
  196. }
  197. &.icon-fans {
  198. background-image: url("./image/ic_fans@2x.png");
  199. }
  200. }
  201. span.label {
  202. padding-top: 2px;
  203. font-size: 14px;
  204. color: #333333;
  205. line-height: 20px;
  206. }
  207. .value {
  208. font-size: 12px;
  209. font-family: PingFangSC-Medium, PingFang SC;
  210. font-weight: 500;
  211. color: #FA4A4A;
  212. line-height: 17px;
  213. }
  214. .arrow {
  215. width: 24px;
  216. height: 24px;
  217. background: url("./image/ic_arrow@2x.png") center center/24px 24px no-repeat;
  218. }
  219. }
  220. .jump-recommend {
  221. display: block;
  222. width: 335px;
  223. height: 61px;
  224. margin: 25px auto 0;
  225. background: url("./image/bg_recommend@2x.png") center center/335px 61px no-repeat;
  226. }
  227. </style>