balance_detail.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <view :class="['qn-page-' + theme]">
  3. <view class="detail-ul">
  4. <view class="detail-li" v-for="(item, index) in listData" :key="index">
  5. <view class="ellipsis title">{{ item.title }}</view>
  6. <view class="time">{{ $u.timeFormat(item.time, 'yyyy-mm-dd hh:MM:ss') }}</view>
  7. <view class="money">
  8. <text>{{ item.type === 1 ? '+' : '' }}{{ item.type === -1 ? '-' : '' }}</text>
  9. <text>¥{{ item.money }}</text>
  10. </view>
  11. </view>
  12. <!-- 空白页 -->
  13. <Aempty text="暂无数据" src="https://onlineimg.qianniao.vip/list.png" v-if="listData.length === 0"></Aempty>
  14. <u-loadmore v-else :status="load_status" />
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. data() {
  21. return {
  22. load_status: 'nomore',
  23. page: 1,
  24. pageSize: 10,
  25. total: 0,
  26. listData: []
  27. };
  28. },
  29. computed: {
  30. userId() {
  31. return this.$store.state.userStatus.id;
  32. }
  33. },
  34. onLoad() {
  35. this.getData();
  36. },
  37. onPullDownRefresh() {
  38. this.page = 1;
  39. this.getData();
  40. },
  41. onReachBottom() {
  42. if (this.total / this.pageSize > this.page) {
  43. this.page += 1;
  44. this.getData();
  45. }
  46. },
  47. methods: {
  48. getData(){
  49. var that = this;
  50. let post={page: this.page,pageSize: this.pageSize}
  51. this.load_status = 'loading';
  52. this.$u.api.getCommissionBalanceDetail(post).then(res=>{
  53. uni.stopPullDownRefresh();
  54. if (that.page === 1) {
  55. that.listData = res.data.data;
  56. } else {
  57. that.listData = that.listData.concat(res.data.data);
  58. }
  59. that.total = res.data.total;
  60. that.load_status = that.$_utils.loadStatus(that.page, that.pageSize, that.total);
  61. }).catch(err=>{
  62. uni.stopPullDownRefresh();
  63. that.load_status = 'nomore';
  64. })
  65. },
  66. }
  67. };
  68. </script>
  69. <style lang="scss" scoped>
  70. .detail-ul {
  71. .detail-li {
  72. width: 710rpx;
  73. margin: 20rpx auto;
  74. background-color: #ffffff;
  75. border-radius: 16rpx;
  76. padding: 24rpx;
  77. position: relative;
  78. .title {
  79. font-weight: bold;
  80. padding-bottom: 12rpx;
  81. -webkit-line-clamp: 2;
  82. }
  83. .time {
  84. font-size: 24rpx;
  85. color: #6c6c6c;
  86. }
  87. .money {
  88. font-weight: bold;
  89. font-family: DIN-Medium;
  90. position: absolute;
  91. right: 24rpx;
  92. top: 50%;
  93. transform: translateY(-50%);
  94. color: $price-color;
  95. }
  96. }
  97. }
  98. </style>