You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
2.4 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <view class="app-container">
  3. <u-tabs :list="tabList" lineColor="#F52F3E" lineWidth="160rpx" @change="change"
  4. itemStyle="padding-left: 0; padding-right: 0;width: 50%; height: 90rpx;font-size: 14px" lineHeight="2"
  5. :activeStyle="{
  6. color: '#F52F3E'
  7. }"></u-tabs>
  8. <u-gap height="10rpx" bgColor="#F7F7F7"></u-gap>
  9. <view class="his-content">
  10. <view class="his-item u-border-bottom" v-for="item in queueList" :key="item.id">
  11. <view class="hit-left">
  12. <view class="his-name">
  13. {{item.merchant.name}}
  14. </view>
  15. </view>
  16. <view class="hit-right">
  17. 购买时排队<span class="text-style">{{item.buy_queue_index}}</span> 当前<span class="text-style">{{item.now_queue_index}}</span>
  18. </view>
  19. </view>
  20. <view class="load-more" @click="getQueueList">{{ hasMore ? '加载更多数据...' : '已加载完毕' }}</view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import {
  26. userQueueRebateList
  27. } from '../../common/api.js'
  28. export default {
  29. data() {
  30. return {
  31. tabList: [{
  32. name: '按时间排序'
  33. }, {
  34. name: '待最快排序'
  35. }],
  36. currentTab: 0,
  37. queueList: [],
  38. hasMore: true,
  39. page: 0,
  40. };
  41. },
  42. onLoad() {
  43. this.getQueueList();
  44. },
  45. onReachBottom() {
  46. this.getQueueList()
  47. },
  48. methods: {
  49. change(e) {
  50. console.log(e.index)
  51. this.currentTab = Number(e.index);
  52. this.queueList = [];
  53. this.hasMore = true;
  54. this.page = 0;
  55. this.getQueueList();
  56. },
  57. getQueueList() {
  58. if (!this.hasMore) {
  59. return
  60. }
  61. this.page++
  62. userQueueRebateList({
  63. page: this.page,
  64. page_size: 15,
  65. status: 0,
  66. sort_type: this.currentTab == 0 ? 1 : 2
  67. }).then(data => {
  68. this.queueList = [...this.queueList, ...data.list]
  69. this.hasMore = data.has_more
  70. })
  71. },
  72. }
  73. }
  74. </script>
  75. <style lang="scss">
  76. .his-content {
  77. padding: 0 30rpx;
  78. .his-item {
  79. display: flex;
  80. justify-content: space-between;
  81. align-items: center;
  82. border-bottom: 1rpx solid #eee;
  83. .hit-left {
  84. font-size: 24rpx;
  85. color: #454545;
  86. font-weight: bold;
  87. }
  88. .hit-right {
  89. height: 130rpx;
  90. line-height: 130rpx;
  91. font-size: 24rpx;
  92. color: #666;
  93. }
  94. span.text-style {
  95. font-size: 24rpx;
  96. color: #F52F3E;
  97. padding: 0 15rpx;
  98. font-weight: bold;
  99. }
  100. }
  101. .u-border-bottom,
  102. .u-border-top {
  103. border-color: #eee !important;
  104. }
  105. }
  106. .load-more {
  107. text-align: center;
  108. font-size: 14px;
  109. }
  110. </style>