Pārlūkot izejas kodu

fix: 1920-768响应式效果修改

Lee 1 nedēļu atpakaļ
vecāks
revīzija
3a4da16347

+ 3 - 3
app/app.vue

@@ -2,7 +2,7 @@
  * @Author: wjc
  * @Date: 2023-11-15 09:54:21
  * @LastEditors: LiZhiWei
- * @LastEditTime: 2026-01-15 14:41:09
+ * @LastEditTime: 2026-01-15 14:50:45
  * @Description: 
 -->
 <template>
@@ -31,9 +31,9 @@
   if (import.meta.client) {
     const handleResize = () => {
       const width = window.innerWidth
-      if (width >= 1200 && width <= 1920) {
+      if (width >= 768 && width <= 1440) {
         // @ts-ignore
-        document.documentElement.style.zoom = width / 1920
+        document.documentElement.style.zoom = width / 1440
       } else {
         // @ts-ignore
         document.documentElement.style.zoom = 1

+ 5 - 0
app/assets/scss/common.scss

@@ -2,6 +2,11 @@
   box-sizing: border-box;
 }
 
+// 响应式容器:1440-1920 之间动态缩小 padding,保持内容 1440 居中
+.landing-container {
+  @extend %landing-container;
+}
+
 #app {
   overflow-x: hidden;
   text-align: center;

+ 23 - 0
app/assets/scss/vars.scss

@@ -42,3 +42,26 @@
   --el-text-color-secondary: var(--hj-text-muted);
   --el-border-color: var(--hj-border);
 }
+
+// 响应式容器占位符
+%landing-container {
+  width: 100%;
+  margin: 0 auto;
+  padding-left: 20px;
+  padding-right: 20px;
+
+  @media screen and (min-width: 992px) {
+    padding-left: 60px;
+    padding-right: 60px;
+  }
+
+  @media screen and (min-width: 1440px) {
+    padding-left: calc((100vw - 1440px) / 2);
+    padding-right: calc((100vw - 1440px) / 2);
+  }
+
+  @media screen and (min-width: 1920px) {
+    padding-left: 240px;
+    padding-right: 240px;
+  }
+}

+ 14 - 10
app/components/Footer.vue

@@ -3,13 +3,13 @@
  * @Description: AppFooter
 -->
 <template>
-  <footer class="bg-black text-white py-60px px-20px lg:px-60px xl:pt-130px xl:pb-60px xl:px-240px">
-    <div class="landing-container">
+  <footer class="bg-black text-white py-60px sm:pt-130px sm:pb-60px">
+    <div class="footer-container">
       <!-- 顶部区域:链接列表 + 联系方式 -->
-      <div class="flex flex-col xl:flex-row justify-between items-start gap-60px xl:gap-0">
+      <div class="flex flex-col sm:flex-row justify-between items-start gap-60px sm:gap-0">
         <!-- 左侧链接列表 -->
         <div
-          class="flex flex-wrap gap-40px lg:gap-80px w-full xl:w-auto justify-between xl:justify-start"
+          class="flex flex-wrap gap-40px sm:gap-80px w-full sm:w-auto justify-between sm:justify-start"
         >
           <!-- 产品 -->
           <div class="text-left">
@@ -100,7 +100,7 @@
         </div>
 
         <!-- 右侧联系方式 -->
-        <div class="flex flex-col lg:flex-row gap-40px xl:gap-123px w-full xl:w-auto">
+        <div class="flex flex-col sm:flex-row gap-40px sm:gap-123px w-full sm:w-auto">
           <div class="text-left">
             <div class="text-16px lh-22px text-white pf-sc-semibold">关注或联系我们</div>
             <div class="text-14px lh-22px text-#94a3b8 mt-16px">电话:400-600-7709</div>
@@ -108,7 +108,7 @@
               地址:海南省海口市美兰区西溪里商业街7号楼A127
             </div>
           </div>
-          <div class="flex flex-col items-start lg:items-center">
+          <div class="flex flex-col items-start sm:items-center">
             <i class="i-custom-qrcode wh-136px"></i>
             <div class="mt-12px text-16px text-#white lh-22px pf-sc-regular">扫一扫关注我们</div>
           </div>
@@ -117,15 +117,15 @@
 
       <!-- 底部区域:Logo + 版权 -->
       <div
-        class="mt-40px lg:mt-80px pt-0 flex flex-col md:flex-row justify-between items-center text-12px text-#64748b"
+        class="mt-40px sm:mt-80px pt-0 flex flex-col sm:flex-row justify-between items-center text-12px text-#64748b"
       >
         <!-- 左侧 Logo -->
-        <div class="flex items-center gap-10px mb-20px md:mb-0">
+        <div class="flex items-center gap-10px mb-20px sm:mb-0">
           <i class="i-custom-logo-white h-31px w-147px"></i>
         </div>
 
         <!-- 右侧 版权 -->
-        <div class="flex flex-col py-8px gap-36px md:flex-row items-center md:gap-20px">
+        <div class="flex flex-col py-8px gap-36px sm:flex-row items-center sm:gap-20px">
           <span>© 2024 海南智慧城科技有限公司版权所有</span>
           <a
             href="https://beian.miit.gov.cn/"
@@ -148,4 +148,8 @@
 
 <script setup lang="ts"></script>
 
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+  .footer-container {
+    @extend %landing-container;
+  }
+</style>

+ 16 - 13
app/components/Header.vue

@@ -2,7 +2,7 @@
  * @Author: LiZhiWei
  * @Date: 2026-01-13 15:41:49
  * @LastEditors: LiZhiWei
- * @LastEditTime: 2026-01-15 14:43:12
+ * @LastEditTime: 2026-01-15 14:49:14
  * @Description: 
 -->
 <!--
@@ -11,28 +11,26 @@
 -->
 <template>
   <header class="landing-header" :class="{ 'is-scrolled': y > 0 }">
-    <div
-      class="landing-container h-60px lg:h-80px flex items-center justify-between gap-16px px-20px lg:px-60px xl:px-240px"
-    >
-      <i class="i-custom-logo w-100px h-20px lg:w-128px lg:h-26px"></i>
+    <div class="landing-container h-60px sm:h-80px flex items-center justify-between gap-16px">
+      <i class="i-custom-logo w-100px h-20px sm:w-128px sm:h-26px"></i>
 
       <!-- Mobile Menu Button -->
-      <button class="lg:hidden p-8px text-gray-600" @click="isMobileMenuOpen = !isMobileMenuOpen">
+      <button class="sm:hidden p-8px text-gray-600" @click="isMobileMenuOpen = !isMobileMenuOpen">
         <div class="i-carbon-menu text-24px"></div>
       </button>
 
       <nav
-        class="hidden lg:flex items-center gap-20px xl:gap-52px text-16px xl:text-16px text-#334155 h-full"
+        class="hidden sm:flex items-center gap-20px xl:gap-52px text-16px xl:text-16px text-#334155 h-full"
       >
         <NuxtLink to="/" class="nav-link flex items-center">首页</NuxtLink>
         <NuxtLink to="/" class="nav-link flex items-center">产品中心</NuxtLink>
-        <div class="group flex items-center">
+        <div class="group h-full flex items-center">
           <NuxtLink to="/" class="nav-link flex items-center">解决方案</NuxtLink>
           <!-- Mega Menu -->
           <div
-            class="fixed left-0 top-80px w-full bg-white shadow-lg border-t border-gray-100 hidden group-hover:block z-50 animate-fade-in-down"
+            class="fixed left-0 top-60px sm:top-80px w-full bg-white shadow-lg border-t border-gray-100 hidden group-hover:block z-50 animate-fade-in-down"
           >
-            <div class="landing-container px-20px lg:px-60px xl:px-240px py-40px flex">
+            <div class="landing-container py-40px flex">
               <!-- Left Sidebar -->
               <div class="w-240px border-r border-gray-100 pr-40px shrink-0">
                 <div class="text-18px font-600 mb-20px text-#1e293b">解决方案分类</div>
@@ -86,14 +84,14 @@
       </nav>
 
       <div class="flex items-center gap-30px">
-        <span class="flex items-center gap-14px hidden lg:flex">
+        <span class="flex items-center gap-14px hidden sm:flex">
           <i class="i-custom-telephone wh-28px"></i>
           <span class="font-s-28px font-bold text-#28292E d-din-pro-600-semibold">
             400-600-7709
           </span>
         </span>
         <button
-          class="btn-primary text-white font-medium w-134px h-40px pf-sc-medium font-s-16px rounded-8px hidden lg:block"
+          class="btn-primary text-white font-medium w-134px h-40px pf-sc-medium font-s-16px rounded-8px hidden sm:block"
           @click="openConsultation"
         >
           <span class="lh-20px">申请试用</span>
@@ -104,7 +102,7 @@
     <!-- Mobile Menu Overlay -->
     <div
       v-if="isMobileMenuOpen"
-      class="fixed inset-0 top-60px bg-white z-90 lg:hidden flex flex-col p-20px animate-fade-in-down"
+      class="fixed inset-0 top-60px bg-white z-90 sm:hidden flex flex-col p-20px animate-fade-in-down"
     >
       <nav class="flex flex-col gap-20px text-16px text-#334155 font-500">
         <NuxtLink to="/" class="py-10px border-b border-gray-100" @click="isMobileMenuOpen = false">
@@ -276,5 +274,10 @@
 
   .animate-fade-in-down {
     animation: fadeInDown 0.2s ease-out forwards;
+
+    &::before {
+      content: '';
+      @apply absolute -top-10px left-0 w-full h-10px;
+    }
   }
 </style>

+ 33 - 12
app/pages/index/index.vue

@@ -1,13 +1,13 @@
 <!--
  * @Author: LiZhiWei
  * @LastEditors: LiZhiWei
- * @LastEditTime: 2026-01-15 11:03:00
+ * @LastEditTime: 2026-01-15 15:15:11
  * @Description: 
 -->
 <template>
   <div class="landing">
     <section class="hero">
-      <div class="flex items-center pb-48px px-240px pt-200px">
+      <div class="hero-content flex items-center pb-48px pt-200px">
         <div class="text-left">
           <div class="font-s-48px font-semibold text-#000000">智慧社区整体解决方案</div>
           <p class="font-s-18px text-#091221/70">
@@ -48,7 +48,7 @@
     <section
       id="solution"
       ref="solutionRef"
-      class="h-744px px-240px pt-120px transition-all duration-1000 ease-out"
+      class="solution h-744px pt-120px transition-all duration-1000 ease-out"
       :class="[isSolutionVisible ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-100px']"
     >
       <div class="text-center mb-45px">
@@ -194,7 +194,7 @@
     <section
       id="cases"
       ref="casesRef"
-      class="px-240px pt-120px pb-46px transition-all duration-1000 ease-out"
+      class="cases pt-120px pb-46px transition-all duration-1000 ease-out"
       :class="[isCasesVisible ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-100px']"
     >
       <div class="text-center mb-60px">
@@ -246,7 +246,7 @@
         </div>
       </div>
     </section>
-    <section id="partnership" class="px-200px py-60px overflow-hidden">
+    <section id="partnership" class="partnership py-60px overflow-hidden">
       <div class="flex-center gap-32px mb-40px">
         <div class="h-2px w-320px bg-[linear-gradient(90deg,transparent_0%,#E5E9F5_100%)]"></div>
         <div class="text-center font-s-18px lh-21px text-#9CA0A7 pf-sc-regular whitespace-nowrap">
@@ -295,7 +295,7 @@
         >
           发展历程
         </div>
-        <div class="font-s-16px text-#091221/70 pf-sc-regular text-center lh-30px mb-80px">
+        <div class="font-s-16px text-#091221/70 pf-sc-regular text-center lh-30px mb-50px">
           从探索到引领,绘家科技每一步都坚实有力
         </div>
 
@@ -390,7 +390,7 @@
         </div>
 
         <!-- 底部大切换 -->
-        <div class="flex gap-24px mt-40px">
+        <div class="flex gap-24px mt-45px">
           <i
             class="wh-56px i-custom-button-previous hover:i-custom-button-previous-active flex-center cursor-pointer"
             :class="{
@@ -558,9 +558,14 @@
 
   .hero {
     @apply h-680px relative overflow-hidden;
-    background-size: 100% 100%;
+    background-size: cover;
+    background-position: center;
     background-image: url('@/assets/images/banner.png');
 
+    .hero-content {
+      @extend %landing-container;
+    }
+
     .metric {
       @apply flex items-start flex-col;
 
@@ -574,12 +579,25 @@
     }
   }
 
+  .solution {
+    @extend %landing-container;
+  }
+
   .ability {
-    @apply px-240px py-120px;
+    @apply py-120px;
+    @extend %landing-container;
     background-size: 100% 100%;
     background-image: url('@/assets/images/bg-ability.png');
   }
 
+  .cases {
+    @extend %landing-container;
+  }
+
+  .partnership {
+    @extend %landing-container;
+  }
+
   .tab-fade-enter-active {
     transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
   }
@@ -632,14 +650,17 @@
   }
 
   .history {
-    @apply overflow-hidden relative py-60px px-260px;
-    background-size: 100% 100%;
+    @apply overflow-hidden relative py-60px;
+    @extend %landing-container;
+    background-size: cover;
+    background-position: center;
     background-image: url('@/assets/images/history-bg.png');
   }
 
   .cta {
     @apply w-full h-276px;
-    background-size: 100% 100%;
+    background-size: cover;
+    background-position: center;
     background-image: url('@/assets/images/bg-3.png');
   }
 </style>

+ 1 - 1
uno.config.ts

@@ -2,7 +2,7 @@
  * @Author: wjc
  * @Date: 2023-05-07 20:59:28
  * @LastEditors: LiZhiWei
- * @LastEditTime: 2026-01-09 15:08:04
+ * @LastEditTime: 2026-01-15 15:04:36
  * @Description:
  */
 import {