withdraw-detail.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <view class="withdraw-detail">
  3. <!-- 列表区域 -->
  4. <scroll-view scroll-y class="detail-list" @scrolltolower="loadMore" refresher-enabled
  5. :refresher-triggered="isRefreshing" @refresherrefresh="onRefresh">
  6. <view class="detail-item" v-for="(item, index) in detailList" :key="index">
  7. <view class="item-left">
  8. <text class="title">{{ item.title }}</text>
  9. <text class="time">{{ item.time }}</text>
  10. </view>
  11. <view class="item-right">
  12. <text class="amount">-{{ item.amount.toFixed(2) }}</text>
  13. <text class="status">{{ item.status }}</text>
  14. </view>
  15. </view>
  16. <!-- 加载更多 -->
  17. <view class="load-more" v-if="detailList.length > 0">
  18. <text v-if="hasMore">加载更多</text>
  19. <text v-else>我是有底线哒</text>
  20. </view>
  21. </scroll-view>
  22. </view>
  23. </template>
  24. <script>
  25. export default {
  26. data() {
  27. return {
  28. page: 1,
  29. pageSize: 10,
  30. isRefreshing: false,
  31. hasMore: true,
  32. detailList: [
  33. {
  34. title: '微信提现',
  35. time: '2021.2.25 10:48:32',
  36. amount: 36.00,
  37. status: '提现中'
  38. },
  39. {
  40. title: '微信提现',
  41. time: '2021.2.25 10:48:32',
  42. amount: 36.00,
  43. status: '提现完成'
  44. },
  45. {
  46. title: '微信提现',
  47. time: '2021.2.25 10:48:32',
  48. amount: 36.00,
  49. status: '提现完成'
  50. },
  51. {
  52. title: '微信提现',
  53. time: '2021.2.25 10:48:32',
  54. amount: 36.00,
  55. status: '提现完成'
  56. }
  57. ]
  58. }
  59. },
  60. onLoad() {
  61. this.loadData()
  62. },
  63. methods: {
  64. // 加载数据
  65. async loadData() {
  66. // 实际开发时替换为接口调用
  67. setTimeout(() => {
  68. // 模拟数据加载
  69. this.hasMore = this.page < 3
  70. this.isRefreshing = false
  71. }, 500)
  72. },
  73. // 下拉刷新
  74. onRefresh() {
  75. this.isRefreshing = true
  76. this.page = 1
  77. this.loadData()
  78. },
  79. // 加载更多
  80. loadMore() {
  81. if (!this.hasMore) return
  82. this.page++
  83. this.loadData()
  84. }
  85. }
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. .withdraw-detail {
  90. min-height: 100vh;
  91. background: #F5F5F5;
  92. padding: 20rpx;
  93. .detail-list {
  94. height: 100vh;
  95. .detail-item {
  96. background: #FFFFFF;
  97. border-radius: 12rpx;
  98. padding: 30rpx;
  99. margin-bottom: 20rpx;
  100. display: flex;
  101. justify-content: space-between;
  102. align-items: center;
  103. .item-left {
  104. .title {
  105. font-size: 28rpx;
  106. color: #333;
  107. display: block;
  108. margin-bottom: 10rpx;
  109. }
  110. .time {
  111. font-size: 24rpx;
  112. color: #999;
  113. }
  114. }
  115. .item-right {
  116. text-align: right;
  117. .amount {
  118. font-size: 32rpx;
  119. color: #38C148;
  120. font-weight: 500;
  121. display: block;
  122. margin-bottom: 10rpx;
  123. }
  124. .status {
  125. font-size: 24rpx;
  126. color: #999;
  127. }
  128. }
  129. }
  130. }
  131. .load-more {
  132. text-align: center;
  133. color: #999;
  134. font-size: 24rpx;
  135. padding: 30rpx 0;
  136. &::before,
  137. &::after {
  138. content: '';
  139. display: inline-block;
  140. width: 100rpx;
  141. height: 1px;
  142. background: #EEEEEE;
  143. vertical-align: middle;
  144. margin: 0 20rpx;
  145. }
  146. }
  147. }
  148. </style>