user-withdrawal-list.html 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>提现记录-创业帮</title>
  6. <meta name="keywords" content="提现记录-创业帮">
  7. <meta name="description" content="提现记录-创业帮">
  8. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  11. <meta content="telephone=no" name="format-detection">
  12. <meta content="email=no" name="format-detection">
  13. <meta name="apple-mobile-web-app-title" content="提现记录-创业帮">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <link rel="stylesheet" href="./static/css/main.css">
  16. </head>
  17. <body class="bgc-back pt0 pb0 ovh" style="padding-top:0;">
  18. <div id="app" v-cloak>
  19. <van-nav-bar class="user_rank_explan_title user_title_normal" left-arrow title="提现记录" v-if="toptitleisshow" @click-left="goback">
  20. <template #left> <img src="./static/images/left.png" alt=""></template>
  21. </van-nav-bar>
  22. <div class="withdrawal-record ovh-x withdrawallist" ref="wrapper1">
  23. <van-pull-refresh v-model="refreshing" @refresh="onRefresh" :class="withdrawals.length === 0 ? 'isnodata':''" style="height:100%;">
  24. <van-list v-model="loading" :finished="finished" finished-text="没有更多数据了" @load="onLoad" :immediate-check="false">
  25. <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="isnodata"></van-empty>
  26. <van-cell v-for="item,index in withdrawals" :key="index" :value="'¥'+item.TradeAmount" :label="item.CreateDate" @click="withdrawaldetail(item.Id)" is-link center>
  27. <template #title>
  28. <div>{{item.Remark}}<span class="pl6" :class="item.Status === 1 ? 'green':'more'">{{withdrawalstatus(item.Status)}}</span></div>
  29. </template>
  30. </van-cell>
  31. </van-list>
  32. </van-pull-refresh>
  33. </div>
  34. </div>
  35. <script src="./static/js/klm-vv.min.js"></script>
  36. <script src="./static/js/appfunc.min.js"></script>
  37. <script src="./static/js/klm-axios-config.js"></script>
  38. <script src="./static/js/publicfn.js"></script>
  39. <script>
  40. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  41. // 可以通过下面的方式手动注册
  42. Vue.use(vant.Lazyload);
  43. // 在 #app 标签下渲染一个按钮组件
  44. let app = new Vue({
  45. el: '#app',
  46. data() {
  47. return {
  48. isnodata:false,
  49. toptitleisshow:false,
  50. active: 0,
  51. loading: false,
  52. finished: false,
  53. refreshing: false,
  54. withdrawals:[
  55. ],
  56. pageinfo:{
  57. PageSize:20,
  58. PageNum:1,
  59. }
  60. };
  61. },
  62. created() {
  63. this.toptitleisshow = toptitleisshow;
  64. this.geiwithdrawallist('refresh');
  65. },
  66. beforeUpdate(){
  67. this.$nextTick(() => {
  68. this.$refs.wrapper1.style.height = `${document.documentElement.clientHeight}px`;
  69. });
  70. },
  71. methods: {
  72. withdrawalstatus(status){
  73. switch(status){
  74. case 0:
  75. return '处理中';
  76. break;
  77. case 1:
  78. return '交易成功';
  79. break;
  80. case 2:
  81. return '提现失败';
  82. break;
  83. case 3:
  84. return '挂账';
  85. break;
  86. default:
  87. return '状态异常';
  88. break;
  89. };
  90. },
  91. async geiwithdrawallist(type = 'onload'){
  92. //- PublicLib.ShowLoading({Message:''});
  93. const UserId = PublicLib.getCookieInfo('userId');
  94. const res = await getRequest('api/v1/usercashrecord/list?t='+Math.random(6),JSON.stringify({...this.pageinfo,UserId}));
  95. if(res.status !== '1') return tips('提现记录获取失败!');
  96. //- PublicLib.HideLoading();
  97. if(res.data.length < this.pageinfo.PageSize) {
  98. this.finished = true;
  99. }
  100. if(type === 'refresh'){
  101. this.withdrawals = res.data
  102. this.refreshing = false;
  103. }else{
  104. this.withdrawals.push(...res.data);
  105. }
  106. this.loading = false;
  107. if(this.withdrawals.length === 0) {this.isnodata = true}else{this.isnodata = false};
  108. },
  109. onLoad() {
  110. if (this.refreshing) {
  111. //- this.withdrawals = [];
  112. this.refreshing = false;
  113. this.pageinfo.PageNum = 0;
  114. };
  115. this.pageinfo.PageNum++;
  116. this.geiwithdrawallist();
  117. },
  118. onRefresh() {
  119. // 清空列表数据
  120. this.finished = false;
  121. // 重新加载数据
  122. // 将 loading 设置为 true,表示处于加载状态
  123. this.loading = true;
  124. this.pageinfo.PageNum = 1;
  125. this.geiwithdrawallist('refresh');
  126. },
  127. //- 点击跳转详情
  128. withdrawaldetail(id){
  129. PublicLib.putCookieInfo('withdrawalId', id);
  130. PublicLib.Goto({Url:'user-withdrawal-detail', Jump: 1});
  131. },
  132. goback(){
  133. PublicLib.GoBack({Level:1});
  134. }
  135. }
  136. });
  137. </script>
  138. </body>
  139. </html>