wupengfei
2025-03-11 286f1b727856d6b32a8d237f353ae008f3076deb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<template>
  <TaskCard v-bind="props" :show-actions="false" class="my-task-card-wrapper">
    <template #title-right>
      <RectRight :size="12" class="my-task-card-arrow" v-if="showMyTaskArrow" />
      <div v-else></div>
    </template>
    <div class="my-task-card-time" v-if="showTime">
      {{
        `${dayjs(startDate).format('YYYY年MM月DD日')}至${dayjs(endDate).format('YYYY年MM月DD日')}`
      }}
    </div>
    <div v-else></div>
  </TaskCard>
</template>
 
<script setup lang="ts">
import TaskCard from './TaskCard.vue';
import { CommonTaskCardProps } from './card';
import { RectRight } from '@nutui/icons-vue-taro';
import dayjs from 'dayjs';
 
defineOptions({
  name: 'MyTaskCard',
});
 
type Props = CommonTaskCardProps & {
  showMyTaskArrow?: boolean;
  showTime?: boolean;
 
  startDate?: string;
  endDate?: string;
  taskName?: string;
  address?: string;
};
 
const props = withDefaults(defineProps<Props>(), {
  showMyTaskArrow: true,
  showTime: true,
});
</script>
 
<style lang="scss">
@import '@/styles/common.scss';
 
.my-task-card-wrapper {
  .my-task-card-arrow {
    color: boleGetCssVar('text-color', 'primary');
  }
 
  .my-task-card-time {
    font-weight: 400;
    @include ellipsis;
    font-size: 24px;
    color: boleGetCssVar('text-color', 'primary');
    line-height: 36px;
    margin-bottom: 14px;
  }
}
</style>