ouyj 5 ヶ月 前
コミット
d273a0dbd6
1 ファイル変更23 行追加5 行削除
  1. 23 5
      pages/worktime/index.uvue

+ 23 - 5
pages/worktime/index.uvue

@@ -87,9 +87,9 @@
             <text class="breakdown-label">维修工时</text>
             <text class="breakdown-value">{{ repairHours }}小时</text>
           </view>
-          <view v-if="rank !== null" class="breakdown-item">
+          <view v-if="rank !== null && totalRankingUsers !== null" class="breakdown-item">
             <text class="breakdown-label">排名</text>
-            <text class="breakdown-value">第{{ rank }}名</text>
+            <text class="breakdown-value">{{ rank }}/{{ totalRankingUsers }}</text>
           </view>
         </view>
       </view>
@@ -104,6 +104,7 @@
       @refresh="handleRefresh" 
       @loadMore="loadMore" 
       @itemClick="viewOrderDetail"
+      class="list-with-padding"
     >
       <template #default="{ item }">
         <view class="list-item">
@@ -114,7 +115,7 @@
             </view>
             <view class="info-row">
               <view class="info-label">
-                <text class="text-xs text-gray-500">下发时间: {{ formatDate(getPropertyValue(item, 'assignTime')) }}</text>
+                <text>下发时间: {{ formatDate(getPropertyValue(item, 'assignTime')) }}</text>
               </view>
               <view class="info-value">
                 <text>处理时长: {{ formatNumber(parseFloat(getPropertyValue(item, 'handleHour'))) }}小时</text>
@@ -131,8 +132,8 @@
         <view class="popup-header">
           <text class="popup-title">选择时间范围</text>
           <view class="popup-actions">
-            <text class="cancel-btn" @click="closeDatePicker">取消</text>
             <text class="confirm-btn" @click="confirmCustomDate">确定</text>
+            <text class="cancel-btn" @click="closeDatePicker">取消</text>
           </view>
         </view>
         
@@ -204,6 +205,7 @@ const totalHours = ref<number>(0)
 const maintenanceHours = ref<number>(0)
 const repairHours = ref<number>(0)
 const rank = ref<number | null>(null)
+const totalRankingUsers = ref<number | null>(null)
 
 // 弹窗显示状态
 const showDatePickerPopup = ref<boolean>(false)
@@ -332,11 +334,13 @@ function getStatistics() {
       maintenanceHours.value = (responseData['maintenanceHours'] != null) ? parseFloat((responseData['maintenanceHours'] as number).toFixed(1)) : 0
       repairHours.value = (responseData['repairHours'] != null) ? parseFloat((responseData['repairHours'] as number).toFixed(1)) : 0
       rank.value = (responseData['rank'] != null) ? responseData['rank'] as number : null
+      totalRankingUsers.value = (responseData['totalRankingUsers'] != null) ? responseData['totalRankingUsers'] as number : null
     } else {
       totalHours.value = 0
       maintenanceHours.value = 0
       repairHours.value = 0
       rank.value = null
+      totalRankingUsers.value = null
     }
   })
 }
@@ -445,6 +449,8 @@ function showCustomDatePicker() {
 }
 
 function closeDatePicker() {
+  showStartDatePicker.value = false
+  showEndDatePicker.value = false
   showDatePickerPopup.value = false
 }
 
@@ -548,6 +554,7 @@ onMounted(() => {
 .list-page {
   flex: 1;
   background-color: #e8f0f9;
+  padding-bottom: 150rpx; // 为底部 TabBar 留出空间
 }
 
 /* 搜索栏样式 */
@@ -722,7 +729,7 @@ onMounted(() => {
 
   .item-title {
     flex: 1;
-    font-size: 32rpx;
+    font-size: 28rpx;
     color: #333333;
     font-weight: bold;
   }
@@ -749,12 +756,17 @@ onMounted(() => {
   }
 }
 
+.text-gray{
+  color: #999999;
+}
 /* 日期选择弹窗 */
 .date-picker-popup {
   background-color: white;
   border-top-left-radius: 30rpx;
   border-top-right-radius: 30rpx;
   padding: 40rpx;
+  padding-bottom: calc(40rpx + env(safe-area-inset-bottom)); // 适配安全区域
+  margin-bottom: env(safe-area-inset-bottom); // 适配安全区域
 }
 
 .popup-header {
@@ -787,6 +799,7 @@ onMounted(() => {
 
 .date-picker-container {
   padding: 20rpx 0;
+  padding-bottom: env(safe-area-inset-bottom); // 适配安全区域
 }
 
 .date-picker-item {
@@ -808,4 +821,9 @@ onMounted(() => {
   font-size: 32rpx;
   color: #333;
 }
+
+// 添加底部填充的类
+.list-with-padding {
+  padding-bottom: 40rpx;
+}
 </style>