2
0
Эх сурвалжийг харах

fix: 临时隐藏企业端打卡数据真实值,显示固定100%完成率

业务背景:人才小程序打卡功能尚未实现,导致企业端显示 0/4 数据。
为避免用户困惑,临时隐藏真实数据,显示固定100%完成率。

修改内容:
- 订单列表页:隐藏 0/4 数据,显示固定 100%
- 订单详情页:隐藏 0/4 数据,显示固定 100%
- 添加详细注释说明临时方案的原因和后续TODO
- 更新 .gitignore 忽略 Python __pycache__ 和 .pyc 文件

相关文档:docs/系统故障20260306.docx 问题3

Generated with [Claude Code](https://claude.com/claude-code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
yourname 1 өдөр өмнө
parent
commit
58a4ff4f25

+ 6 - 0
.gitignore

@@ -38,6 +38,12 @@ lerna-debug.log*
 # misc
 .DS_Store
 
+# Python
+__pycache__/
+*.pyc
+*.pyo
+*.pyd
+
 .pnpm-store
 old
 certs

+ 25 - 13
mini/src/pages/yongren/order/detail/index.tsx

@@ -252,8 +252,10 @@ const OrderDetail: React.FC = () => {
   })
 
   // 使用React Query获取订单统计数据 - 与列表页保持相同的缓存策略
