index.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view>
  3. <view class='commission-details'>
  4. <view class='promoterHeader'>
  5. <view class='headerCon acea-row row-between-wrapper'>
  6. <view>
  7. <view class='name'>可提现余额</view>
  8. <view class='money'>¥<text class='num'>{{money}}</text></view>
  9. </view>
  10. <view class='iconfont icon-jinbi1'></view>
  11. </view>
  12. </view>
  13. <view class='sign-record'>
  14. <view class='list' v-for="(item,index) in recordList" :key="index">
  15. <view class='item'>
  16. <view class='listn'>
  17. <view class='itemn acea-row row-between-wrapper'>
  18. <view>
  19. <view class='name line1'>{{item.title}}</view>
  20. <view>{{item.time}}</view>
  21. </view>
  22. <view class='num font-color'>+{{item.v}}</view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class='loadingicon acea-row row-center-wrapper' v-if="recordList.length>0">
  28. <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
  29. </view>
  30. <view v-if="recordList.length == 0">
  31. <emptyPage title='暂无佣金记录~'></emptyPage>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import {
  39. mapGetters
  40. } from "vuex";
  41. import {
  42. toLogin
  43. } from '@/libs/login.js';
  44. import {
  45. account,
  46. recordList
  47. } from '@/api/api.js';
  48. import emptyPage from '@/components/emptyPage.vue'
  49. export default {
  50. components: {
  51. emptyPage
  52. },
  53. data() {
  54. return {
  55. money: 0,
  56. loadTitle: '加载更多',
  57. loading: false,
  58. loadend: false,
  59. page: 1,
  60. limit: 10,
  61. type: 'income',
  62. recordList: []
  63. };
  64. },
  65. computed: mapGetters(['isLogin']),
  66. onLoad() {
  67. if (this.isLogin) {
  68. this.getAccount();
  69. this.getRecordList();
  70. } else {
  71. toLogin();
  72. }
  73. },
  74. methods: {
  75. getAccount: function() {
  76. account().then(res => {
  77. this.money = res.data.tx_money;
  78. });
  79. },
  80. getRecordList: function() {
  81. let that = this;
  82. if (that.loadend) return;
  83. if (that.loading) return;
  84. that.loading = true;
  85. that.loadTitle = "";
  86. let data = {
  87. page: that.page,
  88. tabType: that.type
  89. }
  90. recordList(data).then(function(res) {
  91. let list = res.data.list,
  92. loadend = list.length < that.limit;
  93. that.recordList = that.$util.SplitArray(list, that.recordList);
  94. that.loadend = loadend;
  95. that.loading = false;
  96. that.loadTitle = loadend ? "哼~我也是有底线的~" : "加载更多";
  97. that.page = that.page + 1;
  98. }, function(res) {
  99. that.loading = false;
  100. that.loadTitle = '加载更多';
  101. });
  102. },
  103. },
  104. onReachBottom: function() {
  105. this.getRecordList();
  106. }
  107. }
  108. </script>
  109. <style scoped lang="scss">
  110. .commission-details .promoterHeader{
  111. background: #ff5c00;
  112. }
  113. .commission-details .promoterHeader .headerCon .money {
  114. font-size: 36rpx;
  115. }
  116. .commission-details .promoterHeader .headerCon .money .num {
  117. font-family: 'Guildford Pro';
  118. }
  119. .bg-color{
  120. background-color: #e93323!important;
  121. }
  122. .font-color,.font-color-red {
  123. color: #e93323!important;
  124. }
  125. </style>