Browse Source

修改项目选择布局

Renxy 1 year ago
parent
commit
b0d6c57bd7
2 changed files with 8 additions and 6 deletions
  1. 5 5
      src/pages/Projects/index.js
  2. 3 1
      src/pages/Projects/index.less

+ 5 - 5
src/pages/Projects/index.js

@@ -1,7 +1,7 @@
 import { queryProject } from '@/services/diagnosticTec';
 import { UnityAction } from '@/utils/utils';
 import { useRequest } from '@umijs/max';
-import { useRef } from 'react';
+import { useEffect, useRef } from 'react';
 import Swiper from 'react-id-swiper';
 import 'swiper/css/swiper.css';
 import styles from './index.less';
@@ -41,10 +41,10 @@ const Projects = () => {
   const toProject = (item) => {
     UnityAction.sendMsg('project', JSON.stringify(item));
   };
-  // useEffect(() => {
-  //   localStorage.width = document.documentElement.getBoundingClientRect().width;
-  //   window.refreshRem();
-  // }, []);
+  useEffect(() => {
+    localStorage.width = document.documentElement.getBoundingClientRect().width;
+    window.refreshRem();
+  }, []);
   return (
     <div className={styles.main}>
       {/* <div className={styles.titleCon}>

+ 3 - 1
src/pages/Projects/index.less

@@ -1,6 +1,8 @@
 .main {
   width: 100%;
   height: 100vh;
+  padding-top: calc(100vh - 8.1rem);
+  // background-color: aqua;
   // background: url('@/assets/projects/bg.png') no-repeat center;
   // background-size: 100% 100%;
   // .titleCon {
@@ -35,7 +37,7 @@
 }
 .swiper {
   position: relative;
-  top: 30%;
+  bottom: 0;
   // margin-top: 2rem;
   .pic {
     width: 100%;