withdrawDetail.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <view class="withdraw-detail">
  3. <u-sticky bg-color="#151728">
  4. <u-tabs
  5. :list="tabs"
  6. line-color="#6EEBE8"
  7. :active-style="{color: '#6EEBE8'}"
  8. :inactive-style="{color: '#ffffff'}"
  9. :item-style="{width: 'calc(750rpx / 5)', height: '44px'}"
  10. :current="activeIndex"
  11. @click="handleTabClick"
  12. />
  13. </u-sticky>
  14. <template v-for="(tab, index) in tabs">
  15. <view
  16. v-if="activeIndex === index"
  17. :key="index"
  18. class="detail-box"
  19. >
  20. <view
  21. v-for="(data, dataIndex) in tab.data"
  22. :key="dataIndex"
  23. class="detail-item"
  24. >
  25. <view class="date">
  26. {{ data.created_at }}
  27. </view>
  28. <view class="info">
  29. <view class="type main-left cross-center">
  30. {{ data.type_name }}
  31. <view class="status">{{ data.status_name }}</view>
  32. </view>
  33. <view class="withdraw-box main-between cross-center">
  34. <view class="item">
  35. <view>提现账户:{{ data.account }}</view>
  36. <view>提现时间: {{ data.created_at }}</view>
  37. </view>
  38. <view class="item price-box">
  39. <view class="price">{{ data.price }}</view>
  40. <view class="discount">手续费: {{ data.discount }}</view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </template>
  47. </view>
  48. </template>
  49. <script>
  50. export default {
  51. data() {
  52. return {
  53. tabs: [
  54. { name: '全部', status: -1, data: [], limit: 10, page: 1, isMore: true },
  55. { name: '待审核', status: 0, data: [], limit: 10, page: 1, isMore: true },
  56. { name: '待打款', status: 1, data: [], limit: 10, page: 1, isMore: true },
  57. { name: '已打款', status: 2, data: [], limit: 10, page: 1, isMore: true },
  58. { name: '无效', status: 3, data: [], limit: 10, page: 1, isMore: true }
  59. ],
  60. activeIndex: 0
  61. }
  62. },
  63. computed: {},
  64. methods: {
  65. handleTabClick(item) {
  66. this.activeIndex = item.index
  67. const tab = this.tabs[this.activeIndex]
  68. if (tab.data.length === 0 && tab.isMore) {
  69. this.getData()
  70. }
  71. },
  72. getData() {
  73. this.$loading()
  74. const item = this.tabs[this.activeIndex]
  75. const params = { limit: item.limit, page: item.page, status: item.status }
  76. this.$api.share.withdraw.lists(params).then(res => {
  77. this.$hideLoading()
  78. if (res.data.length) {
  79. item.data = item.data.concat(res.data)
  80. } else {
  81. item.isMore = false
  82. }
  83. })
  84. }
  85. },
  86. onLoad(options) {
  87. this.activeIndex = typeof options.active !== 'undefined' ? parseInt(options.active) : 0
  88. this.getData()
  89. },
  90. onReachBottom(e) {
  91. const item = this.tabs[this.activeIndex]
  92. if (!item.isMore) return
  93. item.page += 1
  94. this.getData()
  95. }
  96. }
  97. </script>
  98. <style lang="scss" scoped>
  99. .withdraw-detail {
  100. font-size: 28rpx;
  101. padding: 30rpx 0 80rpx;
  102. .detail-box{
  103. padding: 0 30rpx;
  104. margin-top: 30rpx;
  105. .detail-item{
  106. background: $bg-op-color;
  107. color: #ffffff;
  108. border-radius: 10rpx;
  109. padding: 30rpx 0;
  110. margin-bottom: 20rpx;
  111. .date{
  112. border-bottom: 1rpx $border-op-color solid;
  113. padding: 0 30rpx 30rpx;
  114. }
  115. .info{
  116. padding: 30rpx 30rpx 0;
  117. .type{
  118. font-size: 32rpx;
  119. .status{
  120. font-size: 20rpx;
  121. color: #ff74b9;
  122. border: 1rpx solid #FF74B9;
  123. border-radius: 30rpx;
  124. padding: 2rpx 20rpx;
  125. margin-left: 20rpx;
  126. }
  127. }
  128. .withdraw-box{
  129. margin-top: 20rpx;
  130. .item{
  131. >view:first-child{
  132. margin-bottom: 10rpx;
  133. }
  134. &.price-box{
  135. color: #6eebe8;
  136. font-size: 36rpx;
  137. font-weight: bold;
  138. .discount{
  139. font-size: 24rpx;
  140. font-weight: normal;
  141. }
  142. }
  143. }
  144. }
  145. }
  146. }
  147. }
  148. }
  149. </style>