zhengyiming
2025-02-10 0f686ea1fe4700a909a6159efcf1fcb0e1f88a17
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<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>