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.

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