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.

1094 lines
27 KiB

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