index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <view class="com-ward">
  3. <view class="com-ward-list">
  4. <view
  5. class="com-ward-list-item u-border-bottom"
  6. v-for="item in list"
  7. :key="item.orderSn"
  8. @click="toDetail(item)"
  9. >
  10. <view class="fl_b com-ward-list-item-top">
  11. <image src="../../static/image/icon_com.png" mode="" />
  12. <view class="title u-line-1">{{ item.orderSn }}</view>
  13. <view class="money">+{{ item.cash }}</view>
  14. </view>
  15. <view class="com-ward-list-item-status">
  16. {{ item.orderTime | formate("yyyy-mm-dd hh:mm") }}
  17. </view>
  18. </view>
  19. </view>
  20. <view class="nomore" v-if="total && list.length == total">
  21. 已显示全部
  22. </view>
  23. <view class="nomore" v-if="!total"> 暂无数据 </view>
  24. </view>
  25. </template>
  26. <script>
  27. import { getCashList } from "@/utils/commission";
  28. export default {
  29. name: "commission",
  30. data() {
  31. return {
  32. list: [],
  33. total: 0,
  34. param: {},
  35. };
  36. },
  37. onShow() {
  38. this.reset();
  39. this.getCashList();
  40. },
  41. onReachBottom() {
  42. if (this.list.length >= this.total) {
  43. return;
  44. }
  45. this.param.pageNum++;
  46. this.getCashList();
  47. },
  48. methods: {
  49. toDetail(data) {
  50. uni.navigateTo({
  51. url: "/pages/comdetail/index?id=" + 28,
  52. });
  53. },
  54. reset() {
  55. this.list = [];
  56. this.param = {
  57. pageNum: 1,
  58. pageSize: 10,
  59. };
  60. },
  61. getCashList() {
  62. getCashList(this.param).then((res) => {
  63. this.list.push(...res.rows);
  64. this.total = res.total;
  65. });
  66. },
  67. },
  68. };
  69. </script>
  70. <style lang="scss" scoped>
  71. page {
  72. background: #ffffff;
  73. padding: 20rpx 40rpx 0;
  74. }
  75. .com-ward {
  76. .com-ward-list {
  77. .com-ward-list-item {
  78. margin-top: 40rpx;
  79. .com-ward-list-item-top {
  80. image {
  81. width: 32rpx;
  82. height: 32rpx;
  83. margin-right: 14rpx;
  84. padding-top: 4rpx;
  85. }
  86. .title {
  87. flex: 1;
  88. font-weight: bold;
  89. color: #24263d;
  90. font-size: 32rpx;
  91. }
  92. .money {
  93. width: 160rpx;
  94. color: #eb5757;
  95. font-size: 36rpx;
  96. font-weight: 500;
  97. text-align: right;
  98. }
  99. }
  100. .com-ward-list-item-status {
  101. margin: 24rpx 0 40rpx;
  102. color: #7e7d83;
  103. font-size: 28rpx;
  104. padding-left: 44rpx;
  105. }
  106. }
  107. }
  108. }
  109. </style>