From a0da24df7c71cd8349b44351415cc80ad696f170 Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期三, 22 十月 2025 17:01:31 +0800
Subject: [PATCH] fix: bug

---
 apps/bMiniApp/src/subpackages/task/components/TaskCheckCard.vue |   73 +++++++++++++++++++++++++++++++++++-
 1 files changed, 71 insertions(+), 2 deletions(-)

diff --git a/apps/bMiniApp/src/subpackages/task/components/TaskCheckCard.vue b/apps/bMiniApp/src/subpackages/task/components/TaskCheckCard.vue
index 801c3ee..c74a2cc 100644
--- a/apps/bMiniApp/src/subpackages/task/components/TaskCheckCard.vue
+++ b/apps/bMiniApp/src/subpackages/task/components/TaskCheckCard.vue
@@ -10,7 +10,7 @@
     >
       <template #actions>
         <template v-if="checkReceiveMethod === EnumTaskCheckReceiveMethod.CheckIn">
-          <nut-button
+          <!-- <nut-button
             v-if="!checkInTime"
             type="primary"
             class="task-check-card-phone-btn"
@@ -26,7 +26,10 @@
           >
           <div v-else class="task-check-card-phone-status" :style="{ color: Colors.Success }">
             {{ EnumTaskCheckReceiveStatusText[checkReceiveStatus] }}
-          </div>
+          </div> -->
+          <nut-button type="primary" class="task-check-card-phone-btn" @click.stop="handleMore"
+            >鎿嶄綔</nut-button
+          >
         </template>
         <template v-else>
           <nut-button
@@ -54,10 +57,18 @@
   EnumTaskCheckReceiveMethod,
 } from '@12333/constants';
 import { CheckInOrOutEventEnum } from '../constants';
+import { Portal } from 'senin-mini/components';
+import { ActionSheet } from '@nutui/nutui-taro';
 
 defineOptions({
   name: 'TaskCheckCard',
 });
+
+enum ManageActions {
+  CheckIn = 1,
+  CheckOut,
+  OutWork,
+}
 
 type Props = {
   avatar?: string;
@@ -79,6 +90,64 @@
   (e: 'checkReceive'): void;
   (e: 'checkInOrOut', ev: CheckInOrOutEventEnum): void;
 }>();
+
+const menuList = computed(() => {
+  let _menuList = [];
+  if (props.checkReceiveMethod === EnumTaskCheckReceiveMethod.CheckIn) {
+    _menuList.push(
+      {
+        name: '绛惧埌',
+        value: ManageActions.CheckIn,
+      },
+      {
+        name: '绛惧嚭',
+        value: ManageActions.CheckOut,
+      },
+      {
+        name: '鏈埌宀�',
+        value: ManageActions.OutWork,
+      }
+    );
+  }
+
+  return _menuList;
+});
+
+function handleMore() {
+  Portal.add((key) => {
+    return h(
+      Portal.Container,
+      { keyNumber: key, delayOpen: true },
+      {
+        default: ({ open, onClose }) =>
+          // @ts-ignore
+          h(ActionSheet, {
+            visible: open.value,
+            'onUpdate:visible': () => onClose(),
+            menuItems: menuList.value,
+            onChoose: (item) => {
+              handleEmit(item);
+              onClose();
+            },
+          }),
+      }
+    );
+  });
+}
+
+function handleEmit(action: { name: string; value: number }) {
+  switch (action.value) {
+    case ManageActions.CheckIn:
+      emit('checkInOrOut', CheckInOrOutEventEnum.CheckIn);
+      break;
+    case ManageActions.CheckOut:
+      emit('checkInOrOut', CheckInOrOutEventEnum.CheckOut);
+      break;
+    case ManageActions.OutWork:
+      emit('checkInOrOut', CheckInOrOutEventEnum.CheckOut);
+      break;
+  }
+}
 </script>
 
 <style lang="scss">

--
Gitblit v1.9.1