index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713
  1. <template>
  2. <div class="drive-page">
  3. <Header />
  4. <main class="drive-main">
  5. <section class="drive-hero">
  6. <div class="drive-hero__copy pl-5">
  7. <p class="drive-hero__eyebrow">DASHBOARD PORTAL</p>
  8. <p class="drive-hero__title">驾驶舱门户</p>
  9. <p class="drive-hero__desc">选择一个驾驶舱,快速进入对应业务看板。</p>
  10. </div>
  11. <div class="drive-hero__visual">
  12. <el-image
  13. :src="themeStore.theme === 'light' ? banner_white : banner"
  14. class="drive-hero__image"
  15. />
  16. </div>
  17. </section>
  18. <section class="drive-tabs px-10 mt-2!">
  19. <button
  20. v-for="tab in tabs"
  21. :key="tab.value"
  22. type="button"
  23. class="drive-tab"
  24. :class="{ 'drive-tab--active': activeTab === tab.value }"
  25. @click="activeTab = tab.value"
  26. >
  27. <div class="flex items-center gap-2">
  28. <img :src="tab.icon" alt="tab icon" class="w-6 h-6" />
  29. {{ tab.label }}
  30. </div>
  31. </button>
  32. </section>
  33. <section class="drive-grid md:px-20">
  34. <button
  35. v-for="card in filteredCards"
  36. :key="card.title"
  37. type="button"
  38. class="drive-card overflow-hidden"
  39. :style="{
  40. '--bg-image': `url(${card.pcBg})`,
  41. '--mobile-bg-image': `url(${card.mobileBg})`,
  42. }"
  43. @click="openDrive(card)"
  44. ></button>
  45. <div
  46. v-if="filteredCards.length === 0"
  47. class="text-center py-10 text-gray-400 col-span-2"
  48. >
  49. 暂无相关驾驶舱
  50. </div>
  51. </section>
  52. </main>
  53. <div class="mt-[500px] md:mt-[300px]">
  54. <Footer />
  55. </div>
  56. </div>
  57. </template>
  58. <script setup lang="ts">
  59. import Header from "@components/home/header.vue";
  60. import Footer from "@components/home/Footer.vue";
  61. import { ref, computed, watch } from "vue";
  62. import { getMCSsoToken } from "@/api/user";
  63. import { useUserStore } from "@/stores/useUserStore";
  64. import { useThemeStore } from "@/stores/useThemeStore";
  65. import { getAccessToken } from "@/utils/auth";
  66. import banner from "@/assets/images/drivebannere.png";
  67. import banner_white from "@/assets/images/drivebannere_white.png";
  68. import drivePc1 from "@/assets/images/dr1.png"; // 经营驾驶舱pc端背景图
  69. import drivePc2 from "@/assets/images/生产pc.png"; // 生产驾驶舱pc端背景图
  70. import drivePc3 from "@/assets/images/财务pc.png"; // 财务驾驶舱pc端背景图
  71. import drivePc4 from "@/assets/images/供应链pc.png"; // 供应链驾驶舱pc端背景图
  72. import drivePc5 from "@/assets/images/市场pc.png"; // 市场驾驶舱pc端背景图
  73. import drivePc6 from "@/assets/images/qhsepc.png"; // QHSE驾驶舱pc端背景图
  74. import driveMobile1 from "@/assets/images/mobile.png"; // 经营驾驶舱移动端背景图
  75. import driveMobile2 from "@/assets/images/生产驾驶舱.png"; // 生产驾驶舱移动端背景图
  76. import driveMobile3 from "@/assets/images/财务驾驶舱.png"; // 财务驾驶舱移动端背景图
  77. import driveMobile4 from "@/assets/images/供应链驾驶舱.png"; // 供应链驾驶舱移动端背景图
  78. import driveMobile5 from "@/assets/images/市场驾驶舱.png"; // 市场驾驶舱移动端背景图
  79. import driveMobile6 from "@/assets/images/QHSE驾驶舱.png"; // QHSE驾驶舱移动端背景图
  80. import drivePc1_white from "@/assets/images/dr1_white.png"; // 经营驾驶舱pc端背景图
  81. import drivePc2_white from "@/assets/images/生产pc_white.png"; // 生产驾驶舱pc端背景图
  82. import drivePc3_white from "@/assets/images/财务pc_white.png"; // 财务驾驶舱pc端背景图
  83. import drivePc4_white from "@/assets/images/gong_white.png";
  84. import drivePc5_white from "@/assets/images/市场pc_white.png";
  85. import drivePc6_white from "@/assets/images/qhsepc_white.png";
  86. import driveMobile1_white from "@/assets/images/mobile_white.png"; // 经营驾驶舱移动端背景图
  87. import driveMobile2_white from "@/assets/images/生产驾驶舱_white.png"; // 生产驾驶舱移动端背景图
  88. import driveMobile3_white from "@/assets/images/财务驾驶舱_white.png"; // 生产驾驶舱移动端背景图
  89. import driveMobile4_white from "@/assets/images/供应链驾驶舱_white.png"; // 生产驾驶舱移动端背景图
  90. import driveMobile5_white from "@/assets/images/市场驾驶舱_white.png"; // 生产驾驶舱移动端背景图
  91. import driveMobile6_white from "@/assets/images/QHSE驾驶舱_white.png"; // 生产驾驶舱移动端背景图
  92. import all from "@/assets/images/driveall.png";
  93. import jingying from "@/assets/images/jingying.png";
  94. import shengc from "@/assets/images/shengc.png";
  95. import cai from "@/assets/images/cai.png";
  96. import gong from "@/assets/images/gong.png";
  97. import city from "@/assets/images/city.png";
  98. const userStore = useUserStore();
  99. const themeStore = useThemeStore();
  100. const tabs = [
  101. { label: "全部驾驶舱", value: "all", icon: all },
  102. { label: "经营管理", value: "management", icon: jingying },
  103. { label: "生产运营", value: "production", icon: shengc },
  104. { label: "财务管理", value: "finance", icon: cai },
  105. { label: "供应链管理", value: "supply", icon: gong },
  106. { label: "市场营销", value: "marketing", icon: city },
  107. { label: "QHSE", value: "qhse", icon: gong },
  108. ];
  109. const activeTab = ref("all");
  110. type DriveCard = {
  111. title: string;
  112. description: string;
  113. url: string;
  114. bgColor: string;
  115. pcBg: string;
  116. mobileBg: string;
  117. category: string; // 新增分类字段
  118. };
  119. watch(
  120. () => themeStore.theme,
  121. () => {
  122. if (themeStore.theme === "light") {
  123. driveCards.value = [
  124. {
  125. title: "经营驾驶舱",
  126. description: "查看经营分析、经营指标与执行情况。",
  127. url: "https://report.deepoil.cc/webroot/decision/v10/entry/access/9fb42908-894a-4373-a6be-ce046a42851d?preview=true&page_number=1",
  128. bgColor: "#3876e0",
  129. pcBg: drivePc1_white,
  130. mobileBg: driveMobile1_white,
  131. category: "management", // 对应经营管理
  132. },
  133. {
  134. title: "生产驾驶舱",
  135. description: "查看生产运营态势、核心指标与执行情况。",
  136. url: "https://report.deepoil.cc/webroot/decision/v10/entry/access/dbc9cf73-81ce-43f1-9923-45cdfa5d5d3a?preview=true&page_number=1",
  137. bgColor: "#0f766e",
  138. pcBg: drivePc2_white,
  139. mobileBg: driveMobile2_white,
  140. category: "production", // 对应生产运营
  141. },
  142. {
  143. title: "财务驾驶舱",
  144. description: "查看财务分析、预算执行与经营数据表现。",
  145. url: "https://report.deepoil.cc/webroot/decision/v10/entry/access/e836fb5b-092c-4d64-a324-3beeb4fac0cc?preview=true&page_number=1",
  146. bgColor: "#ca8a04",
  147. pcBg: drivePc3_white,
  148. mobileBg: driveMobile3_white,
  149. category: "finance", // 对应财务管理
  150. },
  151. {
  152. title: "供应链驾驶舱",
  153. description: "查看供应链分析、物料需求与执行。",
  154. url: "#",
  155. bgColor: "#7c3aed",
  156. pcBg: drivePc4_white,
  157. mobileBg: driveMobile4_white,
  158. category: "supply", // 对应供应链管理
  159. },
  160. {
  161. title: "市场驾驶舱",
  162. description: "查看市场分析、销售数据与执行情况。",
  163. url: "#",
  164. bgColor: "#16a34a",
  165. pcBg: drivePc5_white,
  166. mobileBg: driveMobile5_white,
  167. category: "marketing", // 对应市场营销
  168. },
  169. {
  170. title: "QHSE驾驶舱",
  171. description: "查看安全、健康、环境与质量数据。",
  172. url: "#",
  173. bgColor: "#dc2626",
  174. pcBg: drivePc6_white,
  175. mobileBg: driveMobile6_white,
  176. category: "qhse", // 对应 QHSE
  177. },
  178. ];
  179. } else {
  180. driveCards.value = [
  181. {
  182. title: "经营驾驶舱",
  183. description: "查看经营分析、经营指标与执行情况。",
  184. url: "https://report.deepoil.cc/webroot/decision/v10/entry/access/9fb42908-894a-4373-a6be-ce046a42851d?preview=true&page_number=1",
  185. bgColor: "#3876e0",
  186. pcBg: drivePc1,
  187. mobileBg: driveMobile1,
  188. category: "management", // 对应经营管理
  189. },
  190. {
  191. title: "生产驾驶舱",
  192. description: "查看生产运营态势、核心指标与执行情况。",
  193. url: "https://report.deepoil.cc/webroot/decision/v10/entry/access/dbc9cf73-81ce-43f1-9923-45cdfa5d5d3a?preview=true&page_number=1",
  194. bgColor: "#0f766e",
  195. pcBg: drivePc2,
  196. mobileBg: driveMobile2,
  197. category: "production", // 对应生产运营
  198. },
  199. {
  200. title: "财务驾驶舱",
  201. description: "查看财务分析、预算执行与经营数据表现。",
  202. url: "https://report.deepoil.cc/webroot/decision/v10/entry/access/e836fb5b-092c-4d64-a324-3beeb4fac0cc?preview=true&page_number=1",
  203. bgColor: "#ca8a04",
  204. pcBg: drivePc3,
  205. mobileBg: driveMobile3,
  206. category: "finance", // 对应财务管理
  207. },
  208. {
  209. title: "供应链驾驶舱",
  210. description: "查看供应链分析、物料需求与执行。",
  211. url: "#",
  212. bgColor: "#7c3aed",
  213. pcBg: drivePc4,
  214. mobileBg: driveMobile4,
  215. category: "supply", // 对应供应链管理
  216. },
  217. {
  218. title: "市场驾驶舱",
  219. description: "查看市场分析、销售数据与执行情况。",
  220. url: "#",
  221. bgColor: "#16a34a",
  222. pcBg: drivePc5,
  223. mobileBg: driveMobile5,
  224. category: "marketing", // 对应市场营销
  225. },
  226. {
  227. title: "QHSE驾驶舱",
  228. description: "查看安全、健康、环境与质量数据。",
  229. url: "#",
  230. bgColor: "#dc2626",
  231. pcBg: drivePc6,
  232. mobileBg: driveMobile6,
  233. category: "qhse", // 对应 QHSE
  234. },
  235. ];
  236. }
  237. },
  238. );
  239. const driveCards = ref([
  240. {
  241. title: "经营驾驶舱",
  242. description: "查看经营分析、经营指标与执行情况。",
  243. url: "https://report.deepoil.cc/webroot/decision/v10/entry/access/9fb42908-894a-4373-a6be-ce046a42851d?preview=true&page_number=1",
  244. bgColor: "#3876e0",
  245. pcBg: themeStore.theme === "light" ? drivePc1_white : drivePc1,
  246. mobileBg: themeStore.theme === "light" ? driveMobile1_white : driveMobile1,
  247. category: "management", // 对应经营管理
  248. },
  249. {
  250. title: "生产驾驶舱",
  251. description: "查看生产运营态势、核心指标与执行情况。",
  252. url: "https://report.deepoil.cc/webroot/decision/v10/entry/access/dbc9cf73-81ce-43f1-9923-45cdfa5d5d3a?preview=true&page_number=1",
  253. bgColor: "#0f766e",
  254. pcBg: themeStore.theme === "light" ? drivePc2_white : drivePc2,
  255. mobileBg: themeStore.theme === "light" ? driveMobile2_white : driveMobile2,
  256. category: "production", // 对应生产运营
  257. },
  258. {
  259. title: "财务驾驶舱",
  260. description: "查看财务分析、预算执行与经营数据表现。",
  261. url: "https://report.deepoil.cc/webroot/decision/v10/entry/access/e836fb5b-092c-4d64-a324-3beeb4fac0cc?preview=true&page_number=1",
  262. bgColor: "#ca8a04",
  263. pcBg: themeStore.theme === "light" ? drivePc3_white : drivePc3,
  264. mobileBg: themeStore.theme === "light" ? driveMobile3_white : driveMobile3,
  265. category: "finance", // 对应财务管理
  266. },
  267. {
  268. title: "供应链驾驶舱",
  269. description: "查看供应链分析、物料需求与执行。",
  270. url: "#",
  271. bgColor: "#7c3aed",
  272. pcBg: themeStore.theme === "light" ? drivePc4_white : drivePc4,
  273. mobileBg: themeStore.theme === "light" ? driveMobile4_white : driveMobile4,
  274. category: "supply", // 对应供应链管理
  275. },
  276. {
  277. title: "市场驾驶舱",
  278. description: "查看市场分析、销售数据与执行情况。",
  279. url: "#",
  280. bgColor: "#16a34a",
  281. pcBg: themeStore.theme === "light" ? drivePc5_white : drivePc5,
  282. mobileBg: themeStore.theme === "light" ? driveMobile5_white : driveMobile5,
  283. category: "marketing", // 对应市场营销
  284. },
  285. {
  286. title: "QHSE驾驶舱",
  287. description: "查看安全、健康、环境与质量数据。",
  288. url: "#",
  289. bgColor: "#dc2626",
  290. pcBg: themeStore.theme === "light" ? drivePc6_white : drivePc6,
  291. mobileBg: themeStore.theme === "light" ? driveMobile6_white : driveMobile6,
  292. category: "qhse", // 对应 QHSE
  293. },
  294. ]);
  295. const filteredCards = computed(() => {
  296. if (activeTab.value === "all") {
  297. return driveCards.value;
  298. }
  299. return driveCards.value.filter((card) => card.category === activeTab.value);
  300. });
  301. const openDrive = async (option: DriveCard) => {
  302. if (userStore.getUser.username && getAccessToken()) {
  303. const res = await getMCSsoToken();
  304. if (res) {
  305. window.open(`${option.url}&ssoToken=${res}`, "_blank");
  306. }
  307. }
  308. };
  309. </script>
  310. <style scoped>
  311. .drive-page {
  312. --portal-text: #17345f;
  313. --portal-text-muted: #5f6f83;
  314. --portal-text-soft: #7f8fa6;
  315. --portal-title: #163867;
  316. --portal-subtitle: rgba(61, 92, 135, 0.86);
  317. --portal-line: rgba(126, 156, 201, 0.24);
  318. --portal-card: rgba(255, 255, 255, 0.82);
  319. --portal-card-2: rgba(248, 251, 255, 0.94);
  320. --portal-card-3: rgba(240, 246, 255, 0.88);
  321. --portal-card-4: rgba(231, 239, 251, 0.92);
  322. --portal-nav-bg: rgba(255, 255, 255, 0.72);
  323. --portal-nav-hover: rgba(219, 232, 252, 0.8);
  324. --portal-input-bg: rgba(255, 255, 255, 0.7);
  325. --portal-input-hover: rgba(255, 255, 255, 0.92);
  326. --portal-shadow: 0 18px 40px rgba(23, 52, 95, 0.12);
  327. --portal-shadow-strong: 0 24px 60px rgba(23, 52, 95, 0.16);
  328. --portal-accent: #245edb;
  329. --portal-accent-2: #4e8cff;
  330. --portal-accent-soft: rgba(36, 94, 219, 0.14);
  331. --portal-todo-bg: rgba(242, 247, 255, 0.94);
  332. --portal-todo-hover: rgba(228, 238, 252, 0.95);
  333. --portal-number-todo: #e15a5a;
  334. --portal-number-done: #2da04d;
  335. color: var(--portal-text);
  336. background:
  337. radial-gradient(
  338. circle at 18% 12%,
  339. rgba(83, 126, 255, 0.14),
  340. transparent 22%
  341. ),
  342. radial-gradient(
  343. circle at 82% 20%,
  344. rgba(71, 148, 255, 0.14),
  345. transparent 20%
  346. ),
  347. radial-gradient(
  348. circle at 50% 100%,
  349. rgba(97, 142, 247, 0.12),
  350. transparent 28%
  351. ),
  352. linear-gradient(180deg, #eef3f9 0%, #f7faff 46%, #eef3f9 100%);
  353. }
  354. :global([data-theme="dark"] .drive-page) {
  355. --portal-text: #eaf1ff;
  356. --portal-text-muted: rgba(234, 241, 255, 0.95);
  357. --portal-text-soft: #8a9ab0;
  358. --portal-title: #f4f7ff;
  359. --portal-subtitle: rgba(188, 205, 255, 0.82);
  360. --portal-line: rgba(97, 129, 206, 0.28);
  361. --portal-card: rgba(10, 19, 43, 0.8);
  362. --portal-card-2: rgba(12, 24, 52, 0.92);
  363. --portal-card-3: rgba(17, 25, 48, 0.8);
  364. --portal-card-4: rgba(15, 24, 45, 0.82);
  365. --portal-nav-bg: rgba(10, 19, 43, 0.8);
  366. --portal-nav-hover: rgba(28, 40, 72, 0.8);
  367. --portal-input-bg: rgba(255, 255, 255, 0.08);
  368. --portal-input-hover: rgba(255, 255, 255, 0.12);
  369. --portal-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
  370. --portal-shadow-strong: 0 24px 60px rgba(0, 0, 0, 0.38);
  371. --portal-accent: #6e7dff;
  372. --portal-accent-2: #8d4dff;
  373. --portal-accent-soft: rgba(110, 125, 255, 0.16);
  374. --portal-todo-bg: #070e20;
  375. --portal-todo-hover: rgba(28, 40, 72, 0.8);
  376. --portal-number-todo: #f56c6c;
  377. --portal-number-done: #ffffff;
  378. color: var(--portal-text);
  379. background:
  380. radial-gradient(
  381. circle at 18% 12%,
  382. rgba(79, 82, 221, 0.34),
  383. transparent 22%
  384. ),
  385. radial-gradient(circle at 82% 20%, rgba(28, 95, 255, 0.2), transparent 20%),
  386. radial-gradient(
  387. circle at 50% 100%,
  388. rgba(103, 46, 255, 0.16),
  389. transparent 28%
  390. ),
  391. linear-gradient(180deg, #040814 0%, #060d1d 46%, #040814 100%);
  392. }
  393. .drive-main {
  394. max-width: 100vw;
  395. margin: 0 auto;
  396. padding-top: 50px;
  397. }
  398. .drive-hero {
  399. position: relative;
  400. min-height: 220px;
  401. overflow: hidden;
  402. background:
  403. linear-gradient(180deg, rgba(2, 8, 25, 0.55), rgba(2, 8, 25, 0.86)), #000613;
  404. box-shadow:
  405. 0 24px 60px rgba(0, 0, 0, 0.42),
  406. inset 0 1px 0 rgba(255, 255, 255, 0.04);
  407. }
  408. .drive-hero::before {
  409. content: "";
  410. position: absolute;
  411. inset: 0;
  412. background: linear-gradient(
  413. 90deg,
  414. rgba(0, 6, 19, 0.8) 0%,
  415. rgba(0, 6, 19, 0.24) 40%,
  416. rgba(0, 6, 19, 0.08) 100%
  417. );
  418. z-index: 1;
  419. }
  420. .drive-hero__copy {
  421. position: absolute;
  422. z-index: 2;
  423. left: 56px;
  424. top: 54px;
  425. max-width: 560px;
  426. }
  427. .drive-hero__eyebrow {
  428. margin: 0 0 16px;
  429. color: #6d77ff;
  430. font-size: 14px;
  431. font-weight: 700;
  432. letter-spacing: 0.22em;
  433. }
  434. .drive-hero__title {
  435. margin: 0;
  436. color: #f5f8ff;
  437. font-size: clamp(20px, 5vw, 50px);
  438. font-weight: 900;
  439. line-height: 1.08;
  440. text-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  441. }
  442. .drive-hero__desc {
  443. margin: 20px 0 0;
  444. color: #5c6dc8;
  445. font-size: 18px;
  446. line-height: 1.8;
  447. }
  448. .drive-hero__visual {
  449. position: absolute;
  450. inset: 0;
  451. }
  452. .drive-hero__image {
  453. width: 100%;
  454. height: 100%;
  455. }
  456. .drive-hero__image :deep(img) {
  457. width: 100%;
  458. height: 100%;
  459. object-fit: cover;
  460. filter: saturate(1.1) contrast(1.05);
  461. }
  462. .drive-tabs {
  463. display: grid;
  464. grid-template-columns: repeat(7, minmax(0, 1fr));
  465. gap: 0;
  466. margin: 0 auto;
  467. padding: 0px 0px;
  468. width: 90%;
  469. border: 1px solid rgba(79, 110, 208, 0.16);
  470. border-radius: 10px;
  471. background: var(--bg-tab);
  472. box-shadow: 0 16px 34px rgba(0, 0, 0, 0.2);
  473. overflow: hidden;
  474. }
  475. .drive-tab {
  476. height: 58px;
  477. border: 0;
  478. border-right: 1px solid rgba(255, 255, 255, 0.06);
  479. background: transparent;
  480. color: var(--tab-text);
  481. font-size: 18px;
  482. font-weight: 700;
  483. cursor: pointer;
  484. display: flex;
  485. justify-content: center;
  486. align-items: center;
  487. }
  488. .drive-tab:last-child {
  489. border-right: 0;
  490. }
  491. .drive-tab--active {
  492. color: #fff !important;
  493. background: var(--bg-drive-tab);
  494. padding-bottom: 22px;
  495. padding-top: 22px;
  496. border-radius: 0;
  497. position: relative;
  498. }
  499. .drive-tab--active::before {
  500. content: "";
  501. position: absolute;
  502. left: 50%;
  503. bottom: -2px;
  504. width: 100%;
  505. height: 2px;
  506. transform: translateX(-50%);
  507. border-radius: 999px;
  508. background: linear-gradient(
  509. to right,
  510. #5887f8 0%,
  511. #69b5f8 30%,
  512. #fff 50%,
  513. #69b5f8 70%,
  514. #5887f8 100%
  515. );
  516. box-shadow: 0 0 12px rgba(112, 120, 255, 0.95);
  517. }
  518. .drive-grid {
  519. display: grid;
  520. grid-template-columns: repeat(2, minmax(0, 1fr));
  521. gap: 22px;
  522. margin-top: 30px;
  523. }
  524. .drive-card {
  525. position: relative;
  526. display: flex;
  527. align-items: center;
  528. justify-content: center;
  529. background-color: transparent !important;
  530. /* width: 100%; */
  531. height: 140px;
  532. /* 使用 CSS 变量动态绑定背景图 */
  533. background-image: var(--bg-image);
  534. background-size: contain;
  535. background-position: center;
  536. background-repeat: no-repeat;
  537. text-align: center;
  538. cursor: pointer;
  539. transition:
  540. transform 0.2s ease,
  541. box-shadow 0.2s ease,
  542. border-color 0.2s ease;
  543. overflow: hidden;
  544. }
  545. .drive-card:hover {
  546. transform: scale(1.02);
  547. border-color: rgba(115, 145, 255, 0.42);
  548. /* box-shadow: 0 28px 54px rgba(0, 0, 0, 0.42); */
  549. }
  550. /* 补充缺失的内容样式,确保文字能显示在背景图上 */
  551. .drive-card__content {
  552. position: relative;
  553. z-index: 1;
  554. min-width: 0;
  555. flex: 1;
  556. /* 根据原设计可能需要调整文字颜色或背景遮罩以确保可读性 */
  557. }
  558. .drive-card__title {
  559. margin: 0;
  560. color: #f4f7ff;
  561. font-size: 28px;
  562. font-weight: 700;
  563. text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  564. }
  565. .drive-card__text {
  566. margin: 10px 0 0;
  567. color: rgba(191, 203, 235, 0.82);
  568. font-size: 16px;
  569. line-height: 1.7;
  570. text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  571. }
  572. .drive-card__arrow {
  573. position: relative;
  574. z-index: 1;
  575. color: rgba(210, 220, 248, 0.82);
  576. font-size: 34px;
  577. flex-shrink: 0;
  578. transition:
  579. transform 0.2s ease,
  580. color 0.2s ease;
  581. }
  582. .drive-card:hover .drive-card__arrow {
  583. color: #ffffff;
  584. transform: translate(2px, -2px);
  585. }
  586. @media (max-width: 768px) {
  587. .drive-main {
  588. padding: 50px 0px 56px;
  589. margin-top: 0;
  590. }
  591. .drive-hero {
  592. min-height: 260px;
  593. }
  594. .drive-hero__copy {
  595. left: 20px;
  596. right: 20px;
  597. top: 24px;
  598. }
  599. .drive-tabs {
  600. grid-template-columns: repeat(2, minmax(0, 1fr));
  601. }
  602. .drive-grid {
  603. grid-template-columns: 1fr;
  604. gap: 16px;
  605. padding-left: 0;
  606. }
  607. .drive-card {
  608. min-height: 100px;
  609. height: 100px; /* 修正原代码中 height: 0px 的问题,确保卡片有高度 */
  610. width: 100%; /* 修正原代码中 width: 100vw 可能导致溢出问题,通常用 100% */
  611. padding: 0;
  612. margin-top: 0;
  613. /* 使用 CSS 变量动态绑定移动端背景图 */
  614. background-image: var(--mobile-bg-image);
  615. background-size: contain;
  616. background-position: center center;
  617. }
  618. .drive-card__title {
  619. font-size: 20px;
  620. }
  621. .drive-hero__image :deep(img) {
  622. object-fit: cover;
  623. object-position: 68% center;
  624. }
  625. }
  626. @media (max-width: 768px) {
  627. .drive-tabs {
  628. display: flex; /* 改为 flex 布局 */
  629. overflow-x: auto; /* 允许横向滚动 */
  630. white-space: nowrap; /* 防止文字换行 */
  631. padding: 12px;
  632. gap: 10px; /* 增加间距 */
  633. /* 移除原有的 grid 相关属性 */
  634. grid-template-columns: unset;
  635. width: 100%;
  636. }
  637. .drive-tab {
  638. flex-shrink: 0; /* 防止按钮被压缩 */
  639. border-right: none; /* 移除右侧边框,改用间距或底部指示器 */
  640. padding: 0 16px; /* 增加左右内边距 */
  641. }
  642. }
  643. /* 优化横向滚动条 */
  644. .drive-tabs::-webkit-scrollbar {
  645. height: 1px;
  646. }
  647. .drive-tabs::-webkit-scrollbar-thumb {
  648. background-color: var(--color-border-default);
  649. border-radius: 2px;
  650. }
  651. </style>