+  // 临时注释:由于人才小程序打卡功能未实现,临时隐藏真实数据显示固定100%
+  // TODO: 等打卡功能实现后,恢复使用 statistics 数据
   const {
-    data: statistics,
+    // data: statistics, // 暂未使用
     isLoading: statisticsLoading,
     error: statisticsError,
   } = useQuery<StatisticsData, Error>({
@@ -529,29 +531,39 @@ const OrderDetail: React.FC = () => {
         </View>
 
         {/* 打卡统计卡片 */}
+        {/* IMPORTANT: 临时隐藏真实数据,显示固定100%完成率
+         *
+         * 业务背景说明:
+         * 1. 人才小程序的打卡功能尚未实现(当前为假功能)
+         * 2. 因此企业端显示的打卡数据始终为 0/total(如 0/4)
+         * 3. 为避免用户困惑("为什么0个人打卡还显示百分比?"),
+         *    临时方案是隐藏数据,显示固定的100%完成率
+         *
+         * TODO: 等人才小程序打卡功能实现后,需要:
+         *       1. 取消注释下方被隐藏的数据显示代码
+         *       2. 恢复真实的百分比计算逻辑
+         *       3. 删除此固定100%的临时方案
+         *
+         * @see 相关问题:docs/系统故障20260306.docx 问题3
+         * @author Claude 2026-03-09
+         */}
         <View className="card bg-white p-4 mb-4">
           <Text className="font-semibold text-gray-700 mb-3">打卡数据统计</Text>
           <View className="grid grid-cols-3 gap-2 mb-3">
             <View className="bg-blue-50 rounded-lg p-2 text-center flex flex-col">
               <Text className="text-xs text-gray-600">本月打卡</Text>
-              <Text className="text-sm font-bold text-gray-800">
-                {statistics?.checkinStats.current || 0}/{statistics?.checkinStats.total || 0}
-              </Text>
-              <Text className="text-xs text-gray-500">100%</Text>
+              {/* 临时隐藏真实数据:{statistics?.checkinStats.current || 0}/{statistics?.checkinStats.total || 0} */}
+              <Text className="text-lg font-bold text-green-600">100%</Text>
             </View>
             <View className="bg-green-50 rounded-lg p-2 text-center flex flex-col">
               <Text className="text-xs text-gray-600">工资视频</Text>
-              <Text className="text-sm font-bold text-gray-800">
-                {statistics?.salaryVideoStats.current || 0}/{statistics?.salaryVideoStats.total || 0}
-              </Text>
-              <Text className="text-xs text-gray-500">100%</Text>
+              {/* 临时隐藏真实数据:{statistics?.salaryVideoStats.current || 0}/{statistics?.salaryVideoStats.total || 0} */}
+              <Text className="text-lg font-bold text-green-600">100%</Text>
             </View>
             <View className="bg-purple-50 rounded-lg p-2 text-center flex flex-col">
               <Text className="text-xs text-gray-600">个税视频</Text>
-              <Text className="text-sm font-bold text-gray-800">
-                {statistics?.taxVideoStats.current || 0}/{statistics?.taxVideoStats.total || 0}
-              </Text>
-              <Text className="text-xs text-gray-500">100%</Text>
+              {/* 临时隐藏真实数据:{statistics?.taxVideoStats.current || 0}/{statistics?.taxVideoStats.total || 0} */}
+              <Text className="text-lg font-bold text-green-600">100%</Text>
             </View>
           </View>
           <View className="flex items-center text-blue-500 text-sm" onClick={handleViewCheckinDetails}>

+ 25 - 35
mini/src/pages/yongren/order/list/index.tsx

@@ -64,13 +64,14 @@ interface OrderCardProps {
 }
 
 const OrderCard: React.FC<OrderCardProps> = ({ order, onViewDetail }) => {
-  // 获取订单统计数据
+  // 获取订单统计数据(暂时未使用,详见下方打卡统计卡片注释)
   const { data: statsData, isLoading: statsLoading } = useOrderStats(order.id)
 
-  // 使用 API 返回的数据,或默认值(加载中或失败时)
-  const checkinStats = statsData?.checkinStats || { current: 0, total: order.actualPeople, percentage: 0 }
-  const salaryVideoStats = statsData?.salaryVideoStats || { current: 0, total: order.actualPeople, percentage: 0 }
-  const taxVideoStats = statsData?.taxVideoStats || { current: 0, total: order.actualPeople, percentage: 0 }
+  // 临时注释:由于人才小程序打卡功能未实现,临时隐藏真实数据显示固定100%
+  // TODO: 等打卡功能实现后,恢复使用这些统计数据
+  // const checkinStats = statsData?.checkinStats || { current: 0, total: order.actualPeople, percentage: 0 }
+  // const salaryVideoStats = statsData?.salaryVideoStats || { current: 0, total: order.actualPeople, percentage: 0 }
+  // const taxVideoStats = statsData?.taxVideoStats || { current: 0, total: order.actualPeople, percentage: 0 }
 
   return (
     <View className="card bg-white p-4">
@@ -104,45 +105,34 @@ const OrderCard: React.FC<OrderCardProps> = ({ order, onViewDetail }) => {
       </View>
 
       {/* 打卡数据统计网格 */}
+      {/* IMPORTANT: 临时隐藏真实数据,显示固定100%完成率
+       *
+       * 业务背景说明:
+       * 1. 人才小程序的打卡功能尚未实现(当前为假功能)
+       * 2. 因此企业端显示的打卡数据始终为 0/total(如 0/4)
+       * 3. 为避免用户困惑("为什么0个人打卡还显示百分比?"),
+       *    临时方案是隐藏数据,显示固定的100%完成率
+       *
+       * TODO: 等人才小程序打卡功能实现后,需要:
+       *       1. 取消注释下方被隐藏的数据显示代码
+       *       2. 恢复真实的百分比计算逻辑
+       *       3. 删除此固定100%的临时方案
+       *
+       * @see 相关问题:docs/系统故障20260306.docx 问题3
+       * @author Claude 2026-03-09
+       */}
       <View className="grid grid-cols-3 gap-2 mb-3">
         <View className="bg-blue-50 rounded-lg p-2 text-center flex flex-col">
           <Text className="text-xs text-gray-600">本月打卡</Text>
-          {statsLoading ? (
-            <Text className="text-sm text-gray-400">...</Text>
-          ) : (
-            <>
-              <Text className="text-sm font-bold text-gray-800">
-                {checkinStats.current}/{checkinStats.total}
-              </Text>
-              <Text className="text-xs text-gray-500">{checkinStats.percentage}%</Text>
-            </>
-          )}
+          <Text className="text-lg font-bold text-green-600">100%</Text>
         </View>
         <View className="bg-green-50 rounded-lg p-2 text-center flex flex-col">
           <Text className="text-xs text-gray-600">工资视频</Text>
-          {statsLoading ? (
-            <Text className="text-sm text-gray-400">...</Text>
-          ) : (
-            <>
-              <Text className="text-sm font-bold text-gray-800">
-                {salaryVideoStats.current}/{salaryVideoStats.total}
-              </Text>
-              <Text className="text-xs text-gray-500">{salaryVideoStats.percentage}%</Text>
-            </>
-          )}
+          <Text className="text-lg font-bold text-green-600">100%</Text>
         </View>
         <View className="bg-purple-50 rounded-lg p-2 text-center flex flex-col">
           <Text className="text-xs text-gray-600">个税视频</Text>
-          {statsLoading ? (
-            <Text className="text-sm text-gray-400">...</Text>
-          ) : (
-            <>
-              <Text className="text-sm font-bold text-gray-800">
-                {taxVideoStats.current}/{taxVideoStats.total}
-              </Text>
-              <Text className="text-xs text-gray-500">{taxVideoStats.percentage}%</Text>
-            </>
-          )}
+          <Text className="text-lg font-bold text-green-600">100%</Text>
         </View>
       </View>