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.

1096 lines
27 KiB

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