zixun.html 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940
  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. <!-- 引入国内CDN资源 -->
  8. <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
  9. <style>
  10. body {
  11. background: linear-gradient(135deg, #F8F9FF, #E6F7FF);
  12. background-size: cover;
  13. background-repeat: no-repeat;
  14. line-height: 1.6;
  15. max-width: 100vw;
  16. overflow-x: hidden;
  17. }
  18. :root {
  19. --primary: #3A5FE5;
  20. --secondary: #00C4A1;
  21. --danger: #FF4D4F;
  22. --bg: #F8F9FF;
  23. --text: #2D3748;
  24. --card: #FFFFFF;
  25. }
  26. * {
  27. margin: 0;
  28. padding: 0;
  29. box-sizing: border-box;
  30. font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  31. }
  32. .container {
  33. width: 100%;
  34. max-width: 480px;
  35. margin: 0 auto;
  36. padding: 15px;
  37. min-height: 100vh;
  38. display: flex;
  39. flex-direction: column;
  40. }
  41. /* 顶部导航 */
  42. .header {
  43. display: flex;
  44. justify-content: space-between;
  45. align-items: center;
  46. padding: 10px 0;
  47. margin-bottom: 15px;
  48. }
  49. .logo {
  50. font-weight: bold;
  51. font-size: 20px;
  52. color: var(--primary);
  53. display: flex;
  54. align-items: center;
  55. }
  56. .logo i {
  57. margin-right: 8px;
  58. color: var(--secondary);
  59. }
  60. .user-avatar {
  61. width: 36px;
  62. height: 36px;
  63. border-radius: 50%;
  64. background-color: var(--primary);
  65. display: flex;
  66. align-items: center;
  67. justify-content: center;
  68. color: white;
  69. }
  70. /* 咨询页面样式 */
  71. .chat-container {
  72. flex: 1;
  73. display: flex;
  74. flex-direction: column;
  75. padding-bottom: 60px;
  76. background: linear-gradient(180deg, rgba(248, 249, 255, 0.8) 0%, rgba(230, 247, 255, 0.5) 100%);
  77. border-radius: 16px;
  78. overflow: hidden;
  79. }
  80. .chat-header {
  81. padding: 15px;
  82. background: white;
  83. border-radius: 16px 16px 0 0;
  84. box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  85. display: flex;
  86. align-items: center;
  87. }
  88. .chat-avatar {
  89. width: 40px;
  90. height: 40px;
  91. border-radius: 50%;
  92. background: linear-gradient(135deg, var(--primary), #6A8EFF);
  93. display: flex;
  94. align-items: center;
  95. justify-content: center;
  96. color: white;
  97. margin-right: 12px;
  98. }
  99. .chat-info {
  100. flex: 1;
  101. }
  102. .chat-name {
  103. font-weight: bold;
  104. margin-bottom: 2px;
  105. }
  106. .chat-status {
  107. font-size: 12px;
  108. color: #666;
  109. display: flex;
  110. align-items: center;
  111. }
  112. .status-dot {
  113. width: 8px;
  114. height: 8px;
  115. background: #00C4A1;
  116. border-radius: 50%;
  117. margin-right: 5px;
  118. }
  119. .chat-messages {
  120. flex: 1;
  121. overflow-y: auto;
  122. padding: 15px;
  123. background: transparent;
  124. }
  125. .message {
  126. max-width: 85%;
  127. margin-bottom: 15px;
  128. position: relative;
  129. animation: fadeIn 0.3s ease-out;
  130. }
  131. @keyframes fadeIn {
  132. from {
  133. opacity: 0;
  134. transform: translateY(10px);
  135. }
  136. to {
  137. opacity: 1;
  138. transform: translateY(0);
  139. }
  140. }
  141. .user-message {
  142. align-self: flex-end;
  143. background: var(--primary);
  144. color: white;
  145. border-radius: 18px 18px 0 18px;
  146. padding: 12px 15px;
  147. margin-left: auto;
  148. box-shadow: 0 2px 8px rgba(58, 95, 229, 0.2);
  149. }
  150. .ai-message {
  151. align-self: flex-start;
  152. background: white;
  153. border-radius: 18px 18px 18px 0;
  154. padding: 12px 15px;
  155. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  156. }
  157. .message-time {
  158. font-size: 10px;
  159. color: #999;
  160. text-align: right;
  161. margin-top: 5px;
  162. }
  163. .ai-message .message-time {
  164. color: #666;
  165. text-align: left;
  166. }
  167. .law-ref {
  168. background: #E6F7FF;
  169. border-left: 3px solid var(--primary);
  170. padding: 8px 12px;
  171. margin: 8px 0;
  172. border-radius: 0 8px 8px 0;
  173. font-size: 14px;
  174. position: relative;
  175. }
  176. .law-ref::before {
  177. content: "⚖️";
  178. position: absolute;
  179. left: -25px;
  180. top: 50%;
  181. transform: translateY(-50%);
  182. font-size: 16px;
  183. }
  184. .suggestion-box {
  185. background: #F0FFF4;
  186. padding: 10px;
  187. border-radius: 8px;
  188. margin-top: 10px;
  189. font-size: 14px;
  190. border: 1px solid #E6FFED;
  191. }
  192. .suggestion-title {
  193. font-weight: bold;
  194. color: var(--secondary);
  195. margin-bottom: 5px;
  196. display: flex;
  197. align-items: center;
  198. }
  199. .suggestion-title i {
  200. margin-right: 5px;
  201. }
  202. .quick-actions {
  203. display: flex;
  204. flex-wrap: wrap;
  205. gap: 8px;
  206. margin-top: 15px;
  207. }
  208. .quick-action {
  209. background: rgba(58, 95, 229, 0.1);
  210. color: var(--primary);
  211. border: none;
  212. border-radius: 15px;
  213. padding: 8px 12px;
  214. font-size: 12px;
  215. cursor: pointer;
  216. transition: all 0.2s;
  217. }
  218. .quick-action:hover {
  219. background: rgba(58, 95, 229, 0.2);
  220. }
  221. .chat-input-container {
  222. display: flex;
  223. padding: 10px;
  224. background: white;
  225. position: fixed;
  226. bottom: 60px;
  227. left: 0;
  228. right: 0;
  229. max-width: 480px;
  230. margin: 0 auto;
  231. box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  232. border-radius: 16px 16px 0 0;
  233. }
  234. .input-wrapper {
  235. flex: 1;
  236. display: flex;
  237. background: #F5F7FA;
  238. border-radius: 20px;
  239. padding: 5px 15px;
  240. align-items: center;
  241. }
  242. .chat-input {
  243. flex: 1;
  244. border: none;
  245. outline: none;
  246. padding: 8px 5px;
  247. font-size: 16px;
  248. background: transparent;
  249. }
  250. .attach-btn {
  251. background: none;
  252. border: none;
  253. color: #666;
  254. font-size: 18px;
  255. margin-right: 5px;
  256. }
  257. .send-btn {
  258. background: var(--primary);
  259. color: white;
  260. border: none;
  261. width: 40px;
  262. height: 40px;
  263. border-radius: 50%;
  264. margin-left: 10px;
  265. display: flex;
  266. align-items: center;
  267. justify-content: center;
  268. transition: all 0.2s;
  269. }
  270. .send-btn:active {
  271. transform: scale(0.95);
  272. }
  273. .send-btn:disabled {
  274. background: #ccc;
  275. cursor: not-allowed;
  276. }
  277. /* 加载动画 */
  278. .loading {
  279. display: flex;
  280. justify-content: center;
  281. padding: 20px;
  282. }
  283. .typing-indicator {
  284. display: flex;
  285. align-items: center;
  286. background: white;
  287. padding: 10px 15px;
  288. border-radius: 18px;
  289. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  290. width: fit-content;
  291. margin-bottom: 15px;
  292. }
  293. .typing-text {
  294. font-size: 12px;
  295. color: #666;
  296. margin-right: 8px;
  297. }
  298. .typing-dots {
  299. display: flex;
  300. gap: 4px;
  301. }
  302. .typing-dots span {
  303. width: 6px;
  304. height: 6px;
  305. background: #999;
  306. border-radius: 50%;
  307. animation: bounce 1s infinite alternate;
  308. }
  309. .typing-dots span:nth-child(2) {
  310. animation-delay: 0.2s;
  311. }
  312. .typing-dots span:nth-child(3) {
  313. animation-delay: 0.4s;
  314. }
  315. @keyframes bounce {
  316. to {
  317. transform: translateY(-3px);
  318. }
  319. }
  320. /* 底部导航 */
  321. .tab-bar {
  322. display: flex;
  323. background: white;
  324. position: fixed;
  325. bottom: 0;
  326. left: 0;
  327. right: 0;
  328. max-width: 480px;
  329. margin: 0 auto;
  330. box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  331. padding: 8px 0;
  332. z-index: 100;
  333. }
  334. .tab-item {
  335. flex: 1;
  336. display: flex;
  337. flex-direction: column;
  338. align-items: center;
  339. color: #999;
  340. text-decoration: none;
  341. font-size: 12px;
  342. }
  343. .tab-item.active {
  344. color: var(--primary);
  345. }
  346. .tab-icon {
  347. font-size: 20px;
  348. margin-bottom: 3px;
  349. }
  350. /* 空状态 */
  351. .empty-state {
  352. display: flex;
  353. flex-direction: column;
  354. align-items: center;
  355. justify-content: center;
  356. height: 60%;
  357. text-align: center;
  358. padding: 20px;
  359. }
  360. .empty-icon {
  361. font-size: 60px;
  362. color: #D6E4FF;
  363. margin-bottom: 20px;
  364. }
  365. .empty-text {
  366. color: #999;
  367. margin-bottom: 20px;
  368. }
  369. /* 返回按钮 */
  370. .back-btn {
  371. background: none;
  372. border: none;
  373. font-size: 18px;
  374. margin-right: 10px;
  375. color: var(--primary);
  376. }
  377. /* 咨询类型选择 */
  378. .consult-types {
  379. display: flex;
  380. flex-wrap: wrap;
  381. gap: 10px;
  382. margin: 15px 0;
  383. }
  384. .consult-type {
  385. flex: 1;
  386. min-width: calc(50% - 5px);
  387. background: white;
  388. border-radius: 12px;
  389. padding: 15px;
  390. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  391. display: flex;
  392. flex-direction: column;
  393. align-items: center;
  394. transition: all 0.2s;
  395. }
  396. .consult-type:active {
  397. transform: scale(0.98);
  398. }
  399. .consult-icon {
  400. font-size: 24px;
  401. color: var(--primary);
  402. margin-bottom: 10px;
  403. }
  404. .consult-title {
  405. font-weight: bold;
  406. margin-bottom: 5px;
  407. }
  408. .consult-desc {
  409. font-size: 12px;
  410. color: #666;
  411. text-align: center;
  412. }
  413. </style>
  414. </head>
  415. <body>
  416. <div class="container" id="app">
  417. <!-- 咨询主页 -->
  418. <div class="page" id="consult-home-page">
  419. <div class="header">
  420. <button class="back-btn" onclick="showPage('home-page')">
  421. <i class="fas fa-arrow-left"></i>
  422. </button>
  423. <div class="logo">
  424. <span>法律咨询</span>
  425. </div>
  426. <div class="user-avatar">
  427. <i class="fas fa-user"></i>
  428. </div>
  429. </div>
  430. <div style="margin: 20px 0;">
  431. <h3 style="margin-bottom: 15px;">选择咨询类型</h3>
  432. <div class="consult-types">
  433. <div class="consult-type" onclick="startConsult('劳动纠纷')">
  434. <div class="consult-icon">
  435. <i class="fas fa-briefcase"></i>
  436. </div>
  437. <div class="consult-title">劳动纠纷</div>
  438. <div class="consult-desc">劳动合同、工资拖欠、工伤赔偿等问题</div>
  439. </div>
  440. <div class="consult-type" onclick="startConsult('婚姻家庭')">
  441. <div class="consult-icon">
  442. <i class="fas fa-heart"></i>
  443. </div>
  444. <div class="consult-title">婚姻家庭</div>
  445. <div class="consult-desc">离婚财产分割、抚养权、继承等问题</div>
  446. </div>
  447. <div class="consult-type" onclick="startConsult('合同纠纷')">
  448. <div class="consult-icon">
  449. <i class="fas fa-file-contract"></i>
  450. </div>
  451. <div class="consult-title">合同纠纷</div>
  452. <div class="consult-desc">合同审查、违约赔偿、协议起草等问题</div>
  453. </div>
  454. <div class="consult-type" onclick="startConsult('侵权责任')">
  455. <div class="consult-icon">
  456. <i class="fas fa-user-shield"></i>
  457. </div>
  458. <div class="consult-title">侵权责任</div>
  459. <div class="consult-desc">人身损害、名誉权、隐私权等问题</div>
  460. </div>
  461. </div>
  462. </div>
  463. <div style="margin: 20px 0;">
  464. <h3 style="margin-bottom: 15px;">常见问题</h3>
  465. <div style="background: white; border-radius: 12px; padding: 15px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);">
  466. <div style="margin-bottom: 10px; padding: 10px; border-bottom: 1px solid #eee; cursor: pointer;" onclick="startConsult('公司拖欠工资怎么办?')">
  467. <i class="fas fa-question-circle" style="color: var(--primary); margin-right: 8px;"></i>
  468. 公司拖欠工资怎么办?
  469. </div>
  470. <div style="margin-bottom: 10px; padding: 10px; border-bottom: 1px solid #eee; cursor: pointer;" onclick="startConsult('离婚后财产如何分割?')">
  471. <i class="fas fa-question-circle" style="color: var(--primary); margin-right: 8px;"></i>
  472. 离婚后财产如何分割?
  473. </div>
  474. <div style="margin-bottom: 10px; padding: 10px; border-bottom: 1px solid #eee; cursor: pointer;" onclick="startConsult('合同违约如何索赔?')">
  475. <i class="fas fa-question-circle" style="color: var(--primary); margin-right: 8px;"></i>
  476. 合同违约如何索赔?
  477. </div>
  478. <div style="padding: 10px; cursor: pointer;" onclick="startConsult('交通事故责任认定标准是什么?')">
  479. <i class="fas fa-question-circle" style="color: var(--primary); margin-right: 8px;"></i>
  480. 交通事故责任认定标准是什么?
  481. </div>
  482. </div>
  483. </div>
  484. </div>
  485. <!-- 聊天咨询页 -->
  486. <div class="page" id="chat-page" style="display: none;">
  487. <div class="header">
  488. <button class="back-btn" onclick="showPage('consult-home-page')">
  489. <i class="fas fa-arrow-left"></i>
  490. </button>
  491. <div class="logo">
  492. <span>AI法律咨询</span>
  493. </div>
  494. <div class="user-avatar">
  495. <i class="fas fa-ellipsis-v"></i>
  496. </div>
  497. </div>
  498. <div class="chat-container">
  499. <div class="chat-header">
  500. <div class="chat-avatar">
  501. <i class="fas fa-balance-scale"></i>
  502. </div>
  503. <div class="chat-info">
  504. <div class="chat-name">明律通AI律师</div>
  505. <div class="chat-status">
  506. <span class="status-dot"></span>
  507. <span>在线</span>
  508. </div>
  509. </div>
  510. </div>
  511. <div class="chat-messages" id="chat-messages">
  512. <!-- 初始欢迎消息 -->
  513. <div class="message ai-message">
  514. <p>您好!我是明律通AI律师助手,可以为您解答劳动纠纷、婚姻家庭、合同争议等法律问题。</p>
  515. <p>请简要描述您遇到的法律问题,我将为您提供专业分析。</p>
  516. <div class="quick-actions">
  517. <button class="quick-action" onclick="sendQuickQuestion('公司拖欠工资怎么办?')">拖欠工资</button>
  518. <button class="quick-action" onclick="sendQuickQuestion('离婚财产如何分割?')">财产分割</button>
  519. <button class="quick-action" onclick="sendQuickQuestion('合同违约怎么处理?')">合同违约</button>
  520. <button class="quick-action" onclick="sendQuickQuestion('工伤如何认定?')">工伤认定</button>
  521. </div>
  522. <div class="message-time">刚刚</div>
  523. </div>
  524. </div>
  525. <div class="chat-input-container">
  526. <div class="input-wrapper">
  527. <button class="attach-btn">
  528. <i class="fas fa-paperclip"></i>
  529. </button>
  530. <input type="text" class="chat-input" id="chat-input" placeholder="输入您的问题..." onkeypress="handleKeyPress(event)">
  531. </div>
  532. <button class="send-btn" id="send-btn" onclick="sendMessage()" disabled>
  533. <i class="fas fa-paper-plane"></i>
  534. </button>
  535. </div>
  536. </div>
  537. </div>
  538. <!-- 底部导航 -->
  539. <div class="tab-bar">
  540. <a href="#" class="tab-item" onclick="showPage('home-page')">
  541. <div class="tab-icon">
  542. <i class="fas fa-home"></i>
  543. </div>
  544. <div>首页</div>
  545. </a>
  546. <a href="#" class="tab-item active" onclick="showPage('consult-home-page')">
  547. <div class="tab-icon">
  548. <i class="fas fa-comment-dots"></i>
  549. </div>
  550. <div>咨询</div>
  551. </a>
  552. <a href="#" class="tab-item">
  553. <div class="tab-icon">
  554. <i class="fas fa-file-alt"></i>
  555. </div>
  556. <div>文书</div>
  557. </a>
  558. <a href="#" class="tab-item">
  559. <div class="tab-icon">
  560. <i class="fas fa-user"></i>
  561. </div>
  562. <div>我的</div>
  563. </a>
  564. </div>
  565. </div>
  566. <script>
  567. // 页面切换逻辑
  568. function showPage(pageId) {
  569. document.querySelectorAll('.page').forEach(page => {
  570. page.style.display = 'none';
  571. });
  572. document.getElementById(pageId).style.display = 'block';
  573. // 更新底部导航状态
  574. document.querySelectorAll('.tab-item').forEach(tab => {
  575. tab.classList.remove('active');
  576. });
  577. if(pageId === 'home-page') {
  578. document.querySelectorAll('.tab-item')[0].classList.add('active');
  579. } else if(pageId === 'consult-home-page' || pageId === 'chat-page') {
  580. document.querySelectorAll('.tab-item')[1].classList.add('active');
  581. }
  582. // 滚动到底部
  583. if(pageId === 'chat-page') {
  584. setTimeout(() => {
  585. const messages = document.getElementById('chat-messages');
  586. messages.scrollTop = messages.scrollHeight;
  587. }, 100);
  588. }
  589. }
  590. // 开始咨询
  591. function startConsult(question) {
  592. showPage('chat-page');
  593. if(question) {
  594. setTimeout(() => {
  595. const input = document.getElementById('chat-input');
  596. input.value = question;
  597. document.getElementById('send-btn').disabled = false;
  598. }, 300);
  599. }
  600. }
  601. // 发送快捷问题
  602. function sendQuickQuestion(question) {
  603. const input = document.getElementById('chat-input');
  604. input.value = question;
  605. document.getElementById('send-btn').disabled = false;
  606. sendMessage();
  607. }
  608. // 处理回车键
  609. function handleKeyPress(e) {
  610. if(e.key === 'Enter') {
  611. sendMessage();
  612. }
  613. }
  614. // 输入框变化时启用/禁用发送按钮
  615. document.getElementById('chat-input').addEventListener('input', function() {
  616. document.getElementById('send-btn').disabled = this.value.trim() === '';
  617. });
  618. // 发送消息
  619. function sendMessage() {
  620. const input = document.getElementById('chat-input');
  621. const messageText = input.value.trim();
  622. if(messageText === '') return;
  623. const messages = document.getElementById('chat-messages');
  624. // 添加用户消息
  625. const userMsg = document.createElement('div');
  626. userMsg.className = 'message user-message';
  627. userMsg.innerHTML = `
  628. ${messageText}
  629. <div class="message-time">${formatTime(new Date())}</div>
  630. `;
  631. messages.appendChild(userMsg);
  632. // 清空输入框
  633. input.value = '';
  634. document.getElementById('send-btn').disabled = true;
  635. // 显示AI正在输入指示器
  636. const typingIndicator = document.createElement('div');
  637. typingIndicator.className = 'typing-indicator';
  638. typingIndicator.innerHTML = `
  639. <div class="typing-text">AI律师正在思考...</div>
  640. <div class="typing-dots">
  641. <span></span>
  642. <span></span>
  643. <span></span>
  644. </div>
  645. `;
  646. messages.appendChild(typingIndicator);
  647. // 滚动到底部
  648. messages.scrollTop = messages.scrollHeight;
  649. // 模拟AI回复延迟
  650. setTimeout(() => {
  651. // 移除输入指示器
  652. messages.removeChild(typingIndicator);
  653. // 添加AI回复
  654. const aiMsg = document.createElement('div');
  655. aiMsg.className = 'message ai-message';
  656. // 根据问题类型生成不同的回复
  657. if(messageText.includes('工资') || messageText.includes('拖欠')) {
  658. aiMsg.innerHTML = generateLaborResponse();
  659. } else if(messageText.includes('离婚') || messageText.includes('财产') || messageText.includes('分割')) {
  660. aiMsg.innerHTML = generateMarriageResponse();
  661. } else if(messageText.includes('合同') || messageText.includes('违约')) {
  662. aiMsg.innerHTML = generateContractResponse();
  663. } else {
  664. aiMsg.innerHTML = generateGeneralResponse();
  665. }
  666. messages.appendChild(aiMsg);
  667. // 滚动到底部
  668. messages.scrollTop = messages.scrollHeight;
  669. }, 1500 + Math.random() * 2000); // 随机延迟1.5-3.5秒
  670. }
  671. // 生成劳动法相关回复
  672. function generateLaborResponse() {
  673. const laws = [
  674. '《劳动合同法》第三十条',
  675. '《劳动争议调解仲裁法》第五条',
  676. '《工资支付暂行规定》第七条'
  677. ];
  678. const suggestions = [
  679. '收集工资条、银行流水等证据',
  680. '向当地劳动监察大队投诉',
  681. '申请劳动仲裁(时效1年)',
  682. '可以主张经济补偿金'
  683. ];
  684. return `
  685. <p>您的问题涉及劳动法相关规定,根据${laws[Math.floor(Math.random()*laws.length)]},用人单位应当按时足额支付劳动者工资。</p>
  686. <div class="law-ref">
  687. <strong>${laws[0]}</strong><br>
  688. 用人单位应当按照劳动合同约定和国家规定,向劳动者及时足额支付劳动报酬。
  689. </div>
  690. <div class="suggestion-box">
  691. <div class="suggestion-title">
  692. <i class="fas fa-lightbulb"></i> 维权建议
  693. </div>
  694. <ol>
  695. <li>${suggestions[0]}</li>
  696. <li>${suggestions[1]}</li>
  697. <li>${suggestions[2]}</li>
  698. </ol>
  699. </div>
  700. <div class="quick-actions">
  701. <button class="quick-action" onclick="sendQuickQuestion('劳动仲裁需要什么材料?')">仲裁材料</button>
  702. <button class="quick-action" onclick="sendQuickQuestion('经济补偿金怎么计算?')">补偿计算</button>
  703. <button class="quick-action" onclick="sendQuickQuestion('试用期被辞退怎么办?')">试用期辞退</button>
  704. </div>
  705. <div class="message-time">${formatTime(new Date())}</div>
  706. `;
  707. }
  708. // 生成婚姻法相关回复
  709. function generateMarriageResponse() {
  710. const laws = [
  711. '《民法典》第一千零八十七条',
  712. '《民法典》第一千零八十四条',
  713. '《民法典》第一千零九十一条'
  714. ];
  715. const suggestions = [
  716. '婚前财产原则上归各自所有',
  717. '婚后共同财产一般均等分割',
  718. '考虑照顾子女、女方和无过错方权益',
  719. '可以协议分割或诉讼分割'
  720. ];
  721. return `
  722. <p>关于离婚财产分割问题,根据${laws[Math.floor(Math.random()*laws.length)]},夫妻共同财产由双方协议处理;协议不成的,由人民法院根据财产的具体情况判决。</p>
  723. <div class="law-ref">
  724. <strong>${laws[0]}</strong><br>
  725. 离婚时,夫妻的共同财产由双方协议处理;协议不成的,由人民法院根据财产的具体情况,按照照顾子女、女方和无过错方权益的原则判决。
  726. </div>
  727. <div class="suggestion-box">
  728. <div class="suggestion-title">
  729. <i class="fas fa-lightbulb"></i> 处理建议
  730. </div>
  731. <ol>
  732. <li>${suggestions[0]}</li>
  733. <li>${suggestions[1]}</li>
  734. <li>${suggestions[3]}</li>
  735. </ol>
  736. </div>
  737. <div class="quick-actions">
  738. <button class="quick-action" onclick="sendQuickQuestion('婚前房产怎么分割?')">婚前房产</button>
  739. <button class="quick-action" onclick="sendQuickQuestion('抚养权怎么判定?')">抚养权</button>
  740. <button class="quick-action" onclick="sendQuickQuestion('离婚协议书怎么写?')">离婚协议</button>
  741. </div>
  742. <div class="message-time">${formatTime(new Date())}</div>
  743. `;
  744. }
  745. // 生成合同法相关回复
  746. function generateContractResponse() {
  747. const laws = [
  748. '《民法典》第五百七十七条',
  749. '《民法典》第五百八十四条',
  750. '《民法典》第五百八十五条'
  751. ];
  752. const suggestions = [
  753. '审查合同违约条款是否明确',
  754. '收集违约证据(聊天记录、邮件等)',
  755. '先协商解决,协商不成可诉讼',
  756. '注意诉讼时效(一般为3年)'
  757. ];
  758. return `
  759. <p>合同违约问题涉及${laws[Math.floor(Math.random()*laws.length)]},当事人一方不履行合同义务或者履行合同义务不符合约定的,应当承担继续履行、采取补救措施或者赔偿损失等违约责任。</p>
  760. <div class="law-ref">
  761. <strong>${laws[0]}</strong><br>
  762. 当事人一方不履行合同义务或者履行合同义务不符合约定的,应当承担继续履行、采取补救措施或者赔偿损失等违约责任。
  763. </div>
  764. <div class="suggestion-box">
  765. <div class="suggestion-title">
  766. <i class="fas fa-lightbulb"></i> 维权步骤
  767. </div>
  768. <ol>
  769. <li>${suggestions[1]}</li>
  770. <li>${suggestions[2]}</li>
  771. <li>${suggestions[3]}</li>
  772. </ol>
  773. </div>
  774. <div class="quick-actions">
  775. <button class="quick-action" onclick="sendQuickQuestion('违约金过高怎么办?')">违约金</button>
  776. <button class="quick-action" onclick="sendQuickQuestion('合同解除的条件?')">合同解除</button>
  777. <button class="quick-action" onclick="sendQuickQuestion('如何起草合同?')">合同起草</button>
  778. </div>
  779. <div class="message-time">${formatTime(new Date())}</div>
  780. `;
  781. }
  782. // 生成通用回复
  783. function generateGeneralResponse() {
  784. const responses = [
  785. '您的问题涉及多个法律要点,需要进一步了解具体情况。',
  786. '根据相关法律规定,您描述的情况可能有以下几种处理方式:',
  787. '这是一个常见的法律问题,司法实践中通常这样处理:'
  788. ];
  789. const suggestions = [
  790. '建议收集相关证据材料',
  791. '可以咨询专业律师获取详细建议',
  792. '注意保留相关书面证据',
  793. '注意诉讼时效问题'
  794. ];
  795. return `
  796. <p>${responses[Math.floor(Math.random()*responses.length)]}</p>
  797. <div class="law-ref">
  798. <strong>相关法律依据</strong><br>
  799. 根据《民法典》相关规定,民事主体从事民事活动,应当遵循诚信原则,按照约定全面履行自己的义务。
  800. </div>
  801. <div class="suggestion-box">
  802. <div class="suggestion-title">
  803. <i class="fas fa-lightbulb"></i> 一般建议
  804. </div>
  805. <ol>
  806. <li>${suggestions[0]}</li>
  807. <li>${suggestions[1]}</li>
  808. <li>${suggestions[2]}</li>
  809. </ol>
  810. </div>
  811. <p>如果您能提供更多细节,我可以给出更具体的法律建议。</p>
  812. <div class="message-time">${formatTime(new Date())}</div>
  813. `;
  814. }
  815. // 格式化时间
  816. function formatTime(date) {
  817. const hours = date.getHours().toString().padStart(2, '0');
  818. const minutes = date.getMinutes().toString().padStart(2, '0');
  819. return `${hours}:${minutes}`;
  820. }
  821. // 初始化显示咨询主页
  822. showPage('consult-home-page');
  823. </script>
  824. </body>
  825. </html>