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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<template>
  <CommonCard v-bind="rest" class="order-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">{{ _hireNumber }}人</div>
        <div class="order-card-content-info-item-line"></div>
        <div class="order-card-content-info-item">{{ ageStart ?? 0 }}-{{ ageEnd ?? 0 }}周岁</div>
        <div class="order-card-content-info-item-line"></div>
        <div class="order-card-content-info-item">{{ `${provinceName}${cityName}` }}</div>
      </div>
      <div class="order-card-supplier-refund">
        <div class="order-card-supplier-refund-tag">合作</div>
        <div class="order-card-supplier-refund-text">
          {{ supplierRefund }},{{ rebateModeText }}
        </div>
      </div>
    </div>
    <template #footer>
      <slot name="footer"></slot>
    </template>
  </CommonCard>
</template>
 
<script setup lang="ts">
import CommonCard from './CommonCard.vue';
import { OrderUtils } from '@12333/utils';
import { HireType } from '@12333/constants';
 
defineOptions({
  name: 'OrderCard',
});
 
type Props = {
  title?: string;
  src?: string;
  name?: string;
  jobTitle?: string;
  time?: string;
  hireType?: HireType;
  hireNumber?: number;
  hireEndNumber?: number;
  ageStart?: number;
  ageEnd?: number;
  provinceName?: string;
  cityName?: string;
  integratedSalary?: string;
  userId?: string;
  orderSupplierRefundInfo?: API.OrderSupplierRefundInfo[];
  showActionBtn?: boolean;
};
 
const {
  hireType,
  hireNumber,
  hireEndNumber,
  orderSupplierRefundInfo,
  showActionBtn = true,
  ...rest
} = defineProps<Props>();
 
const _hireNumber = computed(() => OrderUtils.getHireNumber(hireType, hireNumber, hireEndNumber));
 
const supplierRefund = computed(() => {
  if (orderSupplierRefundInfo) {
    return OrderUtils.getSupplierRefund(orderSupplierRefundInfo);
  }
  return '';
});
 
const rebateModeText = computed(() => {
  if (orderSupplierRefundInfo) {
    return OrderUtils.getRebateModeText(orderSupplierRefundInfo);
  }
  return '';
});
</script>
 
<style lang="scss">
@import '@/styles/common.scss';
 
.order-card-wrapper {
  .order-card-content {
    .order-card-content-info {
      font-weight: 400;
      font-size: 0;
      color: #9e9e9e;
      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>