record.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <view>
  3. <!--promote/withdrawal/record/record.wxml-->
  4. <view class="list mt20" v-if="data.length>0">
  5. <!-- <block wx:for="{{pageList}}" wx:key="index"> -->
  6. <view v-for="(item, index) in data" :key="index" class="li dflex">
  7. <view class="dizhi flex">
  8. <view>{{item.remark}}<text class="shenghe" v-if="item.state==1">审核中</text><text class="success" v-if="item.state==2">提取成功</text><text class="file" v-if="item.state==3">审核失败</text></view>
  9. <text class="reason" v-if="item.state==3">失败原因:<text class="colorred">{{item.reason}}</text></text>
  10. <view class="time"><text>{{item.time}}</text></view>
  11. </view>
  12. <view class="yue">
  13. <view class="money">-{{item.money}}</view>
  14. <text>余额{{item.balance}}</text>
  15. </view>
  16. </view>
  17. <!-- </block> -->
  18. </view>
  19. <view class="nodata" v-if="ishow">
  20. <image :src="picUrlss+'empty_dd.png'"></image>
  21. <text>暂无提现记录</text>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. // promote/withdrawal/record/record.js
  27. const app = getApp();
  28. const req = require("../../../utils/request.js");
  29. export default {
  30. data() {
  31. return {
  32. picUrlss: req.public.picUrls,
  33. isLoad: true,
  34. form: {
  35. page: 1,
  36. limit: 10
  37. },
  38. data: "",
  39. ishow: false
  40. };
  41. },
  42. components: {},
  43. props: {},
  44. /**
  45. * 生命周期函数--监听页面加载
  46. */
  47. onLoad: function (options) {},
  48. /**
  49. * 生命周期函数--监听页面显示
  50. */
  51. onShow: function () {
  52. this.getRecord();
  53. },
  54. onReachBottom() {
  55. console.log("=============--------------");
  56. this.form.page++;
  57. this.getRecord();
  58. },
  59. methods: {
  60. getRecord() {
  61. let isShowLoading = false;
  62. if (this.form.page == 1 && !isShowLoading) {
  63. req.loadIng('加载中');
  64. isShowLoading = true;
  65. }
  66. let that = this;
  67. console.log("===============", that.isLoad);
  68. if (!that.isLoad) return false;
  69. console.log("11111111111111111");
  70. that.isLoad = false;
  71. req.getRequest('/api/withdraw/list', that.form, data => {
  72. if (data && data.length >= 10) that.isLoad = true;
  73. if (that.form.page > 1) data = that.data.concat(data);
  74. this.setData({
  75. data: data
  76. });
  77. if (this.data && this.data.length <= 0) {
  78. that.setData({
  79. ishow: true
  80. });
  81. } else {
  82. that.setData({
  83. ishow: false
  84. });
  85. }
  86. if (isShowLoading) {
  87. uni.hideLoading();
  88. isShowLoading = false;
  89. }
  90. console.log(data);
  91. });
  92. }
  93. }
  94. };
  95. </script>
  96. <style>
  97. @import "./record.css";
  98. </style>