myCommission.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <view class="my_commission_wrap">
  3. <view class="queryParams_wrap">
  4. <view class="search">
  5. <u--input clearable prefixIcon="search" v-model="queryParams.phone" shape="circle" clearable
  6. @blur="handleKeyword" @clear="handleKeywordClear" placeholder="请输入电话"></u--input>
  7. </view>
  8. <view class="query">
  9. <view style="margin-right: 10rpx;" @click="handleshowFilter">筛选</view>
  10. <u-icon name="arrow-down-fill" color="#aaa" size="10"></u-icon>
  11. </view>
  12. </view>
  13. <view class="commission_item_wrap">
  14. <!-- 统计信息 -->
  15. <commission-item v-for="item in listData" :key="item.id" :item="item" :type="type"></commission-item>
  16. </view>
  17. <filter-query ref="filter" v-model="queryParams" @getList="resetData" :mapHeight="mapHeight"></filter-query>
  18. <!-- 加载更多 -->
  19. <u-loadmore :status="loadStatus" v-if="listData.length > 0" />
  20. <!-- 空状态 -->
  21. <show-emtry v-if="listData.length === 0"></show-emtry>
  22. </view>
  23. </template>
  24. <script>
  25. import pullUpRefresh from "@/utils/pullUpRefresh";
  26. import filterQuery from "./filterQuery.vue";
  27. import commissionItem from "./commissionItem.vue";
  28. import dayjs from "dayjs";
  29. export default {
  30. mixins: [pullUpRefresh],
  31. components: {
  32. filterQuery,
  33. commissionItem
  34. },
  35. props: {
  36. type: {
  37. type: String,
  38. default: '2'
  39. },
  40. showStats: {
  41. type: Boolean,
  42. default: true
  43. }
  44. },
  45. data() {
  46. return {
  47. queryParams: {
  48. receiptDateEnd: dayjs().format("YYYY-MM-DD"),
  49. receiptDateStart: dayjs().startOf('month').format("YYYY-MM-DD"),
  50. item: undefined,
  51. phone: undefined,
  52. receiptUserId: undefined,
  53. pageNum: 1,
  54. pageSize: 10,
  55. },
  56. mapHeight: "0px"
  57. }
  58. },
  59. methods: {
  60. handleKeyword() {
  61. this.resetData();
  62. },
  63. handleKeywordClear() {
  64. // 组件有bug 清空后的值还是存在
  65. this.queryParams.phone = "";
  66. this.resetData();
  67. },
  68. handleshowFilter() {
  69. this.$refs.filter.show();
  70. },
  71. async getList() {
  72. const {
  73. pageNum,
  74. pageSize,
  75. } = this.queryParams;
  76. this.queryParams.type = this.type;
  77. // 调用分成接口
  78. const {
  79. rows,
  80. total
  81. } = await uni.$u.api.selectCommissionList({
  82. pageSize,
  83. pageNum,
  84. }, this.queryParams);
  85. return rows;
  86. },
  87. handleOnReachBottom() {
  88. this.handleReachBottom();
  89. }
  90. },
  91. mounted() {
  92. this.resetData();
  93. uni.getSystemInfo({
  94. success: (e) => {
  95. const {
  96. windowTop,
  97. windowBottom,
  98. windowHeight
  99. } = e;
  100. this.mapHeight = windowHeight + 'px';
  101. }
  102. });
  103. }
  104. }
  105. </script>
  106. <style lang="scss" scoped>
  107. .my_commission_wrap {
  108. .queryParams_wrap {
  109. display: flex;
  110. background: #fff;
  111. padding: 14px 0;
  112. .query,
  113. .search {
  114. display: flex;
  115. align-items: center;
  116. justify-content: center;
  117. font-size: 16px;
  118. font-weight: 700;
  119. color: #202020;
  120. }
  121. .query {
  122. flex: 1;
  123. }
  124. .search {
  125. flex: 2;
  126. padding-left: 20px;
  127. }
  128. }
  129. }
  130. .stats_info_wrap {
  131. margin-bottom: 30px;
  132. }
  133. .stats_info_top {
  134. display: flex;
  135. margin-bottom: 20px;
  136. .info_item {
  137. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  138. width: 23%;
  139. margin-right: 2.6%;
  140. height: 120px;
  141. padding: 15px;
  142. background: #fff;
  143. border-radius: 15px;
  144. &:last-child {
  145. margin-right: 0;
  146. }
  147. .info_title {
  148. font-size: 14px;
  149. color: #6b7280;
  150. margin-bottom: 15px;
  151. }
  152. .info_value {
  153. font-size: 24px;
  154. font-weight: bold;
  155. color: #202020;
  156. }
  157. }
  158. }
  159. .commission_item_wrap {
  160. padding: 20px 20px;
  161. }
  162. .empty_wrap {
  163. margin-top: 100px;
  164. }
  165. </style>