after-sale-result.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <view class="common-page" style="padding:0">
  3. <PageScroll requestStr="/app/orderStat/afterOrderDailyStat" @updateList="updateList" ref="scrollRef"
  4. :otherParams="otherParams">
  5. <u-sticky :customNavHeight="0">
  6. <view class="search-area flex-d">
  7. <view class="flex-a">
  8. <view class="text-item flex-2">申请时段</view>
  9. <view class="text-item flex-1">售后订单数</view>
  10. <view class="text-item flex-1">发出订单数</view>
  11. <view class="text-item flex-1">未发订单数</view>
  12. </view>
  13. </view>
  14. </u-sticky>
  15. <view class="list-con">
  16. <view class="flex-a list-item stat-header" v-if="dataList.length > 0">
  17. <view class="text-item flex-2" style="flex:2">
  18. <view v-if="otherParams.startTime && otherParams.endTime">
  19. <view class="flex-d">
  20. <view class="text-item flex-1">{{otherParams.startTime}}</view>
  21. <view class="text-item flex-1">{{otherParams.endTime}}</view>
  22. </view>
  23. </view>
  24. <view v-else>合计</view>
  25. </view>
  26. <view class="text-item flex-1">{{total.refundOrderNum}}</view>
  27. <view class="text-item flex-1">{{total.sendOrderNum}}</view>
  28. <view class="text-item flex-1">{{total.notSendBookNum}}</view>
  29. </view>
  30. <view v-for="(item,index) in dataList" :key="index" class="flex-a list-item">
  31. <view class="text-item flex-2" style="flex:2">{{item.statDate}}</view>
  32. <view class="text-item flex-1">{{item.refundOrderNum}}</view>
  33. <view class="text-item flex-1">{{item.sendOrderNum}}</view>
  34. <view class="text-item flex-1">{{item.notSendBookNum}}</view>
  35. </view>
  36. </view>
  37. </PageScroll>
  38. </view>
  39. </template>
  40. <script setup>
  41. import { reactive, ref, onMounted } from 'vue';
  42. import PageScroll from '@/components/pageScroll/index.vue'
  43. import { onLoad } from '@dcloudio/uni-app'
  44. const otherParams = ref({
  45. startTime: '',
  46. endTime: ''
  47. })
  48. const scrollRef = ref(null)
  49. const refreshList = () => {
  50. scrollRef.value?.resetUpScroll()
  51. getStatData()
  52. }
  53. let dataList = ref([])
  54. const updateList = (data) => {
  55. dataList.value = data
  56. }
  57. const total = ref({
  58. refundOrderNum: 0,
  59. sendOrderNum: 0,
  60. notSendBookNum: 0
  61. })
  62. //获取时段统计数据
  63. const getStatData = () => {
  64. uni.$u.http.get('/app/orderStat/afterOrderStat?startTime=' + otherParams.value.startTime + '&endTime=' + otherParams.value.endTime).then(res => {
  65. total.value = res.data
  66. })
  67. }
  68. onLoad((options) => {
  69. if (options.startTime && options.endTime) {
  70. otherParams.value.startTime = decodeURIComponent(options.startTime)
  71. otherParams.value.endTime = decodeURIComponent(options.endTime)
  72. getStatData()
  73. }else{
  74. otherParams.value.startTime = ''
  75. otherParams.value.endTime = ''
  76. getStatData()
  77. }
  78. })
  79. </script>
  80. <style lang="scss">
  81. .search-area {
  82. padding: 24rpx;
  83. background-color: #ffffff;
  84. z-index: 9;
  85. }
  86. .stat-header {
  87. background-color: #3bb54b;
  88. }
  89. .flex-2 {
  90. flex: 2;
  91. }
  92. .list-item {
  93. border-bottom: 1rpx solid #f5f5f5;
  94. font-size: 24rpx !important;
  95. padding: 10rpx 0;
  96. }
  97. </style>