recharge_record.vue 1.5 KB

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