<template>
|
<div class="task-card-wrapper">
|
<div class="task-card-title-wrapper">
|
<div class="task-card-title">{{ name }}</div>
|
<slot name="title-right">
|
<TaskPrice :value="serviceFee ?? 0" :unit="BillingMethodEnumUnit[billingMethod]" />
|
</slot>
|
</div>
|
<slot>
|
<div class="task-card-welfare-list">
|
<div class="task-card-welfare-list-item">
|
{{ EnumSettlementCycleText[settlementCycle] }}
|
</div>
|
<div class="task-card-welfare-list-item">{{ TaskUtils.getGenderText(genderLimit) }}</div>
|
<div class="task-card-welfare-list-item">包三餐</div>
|
</div>
|
<div class="task-card-time">
|
{{ dayjs(beginTime).format('YYYY年MM月DD日') }}至{{
|
dayjs(endTime).format('YYYY年MM月DD日')
|
}}
|
</div>
|
</slot>
|
<div class="task-card-footer">
|
<div class="task-card-left">
|
<div class="task-card-footer-tag">H</div>
|
<div class="task-card-footer-address">{{ 'address' }}</div>
|
</div>
|
<div class="task-card-actions" v-if="showActions">
|
<slot name="actions">
|
<nut-button type="primary" @click.stop="handleSign">报名</nut-button>
|
</slot>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script setup lang="ts">
|
import {
|
EnumBillingMethod,
|
EnumSettlementCycle,
|
EnumTaskCheckReceiveStatus,
|
EnumTaskRecommendStatus,
|
EnumTaskReleaseStatus,
|
EnumTaskSettlementStatus,
|
EnumTaskStatus,
|
EnumUserGender,
|
EnumBillingMethodText,
|
EnumUserGenderText,
|
EnumSettlementCycleText,
|
BillingMethodEnumUnit,
|
} from '@12333/constants';
|
import TaskPrice from './TaskPrice.vue';
|
import { CommonTaskCardProps } from './card';
|
import dayjs from 'dayjs';
|
import { TaskUtils } from '@12333/utils';
|
|
defineOptions({
|
name: 'TaskCard',
|
});
|
|
type Props = CommonTaskCardProps & {
|
showActions?: boolean;
|
/** Id */
|
id?: string;
|
/** 任务名称 */
|
name: string;
|
/** 任务单号 */
|
code?: string;
|
billingMethod?: EnumBillingMethod;
|
/** 服务费 */
|
serviceFee?: number;
|
settlementCycle?: EnumSettlementCycle;
|
genderLimit?: EnumUserGender;
|
/** 报名人数 */
|
userCount?: number;
|
status?: EnumTaskStatus;
|
/** 任务开始时间 */
|
beginTime?: string;
|
/** 任务结束时间 */
|
endTime?: string;
|
releaseStatus?: EnumTaskReleaseStatus;
|
checkReceiveStatus?: EnumTaskCheckReceiveStatus;
|
settlementStatus?: EnumTaskSettlementStatus;
|
recommendStatus?: EnumTaskRecommendStatus;
|
/** 创建时间 */
|
createdTime?: string;
|
};
|
|
const props = withDefaults(defineProps<Props>(), {
|
showActions: true,
|
});
|
|
function handleSign() {}
|
</script>
|
|
<style lang="scss">
|
@import '@/styles/common.scss';
|
|
.task-card-wrapper {
|
padding: 24px 32px;
|
margin-bottom: 24px;
|
background-color: #fff;
|
border-radius: 12px;
|
|
&:last-child {
|
margin-bottom: 0;
|
}
|
|
.task-card-title-wrapper {
|
display: flex;
|
align-items: center;
|
margin-bottom: 14px;
|
|
.task-card-title {
|
flex: 1;
|
min-width: 0;
|
@include ellipsis;
|
font-size: 30px;
|
color: boleGetCssVar('text-color', 'primary');
|
line-height: 42px;
|
}
|
}
|
|
.task-card-welfare-list {
|
display: flex;
|
flex-wrap: wrap;
|
row-gap: 6px;
|
column-gap: 18px;
|
margin-bottom: 8px;
|
|
.task-card-welfare-list-item {
|
font-size: 24px;
|
color: #ff7d00;
|
line-height: 36px;
|
}
|
}
|
|
.task-card-time {
|
font-size: 24px;
|
color: boleGetCssVar('text-color', 'regular');
|
line-height: 36px;
|
margin-bottom: 6px;
|
}
|
|
.task-card-footer {
|
display: flex;
|
align-items: center;
|
|
.task-card-left {
|
flex: 1;
|
min-width: 0;
|
display: flex;
|
align-items: center;
|
|
.task-card-footer-tag {
|
width: 32px;
|
height: 32px;
|
background: #2a9e1b;
|
margin-right: 8px;
|
border-radius: 8px;
|
text-align: center;
|
line-height: 32px;
|
color: #fff;
|
font-size: 22px;
|
}
|
|
.task-card-footer-address {
|
font-size: 22px;
|
color: boleGetCssVar('text-color', 'regular');
|
line-height: 36px;
|
flex: 1;
|
min-width: 0;
|
@include ellipsis;
|
}
|
}
|
|
.task-card-actions {
|
--nut-button-default-font-size: 24px;
|
|
.nut-button {
|
height: 26px;
|
}
|
}
|
}
|
}
|
</style>
|