commission_details.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <view class="commission-details">
  3. <mescroll-body ref="mescrollRef" @init="mescrollInit" @up="upCallback" :up="upOption" :down="downOption" @down="downCallback">
  4. <view class="p-t-20" >
  5. <view class="bg-white" v-for="(item, index) in list" :key="index" >
  6. <record-cell :remark="item.source_type" :date="item.create_time" :money="item.change_amount" :type="item.change_type" />
  7. </view>
  8. </view>
  9. </mescroll-body>
  10. </view>
  11. </template>
  12. <script>
  13. import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
  14. import {getCommission} from "@/api/user"
  15. export default {
  16. mixins: [MescrollMixin], // 使用mixin
  17. data() {
  18. return {
  19. // Tabs 列表
  20. upOption: {
  21. empty: {
  22. icon: '/static/images/order_null.png',
  23. tip: '暂无记录', // 提示
  24. }
  25. },
  26. list: [], // 列表数据--全部
  27. };
  28. },
  29. methods: {
  30. // 上拉加载
  31. upCallback(page) {
  32. const pageNum = page.num; // 页码, 默认从1开始
  33. const pageSize = page.size; // 页长, 默认每页10条
  34. getCommission({
  35. page_size: pageSize,
  36. page_no: pageNum,
  37. }).then(({
  38. data
  39. }) => {
  40. if (page.num == 1) this.list = [];
  41. const curPageData = data.list;
  42. const curPageLen = curPageData.length;
  43. const hasNext = !!data.more;
  44. this.list = this.list.concat(curPageData);
  45. this.mescroll.endSuccess(curPageLen, hasNext);
  46. }).catch(() => {
  47. this.mescroll.endErr()
  48. })
  49. }
  50. },
  51. }
  52. </script>
  53. <style scoped>
  54. </style>