income.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <view class="share-income">
  3. <view class="head-box main-between cross-center">
  4. <view class="left-box">
  5. <text>分享佣金</text>
  6. <view class="price main-left cross-bottom">{{ userInfo.total_income }}
  7. <view class="unit">元</view>
  8. </view>
  9. </view>
  10. <view
  11. class="right-box"
  12. @click="$u.route('/pages/share/withdrawDetail')"
  13. >提现明细
  14. </view>
  15. </view>
  16. <view class="menu-group">
  17. <button
  18. v-for="(menu,index) in menus"
  19. :key="index"
  20. class="menu-item main-between cross-center"
  21. @click="handleMenu(menu)"
  22. >
  23. <view class="left-box dir-left-nowrap cross-center">
  24. <text>{{ menu.name }}</text>
  25. </view>
  26. <view class="right-box main-left cross-center">
  27. <text v-if="menu.showNumber">{{ menu.number }} 元</text>
  28. <u-icon name="arrow-right" :color="$colors.infoColor" bold top="1" />
  29. </view>
  30. </button>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. import { mapState } from 'vuex'
  36. export default {
  37. name: 'ShareIncome',
  38. data() {
  39. return {
  40. menus: [
  41. { name: '可提现佣金', href: '/pages/share/withdraw', showNumber: true, number: 0 },
  42. { name: '已提现佣金', href: '/pages/share/withdrawDetail?active=3', showNumber: true, number: 0 },
  43. { name: '待打款佣金', href: '/pages/share/withdrawDetail?active=2', showNumber: true, number: 0 },
  44. { name: '用户须知', href: '/pages/share/tips', showNumber: false }
  45. ]
  46. }
  47. },
  48. computed: {
  49. ...mapState({
  50. userInfo: seate => seate.user.info
  51. })
  52. },
  53. methods: {
  54. handleMenu(menu) {
  55. if (menu.href) {
  56. this.$u.route(menu.href)
  57. }
  58. },
  59. getIncome() {
  60. this.$api.share.income().then(res => {
  61. this.menus[0].number = this.userInfo.income
  62. this.menus[1].number = res.data.been
  63. this.menus[2].number = res.data.wait
  64. })
  65. }
  66. },
  67. onLoad() {
  68. this.getIncome()
  69. }
  70. }
  71. </script>
  72. <style lang="scss" scoped>
  73. .share-income {
  74. padding: 30rpx 30rpx 80rpx;
  75. .head-box{
  76. background: #1C203B;
  77. color: #6eebe8;
  78. padding: 50rpx 30rpx;
  79. border-radius: 20rpx;
  80. .left-box{
  81. text{
  82. font-size: 26rpx;
  83. }
  84. .price{
  85. margin-top: 12rpx;
  86. font-size: 42rpx;
  87. font-weight: bold;
  88. .unit{
  89. font-weight: normal;
  90. font-size: 28rpx;
  91. margin-bottom: 5rpx;
  92. margin-left: 2rpx;
  93. }
  94. }
  95. }
  96. .right-box{
  97. border: 1rpx solid #6eebe8;
  98. border-radius: 30rpx;
  99. padding: 6rpx 20rpx;
  100. font-size: 26rpx;
  101. }
  102. }
  103. .menu-group{
  104. .menu-item{
  105. padding: 20rpx 0;
  106. background: transparent;
  107. border: none;
  108. text-align: unset;
  109. width: 100%;
  110. line-height: initial;
  111. font-size: initial;
  112. justify-content: space-between;
  113. border-bottom: 1rpx solid #232849;
  114. border-radius: 0;
  115. color: #fff;
  116. margin-top: 40rpx;
  117. &:after{
  118. content: unset;
  119. }
  120. .left-box{
  121. flex: 1;
  122. .icon{
  123. transform: translateY(4rpx);
  124. image{
  125. width: 55rpx;
  126. height: 55rpx;
  127. }
  128. }
  129. text{
  130. color: #fff;
  131. margin-left: 10rpx;
  132. }
  133. }
  134. .right-box{
  135. text{
  136. margin-right: 20rpx;
  137. }
  138. }
  139. }
  140. }
  141. }
  142. </style>