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.

757 lines
21 KiB

4 weeks ago
  1. <!-- @format -->
  2. <template>
  3. <view class="main">
  4. <!-- 固定头部 -->
  5. <view class="header_fixed" :style="{ top: iSMT + 'px' }">
  6. <view class="header_content">
  7. <view class="header_back" @click="goBack">
  8. <image src="/static/marketSituation-image/back.png" mode=""></image>
  9. </view>
  10. <view class="header_input_wrapper">
  11. <image class="search_icon" src="/static/marketSituation-image/search.png" mode="" @click="onSearchClick"></image>
  12. <input class="header_input" type="text" placeholder="搜索" placeholder-style="color: #A6A6A6; font-size: 22rpx;" v-model="searchValue" @input="onSearchInput" @confirm="onSearchConfirm" />
  13. </view>
  14. <view class="header_icons">
  15. <view class="header_icon" @click="selected">
  16. <image src="/static/marketSituation-image/mySeclected.png" mode=""></image>
  17. </view>
  18. <view class="header_icon" @click="history">
  19. <image src="/static/marketSituation-image/history.png" mode=""></image>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="warn">
  24. <image src="/static/marketSituation-image/warn.png" mode="aspectFit"></image>
  25. <view class="warn_text_container">
  26. <text :class="warnTextClass">{{ $t("marketSituation.warn") }}</text>
  27. </view>
  28. </view>
  29. </view>
  30. <!-- 内容区域 -->
  31. <scroll-view class="content" :style="{ top: contentTopPosition + 'px' }" scroll-y="true" v-if="isDataLoaded">
  32. <!-- 亚太-中华 -->
  33. <view class="market-section" v-for="(item, parentIndex) in marketSituationStore.gloablCardData" :key="item">
  34. <view class="market-header">
  35. <text class="market-title">{{ item.ac }}</text>
  36. <view class="market-more" @click="viewMore(item.ac)">
  37. <text class="more-text">查看更多</text>
  38. <text class="more-arrow">></text>
  39. </view>
  40. </view>
  41. <view class="cards-grid-three">
  42. <view v-for="(iitem, index) in item.list" :key="iitem" class="card-item">
  43. <IndexCard
  44. :market="iitem.market"
  45. :stockName="iitem.name"
  46. :currentPrice="iitem.currentPrice"
  47. :changeAmount="iitem.changeAmount"
  48. :changePercent="iitem.changePercent"
  49. :isRising="iitem.isRising"
  50. @click="viewIndexDetail(iitem, parentIndex, index)"
  51. />
  52. </view>
  53. </view>
  54. </view>
  55. <!-- 底部安全区域 -->
  56. <view class="bottom-safe-area"></view>
  57. </scroll-view>
  58. </view>
  59. <!-- 底部导航栏 -->
  60. <footerBar class="static-footer" :type="'marketSituation'"></footerBar>
  61. </template>
  62. <script setup>
  63. import { ref, onMounted, onUnmounted, computed, nextTick, watch } from "vue";
  64. import { onShow, onHide } from "@dcloudio/uni-app";
  65. import footerBar from "../../components/footerBar.vue";
  66. import IndexCard from "../../components/IndexCard.vue";
  67. import { getRegionalGroupAPI } from "../../api/marketSituation/marketSituation.js";
  68. import { useMarketSituationStore } from "../../stores/modules/marketSituation.js";
  69. const marketSituationStore = useMarketSituationStore();
  70. // 响应式数据
  71. const iSMT = ref(0); // 状态栏高度
  72. const contentHeight = ref(0);
  73. const headerHeight = ref(0); // 头部高度
  74. const searchValue = ref(""); // 搜索值
  75. const isWarnTextOverflow = ref(false); // warn文字是否溢出
  76. // 数据状态加载
  77. const isDataLoaded = ref(false);
  78. // warn文字的class计算属性
  79. const warnTextClass = computed(() => {
  80. return isWarnTextOverflow.value ? "warn_text scroll-active" : "warn_text";
  81. });
  82. // 检测warn文字是否溢出
  83. const checkWarnTextOverflow = () => {
  84. nextTick(() => {
  85. setTimeout(() => {
  86. const query = uni.createSelectorQuery();
  87. // 同时查询容器和文字元素
  88. query.select(".warn_text_container").boundingClientRect();
  89. query.select(".warn_text").boundingClientRect();
  90. query.exec((res) => {
  91. const containerRect = res[0];
  92. const textRect = res[1];
  93. if (!containerRect || !textRect) {
  94. return;
  95. }
  96. // 判断文字是否超出容器(留一些余量)
  97. const isOverflow = textRect.width > containerRect.width - 10;
  98. isWarnTextOverflow.value = isOverflow;
  99. });
  100. }, 500);
  101. });
  102. };
  103. const globalIndexArray = ref([]);
  104. // 计算属性:内容区域顶部位置
  105. const contentTopPosition = computed(() => {
  106. const statusBarHeight = iSMT.value || 0;
  107. const currentHeaderHeight = headerHeight.value > 0 ? headerHeight.value : 100;
  108. return statusBarHeight + currentHeaderHeight;
  109. });
  110. // 方法:返回上一页
  111. const goBack = () => {
  112. uni.navigateBack();
  113. };
  114. // 方法:搜索输入
  115. const onSearchInput = (e) => {
  116. searchValue.value = e.detail.value;
  117. };
  118. // 方法:清除搜索
  119. const clearSearch = () => {
  120. searchValue.value = "";
  121. };
  122. // 方法:查看更多
  123. const viewMore = (market) => {
  124. console.log("查看更多:", market);
  125. uni.navigateTo({
  126. url: `/pages/marketSituation/marketDetail?market=${market}`,
  127. });
  128. };
  129. // 方法:查看指数详情
  130. const viewIndexDetail = (item, parentIndex, index) => {
  131. console.log("查看指数详情:", item.stockName);
  132. // uni.showToast({
  133. // title: `查看 ${item.stockName} 详情`,
  134. // icon: 'none',
  135. // duration: 2000
  136. // })
  137. // 这里可以跳转到具体的指数详情页面
  138. uni.navigateTo({
  139. url: `/pages/marketSituation/marketCondition?stockInformation=${encodeURIComponent(JSON.stringify(item))}&parentIndex=${parentIndex}&index=${index}&from=globalIndex`,
  140. });
  141. };
  142. const getRegionalGroup = async () => {
  143. try {
  144. const result = await getRegionalGroupAPI();
  145. globalIndexArray.value = result.data;
  146. marketSituationStore.gloablCardData = result.data;
  147. } catch (e) {
  148. console.log("获取区域指数失败", e);
  149. }
  150. };
  151. // TCP相关响应式变量
  152. import tcpConnection, { TCPConnection, TCP_CONFIG } from "@/api/tcpConnection.js";
  153. const tcpConnected = ref(false);
  154. const connectionListener = ref(null);
  155. const messageListener = ref(null);
  156. // 初始化TCP监听器
  157. const initTcpListeners = () => {
  158. // 创建连接状态监听器并保存引用
  159. connectionListener.value = (status, result) => {
  160. tcpConnected.value = status === "connected";
  161. console.log("TCP连接状态变化:", status, tcpConnected.value);
  162. // 显示连接状态提示
  163. // 如果连接,发送获取批量数据
  164. if (status === "connected") {
  165. sendTcpMessage("batch_real_time");
  166. }
  167. };
  168. // 创建消息监听器并保存引用
  169. messageListener.value = (type, message, parsedArray) => {
  170. const messageObj = {
  171. type: type,
  172. content: message,
  173. parsedArray: parsedArray,
  174. timestamp: new Date().toLocaleTimeString(),
  175. direction: "received",
  176. };
  177. // 解析股票数据
  178. parseStockData(message);
  179. };
  180. // 注册监听器
  181. tcpConnection.onConnectionChange(connectionListener.value);
  182. tcpConnection.onMessage(messageListener.value);
  183. };
  184. // 连接TCP服务器
  185. const connectTcp = () => {
  186. console.log("开始连接TCP服务器...");
  187. tcpConnection.connect();
  188. };
  189. // 断开TCP连接
  190. const disconnectTcp = () => {
  191. console.log("断开TCP连接...");
  192. tcpConnection.disconnect();
  193. tcpConnected.value = false;
  194. };
  195. // 发送TCP消息
  196. const sendTcpMessage = (command) => {
  197. let messageData;
  198. let messageDataArray = [];
  199. if (command == "batch_real_time") {
  200. for (let i = 0; i < globalIndexArray.value.length; ++i) {
  201. for (let j = 0; j < globalIndexArray.value[i].list.length; ++j) {
  202. messageDataArray.push(globalIndexArray.value[i].list[j].code);
  203. }
  204. }
  205. }
  206. console.log(messageDataArray);
  207. switch (command) {
  208. // 实时行情推送
  209. case "real_time":
  210. messageData = {
  211. command: "real_time",
  212. stock_code: "SH.000001",
  213. };
  214. break;
  215. // 初始化获取行情历史数据
  216. case "init_real_time":
  217. messageData = {
  218. command: "init_real_time",
  219. stock_code: "SH.000001",
  220. };
  221. break;
  222. case "stop_real_time":
  223. messageData = {
  224. command: "stop_real_time",
  225. };
  226. break;
  227. // 股票列表
  228. case "stock_list":
  229. messageData = {
  230. command: "stock_list",
  231. };
  232. break;
  233. case "batch_real_time":
  234. messageData = {
  235. command: "batch_real_time",
  236. stock_codes: messageDataArray,
  237. };
  238. break;
  239. case "help":
  240. messageData = {
  241. command: "help",
  242. };
  243. break;
  244. }
  245. if (!messageData) {
  246. return;
  247. } else {
  248. try {
  249. // 发送消息
  250. const success = tcpConnection.send(messageData);
  251. if (success) {
  252. console.log("home发送TCP消息:", messageData);
  253. }
  254. } catch (error) {
  255. console.error("发送TCP消息时出错:", error);
  256. }
  257. }
  258. };
  259. // 获取TCP连接状态
  260. const getTcpStatus = () => {
  261. const status = tcpConnection.getConnectionStatus();
  262. uni.showModal({
  263. title: "TCP连接状态",
  264. content: `当前状态: ${status ? "已连接" : "未连接"}`,
  265. showCancel: false,
  266. });
  267. };
  268. let isMorePacket = {
  269. init_batch_real_time: false,
  270. batch_real_time: false,
  271. };
  272. let receivedMessage;
  273. // 解析TCP股票数据
  274. const parseStockData = (message) => {
  275. try {
  276. console.log("进入parseStockData, message类型:", typeof message);
  277. let parsedMessage;
  278. // 如果isMorePacket是true,说明正在接受分包数据,无条件接收
  279. // 如果message是字符串且以{开头,说明是JSON字符串,需要解析
  280. // 如果不属于以上两种情况,说明是普通字符串,不预解析
  281. if (message.includes("欢迎连接到股票数据服务器")) {
  282. console.log("服务器命令列表,不予处理");
  283. return;
  284. }
  285. if ((typeof message === "string" && message.includes("batch_data_start")) || isMorePacket.init_batch_real_time) {
  286. if (typeof message === "string" && message.includes("batch_data_start")) {
  287. console.log("开始接受分包数据");
  288. receivedMessage = "";
  289. } else {
  290. console.log("接收分包数据过程中");
  291. }
  292. isMorePacket.init_batch_real_time = true;
  293. receivedMessage += message;
  294. // 如果当前消息包含},说明收到JSON字符串结尾,结束接收,开始解析
  295. if (receivedMessage.includes("batch_data_complete")) {
  296. console.log("接受分包数据结束");
  297. isMorePacket.init_batch_real_time = false;
  298. console.log("展示数据", receivedMessage);
  299. let startIndex = 0;
  300. let startCount = 0;
  301. let endIndex = receivedMessage.indexOf("batch_data_complete");
  302. for (let i = 0; i < receivedMessage.length; ++i) {
  303. if (receivedMessage[i] == "{") {
  304. startCount++;
  305. if (startCount == 2) {
  306. startIndex = i;
  307. break;
  308. }
  309. }
  310. }
  311. for (let i = receivedMessage.indexOf("batch_data_complete"); i >= 0; --i) {
  312. if (receivedMessage[i] == "}" || startIndex == endIndex) {
  313. endIndex = i;
  314. break;
  315. }
  316. }
  317. if (startIndex >= endIndex) {
  318. throw new Error("JSON字符串格式错误");
  319. }
  320. console.log("message", startIndex, endIndex, receivedMessage[endIndex], receivedMessage[startIndex]);
  321. parsedMessage = JSON.parse(receivedMessage.substring(startIndex, endIndex + 1));
  322. console.log("JSON解析成功,解析后类型:", typeof parsedMessage, parsedMessage);
  323. const stockDataArray = parsedMessage.data;
  324. for (let i = 0; i < globalIndexArray.value.length; ++i) {
  325. for (let j = 0; j < globalIndexArray.value[i].list.length; ++j) {
  326. const stockCode = globalIndexArray.value[i].list[j].code;
  327. marketSituationStore.gloablCardData[i].list[j].currentPrice = stockDataArray[stockCode][0].current_price.toFixed(2);
  328. marketSituationStore.gloablCardData[i].list[j].changeAmount = (stockDataArray[stockCode][0].current_price - stockDataArray[stockCode][0].pre_close).toFixed(2);
  329. marketSituationStore.gloablCardData[i].list[j].changePercent = ((100 * (stockDataArray[stockCode][0].current_price - stockDataArray[stockCode][0].pre_close)) / stockDataArray[stockCode][0].pre_close).toFixed(2) + "%";
  330. marketSituationStore.gloablCardData[i].list[j].isRising = stockDataArray[stockCode][0].current_price - stockDataArray[stockCode][0].pre_close >= 0;
  331. }
  332. }
  333. }
  334. // 数据状态加载完成
  335. isDataLoaded.value = true;
  336. } else if ((typeof message === "string" && message.includes('{"count')) || isMorePacket.batch_real_time) {
  337. if (typeof message === "string" && message.includes('{"count')) {
  338. console.log("开始接受分包数据");
  339. receivedMessage = "";
  340. } else {
  341. console.log("接收分包数据过程中");
  342. }
  343. isMorePacket.batch_real_time = true;
  344. receivedMessage += message;
  345. // 如果当前消息包含},说明收到JSON字符串结尾,结束接收,开始解析
  346. if (receivedMessage.includes("batch_realtime_data")) {
  347. console.log("接受分包数据结束");
  348. isMorePacket.batch_real_time = false;
  349. console.log("展示数据", receivedMessage);
  350. let startIndex = 0;
  351. let endIndex = receivedMessage.length - 1;
  352. for (let i = 0; i < receivedMessage.length; ++i) {
  353. if (receivedMessage[i] == "{") {
  354. startIndex = i;
  355. break;
  356. }
  357. }
  358. for (let i = receivedMessage.length - 1; i >= 0; --i) {
  359. if (receivedMessage[i] == "}" || startIndex == endIndex) {
  360. endIndex = i;
  361. break;
  362. }
  363. }
  364. if (startIndex >= endIndex) {
  365. throw new Error("JSON字符串格式错误");
  366. }
  367. parsedMessage = JSON.parse(receivedMessage.substring(startIndex, endIndex + 1));
  368. console.log("JSON解析成功,解析后类型:", typeof parsedMessage, parsedMessage);
  369. const stockDataArray = parsedMessage.data;
  370. for (let i = 0; i < globalIndexArray.value.length; ++i) {
  371. for (let j = 0; j < globalIndexArray.value[i].list.length; ++j) {
  372. const stockCode = globalIndexArray.value[i].list[j].code;
  373. marketSituationStore.gloablCardData[i].list[j].currentPrice = stockDataArray[stockCode][0].current_price.toFixed(2);
  374. marketSituationStore.gloablCardData[i].list[j].changeAmount = (stockDataArray[stockCode][0].current_price - stockDataArray[stockCode][0].pre_close).toFixed(2);
  375. marketSituationStore.gloablCardData[i].list[j].changePercent = ((100 * (stockDataArray[stockCode][0].current_price - stockDataArray[stockCode][0].pre_close)) / stockDataArray[stockCode][0].pre_close).toFixed(2) + "%";
  376. marketSituationStore.gloablCardData[i].list[j].isRising = stockDataArray[stockCode][0].current_price - stockDataArray[stockCode][0].pre_close >= 0;
  377. }
  378. }
  379. }
  380. } else {
  381. // 没有通过JSON解析判断,说明不是需要的数据
  382. console.log("不是需要的数据,不做处理");
  383. }
  384. } catch (error) {
  385. console.error("解析TCP股票数据失败:", error.message);
  386. console.error("错误详情:", error);
  387. }
  388. };
  389. // 移除TCP监听器
  390. const removeTcpListeners = () => {
  391. if (connectionListener.value) {
  392. tcpConnection.removeConnectionListener(connectionListener.value);
  393. connectionListener.value = null;
  394. console.log("已移除TCP连接状态监听器");
  395. }
  396. if (messageListener.value) {
  397. tcpConnection.removeMessageListener(messageListener.value);
  398. messageListener.value = null;
  399. console.log("已移除TCP消息监听器");
  400. }
  401. };
  402. const startTcp = () => {
  403. try {
  404. removeTcpListeners();
  405. disconnectTcp();
  406. initTcpListeners();
  407. connectTcp();
  408. } catch (error) {
  409. console.error("建立连接并设置监听出错:", error);
  410. }
  411. };
  412. onShow(async () => {
  413. console.log("显示页面");
  414. await getRegionalGroup();
  415. initTcpListeners();
  416. await nextTick();
  417. // 开始连接
  418. startTcp();
  419. });
  420. onHide(() => {
  421. console.log("隐藏页面");
  422. sendTcpMessage("stop_real_time");
  423. removeTcpListeners();
  424. disconnectTcp();
  425. });
  426. onUnmounted(() => {
  427. sendTcpMessage("stop_real_time");
  428. removeTcpListeners();
  429. disconnectTcp();
  430. });
  431. // 生命周期:页面挂载
  432. onMounted(async () => {
  433. // 获取系统信息
  434. const systemInfo = uni.getSystemInfoSync();
  435. iSMT.value = systemInfo.statusBarHeight || 0;
  436. console.log("全球指数页面加载完成");
  437. // 动态计算header实际高度
  438. uni
  439. .createSelectorQuery()
  440. .select(".header_fixed")
  441. .boundingClientRect((rect) => {
  442. if (rect) {
  443. headerHeight.value = rect.height;
  444. console.log("Header实际高度:", headerHeight.value, "px");
  445. }
  446. })
  447. .exec();
  448. // 检测warn文字是否溢出
  449. checkWarnTextOverflow();
  450. });
  451. // 监听headerHeight变化,重新计算contentHeight
  452. watch(headerHeight, (newHeight) => {
  453. if (newHeight > 0) {
  454. const systemInfo = uni.getSystemInfoSync();
  455. const windowHeight = systemInfo.windowHeight;
  456. const statusBarHeight = systemInfo.statusBarHeight || 0;
  457. const footerHeight = 100;
  458. contentHeight.value = windowHeight - statusBarHeight - newHeight - footerHeight;
  459. console.log("重新计算contentHeight:", contentHeight.value);
  460. }
  461. });
  462. </script>
  463. <style lang="scss" scoped>
  464. .main {
  465. position: relative;
  466. height: 100vh;
  467. overflow: hidden;
  468. background-color: #f5f5f5;
  469. }
  470. /* 状态栏占位 */
  471. .top {
  472. position: fixed;
  473. top: 0;
  474. left: 0;
  475. right: 0;
  476. z-index: 1001;
  477. background-color: #ffffff;
  478. }
  479. /* 固定头部样式 */
  480. .header_fixed {
  481. position: fixed;
  482. left: 0;
  483. right: 0;
  484. z-index: 1000;
  485. background-color: #ffffff;
  486. padding: 20rpx 0 0 0;
  487. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  488. }
  489. .header_content {
  490. display: flex;
  491. align-items: center;
  492. justify-content: space-between;
  493. height: 80rpx;
  494. padding: 0 20rpx;
  495. margin-bottom: 10rpx;
  496. }
  497. .header_back {
  498. margin-right: 20rpx;
  499. width: 25rpx;
  500. height: 30rpx;
  501. }
  502. .header_back image {
  503. width: 25rpx;
  504. height: 30rpx;
  505. }
  506. .header_input_wrapper {
  507. display: flex;
  508. align-items: center;
  509. width: 100%;
  510. margin: 0 20rpx 0 0;
  511. height: 70rpx;
  512. border-radius: 35rpx;
  513. background-color: #ffffff;
  514. border: 1rpx solid #e9ecef;
  515. padding: 0 80rpx 0 30rpx;
  516. font-size: 28rpx;
  517. color: #5c5c5c;
  518. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  519. }
  520. .search_icon {
  521. width: 40rpx;
  522. height: 40rpx;
  523. opacity: 0.6;
  524. }
  525. .header_input {
  526. margin-left: 10rpx;
  527. }
  528. .header_icons {
  529. display: flex;
  530. align-items: center;
  531. gap: 15rpx;
  532. }
  533. .header_icon {
  534. width: 40rpx;
  535. height: 40rpx;
  536. display: flex;
  537. align-items: center;
  538. justify-content: center;
  539. }
  540. .header_icon image {
  541. width: 40rpx;
  542. height: 40rpx;
  543. }
  544. .warn {
  545. display: flex;
  546. align-items: center;
  547. justify-content: flex-start;
  548. gap: 10rpx;
  549. font-size: 28rpx;
  550. color: #666666;
  551. padding: 20rpx;
  552. max-width: 100%;
  553. overflow: hidden;
  554. position: relative;
  555. }
  556. .warn image {
  557. width: 40rpx;
  558. height: 40rpx;
  559. flex-shrink: 0;
  560. /* 防止图片被压缩 */
  561. position: relative;
  562. z-index: 2;
  563. /* 确保图片在最上层 */
  564. }
  565. .warn_text_container {
  566. flex: 1;
  567. overflow: hidden;
  568. position: relative;
  569. min-width: 0;
  570. /* 允许容器收缩 */
  571. }
  572. .warn_text {
  573. display: block;
  574. white-space: nowrap;
  575. will-change: transform;
  576. /* 优化动画性能 */
  577. }
  578. /* 文字滚动动画 */
  579. @keyframes scrollText {
  580. 0% {
  581. transform: translateX(0);
  582. }
  583. 20% {
  584. transform: translateX(0);
  585. }
  586. 80% {
  587. transform: translateX(-85%);
  588. }
  589. 100% {
  590. transform: translateX(-85%);
  591. }
  592. }
  593. /* 当文字超长时启用滚动动画 */
  594. .warn_text.scroll-active {
  595. animation: scrollText 12s linear infinite;
  596. animation-delay: 2s;
  597. /* 延迟2秒开始滚动,让用户先看到开头 */
  598. }
  599. /* 内容区域 */
  600. .content {
  601. position: fixed;
  602. left: 0;
  603. right: 0;
  604. bottom: 120rpx;
  605. background-color: #f5f5f5;
  606. padding: 0;
  607. }
  608. /* 市场分组 */
  609. .market-section {
  610. background-color: white;
  611. border-radius: 20rpx;
  612. }
  613. .market-header {
  614. margin: 20rpx 20rpx 0 20rpx;
  615. display: flex;
  616. align-items: center;
  617. justify-content: space-between;
  618. margin-bottom: 10rpx;
  619. padding-bottom: 10rpx;
  620. border-bottom: 2rpx solid #f0f0f0;
  621. }
  622. .market-title {
  623. font-size: 32rpx;
  624. font-weight: 600;
  625. color: #333;
  626. }
  627. .market-more {
  628. display: flex;
  629. align-items: center;
  630. gap: 8rpx;
  631. }
  632. .more-text {
  633. font-size: 24rpx;
  634. color: #666;
  635. }
  636. .more-arrow {
  637. font-size: 20rpx;
  638. color: #666;
  639. font-weight: bold;
  640. }
  641. /* 三列卡片网格 */
  642. .cards-grid-three {
  643. display: grid;
  644. grid-template-columns: repeat(3, 1fr);
  645. }
  646. .card-item {
  647. background-color: white;
  648. border-radius: 16rpx;
  649. overflow: hidden;
  650. transition: transform 0.2s ease, box-shadow 0.2s ease;
  651. }
  652. .card-item:active {
  653. transform: scale(0.98);
  654. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.12);
  655. }
  656. /* 底部安全区域 */
  657. .bottom-safe-area {
  658. height: 40rpx;
  659. background-color: transparent;
  660. }
  661. /* 底部导航栏 */
  662. .static-footer {
  663. position: fixed;
  664. bottom: 0;
  665. left: 0;
  666. right: 0;
  667. z-index: 1000;
  668. }
  669. /* 响应式设计 */
  670. @media (max-width: 400rpx) {
  671. .cards-grid-three {
  672. grid-template-columns: repeat(2, 1fr);
  673. }
  674. }
  675. </style>