withdrawRecord.vue 4.4 KB

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