withdrawRecord.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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>{{showTime(item.showtime)}}</p>
  14. <p>共提现 {{showMap.get(item.showtime).toFixed(2)}}元</p>
  15. </view>
  16. <view class="detailed-item" @click="gotoItem(item)" >
  17. <view class="detailed-item-name">
  18. <view class="u-flex">
  19. <h4>{{item.applicationTypeText}}</h4>
  20. <span :class="{
  21. success:item.status==1,
  22. error:item.status==2,
  23. error2:item.status==0
  24. }">({{item.statusText}})</span>
  25. </view>
  26. <p>{{item.stationName}}</p>
  27. </view>
  28. <view class="detailed-item-num">
  29. <h2>{{item.applicationAmount.toFixed(2)}}元</h2>
  30. <p>{{showTime2(info.createTime)}}</p>
  31. </view>
  32. </view>
  33. </view>
  34. <u-divider v-if="list.length&&list.length == recordsTotal" color="#B6BDC3" style="margin-top:20px;" bg-color="#f7f7f7">已经到底了</u-divider>
  35. </view>
  36. <u-button v-if="info.status" @click="gotoUrl('pagesFinance/user/applicationForWithdrawal')" >创建提现单</u-button>
  37. </view>
  38. </template>
  39. <script>
  40. import * as API from '@/apis/finance.js'
  41. export default {
  42. data() {
  43. return {
  44. pageIndex: 1,
  45. recordsTotal: 0,
  46. list: [],
  47. info:{},
  48. form: {
  49. name: '',
  50. intro: '',
  51. },
  52. showMap:null,
  53. }
  54. },
  55. onLoad(){
  56. this.info=this.carhelp.getPersonInfo("merchantUser")
  57. },
  58. onReady() {
  59. this.getList()
  60. },
  61. onReachBottom() {
  62. if (this.list.length < this.recordsTotal) {
  63. this.myLoadmore();
  64. }
  65. },
  66. methods: {
  67. showTime(name){
  68. if(!name){
  69. return ''
  70. }
  71. return name.replace('-','年')+'月';
  72. },
  73. showTime2(name){
  74. if(!name){
  75. return ''
  76. }
  77. return name.substring(5);
  78. },
  79. gotoItem(item){
  80. if(item.status=='-1'){
  81. this.gotoUrl('pagesFinance/user/applicationForWithdrawal?id='+item.id)
  82. }else{
  83. this.gotoUrl('pagesFinance/user/applicationDetails?id='+item.id)
  84. }
  85. },
  86. getList() {
  87. uni.showLoading({
  88. title: "加载中",
  89. mask: true,
  90. })
  91. API.withdrawRecord({
  92. pageIndex:this.pageIndex
  93. }).then((res) => {
  94. this.list = [
  95. ...this.list,
  96. ...res.data.data
  97. ];
  98. var showMap=new Map()
  99. this.list.forEach(item=>{
  100. var ktime=item.applicationMonth;
  101. if(showMap.has(ktime)){
  102. item.show=false;
  103. // var m=showMap.get(ktime)*100+item.applicationAmount*100;
  104. // showMap.set(ktime,m/100)
  105. }else{
  106. showMap.set(ktime,item.totalApplicationAmount)
  107. item.show=true;
  108. item.showtime=ktime;
  109. }
  110. })
  111. this.showMap=showMap;
  112. this.recordsTotal = res.data.recordsTotal
  113. uni.hideLoading()
  114. }).catch(error => {
  115. uni.showToast({
  116. title: error
  117. })
  118. })
  119. },
  120. }
  121. }
  122. </script>
  123. <style>
  124. page{
  125. background-color: #F7F7F7;
  126. }
  127. </style>
  128. <style lang="scss" scoped>
  129. .detailed-time{
  130. display: flex;
  131. justify-content: space-between;
  132. align-items: center;
  133. padding: 10px 20px;
  134. p{
  135. color:#666;
  136. }
  137. }
  138. .detailed-item{
  139. background-color: #fff;
  140. display: flex;
  141. justify-content: space-between;
  142. padding: 10px 20px;
  143. border-bottom: 1px solid #ededed;
  144. .detailed-item-name{
  145. font-size: 14px;
  146. h4{
  147. font-weight: normal;
  148. }
  149. p{
  150. font-size: 12px;
  151. margin-top: 4px;
  152. color:#666;
  153. }
  154. span{
  155. margin-left: 10px;
  156. }
  157. .success{color:#27b148}
  158. .error{color:#FF6200;}
  159. .error2{color:#1ba7f4;}
  160. }
  161. .detailed-item-num{
  162. text-align: right;
  163. align-items: center;
  164. h2{
  165. }
  166. }
  167. }
  168. .u-btn{
  169. margin: 0 16px;
  170. position: fixed;
  171. bottom: 12px;
  172. left: 0;
  173. right: 0;
  174. height: 44px;
  175. line-height: 44px;
  176. border-radius: 8px;
  177. background-color: rgba(24, 90, 198, 100);
  178. color: rgba(255, 255, 255, 100);
  179. }
  180. </style>