withdrawRecord.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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?item.applicationAmount.toFixed(2):'0'}}元</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="uuid=new Date().getTime(),gotoUrl('pagesFinance/user/applicationForWithdrawal?uuid='+uuid)" >创建提现单</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. uuid:""
  54. }
  55. },
  56. onLoad(){
  57. this.info=this.carhelp.getPersonInfo("merchantUser")
  58. },
  59. onReady() {
  60. this.getList()
  61. },
  62. onReachBottom() {
  63. if (this.list.length < this.recordsTotal) {
  64. this.myLoadmore();
  65. }
  66. },
  67. onShow(){
  68. var obj=this.carhelp.get("withdrawRecord")
  69. if(obj&&obj.uuid==this.uuid){
  70. this.list=[];
  71. this.pageIndex = 1;
  72. this.getList()
  73. }
  74. },
  75. methods: {
  76. showTime(name){
  77. if(!name){
  78. return ''
  79. }
  80. return name.replace('-','年')+'月';
  81. },
  82. showTime2(name){
  83. if(!name){
  84. return ''
  85. }
  86. return name.substring(5);
  87. },
  88. gotoItem(item){
  89. this.uuid=new Date().getTime()
  90. if(this.info.status&&item.status=='-1'){
  91. this.gotoUrl('pagesFinance/user/applicationForWithdrawal?id='+item.id+"&uuid="+this.uuid)
  92. }else{
  93. this.gotoUrl('pagesFinance/user/applicationDetails?id='+item.id)
  94. }
  95. },
  96. getList() {
  97. uni.showLoading({
  98. title: "加载中",
  99. mask: true,
  100. })
  101. API.withdrawRecord({
  102. pageIndex:this.pageIndex
  103. }).then((res) => {
  104. this.list = [
  105. ...this.list,
  106. ...res.data.data
  107. ];
  108. var showMap=new Map()
  109. this.list.forEach(item=>{
  110. var ktime=item.applicationMonth;
  111. if(showMap.has(ktime)){
  112. item.show=false;
  113. // var m=showMap.get(ktime)*100+item.applicationAmount*100;
  114. // showMap.set(ktime,m/100)
  115. }else{
  116. showMap.set(ktime,item.totalApplicationAmount)
  117. item.show=true;
  118. item.showtime=ktime;
  119. }
  120. })
  121. this.showMap=showMap;
  122. this.recordsTotal = res.data.recordsTotal
  123. uni.hideLoading()
  124. }).catch(error => {
  125. uni.showToast({
  126. title: error
  127. })
  128. })
  129. },
  130. }
  131. }
  132. </script>
  133. <style>
  134. page{
  135. background-color: #F7F7F7;
  136. }
  137. </style>
  138. <style lang="scss" scoped>
  139. .detailed-time{
  140. display: flex;
  141. justify-content: space-between;
  142. align-items: center;
  143. padding: 10px 20px;
  144. p{
  145. color:#666;
  146. }
  147. }
  148. .detailed-item{
  149. background-color: #fff;
  150. display: flex;
  151. justify-content: space-between;
  152. padding: 10px 20px;
  153. border-bottom: 1px solid #ededed;
  154. .detailed-item-name{
  155. font-size: 14px;
  156. h4{
  157. font-weight: normal;
  158. }
  159. p{
  160. font-size: 12px;
  161. margin-top: 4px;
  162. color:#666;
  163. }
  164. span{
  165. margin-left: 10px;
  166. }
  167. .success{color:#27b148}
  168. .error{color:#FF6200;}
  169. .error2{color:#1ba7f4;}
  170. }
  171. .detailed-item-num{
  172. text-align: right;
  173. align-items: center;
  174. h2{
  175. }
  176. }
  177. }
  178. .u-btn{
  179. margin: 0 16px;
  180. position: fixed;
  181. bottom: 12px;
  182. left: 0;
  183. right: 0;
  184. height: 44px;
  185. line-height: 44px;
  186. border-radius: 8px;
  187. background-color: rgba(24, 90, 198, 100);
  188. color: rgba(255, 255, 255, 100);
  189. }
  190. </style>