Kaynağa Gözat

feat: 日统计汇总卡片增加统计范围日期提示

汇总卡片上方显示当前统计日期范围,有筛选时显示具体日期,
无筛选时显示"全部日期",避免误解数据范围。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
skyline 1 hafta önce
ebeveyn
işleme
694ade7b26
1 değiştirilmiş dosya ile 19 ekleme ve 1 silme
  1. 19 1
      admin-h5/src/pages/statistics/index.vue

+ 19 - 1
admin-h5/src/pages/statistics/index.vue

@@ -39,6 +39,9 @@
     </view>
 
     <!-- 汇总卡片 -->
+    <view class="summary-range" v-if="list.length > 0">
+      <text class="range-text">统计范围:{{ summaryDateRange }}</text>
+    </view>
     <view class="summary-section" v-if="list.length > 0">
       <view class="summary-card">
         <text class="summary-label">总收入</text>
@@ -197,7 +200,7 @@
 </template>
 
 <script setup>
-import { ref, onMounted } from 'vue'
+import { ref, computed, onMounted } from 'vue'
 import { onReachBottom } from '@dcloudio/uni-app'
 import { getDailyStatList, getMonthlyStatList, getDailyStatAggregate } from '../../api/stat.js'
 import { getStationList } from '../../api/station.js'
@@ -231,6 +234,13 @@ const summary = ref({
 })
 const summaryLoading = ref(false)
 
+const summaryDateRange = computed(() => {
+  if (filterKey.value) {
+    return activeTab.value === 0 ? filterKey.value : filterKey.value
+  }
+  return '全部日期'
+})
+
 const emptySummary = () => ({
   totalIncome: 0, totalConsumption: 0, totalOrders: 0,
   totalRegistrations: 0, totalActiveUsers: 0,
@@ -475,6 +485,14 @@ onMounted(async () => {
   border: none;
 }
 
+.summary-range {
+  padding: 8rpx 20rpx 12rpx;
+}
+.range-text {
+  font-size: 22rpx;
+  color: #999999;
+}
+
 .summary-section {
   display: grid;
   grid-template-columns: repeat(3, 1fr);