PreviewCustomerModal.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <div v-if="visible" class="modal-overlay" @click.self="$emit('close')">
  3. <div class="modal preview-customer-modal">
  4. <div class="modal-header">
  5. <div class="modal-title">
  6. <div class="title-icon bg-primary"><i class="fas fa-eye"></i></div>
  7. <div>
  8. <h3>预览客户</h3>
  9. </div>
  10. </div>
  11. <button class="modal-close" type="button" @click="$emit('close')">
  12. <i class="fas fa-times"></i>
  13. </button>
  14. </div>
  15. <div class="modal-body">
  16. <div v-if="customers && customers.length" class="customer-list">
  17. <div v-for="customer in customers" :key="customer.id" class="customer-card">
  18. <div class="customer-card-left">
  19. <div class="customer-logo">{{ customer.logoText || customer.customerName.charAt(0) }}</div>
  20. <div class="customer-meta">
  21. <div class="customer-name-row">
  22. <div class="customer-name">{{ customer.customerName }}</div>
  23. <span class="customer-badge">{{ customer.tag || '潜客' }}</span>
  24. </div>
  25. <div class="customer-subtitle">{{ customer.role || '采购总监' }} · {{ customer.company }}</div>
  26. <div class="customer-info-row">
  27. <span><i class="fas fa-map-marker-alt"></i> {{ customer.continent }} - {{ customer.country }}</span>
  28. <span><i class="fas fa-dollar-sign"></i> {{ customer.annualPurchase }}</span>
  29. </div>
  30. </div>
  31. </div>
  32. <div class="customer-card-right">
  33. <div class="customer-score">{{ customer.score }}</div>
  34. <div class="customer-score-label">意向分</div>
  35. </div>
  36. </div>
  37. </div>
  38. <div v-else class="empty-state">暂无客户数据</div>
  39. </div>
  40. <div class="modal-footer">
  41. <button class="btn btn-secondary" type="button" @click="$emit('close')">关闭</button>
  42. </div>
  43. </div>
  44. </div>
  45. </template>
  46. <script setup>
  47. const props = defineProps({
  48. visible: { type: Boolean, default: false },
  49. customers: { type: Array, default: () => [] }
  50. })
  51. </script>
  52. <style scoped>
  53. .preview-customer-modal {
  54. max-width: 760px;
  55. }
  56. .customer-list {
  57. display: flex;
  58. flex-direction: column;
  59. gap: 12px;
  60. }
  61. .customer-card {
  62. display: flex;
  63. justify-content: space-between;
  64. align-items: center;
  65. gap: 18px;
  66. padding: 18px 18px;
  67. background: var(--bg-hover);
  68. border: 1px solid var(--border);
  69. border-radius: 16px;
  70. }
  71. .customer-card-left {
  72. display: flex;
  73. align-items: center;
  74. gap: 14px;
  75. min-width: 0;
  76. }
  77. .customer-logo {
  78. width: 52px;
  79. height: 52px;
  80. border-radius: 14px;
  81. background: rgba(56, 189, 248, 0.15);
  82. color: var(--primary);
  83. display: flex;
  84. align-items: center;
  85. justify-content: center;
  86. font-weight: 700;
  87. font-size: 18px;
  88. }
  89. .customer-meta {
  90. min-width: 0;
  91. flex: 1;
  92. }
  93. .customer-name-row {
  94. display: flex;
  95. align-items: center;
  96. gap: 10px;
  97. margin-bottom: 6px;
  98. flex-wrap: wrap;
  99. }
  100. .customer-name {
  101. font-size: 15px;
  102. font-weight: 700;
  103. color: var(--text-primary);
  104. white-space: nowrap;
  105. overflow: hidden;
  106. text-overflow: ellipsis;
  107. }
  108. .customer-badge {
  109. display: inline-flex;
  110. align-items: center;
  111. justify-content: center;
  112. padding: 2px 10px;
  113. border-radius: 999px;
  114. background: rgba(59, 130, 246, 0.12);
  115. color: var(--primary);
  116. font-size: 12px;
  117. font-weight: 600;
  118. }
  119. .customer-subtitle {
  120. font-size: 13px;
  121. color: var(--text-secondary);
  122. margin-bottom: 10px;
  123. line-height: 1.5;
  124. }
  125. .customer-info-row {
  126. display: flex;
  127. flex-wrap: wrap;
  128. gap: 12px;
  129. font-size: 12px;
  130. color: var(--text-secondary);
  131. }
  132. .customer-info-row span {
  133. display: inline-flex;
  134. align-items: center;
  135. gap: 6px;
  136. }
  137. .customer-info-row i {
  138. width: 14px;
  139. text-align: center;
  140. color: var(--text-secondary);
  141. }
  142. .customer-card-right {
  143. display: flex;
  144. flex-direction: column;
  145. align-items: center;
  146. min-width: 92px;
  147. }
  148. .customer-score {
  149. width: 54px;
  150. height: 54px;
  151. display: flex;
  152. border-radius: 50%;
  153. align-items: center;
  154. background: rgba(34, 197, 94, 0.12);
  155. color: var(--success);
  156. font-size: 16px;
  157. font-weight: 700;
  158. justify-content: center;
  159. }
  160. .customer-score-label {
  161. margin-top: 8px;
  162. font-size: 12px;
  163. color: #64748B;
  164. }
  165. .empty-state {
  166. padding: 60px 0;
  167. text-align: center;
  168. color: var(--text-secondary);
  169. }
  170. </style>