monthly_bill.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <view class="month-bill">
  3. <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
  4. :up="upOption">
  5. <view v-for="(item, index) in orderList" :key="index">
  6. <view class="bill-time flex sm">
  7. {{item.date}}
  8. </view>
  9. <view class="show-panel flex">
  10. <view class="panel-item flex-col col-center">
  11. <price-format :price="item.total_money" :subscript-size="26" :color="colorConfig.primary"
  12. :first-size="36" :second-size="36" />
  13. <view class="lighter label m-t-10">预估收入</view>
  14. </view>
  15. <view class="panel-item flex-col col-center">
  16. <view class="xxl">{{item.order_num}}</view>
  17. <view class="lighter label m-t-10">成交笔数</view>
  18. </view>
  19. <view class="panel-item flex-col col-center">
  20. <router-link :to="{path: '/bundle/pages/monthly_bill_detail/monthly_bill_detail', query: {year: item.year, month: item.month}}">
  21. <view class="flex lighter">
  22. 查看详情
  23. <u-icon name="arrow-right" size="28rpx" color="#666666" />
  24. </view>
  25. </router-link>
  26. </view>
  27. </view>
  28. </view>
  29. </mescroll-body>
  30. </view>
  31. </template>
  32. <script>
  33. import {
  34. getMonthBill
  35. } from "@/api/user";
  36. import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins";
  37. export default {
  38. mixins: [MescrollMixin],
  39. data() {
  40. return {
  41. orderList: [],
  42. upOption: {
  43. empty: {
  44. icon: '/static/images/order_null.png',
  45. tip: '暂无数据~', // 提示
  46. }
  47. },
  48. };
  49. },
  50. onLoad: function(options) {
  51. },
  52. methods: {
  53. upCallback(page) {
  54. let pageNum = page.num; // 页码, 默认从1开始
  55. let pageSize = page.size; // 页长, 默认每页10条
  56. getMonthBill({
  57. page_size: pageSize,
  58. page_no: pageNum,
  59. }).then(({
  60. data
  61. }) => {
  62. if (page.num == 1) this.orderList = [];
  63. let curPageData = data.list;
  64. let curPageLen = curPageData.length;
  65. let hasNext = !!data.more;
  66. this.orderList = this.orderList.concat(curPageData);
  67. this.mescroll.endSuccess(curPageLen, hasNext);
  68. }).catch(() => {
  69. this.mescroll.endErr()
  70. })
  71. },
  72. }
  73. };
  74. </script>
  75. <style lang="scss">
  76. .month-bill {
  77. .bill-time {
  78. padding: 20rpx;
  79. line-height: 34rpx;
  80. }
  81. .show-panel {
  82. background-color: white;
  83. padding: 36rpx 0 26rpx;
  84. }
  85. .show-panel {
  86. .panel-item {
  87. flex: 1;
  88. line-height: 34rpx;
  89. }
  90. }
  91. }
  92. .data-null {
  93. padding-top: 200rpx;
  94. }
  95. </style>