history.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <template>
  2. <view class="main">
  3. <navbar :config="config" backColor="#666"></navbar>
  4. <view class="list">
  5. <view class="item" v-for="(item,index) in listData" :key="index">
  6. <view class="left">
  7. <view class="price">¥{{item.donation_amount}}</view>
  8. <view class="time">{{item.create_time}}</view>
  9. </view>
  10. <view class="right">
  11. <view class="status" :class="statusList[item.audit_status].class">{{statusList[item.audit_status].text}}</view>
  12. </view>
  13. </view>
  14. </view>
  15. <u-loadmore :status="loadStatus" />
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. data() {
  21. return {
  22. config: {
  23. back: true,
  24. title: '申领记录',
  25. color: '#1a1a1a',
  26. backgroundColor: [1, '#fff'],
  27. statusBarFontColor: 'black'
  28. },
  29. pageParams:{
  30. page: 1,
  31. limit: 10
  32. },
  33. listData: [],
  34. loadStatus: 'loadmore',//loading / nomore
  35. statusList:[{
  36. class: '',
  37. text: '待审核'
  38. },{
  39. class: 'success',
  40. text: '已发放'
  41. },{
  42. class: 'error',
  43. text: '审核不通过,请重新提交'
  44. }]
  45. }
  46. },
  47. onLoad() {
  48. this.getList(true);
  49. },
  50. methods: {
  51. getList(isRefresh,needLoading = false) {
  52. let that = this;
  53. if (!isRefresh && this.loadStatus == 'nomore') {
  54. return false;
  55. }
  56. this.pageParams.page = isRefresh ? 1 : this.pageParams.page + 1;
  57. this.listData = isRefresh ? [] : this.listData;
  58. if(needLoading){
  59. uni.showLoading({
  60. title: '努力加载中...',
  61. mask: true
  62. });
  63. }
  64. this.loadStatus = 'loading';
  65. this.$http.get('/official/donation/page',this.pageParams)
  66. .then(res=>{
  67. if (res.code == 200) {
  68. let listData = that.listData;
  69. listData.push(...res.page.list);
  70. that.listData = listData;
  71. that.loadStatus = that.listData.length >= res.page.totalCount?'nomore':'loadmore';
  72. }
  73. })
  74. .finally(()=>{
  75. if(needLoading){
  76. uni.hideLoading();
  77. }
  78. })
  79. }
  80. },
  81. onReachBottom(){
  82. this.getList();
  83. }
  84. };
  85. </script>
  86. <style lang="scss" scoped>
  87. .main{
  88. padding: 30rpx 0;
  89. .list{
  90. .item{
  91. width: 100%;
  92. padding: 30rpx 60rpx;
  93. display: flex;
  94. justify-content: space-between;
  95. border-bottom: 1px solid #e6e6e6;
  96. .left{
  97. .price{
  98. font-size: 28rpx;
  99. font-family: MicrosoftYaHei;
  100. text-align: left;
  101. color: #1a1a1a;
  102. margin-bottom: 17rpx;
  103. }
  104. .time{
  105. font-size: 24rpx;
  106. font-family: MicrosoftYaHei;
  107. text-align: left;
  108. color: #999999;
  109. }
  110. }
  111. .right{
  112. .status{
  113. font-size: 28rpx;
  114. font-family: Microsoft YaHei, Microsoft YaHei-Regular;
  115. font-weight: 400;
  116. text-align: right;
  117. color: #1A1A1A;
  118. line-height: 30rpx;
  119. margin-top: 20rpx;
  120. &.success{
  121. color: #118D44;
  122. }
  123. &.error{
  124. color: #F31919;
  125. }
  126. }
  127. }
  128. }
  129. }
  130. }
  131. </style>