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.

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