withdrawRecord.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <view>
  3. <u-navbar title="提现记录"></u-navbar>
  4. <view class="detailed">
  5. <view style="text-align: center;margin-top: 100px" v-if="!list.length">
  6. <img src="@/assets/img/blankpage.png">
  7. <view>没有提现记录</view>
  8. </view>
  9. <view class="detailed-list"
  10. :key="index"
  11. v-for="(item ,index) in list" >
  12. <view class="detailed-time" v-if="item.show">
  13. <p>{{item.showtime}}</p>
  14. <p>共提现 {{showMap.get(item.showtime)}}</p>
  15. </view>
  16. <view class="detailed-item">
  17. <view class="detailed-item-name">
  18. <view class="u-flex">
  19. <h4>提现</h4>
  20. <span v-if="item.status==1" class="success">(提现成功)</span>
  21. <span v-if="item.status==0" class="error">(待转账)</span>
  22. </view>
  23. <p>{{item.createTime}}</p>
  24. </view>
  25. <view class="detailed-item-num">
  26. <h2>{{item.applicationAmount}}</h2>
  27. </view>
  28. </view>
  29. </view>
  30. <u-divider v-if="list.length&&list.length == recordsTotal" color="#B6BDC3" style="margin-top:20px;" bg-color="#f4f0f0">已经到底了</u-divider>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. import * as API from '@/apis/finance.js'
  36. export default {
  37. data() {
  38. return {
  39. pageIndex: 1,
  40. recordsTotal: 0,
  41. list: [],
  42. form: {
  43. name: '',
  44. intro: '',
  45. },
  46. showMap:null,
  47. }
  48. },
  49. onReady() {
  50. this.getList()
  51. },
  52. onReachBottom() {
  53. if (this.list.length < this.recordsTotal) {
  54. this.myLoadmore();
  55. }
  56. },
  57. methods: {
  58. getList() {
  59. uni.showLoading({
  60. title: "加载中",
  61. mask: true,
  62. })
  63. API.withdrawRecord({
  64. pageIndex:this.pageIndex
  65. }).then((res) => {
  66. this.list = [
  67. ...this.list,
  68. ...res.data.data
  69. ];
  70. var showMap=new Map()
  71. this.list.forEach(item=>{
  72. var ktime=item.createTime.split(" ")[0]
  73. if(showMap.has(ktime)){
  74. item.show=false;
  75. var m=showMap.get(ktime)+item.applicationAmount;
  76. showMap.set(ktime,m)
  77. }else{
  78. showMap.set(ktime,item.applicationAmount)
  79. item.show=true;
  80. item.showtime=ktime;
  81. }
  82. })
  83. this.showMap=showMap;
  84. this.recordsTotal = res.data.recordsTotal
  85. uni.hideLoading()
  86. }).catch(error => {
  87. uni.showToast({
  88. title: error
  89. })
  90. })
  91. },
  92. }
  93. }
  94. </script>
  95. <style>
  96. page{
  97. background-color: #F7F7F7;
  98. }
  99. </style>
  100. <style lang="scss" scoped>
  101. .detailed-time{
  102. display: flex;
  103. justify-content: space-between;
  104. align-items: center;
  105. padding: 10px 20px;
  106. p{
  107. color:#666;
  108. }
  109. }
  110. .detailed-item{
  111. background-color: #fff;
  112. display: flex;
  113. justify-content: space-between;
  114. padding: 10px 20px;
  115. border-bottom: 1px solid #ededed;
  116. .detailed-item-name{
  117. h4{
  118. font-weight: normal;
  119. }
  120. p{
  121. font-size: 12px;
  122. margin-top: 4px;
  123. color:#A2A9B5;
  124. }
  125. span{
  126. margin-left: 10px;
  127. }
  128. .success{color:#27b148}
  129. .error{color:#FF6200;}
  130. }
  131. .detailed-item-num{
  132. display: flex;
  133. align-items: center;
  134. h2{
  135. margin-right: 4px;
  136. }
  137. }
  138. }
  139. </style>