assistant.html 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>话术决策助手 - AI实验室</title>
  7. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
  8. <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
  9. <style>
  10. :root {
  11. --primary: #64a0ff;
  12. --primary-light: rgba(100, 160, 255, 0.1);
  13. --dark: #0a192f;
  14. --dark-light: #112240;
  15. --gray: #8892b0;
  16. --light-gray: #f8f9fa;
  17. --white: #ffffff;
  18. --blue: #64a0ff;
  19. --blue-light: rgba(100, 160, 255, 0.15);
  20. --yellow: #ffd43b;
  21. --orange: #ff922b;
  22. --purple: #9c36b5;
  23. --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  24. --shadow-primary: 0 4px 20px rgba(100, 160, 255, 0.2);
  25. }
  26. * {
  27. margin: 0;
  28. padding: 0;
  29. box-sizing: border-box;
  30. font-family: 'Segoe UI', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
  31. }
  32. body {
  33. background-color: #f0f5ff;
  34. color: var(--dark);
  35. line-height: 1.6;
  36. overflow-x: hidden;
  37. background: linear-gradient(135deg, #e6f0ff 0%, #f5f9ff 100%);
  38. min-height: 100vh;
  39. padding: 20px 0;
  40. }
  41. .container {
  42. max-width: 480px;
  43. margin: 0 auto;
  44. padding: 0 16px 30px;
  45. position: relative;
  46. }
  47. /* 顶部导航 */
  48. .app-header {
  49. display: flex;
  50. justify-content: space-between;
  51. align-items: center;
  52. padding: 15px 0;
  53. margin-bottom: 15px;
  54. border-bottom: 1px solid rgba(10, 25, 47, 0.05);
  55. }
  56. .header-title {
  57. font-size: 22px;
  58. font-weight: 700;
  59. color: var(--dark);
  60. display: flex;
  61. align-items: center;
  62. gap: 10px;
  63. }
  64. .header-title i {
  65. color: var(--primary);
  66. background: var(--primary-light);
  67. width: 36px;
  68. height: 36px;
  69. border-radius: 10px;
  70. display: flex;
  71. align-items: center;
  72. justify-content: center;
  73. }
  74. /* 场景选择 */
  75. .scene-selector {
  76. background: var(--white);
  77. border-radius: 20px;
  78. padding: 20px;
  79. margin-bottom: 20px;
  80. box-shadow: var(--shadow);
  81. position: relative;
  82. overflow: hidden;
  83. border: 1px solid rgba(100, 160, 255, 0.2);
  84. }
  85. .scene-options {
  86. display: flex;
  87. gap: 15px;
  88. margin-top: 10px;
  89. }
  90. .scene-option {
  91. flex: 1;
  92. padding: 15px;
  93. border-radius: 15px;
  94. background: var(--light-gray);
  95. text-align: center;
  96. cursor: pointer;
  97. transition: all 0.3s ease;
  98. border: 1px solid rgba(100, 160, 255, 0.1);
  99. }
  100. .scene-option.active {
  101. background: var(--primary-light);
  102. border-color: var(--primary);
  103. box-shadow: var(--shadow-primary);
  104. }
  105. .scene-option i {
  106. font-size: 28px;
  107. margin-bottom: 10px;
  108. color: var(--primary);
  109. }
  110. .scene-option h3 {
  111. font-size: 16px;
  112. margin-bottom: 5px;
  113. }
  114. .scene-option p {
  115. font-size: 13px;
  116. color: var(--gray);
  117. }
  118. /* 对话聊天区 */
  119. .chat-area {
  120. background: var(--white);
  121. border-radius: 20px;
  122. padding: 20px;
  123. margin-bottom: 20px;
  124. box-shadow: var(--shadow);
  125. height: 350px;
  126. overflow-y: auto;
  127. display: flex;
  128. flex-direction: column;
  129. gap: 15px;
  130. border: 1px solid rgba(100, 160, 255, 0.2);
  131. }
  132. .chat-title {
  133. font-size: 18px;
  134. font-weight: 600;
  135. margin-bottom: 15px;
  136. color: var(--dark);
  137. display: flex;
  138. align-items: center;
  139. gap: 10px;
  140. padding-bottom: 10px;
  141. border-bottom: 1px solid rgba(100, 160, 255, 0.1);
  142. }
  143. .chat-title i {
  144. color: var(--primary);
  145. }
  146. .chat-message {
  147. max-width: 85%;
  148. padding: 14px 18px;
  149. border-radius: 18px;
  150. position: relative;
  151. animation: fadeIn 0.3s ease;
  152. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  153. }
  154. @keyframes fadeIn {
  155. from { opacity: 0; transform: translateY(10px); }
  156. to { opacity: 1; transform: translateY(0); }
  157. }
  158. .customer-message {
  159. background: linear-gradient(135deg, #e6f0ff, #ebf2ff);
  160. align-self: flex-start;
  161. border-bottom-left-radius: 5px;
  162. border-left: 3px solid var(--blue);
  163. }
  164. .assistant-message {
  165. background: linear-gradient(135deg, #e6f7ff, #ebf9ff);
  166. border: 1px solid rgba(100, 160, 255, 0.3);
  167. align-self: flex-end;
  168. border-bottom-right-radius: 5px;
  169. border-right: 3px solid var(--primary);
  170. }
  171. .message-header {
  172. display: flex;
  173. align-items: center;
  174. gap: 8px;
  175. margin-bottom: 8px;
  176. font-weight: 600;
  177. }
  178. .customer-header .icon {
  179. background: var(--blue-light);
  180. color: var(--blue);
  181. }
  182. .assistant-header .icon {
  183. background: var(--primary-light);
  184. color: var(--primary);
  185. }
  186. .message-header .icon {
  187. width: 28px;
  188. height: 28px;
  189. border-radius: 8px;
  190. display: flex;
  191. align-items: center;
  192. justify-content: center;
  193. font-size: 14px;
  194. }
  195. .message-content {
  196. line-height: 1.5;
  197. }
  198. .message-time {
  199. font-size: 11px;
  200. color: var(--gray);
  201. margin-top: 8px;
  202. text-align: right;
  203. }
  204. /* 客户标签编辑区 */
  205. .tags-area {
  206. background: var(--light-gray);
  207. border-radius: 15px;
  208. padding: 15px;
  209. margin-top: 10px;
  210. border: 1px solid rgba(100, 160, 255, 0.1);
  211. }
  212. .tags-header {
  213. display: flex;
  214. justify-content: space-between;
  215. align-items: center;
  216. margin-bottom: 10px;
  217. }
  218. .tags-title {
  219. font-size: 14px;
  220. font-weight: 600;
  221. color: var(--dark);
  222. }
  223. .input-tags {
  224. display: flex;
  225. gap: 8px;
  226. flex-wrap: wrap;
  227. }
  228. .tag {
  229. background: var(--primary-light);
  230. color: var(--primary);
  231. padding: 6px 12px 6px 8px;
  232. border-radius: 20px;
  233. font-size: 13px;
  234. display: flex;
  235. align-items: center;
  236. gap: 5px;
  237. cursor: pointer;
  238. transition: all 0.2s ease;
  239. border: 1px solid rgba(100, 160, 255, 0.2);
  240. }
  241. .tag:hover {
  242. background: rgba(100, 160, 255, 0.3);
  243. }
  244. .tag .delete {
  245. font-size: 12px;
  246. margin-left: 5px;
  247. opacity: 0.7;
  248. }
  249. .tag .delete:hover {
  250. opacity: 1;
  251. }
  252. .add-tag {
  253. background: rgba(136, 146, 176, 0.1);
  254. color: var(--gray);
  255. padding: 6px 12px;
  256. border-radius: 20px;
  257. font-size: 13px;
  258. display: flex;
  259. align-items: center;
  260. gap: 5px;
  261. cursor: pointer;
  262. transition: all 0.2s ease;
  263. }
  264. .add-tag:hover {
  265. background: rgba(136, 146, 176, 0.2);
  266. }
  267. /* 输入工作区 */
  268. .input-area {
  269. background: var(--white);
  270. border-radius: 20px;
  271. padding: 20px;
  272. margin-bottom: 20px;
  273. box-shadow: var(--shadow);
  274. border: 1px solid rgba(100, 160, 255, 0.2);
  275. }
  276. .input-title {
  277. font-size: 18px;
  278. font-weight: 600;
  279. margin-bottom: 15px;
  280. color: var(--dark);
  281. display: flex;
  282. align-items: center;
  283. gap: 10px;
  284. padding-bottom: 10px;
  285. border-bottom: 1px solid rgba(100, 160, 255, 0.1);
  286. }
  287. .input-title i {
  288. color: var(--primary);
  289. }
  290. .role-selector {
  291. display: flex;
  292. background: var(--light-gray);
  293. border-radius: 12px;
  294. padding: 4px;
  295. margin-bottom: 15px;
  296. }
  297. .role-btn {
  298. flex: 1;
  299. padding: 10px;
  300. text-align: center;
  301. border-radius: 10px;
  302. cursor: pointer;
  303. transition: all 0.3s ease;
  304. font-weight: 500;
  305. }
  306. .role-btn.active {
  307. background: var(--white);
  308. box-shadow: var(--shadow);
  309. color: var(--primary);
  310. }
  311. .input-field {
  312. position: relative;
  313. }
  314. .text-input {
  315. width: 100%;
  316. height: 120px;
  317. padding: 15px;
  318. border-radius: 15px;
  319. border: 1px solid rgba(136, 146, 176, 0.2);
  320. background: var(--light-gray);
  321. resize: none;
  322. font-size: 16px;
  323. color: var(--dark);
  324. transition: all 0.3s ease;
  325. }
  326. .text-input:focus {
  327. outline: none;
  328. border-color: var(--primary);
  329. box-shadow: 0 0 0 2px rgba(100, 160, 255, 0.2);
  330. }
  331. /* 策略卡片组 */
  332. .strategy-area {
  333. margin-bottom: 25px;
  334. }
  335. .strategy-title {
  336. font-size: 18px;
  337. font-weight: 600;
  338. margin-bottom: 15px;
  339. color: var(--dark);
  340. display: flex;
  341. align-items: center;
  342. gap: 10px;
  343. padding-bottom: 10px;
  344. border-bottom: 1px solid rgba(100, 160, 255, 0.1);
  345. }
  346. .strategy-title i {
  347. color: var(--primary);
  348. }
  349. .cards-container {
  350. position: relative;
  351. height: 320px;
  352. perspective: 1000px;
  353. }
  354. .strategy-card {
  355. position: absolute;
  356. width: 100%;
  357. height: 280px;
  358. border-radius: 20px;
  359. padding: 25px;
  360. box-shadow: var(--shadow);
  361. display: flex;
  362. flex-direction: column;
  363. transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
  364. opacity 0.4s ease,
  365. box-shadow 0.3s ease;
  366. backface-visibility: hidden;
  367. cursor: pointer;
  368. border: 1px solid rgba(100, 160, 255, 0.2);
  369. }
  370. .card-aggressive {
  371. background: linear-gradient(135deg, #eef6ff, #f0f8ff);
  372. border-top: 4px solid var(--blue);
  373. z-index: 30;
  374. }
  375. .card-neutral {
  376. background: linear-gradient(135deg, #fff9e6, #fffbf0);
  377. border-top: 4px solid var(--yellow);
  378. transform: translateY(20px) scale(0.95);
  379. z-index: 20;
  380. }
  381. .card-conservative {
  382. background: linear-gradient(135deg, #f9f0ff, #fdf5ff);
  383. border-top: 4px solid var(--purple);
  384. transform: translateY(40px) scale(0.9);
  385. z-index: 10;
  386. }
  387. .card-header {
  388. display: flex;
  389. justify-content: space-between;
  390. align-items: center;
  391. margin-bottom: 20px;
  392. }
  393. .card-title {
  394. font-size: 18px;
  395. font-weight: 700;
  396. }
  397. .card-icon {
  398. width: 40px;
  399. height: 40px;
  400. border-radius: 12px;
  401. display: flex;
  402. align-items: center;
  403. justify-content: center;
  404. font-size: 18px;
  405. }
  406. .card-content {
  407. flex: 1;
  408. overflow-y: auto;
  409. padding-right: 10px;
  410. }
  411. .card-content p {
  412. margin-bottom: 15px;
  413. line-height: 1.7;
  414. color: #333;
  415. }
  416. .card-highlight {
  417. background: rgba(10, 25, 47, 0.05);
  418. padding: 12px 15px;
  419. border-radius: 12px;
  420. border-left: 3px solid var(--primary);
  421. margin: 15px 0;
  422. font-weight: 500;
  423. line-height: 1.6;
  424. }
  425. .card-footer {
  426. display: flex;
  427. justify-content: space-between;
  428. align-items: center;
  429. margin-top: 15px;
  430. padding-top: 15px;
  431. border-top: 1px solid rgba(136, 146, 176, 0.1);
  432. }
  433. .card-hint {
  434. font-size: 14px;
  435. color: var(--gray);
  436. }
  437. /* 卡片导航点 */
  438. .card-navigation {
  439. display: flex;
  440. justify-content: center;
  441. gap: 10px;
  442. margin-top: 15px;
  443. }
  444. .card-nav-btn {
  445. width: 12px;
  446. height: 12px;
  447. border-radius: 50%;
  448. background: var(--light-gray);
  449. cursor: pointer;
  450. transition: all 0.2s ease;
  451. }
  452. .card-nav-btn.active {
  453. background: var(--primary);
  454. transform: scale(1.2);
  455. }
  456. /* 操作按钮 */
  457. .action-buttons {
  458. display: flex;
  459. gap: 15px;
  460. margin-top: 25px;
  461. }
  462. .action-btn {
  463. flex: 1;
  464. height: 50px;
  465. border-radius: 15px;
  466. display: flex;
  467. align-items: center;
  468. justify-content: center;
  469. gap: 10px;
  470. font-weight: 600;
  471. cursor: pointer;
  472. transition: all 0.3s ease;
  473. }
  474. .save-btn {
  475. background: var(--primary);
  476. color: var(--dark);
  477. border: none;
  478. box-shadow: 0 4px 15px rgba(100, 160, 255, 0.3);
  479. }
  480. .save-btn:hover {
  481. transform: translateY(-2px);
  482. box-shadow: 0 6px 20px rgba(100, 160, 255, 0.4);
  483. }
  484. .history-btn {
  485. background: var(--white);
  486. color: var(--dark);
  487. border: 2px solid var(--primary);
  488. box-shadow: 0 4px 15px rgba(100, 160, 255, 0.1);
  489. }
  490. .history-btn:hover {
  491. transform: translateY(-2px);
  492. box-shadow: 0 6px 20px rgba(100, 160, 255, 0.2);
  493. }
  494. /* 响应式调整 */
  495. @media (max-width: 380px) {
  496. .container {
  497. padding: 0 12px 25px;
  498. }
  499. .scene-options {
  500. flex-direction: column;
  501. }
  502. .cards-container {
  503. height: 300px;
  504. }
  505. .strategy-card {
  506. height: 260px;
  507. padding: 20px;
  508. }
  509. .chat-area {
  510. height: 320px;
  511. }
  512. }
  513. </style>
  514. </head>
  515. <body>
  516. <div class="container">
  517. <!-- 顶部导航 -->
  518. <header class="app-header">
  519. <div class="header-title">
  520. <i class="fas fa-robot"></i>
  521. <h1>话术决策助手</h1>
  522. </div>
  523. </header>
  524. <!-- 场景选择 -->
  525. <section class="scene-selector">
  526. <h2 class="input-title">
  527. <i class="fas fa-dharmachakra"></i>
  528. 选择对话场景
  529. </h2>
  530. <div class="scene-options">
  531. <div class="scene-option active" data-scene="first-contact">
  532. <i class="fas fa-handshake"></i>
  533. <h3>首次接触</h3>
  534. <p>初次沟通建立信任</p>
  535. </div>
  536. <div class="scene-option" data-scene="deep-talk">
  537. <i class="fas fa-comments"></i>
  538. <h3>深度交流</h3>
  539. <p>深入挖掘客户需求</p>
  540. </div>
  541. </div>
  542. </section>
  543. <!-- 客户对话分析 -->
  544. <section class="input-area">
  545. <h2 class="chat-title">
  546. <i class="fas fa-comments"></i>
  547. 客户对话分析
  548. </h2>
  549. <div class="chat-area" id="chatContainer">
  550. <div class="chat-message customer-message">
  551. <div class="message-header customer-header">
  552. <div class="icon"><i class="fas fa-user"></i></div>
  553. <div>客户</div>
  554. </div>
  555. <div class="message-content">您好,我对贵酒店的豪华套房很感兴趣,但觉得价格偏高,能否提供一些优惠?</div>
  556. <div class="message-time">10:25 AM</div>
  557. </div>
  558. <div class="chat-message assistant-message">
  559. <div class="message-header assistant-header">
  560. <div class="icon"><i class="fas fa-headset"></i></div>
  561. <div>销售顾问</div>
  562. </div>
  563. <div class="message-content">感谢您对我们豪华套房的关注!我们的套房拥有全景海景和私人管家服务,目前预订可享8折优惠,您觉得如何?</div>
  564. <div class="message-time">10:26 AM</div>
  565. </div>
  566. <div class="chat-message customer-message">
  567. <div class="message-header customer-header">
  568. <div class="icon"><i class="fas fa-user"></i></div>
  569. <div>客户</div>
  570. </div>
  571. <div class="message-content">8折还是有点高,我看到其他酒店类似房型有更优惠的价格。</div>
  572. <div class="message-time">10:27 AM</div>
  573. </div>
  574. <div class="chat-message assistant-message">
  575. <div class="message-header assistant-header">
  576. <div class="icon"><i class="fas fa-headset"></i></div>
  577. <div>销售顾问</div>
  578. </div>
  579. <div class="message-content">我理解您的考虑。我们的套房包含双人早餐和免费SPA体验,这些增值服务能让您的住宿体验更加完美。</div>
  580. <div class="message-time">10:28 AM</div>
  581. </div>
  582. <div class="chat-message customer-message">
  583. <div class="message-header customer-header">
  584. <div class="icon"><i class="fas fa-user"></i></div>
  585. <div>客户</div>
  586. </div>
  587. <div class="message-content">这个听起来不错,我考虑一下。</div>
  588. <div class="message-time">10:29 AM</div>
  589. </div>
  590. <div class="chat-message assistant-message">
  591. <div class="message-header assistant-header">
  592. <div class="icon"><i class="fas fa-headset"></i></div>
  593. <div>销售顾问</div>
  594. </div>
  595. <div class="message-content">好的,如果您今天预订,我们还可以额外赠送您一次下午茶体验。</div>
  596. <div class="message-time">10:30 AM</div>
  597. </div>
  598. </div>
  599. <!-- 客户标签编辑区 -->
  600. <div class="tags-area">
  601. <div class="tags-header">
  602. <div class="tags-title">客户标签</div>
  603. <div class="add-tag" id="addTagBtn">
  604. <i class="fas fa-plus"></i>
  605. <span>添加标签</span>
  606. </div>
  607. </div>
  608. <div class="input-tags" id="tagsContainer">
  609. <div class="tag" style="background: rgba(100, 160, 255, 0.15); color: #64a0ff;">
  610. <i class="fas fa-user"></i>
  611. <span>VIP客户</span>
  612. <span class="delete"><i class="fas fa-times"></i></span>
  613. </div>
  614. <div class="tag" style="background: rgba(255, 212, 59, 0.15); color: #ffd43b;">
  615. <i class="fas fa-calendar"></i>
  616. <span>旺季时段</span>
  617. <span class="delete"><i class="fas fa-times"></i></span>
  618. </div>
  619. <div class="tag" style="background: rgba(156, 54, 181, 0.15); color: #9c36b5;">
  620. <i class="fas fa-percent"></i>
  621. <span>价格敏感</span>
  622. <span class="delete"><i class="fas fa-times"></i></span>
  623. </div>
  624. </div>
  625. </div>
  626. </section>
  627. <!-- 输入工作区 -->
  628. <section class="input-area">
  629. <h2 class="input-title">
  630. <i class="fas fa-comment-dots"></i>
  631. 输入对话内容
  632. </h2>
  633. <div class="role-selector">
  634. <div class="role-btn active" id="customerRoleBtn">客户消息</div>
  635. <div class="role-btn" id="assistantRoleBtn">销售回复</div>
  636. </div>
  637. <div class="input-field">
  638. <textarea class="text-input" placeholder="输入对话内容..." id="messageInput"></textarea>
  639. </div>
  640. <div class="action-buttons">
  641. <div class="action-btn save-btn" onclick="sendMessage()">
  642. <i class="fas fa-paper-plane"></i>
  643. <span>发送消息</span>
  644. </div>
  645. </div>
  646. </section>
  647. <!-- 策略卡片组 -->
  648. <section class="strategy-area">
  649. <h2 class="strategy-title">
  650. <i class="fas fa-cards"></i>
  651. 推荐应对策略
  652. </h2>
  653. <div class="cards-container">
  654. <div class="strategy-card card-aggressive" onclick="activateCard(0)">
  655. <div class="card-header">
  656. <div class="card-title">主动型策略</div>
  657. <div class="card-icon" style="background: var(--blue-light); color: var(--blue);">
  658. <i class="fas fa-bolt"></i>
  659. </div>
  660. </div>
  661. <div class="card-content">
  662. <p>直接强调酒店独特价值,限量优惠制造紧迫感:</p>
  663. <div class="card-highlight">
  664. "我们的豪华套房拥有全景海景和私人管家服务,目前仅剩3间,现在预订可享8折限时优惠!"
  665. </div>
  666. <p><strong>适用场景:</strong>客户表现出明确兴趣,决策周期短</p>
  667. <p><strong>优势:</strong>快速成交,提升单笔订单价值</p>
  668. </div>
  669. <div class="card-footer">
  670. <div class="card-hint">成功率: 68%</div>
  671. <div class="card-hint"><i class="fas fa-clock"></i> 推荐指数: ⭐⭐⭐⭐</div>
  672. </div>
  673. </div>
  674. <div class="strategy-card card-neutral" onclick="activateCard(1)">
  675. <div class="card-header">
  676. <div class="card-title">平衡型策略</div>
  677. <div class="card-icon" style="background: rgba(255, 212, 59, 0.15); color: var(--yellow);">
  678. <i class="fas fa-balance-scale"></i>
  679. </div>
  680. </div>
  681. <div class="card-content">
  682. <p>提供阶梯式优惠,引导客户选择:</p>
  683. <div class="card-highlight">
  684. "如果您连住3晚以上,我们可以提供免费升级和早餐。另外,会员可额外享受9折优惠,现在注册立享福利!"
  685. </div>
  686. <p><strong>适用场景:</strong>客户在多个选项间犹豫</p>
  687. <p><strong>优势:</strong>平衡双方利益,建立长期关系</p>
  688. </div>
  689. <div class="card-footer">
  690. <div class="card-hint">成功率: 82%</div>
  691. <div class="card-hint"><i class="fas fa-clock"></i> 推荐指数: ⭐⭐⭐⭐⭐</div>
  692. </div>
  693. </div>
  694. <div class="strategy-card card-conservative" onclick="activateCard(2)">
  695. <div class="card-header">
  696. <div class="card-title">保守型策略</div>
  697. <div class="card-icon" style="background: rgba(156, 54, 181, 0.15); color: var(--purple);">
  698. <i class="fas fa-shield-alt"></i>
  699. </div>
  700. </div>
  701. <div class="card-content">
  702. <p>提供灵活方案,降低决策风险:</p>
  703. <div class="card-highlight">
  704. "我们提供24小时免费取消政策,现在预订可锁定当前价格。如果您对入住体验有任何不满意,我们将提供额外补偿。"
  705. </div>
  706. <p><strong>适用场景:</strong>客户犹豫不决,决策周期长</p>
  707. <p><strong>优势:</strong>降低客户风险感知,提高转化率</p>
  708. </div>
  709. <div class="card-footer">
  710. <div class="card-hint">成功率: 75%</div>
  711. <div class="card-hint"><i class="fas fa-clock"></i> 推荐指数: ⭐⭐⭐⭐</div>
  712. </div>
  713. </div>
  714. </div>
  715. <!-- 卡片导航点 -->
  716. <div class="card-navigation">
  717. <div class="card-nav-btn active" onclick="activateCard(0)"></div>
  718. <div class="card-nav-btn" onclick="activateCard(1)"></div>
  719. <div class="card-nav-btn" onclick="activateCard(2)"></div>
  720. </div>
  721. <!-- 操作按钮 -->
  722. <div class="action-buttons">
  723. <div class="action-btn save-btn" onclick="saveRecord()">
  724. <i class="fas fa-save"></i>
  725. <span>保存记录</span>
  726. </div>
  727. <div class="action-btn history-btn" onclick="viewHistory()">
  728. <i class="fas fa-history"></i>
  729. <span>查看历史</span>
  730. </div>
  731. </div>
  732. </section>
  733. </div>
  734. <script>
  735. // 初始化变量
  736. let selectedColor = '#64a0ff';
  737. // 场景选择功能
  738. document.querySelectorAll('.scene-option').forEach(item => {
  739. item.addEventListener('click', function() {
  740. document.querySelectorAll('.scene-option').forEach(i => i.classList.remove('active'));
  741. this.classList.add('active');
  742. // 更新策略内容
  743. const scene = this.getAttribute('data-scene');
  744. updateStrategies(scene);
  745. });
  746. });
  747. // 更新策略内容
  748. function updateStrategies(scene) {
  749. const strategies = {
  750. "first-contact": {
  751. aggressive: "主动介绍酒店特色和限时优惠,强调独特卖点",
  752. neutral: "提供套餐选择,引导客户了解不同房型",
  753. conservative: "邀请客户参观虚拟酒店,提供详细资料"
  754. },
  755. "deep-talk": {
  756. aggressive: "深度挖掘客户需求,提供定制化解决方案",
  757. neutral: "建立信任关系,分享成功案例和客户评价",
  758. conservative: "提供专业建议,解答客户深层疑问"
  759. }
  760. };
  761. const sceneTitles = {
  762. "first-contact": "首次接触",
  763. "deep-talk": "深度交流"
  764. };
  765. const sceneTitle = sceneTitles[scene] || "当前场景";
  766. // 更新策略内容
  767. document.querySelector('.card-aggressive .card-highlight').textContent =
  768. strategies[scene].aggressive;
  769. document.querySelector('.card-neutral .card-highlight').textContent =
  770. strategies[scene].neutral;
  771. document.querySelector('.card-conservative .card-highlight').textContent =
  772. strategies[scene].conservative;
  773. // 更新策略标题
  774. document.querySelector('.strategy-title').innerHTML =
  775. `<i class="fas fa-cards"></i> ${sceneTitle} - 推荐应对策略`;
  776. }
  777. // 激活卡片功能
  778. function activateCard(index) {
  779. const cards = document.querySelectorAll('.strategy-card');
  780. const navBtns = document.querySelectorAll('.card-nav-btn');
  781. cards.forEach((c, i) => {
  782. if (i === index) {
  783. c.style.transform = 'translateY(0) scale(1)';
  784. c.style.zIndex = '30';
  785. } else if (Math.abs(i - index) === 1) {
  786. c.style.transform = `translateY(${20 * Math.abs(i - index)}px) scale(${1 - 0.05 * Math.abs(i - index)})`;
  787. c.style.zIndex = '20';
  788. } else {
  789. c.style.transform = `translateY(${40 * Math.abs(i - index)}px) scale(${1 - 0.1 * Math.abs(i - index)})`;
  790. c.style.zIndex = '10';
  791. }
  792. });
  793. navBtns.forEach((btn, i) => {
  794. if (i === index) {
  795. btn.classList.add('active');
  796. } else {
  797. btn.classList.remove('active');
  798. }
  799. });
  800. }
  801. // 角色切换功能
  802. const customerRoleBtn = document.getElementById('customerRoleBtn');
  803. const assistantRoleBtn = document.getElementById('assistantRoleBtn');
  804. customerRoleBtn.addEventListener('click', function() {
  805. customerRoleBtn.classList.add('active');
  806. assistantRoleBtn.classList.remove('active');
  807. });
  808. assistantRoleBtn.addEventListener('click', function() {
  809. assistantRoleBtn.classList.add('active');
  810. customerRoleBtn.classList.remove('active');
  811. });
  812. // 标签删除功能
  813. function setupTagDeletion() {
  814. document.querySelectorAll('.tag .delete').forEach(deleteBtn => {
  815. deleteBtn.addEventListener('click', function(e) {
  816. e.stopPropagation();
  817. this.closest('.tag').remove();
  818. });
  819. });
  820. }
  821. // 初始化标签删除功能
  822. setupTagDeletion();
  823. // 添加新标签功能
  824. const addTagBtn = document.getElementById('addTagBtn');
  825. const tagsContainer = document.getElementById('tagsContainer');
  826. addTagBtn.addEventListener('click', function() {
  827. const newTag = document.createElement('div');
  828. newTag.className = 'tag';
  829. newTag.style.background = 'rgba(100, 160, 255, 0.15)';
  830. newTag.style.color = '#64a0ff';
  831. newTag.innerHTML = `
  832. <i class="fas fa-tag"></i>
  833. <span>新标签</span>
  834. <span class="delete"><i class="fas fa-times"></i></span>
  835. `;
  836. // 添加删除事件
  837. newTag.querySelector('.delete').addEventListener('click', function(e) {
  838. e.stopPropagation();
  839. this.closest('.tag').remove();
  840. });
  841. tagsContainer.appendChild(newTag);
  842. });
  843. // 发送消息功能
  844. const messageInput = document.getElementById('messageInput');
  845. const chatContainer = document.getElementById('chatContainer');
  846. function sendMessage() {
  847. const message = messageInput.value.trim();
  848. if (message) {
  849. // 确定消息角色
  850. const isCustomer = customerRoleBtn.classList.contains('active');
  851. const role = isCustomer ? 'customer' : 'assistant';
  852. // 创建新消息元素
  853. const newMessage = document.createElement('div');
  854. newMessage.className = `chat-message ${role}-message`;
  855. // 获取当前时间
  856. const now = new Date();
  857. const timeString = `${now.getHours()}:${now.getMinutes().toString().padStart(2, '0')}`;
  858. // 消息头部
  859. let headerHtml = '';
  860. if (isCustomer) {
  861. headerHtml = `
  862. <div class="message-header customer-header">
  863. <div class="icon"><i class="fas fa-user"></i></div>
  864. <div>客户</div>
  865. </div>
  866. `;
  867. } else {
  868. headerHtml = `
  869. <div class="message-header assistant-header">
  870. <div class="icon"><i class="fas fa-headset"></i></div>
  871. <div>销售顾问</div>
  872. </div>
  873. `;
  874. }
  875. newMessage.innerHTML = `
  876. ${headerHtml}
  877. <div class="message-content">${message}</div>
  878. <div class="message-time">${timeString}</div>
  879. `;
  880. // 添加到聊天容器
  881. chatContainer.appendChild(newMessage);
  882. // 清空输入框
  883. messageInput.value = '';
  884. // 滚动到底部
  885. chatContainer.scrollTop = chatContainer.scrollHeight;
  886. // 如果是销售发送消息,模拟客户回复
  887. if (!isCustomer) {
  888. setTimeout(() => {
  889. const customerReply = document.createElement('div');
  890. customerReply.className = 'chat-message customer-message';
  891. // 模拟回复内容
  892. const replies = [
  893. "这个优惠包含早餐吗?",
  894. "我需要和家人商量一下",
  895. "能否提供免费接机服务?",
  896. "价格还是有点高,能再优惠些吗?",
  897. "你们的取消政策是怎样的?",
  898. "如果我今天预订,还有额外优惠吗?",
  899. "套餐包含哪些服务?",
  900. "有更经济的房型推荐吗?"
  901. ];
  902. const randomReply = replies[Math.floor(Math.random() * replies.length)];
  903. customerReply.innerHTML = `
  904. <div class="message-header customer-header">
  905. <div class="icon"><i class="fas fa-user"></i></div>
  906. <div>客户</div>
  907. </div>
  908. <div class="message-content">${randomReply}</div>
  909. <div class="message-time">${now.getHours()}:${(now.getMinutes() + 1).toString().padStart(2, '0')}</div>
  910. `;
  911. chatContainer.appendChild(customerReply);
  912. chatContainer.scrollTop = chatContainer.scrollHeight;
  913. }, 1500);
  914. }
  915. // 重新聚焦输入框
  916. messageInput.focus();
  917. }
  918. }
  919. // 支持按Enter发送消息(Shift+Enter换行)
  920. messageInput.addEventListener('keydown', function(e) {
  921. if (e.key === 'Enter' && !e.shiftKey) {
  922. e.preventDefault();
  923. sendMessage();
  924. }
  925. });
  926. // 保存记录功能
  927. function saveRecord() {
  928. // 创建动画效果
  929. const saveBtn = document.querySelector('.save-btn');
  930. saveBtn.innerHTML = '<i class="fas fa-check"></i> 已保存';
  931. saveBtn.style.background = '#4da3ff';
  932. setTimeout(() => {
  933. saveBtn.innerHTML = '<i class="fas fa-save"></i> 保存记录';
  934. saveBtn.style.background = '';
  935. }, 2000);
  936. }
  937. // 查看历史功能
  938. function viewHistory() {
  939. alert('历史记录功能即将开放,正在开发中...');
  940. }
  941. // 初始化
  942. document.addEventListener('DOMContentLoaded', function() {
  943. // 初始化卡片位置
  944. activateCard(0);
  945. // 滚动到聊天底部
  946. chatContainer.scrollTop = chatContainer.scrollHeight;
  947. });
  948. </script>
  949. </body>
  950. </html>