withdrawRecord.vue 2.7 KB

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