shaogen1995 2 лет назад
Родитель
Сommit
1a3aad8db8

+ 32 - 24
后台/src/pages/Z1Gather/index.tsx

@@ -5,10 +5,12 @@ import { MessageFu } from "@/utils/message";
 import TextArea from "antd/es/input/TextArea";
 import classNames from "classnames";
 import { ArrowUpOutlined } from "@ant-design/icons";
-import http from "@/utils/http";
+import http, { baseURL } from "@/utils/http";
 import { isH5Fu, isWeiFu } from "@/utils/pcOrH5";
-import history from "@/utils/history";
+import { urlParameter } from "@/utils/history";
+import { useLocation } from "react-router-dom";
 function Z1Gather() {
+  const location = useLocation();
   // const timeRef = useRef(-1);
   useEffect(() => {
     document.title = "2023 Print China_Contact us";
@@ -66,32 +68,38 @@ function Z1Gather() {
   };
 
   // 通过校验点击确定
-  const onFinish = useCallback(async (values: any) => {
-    const res = await API_btnOk(values);
-    if (res.code === 0) {
-      MessageFu.success("succeed!");
-      localStorage.setItem("HDB_WJ", "1");
-      FormBoxRef.current.resetFields();
-      window.setTimeout(() => {
-        if (isH5Fu()) {
-          if (isWeiFu()) history.go(-1);
-          else {
+  const onFinish = useCallback(
+    async (values: any) => {
+      const res = await API_btnOk(values);
+      if (res.code === 0) {
+        MessageFu.success("succeed!");
+        localStorage.setItem("HDB_WJ", "1");
+        FormBoxRef.current.resetFields();
+
+        window.setTimeout(() => {
+          const obj = urlParameter(location.search);
+          if (obj.q) {
+            // 通过热点跳到这个页面
+            if (isH5Fu() && isWeiFu()) window.history.go(-1);
+            else {
+              window.opener = null;
+              window.open("", "_self");
+              window.close();
+            }
+          } else {
+            // 直接打开这个页面
             window.opener = null;
             window.open("", "_self");
             window.close();
+            window.open(
+              `${baseURL}/webHot/index.html#/?m=e3bv6739474&time=1681093455388&id=1172_1&q=1`
+            );
           }
-        } else {
-          window.opener = null;
-          window.open("", "_self");
-          window.close();
-          // 2023删除
-          window.open(
-            "https://haidebao.4dage.com/webHot/index.html#/?m=e3bv6739474&time=1681093455388&id=1172_1"
-          );
-        }
-      }, 500);
-    }
-  }, []);
+        }, 500);
+      }
+    },
+    [location.search]
+  );
 
   // 输入框只输入空格的非法校验
   const inputCheckFu = useCallback((_: any, value: string) => {

BIN
定制化热点/public/favicon.ico


+ 1 - 1
定制化热点/public/index.html

@@ -4,7 +4,7 @@
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
-    <title><%= htmlWebpackPlugin.options.title %></title>
+    <title>Print China 2023 HEIDELBERG Booth</title>
   </head>
   <body>
     <noscript>

+ 9 - 7
定制化热点/src/views/Device.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="Device" :class="{ DeviceNo: noInfo }">
     <!-- 关闭按钮 -->
-    <div class="close" v-show="!noInfo">
+    <div class="close" v-show="!noInfo" :class="{ closeHide: isQ }">
       <img
         @click="$emit('closePage')"
         src="../assets/images/close2.png"
@@ -116,6 +116,8 @@ export default {
   components: {},
   data() {
     return {
+      // 直接进来还是通过热点进来
+      isQ: this.$route.query.q,
       // a标签下载路径
       doHref: "",
       // a标签下载名称
@@ -183,7 +185,6 @@ export default {
     });
     this.data = res.data;
 
-    // 2023删除
     window.addEventListener("scroll", this.scroolFu, true);
   },
   beforeCreate() {}, //生命周期 - 创建之前
@@ -211,10 +212,6 @@ export default {
   border-top: 10px solid #00a0e6;
   background-color: #fff;
   .close {
-    // 2023删除
-    opacity: 0;
-    pointer-events: none;
-
     padding: 20px 20px 0 0;
     height: 50px;
     text-align: right;
@@ -222,6 +219,11 @@ export default {
       cursor: pointer;
     }
   }
+  // 直接打开页面
+  .closeHide {
+    opacity: 0;
+    pointer-events: none;
+  }
   .main {
     padding-left: 40px;
     height: calc(100% - 80px);
@@ -431,7 +433,7 @@ export default {
     width: 100vw;
     height: 100vh;
     overflow: hidden;
-    .close{
+    .close {
       height: 20px;
     }
     .main {

+ 13 - 8
定制化热点/src/views/Home.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="Home">
-    <div class="main">
+    <div class="main" :class="{ mainHide: isQ }">
       <!-- 标题 -->
       <h3 class="top">{{ title }}</h3>
       <!-- 英文版下载 -->
@@ -118,6 +118,9 @@ export default {
   components: { Swiper, SwiperSlide, Device },
   data() {
     return {
+      // 直接进来还是通过热点进来
+      isQ: this.$route.query.q,
+
       // 下载手册的页面
       devieShow: false,
       m: this.$route.query.m,
@@ -158,7 +161,7 @@ export default {
         this.devieShow = true;
       } else {
         // 新窗口打开
-        window.open(`${baseUrl}/backstage/#/Zgather`);
+        window.open(`${baseUrl}/backstage/#/Zgather?q=1`);
       }
     },
     // 点击查看大图
@@ -193,9 +196,11 @@ export default {
     },
   },
   created() {
-    // 2023删除
-    const flag2 = localStorage.getItem("HDB_WJ");
-    if (flag2) this.devieShow = true;
+    // 直接打开页面
+    if (this.isQ) {
+      const flag2 = localStorage.getItem("HDB_WJ");
+      if (flag2) this.devieShow = true;
+    }
 
     // 监听本地存储改变
     window.addEventListener(
@@ -267,7 +272,7 @@ export default {
     .xiazai {
       cursor: pointer;
       margin: 10px 0 20px;
-      width: 160px;
+      width: 170px;
       height: 30px;
       display: flex;
       justify-content: center;
@@ -486,8 +491,8 @@ export default {
     opacity: 1;
     pointer-events: auto;
   }
-  // 2023删除
-  .main {
+  // 直接打开页面
+  .mainHide {
     opacity: 0;
   }
 }