contact.component.scss 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729
  1. // 客户画像组件样式 - 使用纯 div+scss 实现
  2. // CSS 变量定义
  3. :host {
  4. --primary-color: #3880ff;
  5. --secondary-color: #0cd1e8;
  6. --tertiary-color: #7044ff;
  7. --success-color: #10dc60;
  8. --warning-color: #ffce00;
  9. --danger-color: #f04141;
  10. --dark-color: #222428;
  11. --medium-color: #989aa2;
  12. --light-color: #f4f5f8;
  13. --light-shade: #d7d8da;
  14. }
  15. .contact-page {
  16. display: flex;
  17. flex-direction: column;
  18. height: 100vh;
  19. background-color: #f5f5f5;
  20. }
  21. // 头部导航
  22. .header {
  23. background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  24. color: white;
  25. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  26. position: sticky;
  27. top: 0;
  28. z-index: 100;
  29. .header-toolbar {
  30. display: flex;
  31. align-items: center;
  32. padding: 12px 16px;
  33. max-height: 56px;
  34. .back-button {
  35. background: none;
  36. border: none;
  37. color: white;
  38. padding: 8px;
  39. cursor: pointer;
  40. display: flex;
  41. align-items: center;
  42. justify-content: center;
  43. border-radius: 50%;
  44. transition: background-color 0.3s;
  45. &:hover {
  46. background-color: rgba(255, 255, 255, 0.1);
  47. }
  48. .icon {
  49. width: 24px;
  50. height: 24px;
  51. }
  52. }
  53. .title {
  54. flex: 1;
  55. margin: 0 16px;
  56. font-size: 18px;
  57. font-weight: 600;
  58. }
  59. }
  60. }
  61. // 内容区域
  62. .content {
  63. flex: 1;
  64. overflow-y: auto;
  65. -webkit-overflow-scrolling: touch;
  66. }
  67. // 加载和错误容器
  68. .loading-container,
  69. .error-container {
  70. display: flex;
  71. flex-direction: column;
  72. align-items: center;
  73. justify-content: center;
  74. min-height: 60vh;
  75. padding: 20px;
  76. text-align: center;
  77. .spinner {
  78. width: 48px;
  79. height: 48px;
  80. border: 4px solid var(--light-color);
  81. border-top-color: var(--primary-color);
  82. border-radius: 50%;
  83. animation: spin 1s linear infinite;
  84. margin-bottom: 16px;
  85. }
  86. .icon-large {
  87. width: 64px;
  88. height: 64px;
  89. color: var(--danger-color);
  90. margin-bottom: 16px;
  91. }
  92. p {
  93. color: var(--medium-color);
  94. margin-bottom: 16px;
  95. }
  96. }
  97. @keyframes spin {
  98. to { transform: rotate(360deg); }
  99. }
  100. // 通用按钮样式
  101. .btn {
  102. padding: 12px 24px;
  103. border-radius: 8px;
  104. font-size: 14px;
  105. font-weight: 600;
  106. cursor: pointer;
  107. transition: all 0.3s;
  108. border: none;
  109. outline: none;
  110. &.btn-outline {
  111. background: white;
  112. color: var(--primary-color);
  113. border: 2px solid var(--primary-color);
  114. &:hover {
  115. background: var(--primary-color);
  116. color: white;
  117. }
  118. }
  119. }
  120. // 客户画像容器
  121. .contact-container {
  122. max-width: 800px;
  123. margin: 0 auto;
  124. padding: 16px;
  125. padding-bottom: 32px;
  126. }
  127. // 通用卡片样式
  128. .card {
  129. background: white;
  130. border-radius: 12px;
  131. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  132. margin-bottom: 16px;
  133. overflow: hidden;
  134. .card-header {
  135. padding: 16px;
  136. border-bottom: 1px solid var(--light-shade);
  137. .card-title {
  138. display: flex;
  139. align-items: center;
  140. gap: 8px;
  141. margin: 0;
  142. font-size: 16px;
  143. font-weight: 600;
  144. color: var(--dark-color);
  145. .icon {
  146. width: 20px;
  147. height: 20px;
  148. color: var(--primary-color);
  149. }
  150. }
  151. .card-subtitle {
  152. margin: 4px 0 0;
  153. font-size: 12px;
  154. color: var(--medium-color);
  155. }
  156. }
  157. .card-content {
  158. padding: 16px;
  159. }
  160. }
  161. // 头部卡片
  162. .header-card {
  163. background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  164. color: white;
  165. .customer-header {
  166. display: flex;
  167. align-items: center;
  168. gap: 16px;
  169. padding: 16px;
  170. .customer-avatar {
  171. width: 80px;
  172. height: 80px;
  173. border: 3px solid white;
  174. border-radius: 50%;
  175. overflow: hidden;
  176. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  177. display: flex;
  178. align-items: center;
  179. justify-content: center;
  180. background: rgba(255, 255, 255, 0.2);
  181. img {
  182. width: 100%;
  183. height: 100%;
  184. object-fit: cover;
  185. }
  186. .icon-avatar {
  187. width: 80px;
  188. height: 80px;
  189. color: white;
  190. }
  191. }
  192. .customer-info {
  193. flex: 1;
  194. min-width: 0;
  195. h2 {
  196. margin: 0 0 8px;
  197. font-size: 24px;
  198. font-weight: 700;
  199. color: white;
  200. }
  201. .source-badge {
  202. display: inline-flex;
  203. align-items: center;
  204. gap: 6px;
  205. padding: 4px 12px;
  206. background-color: rgba(255, 255, 255, 0.2);
  207. border-radius: 12px;
  208. font-size: 13px;
  209. .icon {
  210. width: 16px;
  211. height: 16px;
  212. }
  213. }
  214. }
  215. }
  216. .tags-container {
  217. display: flex;
  218. flex-wrap: wrap;
  219. gap: 8px;
  220. padding: 0 16px 16px;
  221. }
  222. }
  223. // Chip 组件
  224. .chip {
  225. display: inline-flex;
  226. align-items: center;
  227. padding: 6px 12px;
  228. border-radius: 16px;
  229. font-size: 12px;
  230. font-weight: 500;
  231. background: rgba(255, 255, 255, 0.2);
  232. color: white;
  233. &.chip-primary {
  234. background: rgba(255, 255, 255, 0.2);
  235. color: white;
  236. }
  237. }
  238. // Badge 组件
  239. .badge {
  240. display: inline-block;
  241. padding: 4px 10px;
  242. border-radius: 12px;
  243. font-size: 11px;
  244. font-weight: 600;
  245. &.badge-primary {
  246. background: var(--primary-color);
  247. color: white;
  248. }
  249. &.badge-secondary {
  250. background: var(--secondary-color);
  251. color: white;
  252. }
  253. &.badge-tertiary {
  254. background: var(--tertiary-color);
  255. color: white;
  256. }
  257. &.badge-success {
  258. background: var(--success-color);
  259. color: white;
  260. }
  261. &.badge-warning {
  262. background: var(--warning-color);
  263. color: var(--dark-color);
  264. }
  265. &.badge-medium {
  266. background: var(--medium-color);
  267. color: white;
  268. }
  269. }
  270. // 图标样式
  271. .icon {
  272. width: 20px;
  273. height: 20px;
  274. flex-shrink: 0;
  275. &.icon-sm {
  276. width: 14px;
  277. height: 14px;
  278. }
  279. &.icon-wechat {
  280. width: 24px;
  281. height: 24px;
  282. color: #09BB07;
  283. }
  284. &.icon-group {
  285. width: 40px;
  286. height: 40px;
  287. }
  288. &.arrow {
  289. width: 20px;
  290. height: 20px;
  291. color: var(--medium-color);
  292. }
  293. }
  294. // 基础信息卡片
  295. .basic-info-card {
  296. .info-list {
  297. display: flex;
  298. flex-direction: column;
  299. gap: 16px;
  300. }
  301. .info-item {
  302. display: flex;
  303. align-items: center;
  304. gap: 12px;
  305. .icon {
  306. width: 24px;
  307. height: 24px;
  308. color: var(--primary-color);
  309. flex-shrink: 0;
  310. }
  311. .info-text {
  312. flex: 1;
  313. min-width: 0;
  314. .info-label {
  315. margin: 0 0 4px;
  316. color: var(--medium-color);
  317. font-size: 12px;
  318. }
  319. .info-value {
  320. margin: 0;
  321. color: var(--dark-color);
  322. font-size: 15px;
  323. font-weight: 500;
  324. }
  325. }
  326. }
  327. .permission-notice {
  328. display: flex;
  329. align-items: center;
  330. gap: 8px;
  331. padding: 12px;
  332. margin-top: 12px;
  333. background-color: var(--light-color);
  334. border-radius: 8px;
  335. font-size: 13px;
  336. color: var(--medium-color);
  337. .icon {
  338. width: 18px;
  339. height: 18px;
  340. flex-shrink: 0;
  341. }
  342. }
  343. }
  344. // 客户画像卡片
  345. .preferences-card {
  346. .preference-grid {
  347. display: grid;
  348. gap: 16px;
  349. .preference-item {
  350. .preference-label {
  351. display: flex;
  352. align-items: center;
  353. gap: 6px;
  354. margin-bottom: 8px;
  355. font-size: 13px;
  356. color: var(--medium-color);
  357. font-weight: 500;
  358. .icon {
  359. width: 18px;
  360. height: 18px;
  361. }
  362. }
  363. .preference-value {
  364. display: flex;
  365. flex-wrap: wrap;
  366. gap: 6px;
  367. .empty {
  368. color: var(--medium-color);
  369. font-size: 13px;
  370. font-style: italic;
  371. }
  372. }
  373. }
  374. }
  375. }
  376. // 群聊卡片
  377. .groups-card {
  378. .groups-grid {
  379. display: flex;
  380. flex-direction: column;
  381. gap: 12px;
  382. }
  383. .groups-card .group-item {
  384. display: flex;
  385. align-items: center;
  386. justify-content: space-between;
  387. padding: 10px 12px;
  388. border: 1px solid var(--light-shade);
  389. border-radius: 10px;
  390. background: #fff;
  391. }
  392. .groups-card .group-info { display:flex; align-items:center; gap:10px; }
  393. .groups-card .group-text h4 { margin:0; font-size:14px; font-weight:600; }
  394. .groups-card .project-name { display:flex; align-items:center; gap:6px; margin:4px 0 0; font-size:12px; color:#666; }
  395. .groups-card .icon.arrow { width:20px; height:20px; color:#999; }
  396. /* 侧栏嵌入模式的关闭按钮占位(由父侧栏提供关闭按钮) */
  397. :host([embeddedMode=true]) .header .back-button { display:none; }
  398. background-color: var(--light-color);
  399. border-radius: 8px;
  400. cursor: pointer;
  401. transition: all 0.3s;
  402. &:hover {
  403. background-color: var(--light-shade);
  404. transform: translateX(4px);
  405. }
  406. &:active {
  407. transform: translateX(2px);
  408. }
  409. .group-info {
  410. display: flex;
  411. align-items: center;
  412. gap: 12px;
  413. flex: 1;
  414. min-width: 0;
  415. .group-text {
  416. flex: 1;
  417. min-width: 0;
  418. h4 {
  419. margin: 0 0 4px;
  420. font-size: 15px;
  421. font-weight: 600;
  422. color: var(--dark-color);
  423. white-space: nowrap;
  424. overflow: hidden;
  425. text-overflow: ellipsis;
  426. }
  427. .project-name {
  428. display: flex;
  429. align-items: center;
  430. gap: 4px;
  431. margin: 0;
  432. font-size: 12px;
  433. color: var(--success-color);
  434. .icon-sm {
  435. width: 14px;
  436. height: 14px;
  437. }
  438. }
  439. .no-project {
  440. margin: 0;
  441. font-size: 12px;
  442. color: var(--medium-color);
  443. font-style: italic;
  444. }
  445. }
  446. }
  447. }
  448. // 历史项目卡片
  449. .projects-card {
  450. .project-list {
  451. display: flex;
  452. flex-direction: column;
  453. gap: 0;
  454. }
  455. .project-item {
  456. display: flex;
  457. align-items: center;
  458. justify-content: space-between;
  459. padding: 16px 8px;
  460. cursor: pointer;
  461. transition: background-color 0.3s;
  462. border-bottom: 1px solid var(--light-shade);
  463. &:last-child {
  464. border-bottom: none;
  465. }
  466. &:hover {
  467. background-color: var(--light-color);
  468. }
  469. &:active {
  470. background-color: var(--light-shade);
  471. }
  472. .project-content {
  473. flex: 1;
  474. min-width: 0;
  475. h4 {
  476. margin: 0 0 4px;
  477. font-size: 15px;
  478. font-weight: 600;
  479. color: var(--dark-color);
  480. }
  481. .project-status {
  482. display: flex;
  483. align-items: center;
  484. gap: 8px;
  485. margin: 4px 0;
  486. .stage {
  487. font-size: 13px;
  488. color: var(--medium-color);
  489. }
  490. }
  491. .project-time {
  492. margin: 4px 0 0;
  493. font-size: 12px;
  494. color: var(--medium-color);
  495. }
  496. }
  497. }
  498. }
  499. // 项目状态样式
  500. .status-pending {
  501. background: var(--warning-color) !important;
  502. color: var(--dark-color) !important;
  503. }
  504. .status-active {
  505. background: var(--primary-color) !important;
  506. color: white !important;
  507. }
  508. .status-completed {
  509. background: var(--success-color) !important;
  510. color: white !important;
  511. }
  512. .status-paused {
  513. background: var(--medium-color) !important;
  514. color: white !important;
  515. }
  516. .status-cancelled {
  517. background: var(--danger-color) !important;
  518. color: white !important;
  519. }
  520. .status-default {
  521. background: var(--light-color) !important;
  522. color: var(--dark-color) !important;
  523. }
  524. // 时间线卡片
  525. .timeline-card {
  526. .timeline {
  527. position: relative;
  528. padding-left: 40px;
  529. &::before {
  530. content: '';
  531. position: absolute;
  532. left: 15px;
  533. top: 8px;
  534. bottom: 8px;
  535. width: 2px;
  536. background-color: var(--light-shade);
  537. }
  538. .timeline-item {
  539. position: relative;
  540. margin-bottom: 24px;
  541. &:last-child {
  542. margin-bottom: 0;
  543. }
  544. .timeline-dot {
  545. position: absolute;
  546. left: -40px;
  547. top: 2px;
  548. width: 32px;
  549. height: 32px;
  550. display: flex;
  551. align-items: center;
  552. justify-content: center;
  553. background-color: var(--primary-color);
  554. border-radius: 50%;
  555. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  556. .icon {
  557. width: 18px;
  558. height: 18px;
  559. color: white;
  560. }
  561. }
  562. .timeline-content {
  563. .timeline-time {
  564. font-size: 11px;
  565. color: var(--medium-color);
  566. margin-bottom: 4px;
  567. }
  568. .timeline-text {
  569. padding: 12px;
  570. background-color: var(--light-color);
  571. border-radius: 8px;
  572. strong {
  573. font-size: 13px;
  574. color: var(--dark-color);
  575. }
  576. p {
  577. margin: 4px 0 0;
  578. font-size: 13px;
  579. color: var(--medium-color);
  580. line-height: 1.5;
  581. }
  582. }
  583. }
  584. }
  585. }
  586. }
  587. // 响应式适配
  588. @media (min-width: 768px) {
  589. .contact-container {
  590. padding: 24px;
  591. .preference-grid {
  592. grid-template-columns: repeat(2, 1fr);
  593. }
  594. .groups-grid {
  595. grid-template-columns: repeat(2, 1fr);
  596. }
  597. }
  598. }
  599. @media (max-width: 480px) {
  600. .header {
  601. .header-toolbar {
  602. .title {
  603. font-size: 16px;
  604. }
  605. }
  606. }
  607. .header-card {
  608. .customer-header {
  609. .customer-avatar {
  610. width: 64px;
  611. height: 64px;
  612. .icon-avatar {
  613. width: 64px;
  614. height: 64px;
  615. }
  616. }
  617. .customer-info {
  618. h2 {
  619. font-size: 20px;
  620. }
  621. }
  622. }
  623. }
  624. }