Explorar el Código

🐛H5扫码页面样式问题

shaogen1995 hace 2 años
padre
commit
6bfaf41566
Se han modificado 3 ficheros con 23 adiciones y 15 borrados
  1. 7 0
      src/pages/H5Code/index.module.scss
  2. 1 1
      src/pages/H5Code/index.tsx
  3. 15 14
      src/pages/Layout/index.tsx

+ 7 - 0
src/pages/H5Code/index.module.scss

@@ -50,6 +50,9 @@
           transform: translateX(-50%);
           width: 55%;
           height: 32%;
+          display: flex;
+          justify-content: center;
+          align-items: center;
         }
 
         .H5Loc {
@@ -67,6 +70,7 @@
             position: relative;
 
             &>div {
+              max-width: calc(100% - 30px);
               position: absolute;
               left: 30px;
               padding: 0 20px 15px 20px;
@@ -77,6 +81,8 @@
               color: #f2e2c1;
               background: url('../../assets/img/H5Xian.png') no-repeat bottom center;
               background-size: 100% 10px;
+              word-wrap:break-word;
+
             }
           }
 
@@ -138,6 +144,7 @@
               height: calc(100% - 72px);
               padding-right: 6px;
               overflow-y: auto;
+              word-wrap:break-word;
             }
 
 

+ 1 - 1
src/pages/H5Code/index.tsx

@@ -85,7 +85,7 @@ function H5Code() {
         dom.style.display = "none";
         a.style.display = "none";
         document.body.removeChild(dom);
-        let blob: any = dataURLToBlob(dom.toDataURL("image/jpeg"));
+        let blob: any = dataURLToBlob(dom.toDataURL("image/png"));
         a.setAttribute("href", URL.createObjectURL(blob));
         //这块是保存图片操作  可以设置保存的图片的信息
         a.setAttribute("download", info.name + ".jpg");

+ 15 - 14
src/pages/Layout/index.tsx

@@ -10,7 +10,6 @@ import styles from "./index.module.scss";
 import SpinLoding from "@/components/SpinLoding";
 import { Route, Switch, useLocation } from "react-router-dom";
 import AuthRoute from "@/components/AuthRoute";
-import NotFound from "@/components/NotFound";
 import classNames from "classnames";
 import history from "@/utils/history";
 import { Button, Form, Input, Modal, Popconfirm } from "antd";
@@ -21,14 +20,16 @@ import { getTokenInfo, removeTokenInfo } from "@/utils/storage";
 import { useDispatch, useSelector } from "react-redux";
 import { getPermissionsAPI } from "@/store/action/role";
 import { RootState } from "@/store";
-import inco1 from '@/assets/img/inco1.png'
-import inco2 from '@/assets/img/inco2.png'
-import inco3 from '@/assets/img/inco3.png'
-import inco4 from '@/assets/img/inco4.png'
-import inco5 from '@/assets/img/inco5.png'
-import inco6 from '@/assets/img/inco6.png'
+import inco1 from "@/assets/img/inco1.png";
+import inco2 from "@/assets/img/inco2.png";
+import inco3 from "@/assets/img/inco3.png";
+import inco4 from "@/assets/img/inco4.png";
+import inco5 from "@/assets/img/inco5.png";
+import inco6 from "@/assets/img/inco6.png";
 import { MessageFu } from "@/utils/message";
 
+const NotFound = React.lazy(() => import("@/components/NotFound"));
+
 function Layout() {
   const dispatch = useDispatch();
 
@@ -40,7 +41,7 @@ function Layout() {
         path: "/",
         done: false,
         Com: React.lazy(() => import("../Hot")),
-        inco:inco1
+        inco: inco1,
       },
       {
         id: 200,
@@ -48,7 +49,7 @@ function Layout() {
         path: "/wall",
         done: false,
         Com: React.lazy(() => import("../Wall")),
-        inco:inco2
+        inco: inco2,
       },
       {
         id: 300,
@@ -56,7 +57,7 @@ function Layout() {
         path: "/goods",
         done: false,
         Com: React.lazy(() => import("../Goods")),
-        inco:inco3
+        inco: inco3,
       },
     ];
   }, []);
@@ -77,7 +78,7 @@ function Layout() {
           path: "/user",
           done: true,
           Com: React.lazy(() => import("../User")),
-          inco:inco4
+          inco: inco4,
         },
         {
           id: 500,
@@ -85,7 +86,7 @@ function Layout() {
           path: "/role",
           done: true,
           Com: React.lazy(() => import("../Role")),
-          inco:inco5
+          inco: inco5,
         },
         {
           id: 600,
@@ -93,7 +94,7 @@ function Layout() {
           path: "/log",
           done: true,
           Com: React.lazy(() => import("../Log")),
-          inco:inco6
+          inco: inco6,
         }
       );
     }
@@ -101,7 +102,7 @@ function Layout() {
 
   // 权限的数据和页面判断
   useEffect(() => {
-    if(authPageArr&&authPageArr.length){
+    if (authPageArr && authPageArr.length) {
       authPageArr.forEach((v) => {
         if (v.authority) {
           listTemp.forEach((v2) => {