details.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <view class="">
  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='integralList'></hua-record-list>
  13. </mescroll-body>
  14. </view>
  15. </template>
  16. <script>
  17. import {
  18. getAccountLog
  19. } from "@/api/user";
  20. import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
  21. export default {
  22. mixins: [MescrollMixin], // 使用mixin
  23. data() {
  24. return {
  25. pageTitle: "券明细",
  26. integralList: []
  27. }
  28. },
  29. methods: {
  30. // 上拉加载更多
  31. upCallback({
  32. num,
  33. size
  34. }) {
  35. getAccountLog({
  36. page_no: num,
  37. page_size: size,
  38. source: 2, //券明细
  39. }).then(({
  40. data,
  41. code
  42. }) => {
  43. if (code != 1) return this.mescroll.endErr()
  44. if (num === 1) this.integralList = []
  45. this.integralList = [...this.integralList, ...data.list]
  46. this.mescroll.endSuccess(data.list.length, !!data.more)
  47. }).catch(err => {
  48. this.mescroll.endErr()
  49. })
  50. }
  51. }
  52. }
  53. </script>
  54. <style lang="scss">
  55. .noData {
  56. position: relative;
  57. height: calc(100vh - var(--status-bar-height));
  58. .wrap {
  59. text-align: center;
  60. // position: absolute;
  61. // top: 50%;
  62. // left: 50%;
  63. // transform: translate(-50%,-50%);
  64. margin-top: 100rpx;
  65. image {
  66. width: 330rpx;
  67. height: 330rpx;
  68. margin: 20rpx auto;
  69. }
  70. .tit {
  71. color: #AAAAAA;
  72. }
  73. }
  74. }
  75. </style>