index.vue 21 KB

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