Renxy 1 rok temu
rodzic
commit
85b0acd957
3 zmienionych plików z 12 dodań i 11 usunięć
  1. 5 4
      src/pages/Home/index.js
  2. 1 1
      src/pages/Menu/index.less
  3. 6 6
      src/pages/Projects/index.js

+ 5 - 4
src/pages/Home/index.js

@@ -14,10 +14,11 @@ const HomePage = (props) => {
   const { data } = useRequest(queryConditionSnapshot, {
     defaultParams: [{ project_id: projectId }],
   });
-  // useEffect(() => {
-  //   localStorage.width = document.documentElement.getBoundingClientRect().width;
-  //   window.refreshpx();
-  // }, []);
+
+  useEffect(() => {
+    localStorage.width = document.documentElement.getBoundingClientRect().width;
+    window.refreshRem();
+  }, []);
   return (
     <div className={styles.content}>
       <CenterContent data={data} />

+ 1 - 1
src/pages/Menu/index.less

@@ -8,7 +8,7 @@
   align-items: flex-end;
   background: url('@/assets/menu/right_bg.png') no-repeat center;
   background-size: 100% 100%;
-  border-radius: 0.74rem 0 0 0.74rem;
+  border-radius: 0.78rem 0 0 0.78rem;
   box-shadow: 0.03rem 0.49rem 1rem 0rem rgba(60, 93, 133, 0.72);
 }
 .menu {

+ 6 - 6
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 { useEffect, useRef } from 'react';
+import { useRef } from 'react';
 import Swiper from 'react-id-swiper';
 import 'swiper/css/swiper.css';
 import styles from './index.less';
@@ -15,7 +15,7 @@ const Projects = () => {
       var list = [];
       res.data.forEach((item) => {
         // 使用水厂名替代项目名
-        item.List.forEach(item => item.Name = item.WaterName)
+        item.List.forEach((item) => (item.Name = item.WaterName));
         list = list.concat(item.List);
       });
       return list;
@@ -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}>