You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1060 lines
24 KiB

  1. <template>
  2. <view class="deepMate-page">
  3. <!-- 顶部导航栏 - 固定定位 -->
  4. <view class="header" :style="{ paddingTop: safeAreaInsets?.top + 'px' }">
  5. <view class="header-left">
  6. <image
  7. src="https://d31zlh4on95l9h.cloudfront.net/images/f91e09b5987802185e7679055dafd272.svg"
  8. class="icon"
  9. ></image>
  10. </view>
  11. <view class="header-center">
  12. <text class="title">DeepMate</text>
  13. </view>
  14. <view class="header-right">
  15. <image
  16. src="https://d31zlh4on95l9h.cloudfront.net/images/d7c4e74201213a25dd9574e908233928.svg"
  17. class="icon"
  18. ></image>
  19. <image
  20. src="https://d31zlh4on95l9h.cloudfront.net/images/099903c4aabf5713488b5cb60815e3f7.svg"
  21. class="icon"
  22. ></image>
  23. <!-- 新增新会话按钮
  24. <button class="new-chat-button" @click="newChat">
  25. <text class="new-chat-text">新会话</text>
  26. </button> -->
  27. </view>
  28. </view>
  29. <!-- 主要内容区域 -->
  30. <view class="main-content">
  31. <!-- 顶部固定区域占位符 -->
  32. <view class="banner-placeholder"></view>
  33. <view
  34. class="banner-panel"
  35. :class="messages.length === 0 ? '' : 'panelShow'"
  36. :style="{ paddingTop: safeAreaInsets?.top + 'px' }"
  37. >
  38. <image
  39. src="https://d31zlh4on95l9h.cloudfront.net/images/42e18bd7fe97d4f4f37aa70439a0990b.svg"
  40. class="pray-banner"
  41. :class="messages.length === 0 ? '' : 'show'"
  42. :style="{ paddingTop: safeAreaInsets?.top + 'px' }"
  43. mode="aspectFill"
  44. ></image>
  45. <view class="contain">
  46. <!-- 机器人头像和欢迎语 -->
  47. <view class="robot-container">
  48. <image
  49. src="https://d31zlh4on95l9h.cloudfront.net/images/61fa384381c88ad80be28f41827fe0e5.svg"
  50. class="robot-avatar"
  51. ></image>
  52. <view class="welcome-message">
  53. <text class="greeting">Hi, 我是您的股市随身顾问~</text>
  54. <text class="description"
  55. >个股诊断市场情绪解读都可以找我</text
  56. >
  57. </view>
  58. </view>
  59. <!-- 功能标签栏 -->
  60. <view
  61. class="function-tabs"
  62. v-if="messages.length === 0"
  63. scroll-x="true"
  64. show-scrollbar="false"
  65. >
  66. <view class="tab-item">个股诊断</view>
  67. <view class="tab-item">市场情绪温度计</view>
  68. <view class="tab-item">买卖时机提示</view>
  69. <view class="tab-item">个股</view>
  70. </view>
  71. <!-- 特斯拉推荐卡片 -->
  72. <view class="recommend-card" v-if="messages.length === 0">
  73. <view class="arrow" v-if="messages.length === 0"></view>
  74. <view class="card-content">
  75. <image
  76. src="../../static/images/tesla-logo.png"
  77. class="logo"
  78. ></image>
  79. <view class="card-text">
  80. <text class="main-question">当前特斯拉该如何布局</text>
  81. <text class="stock-code">TSLA</text>
  82. </view>
  83. <image
  84. src="https://d31zlh4on95l9h.cloudfront.net/images/40d94054644f6e3f1c366751f07f0010.svg"
  85. class="arrow-icon"
  86. @click="goBlank"
  87. ></image>
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. <!-- 可能感兴趣的话题 -->
  93. <view v-if="messages.length === 0" class="interest-section">
  94. <text class="section-title">- 您可能感兴趣 -</text>
  95. <view class="topics-list">
  96. <view class="topic-item" v-for="topic in hotTopics" :key="topic.id">
  97. <image :src="topic.icon" class="tag-icon"></image>
  98. <text class="topic-text" @click="sendMessageList(topic.text)">{{
  99. topic.text
  100. }}</text>
  101. </view>
  102. </view>
  103. </view>
  104. <!-- 聊天区域 -->
  105. <view class="chat-container" v-if="messages.length > 0">
  106. <!-- 给聊天容器添加滚动引用 -->
  107. <scroll-view
  108. class="chat-scroll-view"
  109. scroll-y="true"
  110. :scroll-top="scrollTop"
  111. :style="{ paddingTop: safeAreaInsets?.top + 'px' }"
  112. >
  113. <view class="message-list" id="messageList">
  114. <view
  115. v-for="(message, index) in messages"
  116. :key="index"
  117. :class="
  118. message.isUser ? 'message user-message' : 'message bot-message'
  119. "
  120. >
  121. <!-- 会话图标 -->
  122. <text
  123. :class="
  124. message.isUser
  125. ? 'fa-solid fa-user message-icon'
  126. : 'fa-solid fa-robot message-icon'
  127. "
  128. ></text>
  129. <!-- 会话内容 -->
  130. <view class="message-content">
  131. <!-- loading -->
  132. <view
  133. class="loading-dots"
  134. v-if="message.isThinking || !message.isUser"
  135. >
  136. <div class="thinking-process">
  137. <div class="thinking-header">
  138. <div class="thinking-icon"></div>
  139. <div class="thinking-title">深度思考 正在思考</div>
  140. <div class="thinking-count">25 个结果</div>
  141. <div class="thinking-toggle" @click="toggleThinking">
  142. <span v-if="showThinking"></span>
  143. <span v-else></span>
  144. </div>
  145. </div>
  146. <div v-show="showThinking" class="thinking-content">
  147. <div class="thinking-item">
  148. <div class="item-status">
  149. <span class="checkmark"></span>
  150. </div>
  151. <div class="item-text">问题分析完成</div>
  152. </div>
  153. <div class="thinking-item">
  154. <div class="item-status">
  155. <span class="checkmark"></span>
  156. </div>
  157. <div class="item-text">收集相关信息</div>
  158. </div>
  159. </div>
  160. </div>
  161. </view>
  162. <!-- 使用 rich-text 渲染 Markdown 内容 -->
  163. <rich-text v-if="!message.isUser" class="message-text" :nodes="renderMarkdown(message.content)"></rich-text>
  164. <text v-else class="message-text">{{ message.content }}</text>
  165. </view>
  166. </view>
  167. </view>
  168. </scroll-view>
  169. </view>
  170. </view>
  171. <!-- 输入框区域 -->
  172. <view class="input-area">
  173. <view class="input-wrapper">
  174. <input
  175. type="text"
  176. placeholder="请输入股票代码/名称,获取AI洞察"
  177. placeholder-style="color:#fff;opacity:1"
  178. class="input-field"
  179. v-model="inputMessage"
  180. @confirm="sendMessage"
  181. />
  182. <image class="send-button" @click="sendMessage" :disabled="isSending">
  183. <!-- <image
  184. src="https://d31zlh4on95l9h.cloudfront.net/images/95f1ea2262e9157db13c93c0dc1c5d96.svg"
  185. class="send-icon"
  186. ></image> -->
  187. </image>
  188. </view>
  189. <text class="disclaimer"
  190. >以上数据由AI生成不作为最终投资建议决策需独立</text
  191. >
  192. </view>
  193. <image
  194. class="back-to-top"
  195. src="https://d31zlh4on95l9h.cloudfront.net/images/ba357635d2bb480241952bb1cabacd73.svg"
  196. @click="scrollToTop"
  197. ></image>
  198. <footerBar class="static-footer" :type="type"></footerBar>
  199. </view>
  200. </template>
  201. <script setup>
  202. const { safeAreaInsets } = uni.getSystemInfoSync();
  203. import { ref, onMounted, nextTick, watch } from "vue";
  204. import footerBar from "../../components/footerBar-cn.vue";
  205. import marked from "marked"; // 引入 marked 库
  206. // 设置 marked 选项
  207. marked.setOptions({
  208. renderer: new marked.Renderer(),
  209. highlight: null, // 如果需要代码高亮,可以设置适当的函数
  210. langPrefix: 'language-',
  211. pedantic: false,
  212. gfm: true,
  213. breaks: false,
  214. sanitize: false,
  215. smartLists: true,
  216. smartypants: false,
  217. xhtml: false
  218. });
  219. // 创建一个用于渲染 Markdown 的函数
  220. const renderMarkdown = (content) => {
  221. if (!content) return '';
  222. return marked.parse(content);
  223. };
  224. const type = ref("member");
  225. const inputMessage = ref("");
  226. const showThinking = ref(true);
  227. const isSending = ref(false);
  228. const uuid = ref("");
  229. const messages = ref([]);
  230. const scrollTop = ref(0); // 用于控制scroll-view的滚动位置
  231. const dataInfo = ref("")
  232. const hotTopics = ref([
  233. {
  234. id: 1,
  235. text: "英伟达(NVDA)股票情绪温度?",
  236. icon: "https://d31zlh4on95l9h.cloudfront.net/images/7ed58be0f4b81aeb398d9ba2534a624b.svg",
  237. },
  238. {
  239. id: 2,
  240. text: "博通(AVGO)明天还能涨吗?",
  241. icon: "https://d31zlh4on95l9h.cloudfront.net/images/7ed58be0f4b81aeb398d9ba2534a624b.svg",
  242. },
  243. {
  244. id: 3,
  245. text: "为什么Fluence Energy(FLNC)会暴涨?",
  246. icon: "https://d31zlh4on95l9h.cloudfront.net/images/7ed58be0f4b81aeb398d9ba2534a624b.svg",
  247. },
  248. {
  249. id: 4,
  250. text: "为什么Fluence Energy(FLNC)会暴涨?",
  251. icon: "https://d31zlh4on95l9h.cloudfront.net/images/7ed58be0f4b81aeb398d9ba2534a624b.svg",
  252. },
  253. ]);
  254. // 初始化
  255. onMounted(() => {
  256. initUUID();
  257. // 如果有历史消息,滚动到底部
  258. if (messages.value.length > 0) {
  259. setTimeout(() => {
  260. scrollToBottom();
  261. }, 200);
  262. }
  263. });
  264. // 监听消息变化,当有新消息时自动滚动到最新消息
  265. watch(
  266. messages,
  267. (newMessages) => {
  268. // 延迟执行滚动,确保DOM更新完成
  269. setTimeout(() => {
  270. scrollToBottom();
  271. }, 100);
  272. },
  273. { deep: true }
  274. );
  275. // 初始化 UUID
  276. const initUUID = () => {
  277. let storedUUID = uni.getStorageSync("user_uuid");
  278. if (!storedUUID) {
  279. storedUUID = generateUUID();
  280. uni.setStorageSync("user_uuid", storedUUID);
  281. }
  282. uuid.value = storedUUID;
  283. };
  284. // 生成简单UUID
  285. const generateUUID = () => {
  286. return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
  287. var r = (Math.random() * 16) | 0,
  288. v = c == "x" ? r : (r & 0x3) | 0x8;
  289. return v.toString(16);
  290. });
  291. };
  292. // 新会话
  293. const newChat = () => {
  294. messages.value = [];
  295. uni.removeStorageSync("user_uuid");
  296. initUUID();
  297. };
  298. // 跳转到空白页
  299. const goBlank = () => {
  300. uni.navigateTo({
  301. url: "/pages/blank/blank",
  302. });
  303. };
  304. // 发送消息
  305. const sendMessage = () => {
  306. if (inputMessage.value.trim() === "" || isSending.value) return;
  307. const userMessage = {
  308. content: inputMessage.value,
  309. isUser: true,
  310. isThinking: false,
  311. isTyping: false,
  312. };
  313. messages.value.push(userMessage);
  314. inputMessage.value = "";
  315. // 滚动到底部
  316. setTimeout(() => {
  317. scrollToBottom();
  318. }, 100);
  319. // 模拟机器人回复
  320. simulateBotResponse(userMessage.content);
  321. };
  322. // 发送消息
  323. const sendMessageList = (listMessage) => {
  324. console.log(listMessage);
  325. const userMessage = {
  326. content: listMessage,
  327. isUser: true,
  328. isThinking: false,
  329. isTyping: false,
  330. };
  331. messages.value.push(userMessage);
  332. inputMessage.value = "";
  333. // 滚动到底部
  334. setTimeout(() => {
  335. scrollToBottom();
  336. }, 100);
  337. // 模拟机器人回复
  338. simulateBotResponse(userMessage.content);
  339. };
  340. // 模拟机器人回复
  341. const simulateBotResponse = (userMessage) => {
  342. isSending.value = true;
  343. // 添加机器人加载消息
  344. const botMsg = {
  345. content: "",
  346. isUser: false,
  347. isTyping: true,
  348. isThinking: false,
  349. };
  350. messages.value.push(botMsg);
  351. // 滚动到底部
  352. setTimeout(() => {
  353. scrollToBottom();
  354. }, 100);
  355. // 模拟流式响应
  356. let responseText = `我已经收到您的消息: "${userMessage}"。
  357. ## 股票分析报告
  358. ### 股票名称: Tesla Inc. (TSLA)
  359. - **当前价格**: 448.980
  360. - **更新时间**: 23/10/2025
  361. - **今日无变盘点**
  362. ### 技术分析
  363. - **CFTL**: 当前牵牛绳为红色处于龙线区域最近出现牛刀小试度牛线目前处于青绿色区域
  364. - **空间预测**:
  365. - 预测低一值: 413.364
  366. - 预测高一值: 426.636
  367. - 预测低二值: 421.670
  368. - 预测高二值: 448.314
  369. - **能量分析**: AI智能均线多头排列当前卖盘小于买盘
  370. ### 资金与主力
  371. - **主力分析**:
  372. 1. 该股庄家中长期筹码成本价格为 356.036短期资金成本价格为 406.429该股筹码分散当日筹码成本价格为 439.322
  373. 2. 近日没有出现主力集中吸筹
  374. 3. 近期主力持仓比例大于散户持仓比例当日主力持仓增加当日散户持仓减少
  375. ### 综合评价
  376. - **个股走势评价**:
  377. - 该股整体趋势向好出现暴涨的可能性较大当前如果已经持有该股票可以继续持股观察如果尚未持有该股票可持续进行观察目前处于机会的初期处于反弹阶段可以分步建仓
  378. - **核心证据链**:
  379. - 资金共识当日多方资金流入
  380. - 趋势动能该股中长期处于上升趋势短期处于弱势状态
  381. - **牛股评级**:
  382. - **暴涨概率**: 60%
  383. - **风险评估**: 非常安全
  384. - **安全边际**: 432.671~458.057
  385. - **黄金价域**: 427.995~440.835`;
  386. let index = 0;
  387. const typeWriter = () => {
  388. if (index < responseText.length) {
  389. // 使用 Vue 的响应式更新机制
  390. messages.value[messages.value.length - 1].content =
  391. responseText.substring(0, index + 1);
  392. index++;
  393. // 滚动到底部,更频繁地触发滚动以适应文本增长
  394. setTimeout(() => {
  395. scrollToBottom();
  396. }, 20);
  397. setTimeout(typeWriter, 30);
  398. } else {
  399. messages.value[messages.value.length - 1].isTyping = false;
  400. isSending.value = false;
  401. // 最后确保滚动到底部
  402. setTimeout(() => {
  403. scrollToBottom();
  404. }, 100);
  405. }
  406. };
  407. setTimeout(typeWriter, 500);
  408. };
  409. // 滚动到底部
  410. const scrollToBottom = () => {
  411. // 使用scroll-view的scrollTop属性来控制滚动
  412. const query = uni.createSelectorQuery();
  413. query.select("#messageList").boundingClientRect();
  414. query.exec((res) => {
  415. if (res[0]) {
  416. // 设置scrollTop为消息列表的高度,实现滚动到底部
  417. scrollTop.value = res[0].height;
  418. }
  419. });
  420. };
  421. const scrollToTop = () => {
  422. // 滚动到顶部
  423. scrollTop.value = 0;
  424. };
  425. const toggleThinking = () => {
  426. showThinking.value = !showThinking.value;
  427. };
  428. // function getDataInfo() {
  429. // return uni.request({
  430. // url: 'http://localhost:8888/ka',
  431. // data: {},
  432. // header: {
  433. // Accept: 'application/json',
  434. // 'Content-Type': 'application/json',
  435. // 'X-Requested-With': 'XMLHttpRequest'
  436. // },
  437. // method: 'GET',
  438. // sslVerify: true,
  439. // success: (res) => {
  440. // console.log(res.data);
  441. // res.data.forEach(item => {
  442. // console.log("item是"+item);
  443. // dataInfo.value = item.name;
  444. // });
  445. // },
  446. // fail: (error) => {}
  447. // })
  448. // }
  449. </script>
  450. <style scoped>
  451. .deepMate-page {
  452. display: flex;
  453. flex-direction: column;
  454. height: 100vh;
  455. max-height: 100vh; /* 限制最大高度 */
  456. background-color: #ffffff;
  457. padding: 0; /* 移除padding,避免影响布局 */
  458. position: relative;
  459. overflow: hidden; /* 禁止页面整体滚动 */
  460. -webkit-overflow-scrolling: none; /* 禁用iOS弹性滚动 */
  461. }
  462. /* 顶部导航栏 - 固定定位 */
  463. .header {
  464. display: flex;
  465. justify-content: space-between;
  466. align-items: center;
  467. padding: 20rpx 30rpx;
  468. background-color: #ffffff;
  469. position: fixed;
  470. top: 0;
  471. left: 0;
  472. right: 0;
  473. z-index: 999;
  474. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
  475. }
  476. /* 顶部固定区域占位符 */
  477. .header-placeholder {
  478. height: 120rpx; /* 与header高度一致 */
  479. }
  480. /* 顶部固定区域占位符 */
  481. .banner-placeholder {
  482. height: 80rpx; /* 与header高度一致,防止内容被固定头部遮挡 */
  483. }
  484. .header-left,
  485. .header-right {
  486. display: flex;
  487. align-items: center;
  488. }
  489. .header-left .icon,
  490. .header-right .icon {
  491. width: 40rpx;
  492. height: 40rpx;
  493. margin-right: 20rpx;
  494. }
  495. .header-center .title {
  496. font-size: 36rpx;
  497. font-weight: bold;
  498. color: #333333;
  499. }
  500. .new-chat-button {
  501. background-color: #ff6600;
  502. border: none;
  503. border-radius: 8rpx;
  504. padding: 10rpx 20rpx;
  505. }
  506. .new-chat-text {
  507. color: white;
  508. font-size: 24rpx;
  509. }
  510. .main-content {
  511. flex: 1;
  512. padding: 20rpx;
  513. overflow-y: hidden; /* 禁止主内容区域滚动 */
  514. margin-top: 20rpx;
  515. margin-bottom: 250rpx; /* 为底部输入区域留出空间 */
  516. max-height: calc(100vh - 200rpx); /* 确保内容区域不会超出视口 */
  517. -webkit-overflow-scrolling: none; /* 禁用iOS弹性滚动 */
  518. }
  519. .robot-container {
  520. display: flex;
  521. align-items: center;
  522. margin-bottom: 30rpx;
  523. }
  524. .robot-avatar {
  525. width: 130rpx;
  526. height: 130rpx;
  527. border-radius: 50%;
  528. margin-right: 10rpx;
  529. }
  530. .welcome-message {
  531. flex: 1;
  532. }
  533. .greeting {
  534. font-size: 32rpx;
  535. margin-left: 50rpx;
  536. top: 40rpx;
  537. font-weight: bold;
  538. color: #333333;
  539. line-height: 48rpx;
  540. }
  541. .description {
  542. display: block;
  543. font-size: 24rpx;
  544. color: #666666;
  545. line-height: 36rpx;
  546. margin-top: 10rpx;
  547. margin-left: 45rpx;
  548. }
  549. .function-tabs {
  550. display: flex;
  551. margin-bottom: 30rpx;
  552. }
  553. .tab-item {
  554. padding: 5rpx 20rpx;
  555. border-radius: 20rpx;
  556. font-size: 20rpx;
  557. font-weight: 700;
  558. color: #666666;
  559. background-color: #fffefe;
  560. margin-right: 20rpx;
  561. transition: all 0.3s;
  562. }
  563. .tab-item.active {
  564. color: #ff6600;
  565. background-color: #fff;
  566. border: 1rpx solid #ff6600;
  567. }
  568. .recommend-card {
  569. background: url("https://d31zlh4on95l9h.cloudfront.net/images/4da1d629a55c307c3605ca15bf15189a.svg");
  570. background-repeat: no-repeat;
  571. /* border-radius: 20rpx; */
  572. padding: 40rpx;
  573. margin-bottom: 30rpx;
  574. /* box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05); */
  575. }
  576. .card-content {
  577. display: flex;
  578. align-items: center;
  579. justify-content: space-between;
  580. }
  581. .logo {
  582. width: 80rpx;
  583. height: 80rpx;
  584. background-color: #ff0000;
  585. border-radius: 10rpx;
  586. display: flex;
  587. align-items: center;
  588. justify-content: center;
  589. margin-right: 20rpx;
  590. }
  591. .card-text {
  592. flex: 1;
  593. margin-left: 20rpx;
  594. }
  595. .main-question {
  596. font-size: 32rpx;
  597. color: #333333;
  598. line-height: 48rpx;
  599. }
  600. .stock-code {
  601. display: block;
  602. font-size: 24rpx;
  603. color: #ff3b30;
  604. background-color: #ffffff;
  605. padding: 2rpx 15rpx;
  606. border-radius: 12rpx;
  607. margin-top: 8rpx;
  608. width: fit-content;
  609. border: 1rpx solid #ff3b30;
  610. }
  611. .arrow-icon {
  612. background: url("https://d31zlh4on95l9h.cloudfront.net/images/40d94054644f6e3f1c366751f07f0010.svg");
  613. background-repeat: no-repeat;
  614. left: 0.5rem;
  615. top: 1.8rem;
  616. background-size: 100% 100%;
  617. width: 60rpx;
  618. height: 60rpx;
  619. }
  620. .interest-section {
  621. margin-bottom: 30rpx;
  622. }
  623. .section-title {
  624. display: block;
  625. text-align: center;
  626. font-size: 26rpx;
  627. color: #666666;
  628. margin-bottom: 20rpx;
  629. }
  630. .topics-list {
  631. display: flex;
  632. flex-direction: column;
  633. gap: 15rpx;
  634. }
  635. .topic-item {
  636. display: flex;
  637. align-items: center;
  638. padding: 15rpx 20rpx;
  639. background-color: #f0f0f0;
  640. border-radius: 15rpx;
  641. width: fit-content;
  642. }
  643. .tag-icon {
  644. width: 24rpx;
  645. height: 24rpx;
  646. margin-right: 10rpx;
  647. }
  648. .topic-text {
  649. font-size: 28rpx;
  650. color: #333333;
  651. flex: 1;
  652. }
  653. /* 聊天区域样式 */
  654. .chat-container {
  655. margin-top: 30rpx;
  656. border-radius: 10rpx;
  657. height: fit-content;
  658. /* overflow-y: auto; */
  659. }
  660. .chat-scroll-view {
  661. height: calc(80vh - 250rpx);
  662. /* height: 80vh ; */
  663. /* flex: 1; */
  664. /* height: fit-content; */
  665. margin-top: 70rpx;
  666. }
  667. .message-list {
  668. /* padding: 20rpx; */
  669. /* margin-top: 200rpx; */
  670. }
  671. .message {
  672. display: flex;
  673. align-items: flex-start;
  674. margin-bottom: 30rpx;
  675. }
  676. .user-message {
  677. flex-direction: row-reverse;
  678. }
  679. .message-icon {
  680. font-size: 24rpx;
  681. margin: 0 10rpx;
  682. padding: 10rpx;
  683. border-radius: 50%;
  684. background-color: #ddd;
  685. width: 40rpx;
  686. height: 40rpx;
  687. display: flex;
  688. align-items: center;
  689. justify-content: center;
  690. }
  691. .user-message .message-icon {
  692. background-color: #007aff;
  693. color: white;
  694. }
  695. .bot-message .message-icon {
  696. background-color: #34c759;
  697. color: white;
  698. }
  699. .message-content {
  700. max-width: 70%;
  701. position: relative;
  702. }
  703. .user-message .message-content {
  704. background-color: #007aff;
  705. border-radius: 10rpx;
  706. padding: 15rpx;
  707. }
  708. .bot-message .message-content {
  709. background-color: #f0f0f0;
  710. border-radius: 10rpx;
  711. padding: 15rpx;
  712. }
  713. .message-text {
  714. font-size: 28rpx;
  715. line-height: 40rpx;
  716. }
  717. .user-message .message-text {
  718. color: white;
  719. }
  720. .bot-message .message-text {
  721. color: #333;
  722. }
  723. .loading-dots {
  724. display: flex;
  725. align-items: center;
  726. padding-top: 10rpx;
  727. }
  728. .dot {
  729. width: 10rpx;
  730. height: 10rpx;
  731. background-color: #666;
  732. border-radius: 50%;
  733. margin: 0 4rpx;
  734. animation: loading 1.4s infinite ease-in-out both;
  735. }
  736. .user-message .dot {
  737. background-color: white;
  738. }
  739. .dot:nth-child(1) {
  740. animation-delay: -0.32s;
  741. }
  742. .dot:nth-child(2) {
  743. animation-delay: -0.16s;
  744. }
  745. @keyframes loading {
  746. 0%,
  747. 80%,
  748. 100% {
  749. transform: scale(0);
  750. }
  751. 40% {
  752. transform: scale(1);
  753. }
  754. }
  755. .input-area {
  756. position: fixed;
  757. bottom: 70rpx;
  758. left: 0;
  759. right: 0;
  760. padding: 0 40rpx 80rpx 40rpx;
  761. background-color: #ffffff;
  762. z-index: 999;
  763. -webkit-overflow-scrolling: none; /* 禁用iOS弹性滚动 */
  764. }
  765. .input-wrapper {
  766. position: relative;
  767. display: flex;
  768. align-items: center;
  769. padding: 15rpx 20rpx;
  770. background-color: rgb(220, 31, 29);
  771. border-radius: 100rpx;
  772. display: flex;
  773. align-items: center;
  774. justify-content: center;
  775. height: 50rpx;
  776. }
  777. .mic-icon {
  778. width: 36rpx;
  779. height: 36rpx;
  780. margin-right: 20rpx;
  781. }
  782. .input-field {
  783. flex: 1;
  784. font-size: 28rpx;
  785. color: #fff;
  786. display: flex;
  787. align-items: center;
  788. justify-content: center;
  789. margin-left: 60rpx;
  790. background: none;
  791. border: none;
  792. outline: none;
  793. }
  794. .input-field::placeholder {
  795. color: #ffffff !important;
  796. opacity: 1;
  797. }
  798. .send-button {
  799. background: url("https://d31zlh4on95l9h.cloudfront.net/images/95f1ea2262e9157db13c93c0dc1c5d96.svg");
  800. background-repeat: no-repeat;
  801. background-size: 100% 100%;
  802. height: 50rpx;
  803. width: 50rpx;
  804. padding: 0;
  805. border: 1rpx solid transparent;
  806. margin-left: 20rpx;
  807. }
  808. .send-icon {
  809. width: 36rpx;
  810. height: 36rpx;
  811. }
  812. .disclaimer {
  813. font-size: 15rpx;
  814. color: #4d4c4c;
  815. display: flex;
  816. align-items: center;
  817. justify-content: center;
  818. margin-top: 15rpx;
  819. }
  820. .banner-panel {
  821. position: relative;
  822. height: 480rpx; /* 拉长容器,灰色背景跟随变高 */
  823. overflow: hidden; /* 让圆角和内部层剪裁一致 */
  824. border-radius: 15rpx;
  825. }
  826. .panelShow {
  827. height: 150rpx;
  828. position: fixed;
  829. top: 70rpx;
  830. z-index: 999;
  831. width: 700rpx;
  832. }
  833. .pray-banner {
  834. position: absolute;
  835. /* background-size: 100% 100%; */
  836. inset: 0; /* 顶部、底部、左、右都贴合容器 */
  837. width: 100%;
  838. height: 88%;
  839. border-radius: 15rpx;
  840. z-index: 1; /* 在灰底之上、内容之下 */
  841. }
  842. .contain {
  843. margin: 0 20rpx;
  844. gap: 5rpx;
  845. }
  846. .banner-panel .robot-container,
  847. .banner-panel .function-tabs,
  848. .banner-panel .recommend-card {
  849. position: relative;
  850. z-index: 2;
  851. }
  852. .back-to-top {
  853. position: fixed;
  854. right: 30rpx;
  855. bottom: 35%;
  856. width: 100rpx;
  857. height: 100rpx;
  858. z-index: 1000;
  859. }
  860. .back-to-top:active {
  861. transform: scale(0.96);
  862. }
  863. .static-footer {
  864. position: fixed;
  865. bottom: 0;
  866. z-index: 999;
  867. }
  868. /* 顶部固定区域占位符 */
  869. .banner-placeholder {
  870. height: 120rpx; /* 与header高度一致,防止内容被固定头部遮挡 */
  871. }
  872. .thinking-process {
  873. margin: 20rpx 0;
  874. border: 2rpx solid #e5e5e5;
  875. border-radius: 2rpx;
  876. background-color: #f9f9f9;
  877. }
  878. .thinking-header {
  879. display: flex;
  880. align-items: center;
  881. padding: 20rpx 30rpx;
  882. cursor: pointer;
  883. background-color: #fff;
  884. border-bottom: 2px solid #e5e5e5;
  885. }
  886. .thinking-icon {
  887. font-size: 32rpx;
  888. margin-right: 16rpx;
  889. color: #d47c45;
  890. }
  891. .thinking-title {
  892. font-size: 28rpx;
  893. font-weight: 500;
  894. color: #d47c45;
  895. margin-right: 16rpx;
  896. }
  897. .thinking-count {
  898. font-size: 24rpx;
  899. color: #666;
  900. margin-right: 16rpx;
  901. }
  902. .thinking-toggle {
  903. font-size: 24rpx;
  904. color: #999;
  905. }
  906. .thinking-content {
  907. padding: 20rpx 30rpx;
  908. }
  909. .thinking-item {
  910. display: flex;
  911. align-items: center;
  912. margin-bottom: 16rpx;
  913. padding: 8rpx 0;
  914. }
  915. .item-status {
  916. width: 32rpx;
  917. height: 32rpx;
  918. border-radius: 50%;
  919. background-color: #f0f0f0;
  920. display: flex;
  921. justify-content: center;
  922. align-items: center;
  923. margin-right: 16rpx;
  924. }
  925. .checkmark {
  926. font-size: 20rpx;
  927. color: #ff0000;
  928. }
  929. .item-text {
  930. font-size: 24rpx;
  931. color: #333;
  932. }
  933. </style>