deepseek_html_20251217_604f09.html 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  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. <style>
  8. * {
  9. margin: 0;
  10. padding: 0;
  11. box-sizing: border-box;
  12. font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
  13. }
  14. body {
  15. background-color: #f0f2f5;
  16. padding: 20px;
  17. min-height: 100vh;
  18. display: flex;
  19. justify-content: center;
  20. align-items: center;
  21. }
  22. .chat-container {
  23. width: 100%;
  24. max-width: 800px;
  25. background: white;
  26. border-radius: 24px;
  27. box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  28. overflow: hidden;
  29. height: 90vh;
  30. display: flex;
  31. flex-direction: column;
  32. }
  33. .chat-header {
  34. background: #00c853;
  35. color: white;
  36. padding: 25px 30px;
  37. text-align: center;
  38. position: relative;
  39. }
  40. .chat-header h1 {
  41. font-size: 26px;
  42. display: flex;
  43. align-items: center;
  44. justify-content: center;
  45. gap: 15px;
  46. }
  47. .chat-header h1::before {
  48. content: "🤖";
  49. font-size: 32px;
  50. }
  51. .tagline {
  52. font-size: 15px;
  53. opacity: 0.95;
  54. margin-top: 8px;
  55. }
  56. .quick-actions {
  57. display: flex;
  58. flex-wrap: wrap;
  59. gap: 12px;
  60. padding: 20px 30px;
  61. background: #f9f9f9;
  62. border-bottom: 1px solid #eee;
  63. justify-content: center;
  64. }
  65. .action-btn {
  66. background: white;
  67. border: 2px solid #e0e0e0;
  68. border-radius: 50px;
  69. padding: 10px 20px;
  70. font-size: 14px;
  71. cursor: pointer;
  72. transition: all 0.3s;
  73. color: #333;
  74. display: flex;
  75. align-items: center;
  76. gap: 8px;
  77. }
  78. .action-btn:hover {
  79. background: #00c853;
  80. color: white;
  81. border-color: #00c853;
  82. transform: translateY(-2px);
  83. }
  84. .action-btn::before {
  85. content: "⚡";
  86. }
  87. .chat-body {
  88. flex: 1;
  89. overflow-y: auto;
  90. padding: 30px;
  91. background: #fefefe;
  92. display: flex;
  93. flex-direction: column;
  94. gap: 20px;
  95. }
  96. .welcome-card {
  97. background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  98. border-radius: 20px;
  99. padding: 25px;
  100. margin-bottom: 10px;
  101. box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
  102. }
  103. .welcome-card h2 {
  104. color: #1e88e5;
  105. margin-bottom: 15px;
  106. font-size: 22px;
  107. }
  108. .welcome-card p {
  109. color: #333;
  110. line-height: 1.6;
  111. margin-bottom: 20px;
  112. }
  113. .welcome-features {
  114. display: grid;
  115. grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  116. gap: 15px;
  117. }
  118. .welcome-feature {
  119. background: rgba(255, 255, 255, 0.7);
  120. padding: 15px;
  121. border-radius: 12px;
  122. font-size: 14px;
  123. color: #444;
  124. text-align: center;
  125. border-left: 4px solid #00c853;
  126. }
  127. .message {
  128. max-width: 80%;
  129. padding: 18px;
  130. border-radius: 20px;
  131. line-height: 1.5;
  132. word-wrap: break-word;
  133. }
  134. .message.ai {
  135. background: #e8f5e9;
  136. align-self: flex-start;
  137. border-bottom-left-radius: 5px;
  138. color: #1b5e20;
  139. }
  140. .message.user {
  141. background: #1e88e5;
  142. color: white;
  143. align-self: flex-end;
  144. border-bottom-right-radius: 5px;
  145. }
  146. .chat-footer {
  147. padding: 25px 30px;
  148. background: white;
  149. border-top: 1px solid #eee;
  150. display: flex;
  151. flex-direction: column;
  152. gap: 15px;
  153. }
  154. .input-wrapper {
  155. display: flex;
  156. gap: 15px;
  157. }
  158. .input-wrapper textarea {
  159. flex: 1;
  160. padding: 18px;
  161. border: 2px solid #ddd;
  162. border-radius: 16px;
  163. font-size: 16px;
  164. resize: none;
  165. height: 60px;
  166. transition: border 0.3s;
  167. font-family: inherit;
  168. }
  169. .input-wrapper textarea:focus {
  170. border-color: #00c853;
  171. outline: none;
  172. }
  173. .send-btn {
  174. background: #00c853;
  175. color: white;
  176. border: none;
  177. border-radius: 16px;
  178. padding: 0 30px;
  179. font-size: 16px;
  180. cursor: pointer;
  181. transition: background 0.3s;
  182. display: flex;
  183. align-items: center;
  184. justify-content: center;
  185. gap: 8px;
  186. }
  187. .send-btn:hover {
  188. background: #00b248;
  189. }
  190. .hint-text {
  191. text-align: center;
  192. color: #888;
  193. font-size: 14px;
  194. line-height: 1.5;
  195. }
  196. .hint-text strong {
  197. color: #1e88e5;
  198. }
  199. @media (max-width: 600px) {
  200. .quick-actions {
  201. padding: 15px;
  202. gap: 10px;
  203. }
  204. .action-btn {
  205. padding: 8px 16px;
  206. font-size: 13px;
  207. }
  208. .welcome-features {
  209. grid-template-columns: 1fr;
  210. }
  211. }
  212. </style>
  213. </head>
  214. <body>
  215. <div class="chat-container">
  216. <div class="chat-header">
  217. <h1>AI回收助手</h1>
  218. <p class="tagline">智能回收,绿色生活</p>
  219. </div>
  220. <div class="quick-actions">
  221. <button class="action-btn">识别物品</button>
  222. <button class="action-btn">查询价格</button>
  223. <button class="action-btn">预约上门</button>
  224. <button class="action-btn">附近站点</button>
  225. <button class="action-btn">环保知识</button>
  226. </div>
  227. <div class="chat-body" id="chatBody">
  228. <div class="welcome-card">
  229. <h2>欢迎使用 AI 回收助手!</h2>
  230. <p>我能够帮助你处理回收相关的各类问题,让回收变得更简单、更智能。</p>
  231. <div class="welcome-features">
  232. <div class="welcome-feature">📸 图片识别可回收物</div>
  233. <div class="welcome-feature">💰 实时回收价格查询</div>
  234. <div class="welcome-feature">🚚 一键预约上门回收</div>
  235. <div class="welcome-feature">🗺️ 智能推荐附近投递点</div>
  236. </div>
  237. </div>
  238. <div class="message ai">
  239. 你好!我是你的 AI 回收助手,随时为你服务。你可以直接输入问题,或点击上方快捷按钮。
  240. </div>
  241. </div>
  242. <div class="chat-footer">
  243. <div class="input-wrapper">
  244. <textarea id="userMessage" placeholder="输入你的问题... 按 Enter 发送,Shift + Enter 换行"></textarea>
  245. <button class="send-btn" id="sendMessage">发送</button>
  246. </div>
  247. <div class="hint-text">
  248. 试试提问:<strong>什么物品可以回收?</strong> | <strong>如何预约上门回收?</strong> | <strong>积分规则是什么?</strong>
  249. </div>
  250. </div>
  251. </div>
  252. <script>
  253. const chatBody = document.getElementById('chatBody');
  254. const userMessage = document.getElementById('userMessage');
  255. const sendMessage = document.getElementById('sendMessage');
  256. const actionButtons = document.querySelectorAll('.action-btn');
  257. actionButtons.forEach((btn, index) => {
  258. btn.addEventListener('click', () => {
  259. const actions = [
  260. "请帮我识别一个可回收物品",
  261. "查询当前废纸的回收价格",
  262. "我想预约上门回收服务",
  263. "查找附近的回收投递点",
  264. "介绍一些环保回收知识"
  265. ];
  266. userMessage.value = actions[index];
  267. });
  268. });
  269. function addMessage(text, isUser = false) {
  270. const msg = document.createElement('div');
  271. msg.className = `message ${isUser ? 'user' : 'ai'}`;
  272. msg.textContent = text;
  273. chatBody.appendChild(msg);
  274. chatBody.scrollTop = chatBody.scrollHeight;
  275. }
  276. sendMessage.addEventListener('click', () => {
  277. sendMessageFunc();
  278. });
  279. userMessage.addEventListener('keydown', (e) => {
  280. if (e.key === 'Enter' && !e.shiftKey) {
  281. e.preventDefault();
  282. sendMessageFunc();
  283. }
  284. });
  285. function sendMessageFunc() {
  286. const text = userMessage.value.trim();
  287. if (text) {
  288. addMessage(text, true);
  289. userMessage.value = '';
  290. setTimeout(() => {
  291. const replies = [
  292. "已收到您的请求,正在为您处理...",
  293. "这个问题我可以帮您解答,请稍等。",
  294. "正在查询相关信息,马上为您呈现。",
  295. "好的,关于这个问题,我们的建议是..."
  296. ];
  297. const randomReply = replies[Math.floor(Math.random() * replies.length)];
  298. addMessage(randomReply);
  299. }, 1000);
  300. }
  301. }
  302. </script>
  303. </body>
  304. </html>