<template>
|
<CommonCard v-bind="rest" class="resource-card-wrapper">
|
<template #title-right v-if="showActionBtn">
|
<slot name="title-right">
|
<nut-button color="linear-gradient( 90deg, #569CFF 0%, #3A71FE 100%)">去对接</nut-button>
|
</slot>
|
</template>
|
<div class="order-card-content">
|
<div class="order-card-content-info">
|
<div class="order-card-content-info-item">可交付{{ resourceCount ?? 0 }}人</div>
|
</div>
|
<div class="order-card-supplier-refund">
|
<div class="order-card-supplier-refund-text">
|
可交付城市:{{ intendedDeliveryCitiesNames }}
|
</div>
|
</div>
|
</div>
|
<template #footer>
|
<slot name="footer"></slot>
|
</template>
|
</CommonCard>
|
</template>
|
|
<script setup lang="ts">
|
import CommonCard from './CommonCard.vue';
|
import { useAllAreaList } from '@12333/hooks';
|
|
defineOptions({
|
name: 'ResourceCard',
|
});
|
|
type Props = {
|
title?: string;
|
src?: string;
|
name?: string;
|
jobTitle?: string;
|
time?: string;
|
resourceCount?: number;
|
userId?: string;
|
intendedDeliveryCities?: API.CityInfo[];
|
showActionBtn?: boolean;
|
};
|
|
const {
|
resourceCount,
|
intendedDeliveryCities = [],
|
showActionBtn = true,
|
...rest
|
} = defineProps<Props>();
|
|
const { findAreaNameFromCode } = useAllAreaList();
|
|
const intendedDeliveryCitiesNames = computed(() => {
|
if (intendedDeliveryCities.length > 0) {
|
return intendedDeliveryCities
|
.map((item) => `${findAreaNameFromCode(item.provinceCode)}${item.areaName}`)
|
.join('、');
|
}
|
return '';
|
});
|
</script>
|
|
<style lang="scss">
|
@import '@/styles/common.scss';
|
|
.resource-card-wrapper {
|
.order-card-content {
|
.order-card-content-info {
|
font-weight: 400;
|
font-size: 0;
|
color: boleGetCssVar('text-color', 'secondary');
|
line-height: 34px;
|
word-break: break-all;
|
@include ellipsis;
|
margin-bottom: 16px;
|
|
.order-card-content-info-item {
|
font-size: 24px;
|
vertical-align: middle;
|
display: inline-block;
|
}
|
|
.order-card-content-info-item-line {
|
vertical-align: middle;
|
display: inline-block;
|
width: 2px;
|
height: 20px;
|
background-color: #979797;
|
margin: 0 6px;
|
}
|
}
|
|
.order-card-supplier-refund {
|
display: flex;
|
align-items: center;
|
|
.order-card-supplier-refund-tag {
|
height: 34px;
|
background: #edf2ff;
|
border-radius: 4px;
|
padding: 0 8px;
|
margin-right: 8px;
|
font-weight: 400;
|
font-size: 20px;
|
color: boleGetCssVar('color', 'primary');
|
line-height: 34px;
|
flex-shrink: 0;
|
}
|
|
.order-card-supplier-refund-text {
|
height: 34px;
|
background: #f9faff;
|
padding: 0 8px;
|
font-weight: 400;
|
font-size: 24px;
|
color: boleGetCssVar('text-color', 'primary');
|
line-height: 34px;
|
@include ellipsis;
|
}
|
}
|
}
|
}
|
</style>
|