index.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  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-fans"></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. <li @click="$router.push({name: 'Feedback'})">
  54. <p class="left">
  55. <van-icon
  56. size="20px"
  57. color="#6b400d"
  58. name="comment-o"/>
  59. <span class="label">意见反馈</span>
  60. </p>
  61. <p class="right">
  62. <i class="arrow"></i>
  63. </p>
  64. </li>
  65. </ul>
  66. <router-link
  67. class="jump-recommend"
  68. :to="{name: 'Recommend'}"></router-link>
  69. </div>
  70. </div>
  71. </template>
  72. <script>
  73. import BScroll from 'better-scroll'
  74. import { Icon } from 'vant'
  75. import { mapGetters } from 'vuex'
  76. export default {
  77. name: 'index',
  78. components: {
  79. 'van-icon': Icon
  80. },
  81. data () {
  82. return {
  83. scroll: null
  84. }
  85. },
  86. computed: {
  87. ...mapGetters({
  88. userInfo: 'common/userinfo'
  89. })
  90. },
  91. activated () {
  92. if (!this.$route.meta.isUseCache) {
  93. setTimeout(() => {
  94. this.scroll = new BScroll(this.$refs.fbyMine, {
  95. click: true,
  96. scrollbar: true
  97. })
  98. }, 500)
  99. } else {
  100. if (this.scroll) {
  101. this.scroll.refresh()
  102. }
  103. }
  104. }
  105. }
  106. </script>
  107. <style lang="scss" scoped>
  108. .mine-conatainer {
  109. position: absolute;
  110. left: 0;
  111. top: 0;
  112. right: 0;
  113. bottom: 50px;
  114. width: 100%;
  115. overflow: hidden;
  116. & > div {
  117. padding-bottom: 50px;
  118. }
  119. }
  120. .header {
  121. width: 100%;
  122. padding-top: 59px;
  123. background: url("./image/bg_header@2x.png") center top/100% 94px no-repeat;
  124. }
  125. .avatar {
  126. width: 73px;
  127. height: 73px;
  128. margin: 0 auto;
  129. border-radius: 50%;
  130. overflow: hidden;
  131. img {
  132. display: block;
  133. width: 100%;
  134. }
  135. }
  136. .income-wrap {
  137. display: flex;
  138. align-items: center;
  139. width: 335px;
  140. margin: 17px auto;
  141. padding: 16px 0;
  142. border-radius: 10px;
  143. background: #FFFFFF;
  144. box-shadow: 0 2px 4px 0 rgba(31, 49, 74, 0.12);
  145. & > div {
  146. position: relative;
  147. left: 0;
  148. top: 0;
  149. flex: 1;
  150. &:nth-of-type(2) {
  151. &:before {
  152. @include vertical-center;
  153. left: 0;
  154. height: 86%;
  155. content: '';
  156. border-left: 1px solid #ccc;
  157. }
  158. }
  159. }
  160. p {
  161. width: 100%;
  162. font-size: 14px;
  163. color: #333333;
  164. line-height: 20px;
  165. text-align: center;
  166. &:nth-of-type(2) {
  167. margin-top: 4px;
  168. }
  169. }
  170. }
  171. ul {
  172. width: 335px;
  173. margin: 0 auto;
  174. li {
  175. display: flex;
  176. align-items: center;
  177. width: 100%;
  178. padding: 16px 0;
  179. background: #FFFFFF;
  180. box-shadow: 0 2px 4px 0 rgba(31, 49, 74, 0.12);
  181. border-radius: 10px;
  182. margin-top: 17px;
  183. &:nth-of-type(1) {
  184. margin-top: 4px;
  185. }
  186. }
  187. .left,
  188. .right {
  189. display: flex;
  190. align-items: center;
  191. width: 50%;
  192. }
  193. .left {
  194. padding-left: 19px;
  195. }
  196. .right {
  197. justify-content: flex-end;
  198. padding-right: 14px;
  199. }
  200. ::v-deep .van-icon {
  201. padding-top: 4px;
  202. margin-right: 8px;
  203. }
  204. i.label {
  205. width: 20px;
  206. height: 20px;
  207. margin-right: 8px;
  208. background-position: center center;
  209. background-size: 20px 20px;
  210. background-repeat: no-repeat;
  211. &.icon-order {
  212. background-image: url("./image/ic_order@2x.png");
  213. }
  214. &.icon-wallet {
  215. background-image: url("./image/ic_wallet@2x.png");
  216. }
  217. &.icon-fans {
  218. background-image: url("./image/ic_fans@2x.png");
  219. }
  220. }
  221. span.label {
  222. padding-top: 2px;
  223. font-size: 14px;
  224. color: #333333;
  225. line-height: 20px;
  226. }
  227. .value {
  228. font-size: 12px;
  229. font-family: PingFangSC-Medium, PingFang SC;
  230. font-weight: 500;
  231. color: #FA4A4A;
  232. line-height: 17px;
  233. }
  234. .arrow {
  235. width: 24px;
  236. height: 24px;
  237. background: url("./image/ic_arrow@2x.png") center center/24px 24px no-repeat;
  238. }
  239. }
  240. .jump-recommend {
  241. display: block;
  242. width: 335px;
  243. height: 61px;
  244. margin: 25px auto 0;
  245. background: url("./image/bg_recommend@2x.png") center center/335px 61px no-repeat;
  246. }
  247. </style>