energy-detials.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <view>
  3. <hua-page-head :pageTitle="pageTitle"></hua-page-head>
  4. <mescroll-body ref="mescrollRef" :up="{
  5. noMoreSize: 10,
  6. empty: {
  7. icon: '/static/images/order_null.png',
  8. tip: '暂无抵用券明细~',
  9. fixed: false
  10. }
  11. }" @init="mescrollInit" @down="downCallback" @up="upCallback">
  12. <hua-record-list :data='data' :type="1"></hua-record-list>
  13. </mescroll-body>
  14. </view>
  15. </template>
  16. <script>
  17. import {
  18. energyLog
  19. } from '@/api/shop.js'
  20. import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
  21. export default {
  22. mixins: [MescrollMixin], // 使用mixin
  23. data() {
  24. return {
  25. data: [],
  26. pageTitle: "抵用券明细"
  27. }
  28. },
  29. methods: {
  30. // 上拉加载更多
  31. upCallback({
  32. num,
  33. size
  34. }) {
  35. energyLog({
  36. page_no: num,
  37. page_size: size
  38. }).then(({
  39. data,
  40. code
  41. }) => {
  42. if (code != 1) return this.mescroll.endErr()
  43. if (num === 1) this.data = []
  44. this.data = [...this.data, ...data.list]
  45. this.mescroll.endSuccess(data.list.length, !!data.more)
  46. }).catch(err => {
  47. this.mescroll.endErr()
  48. })
  49. }
  50. },
  51. }
  52. </script>
  53. <style lang="scss">
  54. .noData {
  55. position: relative;
  56. height: calc(100vh - var(--status-bar-height));
  57. .wrap {
  58. text-align: center;
  59. // position: absolute;
  60. // top: 50%;
  61. // left: 50%;
  62. // transform: translate(-50%,-50%);
  63. margin-top: 100rpx;
  64. image {
  65. width: 330rpx;
  66. height: 330rpx;
  67. margin: 20rpx auto;
  68. }
  69. .tit {
  70. color: #AAAAAA;
  71. }
  72. }
  73. }
  74. </style>