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.

849 lines
20 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. <view class="chat-container" v-if="messages.length > 0">
  76. <view class="message-list" id="messageList">
  77. <view
  78. v-for="(message, index) in messages"
  79. :key="index"
  80. :class="
  81. message.isUser ? 'message user-message' : 'message bot-message'
  82. "
  83. >
  84. <!-- 会话图标 -->
  85. <text
  86. :class="
  87. message.isUser
  88. ? 'fa-solid fa-user message-icon'
  89. : 'fa-solid fa-robot message-icon'
  90. "
  91. ></text>
  92. <!-- 会话内容 -->
  93. <view class="message-content">
  94. <text class="message-text">{{ message.content }}</text>
  95. <!-- loading -->
  96. <view
  97. class="loading-dots"
  98. v-if="message.isThinking || message.isTyping"
  99. >
  100. <text class="dot"></text>
  101. <text class="dot"></text>
  102. <text class="dot"></text>
  103. </view>
  104. </view>
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. <!-- 输入框区域 -->
  110. <view class="input-area">
  111. <view class="input-wrapper">
  112. <input
  113. type="text"
  114. placeholder="请输入股票代码/名称,获取AI洞察"
  115. placeholder-style="color:#fff;opacity:1"
  116. class="input-field"
  117. v-model="inputMessage"
  118. @confirm="sendMessage"
  119. />
  120. <image class="send-button" @click="sendMessage" :disabled="isSending">
  121. <!-- <image
  122. src="https://d31zlh4on95l9h.cloudfront.net/images/95f1ea2262e9157db13c93c0dc1c5d96.svg"
  123. class="send-icon"
  124. ></image> -->
  125. </image>
  126. </view>
  127. <text class="disclaimer"
  128. >以上数据由AI生成不作为最终投资建议决策需独立</text
  129. >
  130. </view>
  131. <image
  132. class="back-to-top"
  133. src="https://d31zlh4on95l9h.cloudfront.net/images/ba357635d2bb480241952bb1cabacd73.svg"
  134. @click="scrollToTop"
  135. ></image>
  136. <footerBar class="static-footer" :type="type"></footerBar>
  137. </view>
  138. </template>
  139. <script setup>
  140. const { safeAreaInsets } = uni.getSystemInfoSync();
  141. import { ref, computed, onMounted, onUnmounted, watch, nextTick } from "vue";
  142. import footerBar from '../../components/footerBar-cn'
  143. const type = ref('member')
  144. const inputMessage = ref("");
  145. const isSending = ref(false);
  146. const uuid = ref("");
  147. const messages = ref([]);
  148. const hotTopics = ref([
  149. {
  150. id: 1,
  151. text: "英伟达(NVDA)股票情绪温度?",
  152. icon: "https://d31zlh4on95l9h.cloudfront.net/images/7ed58be0f4b81aeb398d9ba2534a624b.svg",
  153. },
  154. {
  155. id: 2,
  156. text: "博通(AVGO)明天还能涨吗?",
  157. icon: "https://d31zlh4on95l9h.cloudfront.net/images/7ed58be0f4b81aeb398d9ba2534a624b.svg",
  158. },
  159. {
  160. id: 3,
  161. text: "为什么Fluence Energy(FLNC)会暴涨?",
  162. icon: "https://d31zlh4on95l9h.cloudfront.net/images/7ed58be0f4b81aeb398d9ba2534a624b.svg",
  163. },
  164. {
  165. id: 4,
  166. text: "为什么Fluence Energy(FLNC)会暴涨?",
  167. icon: "https://d31zlh4on95l9h.cloudfront.net/images/7ed58be0f4b81aeb398d9ba2534a624b.svg",
  168. },
  169. ]);
  170. // 新增:tabs 列表用于渲染与轮换
  171. const tabsList = ref(['个股诊断', '市场情绪温度计', '买卖时机提示', '个股']);
  172. // 用于无缝滚动的引用与状态(兼容小程序/App)
  173. const tabsTrack = ref(null);
  174. const marqueeOffset = ref(0);
  175. let tabsTickId = 0;
  176. const marqueeSpeed = 0.6; // 像素/帧
  177. let currentThreshold = 0; // 当前第一个标签的宽度(含右外边距)
  178. // 统一 raf/caf(小程序端可能没有 rAF)
  179. const hasRAF = typeof requestAnimationFrame === 'function';
  180. const startFrame = (fn) => hasRAF ? requestAnimationFrame(fn) : setTimeout(fn, 16);
  181. const stopFrame = (id) => hasRAF ? cancelAnimationFrame(id) : clearTimeout(id);
  182. const measureFirstThreshold = (cb) => {
  183. if (!tabsList.value.length) { currentThreshold = 0; if (cb) cb(0); return; }
  184. const q = uni.createSelectorQuery();
  185. q.selectAll('.function-tabs .tab-item').boundingClientRect();
  186. q.exec(res => {
  187. if (res && res[0] && res[0].length) {
  188. const firstRect = res[0][0];
  189. const marginRightPx = uni.upx2px(20);
  190. currentThreshold = (firstRect?.width || 0) + marginRightPx;
  191. if (typeof cb === 'function') cb(currentThreshold);
  192. } else {
  193. // 若暂时无法获取,稍后重试一次
  194. setTimeout(() => measureFirstThreshold(cb), 16);
  195. }
  196. });
  197. };
  198. const startTabsMarquee = () => {
  199. stopFrame(tabsTickId);
  200. if (tabsList.value.length <= 1) return; // 单个标签不滚动
  201. marqueeOffset.value = 0;
  202. measureFirstThreshold(() => {
  203. const step = () => {
  204. marqueeOffset.value += marqueeSpeed;
  205. if (currentThreshold > 0 && marqueeOffset.value >= currentThreshold) {
  206. const first = tabsList.value.shift();
  207. if (first !== undefined) tabsList.value.push(first);
  208. marqueeOffset.value -= currentThreshold;
  209. measureFirstThreshold();
  210. }
  211. tabsTickId = startFrame(step);
  212. };
  213. nextTick(step);
  214. });
  215. };
  216. // 初始化
  217. onMounted(() => {
  218. initUUID();
  219. if (messages.value.length === 0) {
  220. nextTick(startTabsMarquee);
  221. }
  222. if (messages.value.length > 0) {
  223. nextTick(() => { scrollToBottom(); });
  224. }
  225. });
  226. // 当消息数量变化,控制滚动是否运行
  227. watch(messages, (val) => {
  228. if (val.length === 0) {
  229. nextTick(startTabsMarquee);
  230. } else {
  231. stopFrame(tabsTickId);
  232. }
  233. });
  234. onUnmounted(() => { stopFrame(tabsTickId); });
  235. // 初始化 UUID
  236. const initUUID = () => {
  237. let storedUUID = uni.getStorageSync("user_uuid");
  238. if (!storedUUID) {
  239. storedUUID = generateUUID();
  240. uni.setStorageSync("user_uuid", storedUUID);
  241. }
  242. uuid.value = storedUUID;
  243. };
  244. // 生成简单UUID
  245. const generateUUID = () => {
  246. return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
  247. var r = (Math.random() * 16) | 0,
  248. v = c == "x" ? r : (r & 0x3) | 0x8;
  249. return v.toString(16);
  250. });
  251. };
  252. // 新会话
  253. const newChat = () => {
  254. messages.value = [];
  255. uni.removeStorageSync("user_uuid");
  256. initUUID();
  257. };
  258. // 跳转到空白页
  259. const goBlank = () => {
  260. uni.navigateTo({
  261. url: "/pages/blank/blank",
  262. });
  263. };
  264. // 发送消息
  265. const sendMessage = () => {
  266. if (inputMessage.value.trim() === "" || isSending.value) return;
  267. const userMessage = {
  268. content: inputMessage.value,
  269. isUser: true,
  270. isThinking: false,
  271. isTyping: false,
  272. };
  273. messages.value.push(userMessage);
  274. inputMessage.value = "";
  275. // 滚动到底部
  276. nextTick(() => {
  277. scrollToBottom();
  278. });
  279. // 模拟机器人回复
  280. simulateBotResponse(userMessage.content);
  281. };
  282. // 发送消息
  283. const sendMessageList = (listMessage) => {
  284. console.log(listMessage);
  285. const userMessage = {
  286. content: listMessage,
  287. isUser: true,
  288. isThinking: false,
  289. isTyping: false,
  290. };
  291. messages.value.push(userMessage);
  292. inputMessage.value = "";
  293. // 滚动到底部
  294. nextTick(() => {
  295. scrollToBottom();
  296. });
  297. // 模拟机器人回复
  298. simulateBotResponse(userMessage.content);
  299. };
  300. // 模拟机器人回复
  301. const simulateBotResponse = (userMessage) => {
  302. isSending.value = true;
  303. // 添加机器人加载消息
  304. const botMsg = {
  305. content: "",
  306. isUser: false,
  307. isTyping: true,
  308. isThinking: false,
  309. };
  310. messages.value.push(botMsg);
  311. // 滚动到底部
  312. nextTick(() => {
  313. scrollToBottom();
  314. });
  315. // 模拟流式响应
  316. let responseText = `我已经收到您的消息: "${userMessage}"。作为您的股市顾问,我可以为您提供专业的投资建议。请问您想了解哪方面的信息?作为您的股市顾问,我可以为您提供专业的投资建议。请问您想了解哪方面的信息?作为您的股市顾问,我可以为您提供专业的投资建议。请问您想了解哪方面的信息?作为您的股市顾问,我可以为您提供专业的投资建议。请问您想了解哪方面的信息?作为您的股市顾问,我可以为您提供专业的投资建议。请问您想了解哪方面的信息?作为您的股市顾问,我可以为您提供专业的投资建议。请问您想了解哪方面的信息?作为您的股市顾问,我可以为您提供专业的投资建议。请问您想了解哪方面的信息?作为您的股市顾问,我可以为您提供专业的投资建议。请问您想了解哪方面的信息?作为您的股市顾问,我可以为您提供专业的投资建议。请问您想了解哪方面的信息?作为您的股市顾问,我可以为您提供专业的投资建议。请问您想了解哪方面的信息?作为您的股市顾问,我可以为您提供专业的投资建议。请问您想了解哪方面的信息?`;
  317. let index = 0;
  318. const typeWriter = () => {
  319. if (index < responseText.length) {
  320. botMsg.content += responseText.charAt(index);
  321. index++;
  322. // 滚动到底部
  323. scrollToBottom();
  324. setTimeout(typeWriter, 30);
  325. } else {
  326. botMsg.isTyping = false;
  327. isSending.value = false;
  328. }
  329. };
  330. setTimeout(typeWriter, 500);
  331. };
  332. // 滚动到底部
  333. const scrollToBottom = () => {
  334. const query = uni.createSelectorQuery();
  335. query.select("#messageList").boundingClientRect();
  336. query.selectViewport().scrollOffset();
  337. query.exec((res) => {
  338. if (res[0] && res[1]) {
  339. uni.pageScrollTo({
  340. scrollTop: res[0].height,
  341. duration: 100,
  342. });
  343. }
  344. });
  345. };
  346. const scrollToTop = () => {
  347. uni.pageScrollTo({ scrollTop: 0, duration: 200 });
  348. };
  349. </script>
  350. <style scoped>
  351. .deepMate-page {
  352. display: flex;
  353. flex-direction: column;
  354. height: 100vh;
  355. background-color: #ffffff;
  356. padding: 20rpx 0rpx;
  357. }
  358. .header {
  359. display: flex;
  360. justify-content: space-between;
  361. align-items: center;
  362. padding: 20rpx 30rpx;
  363. background-color: #ffffff;
  364. }
  365. .header-left,
  366. .header-right {
  367. display: flex;
  368. align-items: center;
  369. }
  370. .header-left .icon,
  371. .header-right .icon {
  372. width: 40rpx;
  373. height: 40rpx;
  374. margin-right: 20rpx;
  375. }
  376. .header-center .title {
  377. font-size: 36rpx;
  378. font-weight: bold;
  379. color: #333333;
  380. }
  381. .new-chat-button {
  382. background-color: #ff6600;
  383. border: none;
  384. border-radius: 8rpx;
  385. padding: 10rpx 20rpx;
  386. }
  387. .new-chat-text {
  388. color: white;
  389. font-size: 24rpx;
  390. }
  391. .main-content {
  392. flex: 1;
  393. padding: 20rpx;
  394. overflow-y: auto;
  395. margin-top: 20rpx;
  396. margin-bottom: 120rpx;
  397. }
  398. .robot-container {
  399. display: flex;
  400. align-items: center;
  401. margin-top: 30rpx;
  402. }
  403. .robot-avatar {
  404. width: 130rpx;
  405. height: 130rpx;
  406. border-radius: 50%;
  407. margin-left: 20rpx;
  408. }
  409. .welcome-message {
  410. flex: 1;
  411. }
  412. .greeting {
  413. font-size: 32rpx;
  414. margin-left: 50rpx;
  415. top: 40rpx;
  416. font-weight: bold;
  417. color: #333333;
  418. line-height: 48rpx;
  419. }
  420. .description {
  421. display: block;
  422. font-size: 24rpx;
  423. color: #666666;
  424. line-height: 36rpx;
  425. margin-top: 10rpx;
  426. margin-left: 45rpx;
  427. }
  428. .function-tabs {
  429. display: block;
  430. overflow: hidden;
  431. margin-bottom: 30rpx;
  432. }
  433. .tabs-track {
  434. display: inline-flex;
  435. white-space: nowrap;
  436. will-change: transform;
  437. }
  438. .tab-item {
  439. padding: 5rpx 20rpx;
  440. border-radius: 20rpx;
  441. font-size: 20rpx;
  442. font-weight: 700;
  443. color: #666666;
  444. background-color: #fffefe;
  445. margin-right: 20rpx;
  446. transition: all 0.3s;
  447. }
  448. .tab-item.active {
  449. color: #ff6600;
  450. background-color: #fff;
  451. border: 1rpx solid #ff6600;
  452. }
  453. .recommend-card {
  454. background: url("https://d31zlh4on95l9h.cloudfront.net/images/4da1d629a55c307c3605ca15bf15189a.svg");
  455. background-repeat: no-repeat;
  456. background-position: center bottom;
  457. background-size: contain;
  458. /* min-height: 20rpx; */
  459. /* border-radius: 20rpx; */
  460. padding: 40rpx;
  461. margin-top: 20rpx;
  462. margin-bottom: 10rpx;
  463. /* box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05); */
  464. }
  465. .card-content {
  466. display: flex;
  467. align-items: center;
  468. justify-content: space-between;
  469. margin-left: 40rpx;
  470. }
  471. .logo {
  472. width: 80rpx;
  473. height: 80rpx;
  474. background-color: #ff0000;
  475. border-radius: 10rpx;
  476. display: flex;
  477. align-items: center;
  478. justify-content: center;
  479. margin-right: 20rpx;
  480. }
  481. .card-text {
  482. flex: 1;
  483. margin-left: 20rpx;
  484. }
  485. .main-question {
  486. font-size: 32rpx;
  487. color: #333333;
  488. line-height: 48rpx;
  489. }
  490. .stock-code {
  491. display: block;
  492. font-size: 24rpx;
  493. color: #ff3b30;
  494. background-color: #ffffff;
  495. padding: 2rpx 15rpx;
  496. border-radius: 12rpx;
  497. margin-top: 8rpx;
  498. width: fit-content;
  499. border: 1rpx solid #ff3b30;
  500. }
  501. .arrow-icon {
  502. background: url("https://d31zlh4on95l9h.cloudfront.net/images/40d94054644f6e3f1c366751f07f0010.svg");
  503. background-repeat: no-repeat;
  504. left: 0.5rem;
  505. top: 1.8rem;
  506. background-size: 100% 100%;
  507. width: 60rpx;
  508. height: 60rpx;
  509. }
  510. .interest-section {
  511. margin-bottom: 30rpx;
  512. }
  513. .section-title {
  514. display: block;
  515. text-align: center;
  516. font-size: 26rpx;
  517. color: #666666;
  518. margin-bottom: 20rpx;
  519. }
  520. .topics-list {
  521. display: flex;
  522. flex-direction: column;
  523. gap: 15rpx;
  524. }
  525. .topic-item {
  526. display: flex;
  527. align-items: center;
  528. padding: 15rpx 20rpx;
  529. background-color: #f0f0f0;
  530. border-radius: 15rpx;
  531. width: fit-content;
  532. }
  533. .tag-icon {
  534. width: 24rpx;
  535. height: 24rpx;
  536. margin-right: 10rpx;
  537. }
  538. .topic-text {
  539. font-size: 28rpx;
  540. color: #333333;
  541. flex: 1;
  542. }
  543. /* 聊天区域样式 */
  544. .chat-container {
  545. margin-top: 30rpx;
  546. border-radius: 10rpx;
  547. height: fit-content;
  548. /* overflow-y: auto; */
  549. }
  550. .message-list {
  551. /* padding: 20rpx; */
  552. }
  553. .message {
  554. display: flex;
  555. align-items: flex-start;
  556. margin-bottom: 30rpx;
  557. }
  558. .user-message {
  559. flex-direction: row-reverse;
  560. }
  561. .message-icon {
  562. font-size: 24rpx;
  563. margin: 0 10rpx;
  564. padding: 10rpx;
  565. border-radius: 50%;
  566. background-color: #ddd;
  567. width: 40rpx;
  568. height: 40rpx;
  569. display: flex;
  570. align-items: center;
  571. justify-content: center;
  572. }
  573. .user-message .message-icon {
  574. background-color: #007aff;
  575. color: white;
  576. }
  577. .bot-message .message-icon {
  578. background-color: #34c759;
  579. color: white;
  580. }
  581. .message-content {
  582. max-width: 70%;
  583. position: relative;
  584. }
  585. .user-message .message-content {
  586. background-color: #007aff;
  587. border-radius: 10rpx;
  588. padding: 15rpx;
  589. }
  590. .bot-message .message-content {
  591. background-color: #f0f0f0;
  592. border-radius: 10rpx;
  593. padding: 15rpx;
  594. }
  595. .message-text {
  596. font-size: 28rpx;
  597. line-height: 40rpx;
  598. }
  599. .user-message .message-text {
  600. color: white;
  601. }
  602. .bot-message .message-text {
  603. color: #333;
  604. }
  605. .loading-dots {
  606. display: flex;
  607. align-items: center;
  608. padding-top: 10rpx;
  609. }
  610. .dot {
  611. width: 10rpx;
  612. height: 10rpx;
  613. background-color: #666;
  614. border-radius: 50%;
  615. margin: 0 4rpx;
  616. animation: loading 1.4s infinite ease-in-out both;
  617. }
  618. .user-message .dot {
  619. background-color: white;
  620. }
  621. .dot:nth-child(1) {
  622. animation-delay: -0.32s;
  623. }
  624. .dot:nth-child(2) {
  625. animation-delay: -0.16s;
  626. }
  627. @keyframes loading {
  628. 0%,
  629. 80%,
  630. 100% {
  631. transform: scale(0);
  632. }
  633. 40% {
  634. transform: scale(1);
  635. }
  636. }
  637. .input-area {
  638. position: fixed;
  639. bottom: 70rpx;
  640. left: 0;
  641. right: 0;
  642. padding: 0 40rpx 80rpx 40rpx;
  643. background-color: #ffffff;
  644. }
  645. .input-wrapper {
  646. position: relative;
  647. display: flex;
  648. align-items: center;
  649. padding: 15rpx 20rpx;
  650. background-color: rgb(220, 31, 29);
  651. border-radius: 100rpx;
  652. display: flex;
  653. align-items: center;
  654. justify-content: center;
  655. height: 50rpx;
  656. }
  657. .mic-icon {
  658. width: 36rpx;
  659. height: 36rpx;
  660. margin-right: 20rpx;
  661. }
  662. .input-field {
  663. flex: 1;
  664. font-size: 28rpx;
  665. color: #fff;
  666. display: flex;
  667. align-items: center;
  668. justify-content: center;
  669. margin-left: 60rpx;
  670. background: none;
  671. border: none;
  672. outline: none;
  673. }
  674. .input-field::placeholder {
  675. color: #ffffff !important;
  676. opacity: 1;
  677. }
  678. .send-button {
  679. background: url("https://d31zlh4on95l9h.cloudfront.net/images/95f1ea2262e9157db13c93c0dc1c5d96.svg");
  680. background-repeat: no-repeat;
  681. background-size: 100% 100%;
  682. height: 50rpx;
  683. width: 50rpx;
  684. padding: 0;
  685. border: 1rpx solid transparent;
  686. margin-left: 20rpx;
  687. }
  688. .send-icon {
  689. width: 36rpx;
  690. height: 36rpx;
  691. }
  692. .disclaimer {
  693. font-size: 15rpx;
  694. color: #4d4c4c;
  695. display: flex;
  696. align-items: center;
  697. justify-content: center;
  698. margin-top: 15rpx;
  699. }
  700. .banner-panel {
  701. position: relative;
  702. height: 480rpx; /* 拉长容器,灰色背景跟随变高 */
  703. overflow: hidden; /* 让圆角和内部层剪裁一致 */
  704. border-radius: 15rpx;
  705. }
  706. .panelShow{
  707. height: 12%;
  708. }
  709. .pray-banner {
  710. position: absolute;
  711. /* background-size: 100% 100%; */
  712. inset: 0; /* 顶部、底部、左、右都贴合容器 */
  713. width: 100%;
  714. height: 88%;
  715. border-radius: 15rpx;
  716. z-index: 1; /* 在灰底之上、内容之下 */
  717. }
  718. .contain {
  719. margin: 0 20rpx;
  720. gap: 5rpx;
  721. }
  722. .banner-panel .robot-container,
  723. .banner-panel .function-tabs,
  724. .banner-panel .recommend-card {
  725. position: relative;
  726. z-index: 2;
  727. }
  728. .back-to-top {
  729. position: fixed;
  730. right: 30rpx;
  731. bottom: 35%;
  732. width: 100rpx;
  733. height: 100rpx;
  734. z-index: 1000;
  735. }
  736. .back-to-top:active {
  737. transform: scale(0.96);
  738. }
  739. .static-footer {
  740. position: fixed;
  741. bottom: 0;
  742. }
  743. </style>