shaogen1995 2 anni fa
parent
commit
5924724761

+ 4 - 4
pc场景/public/static/js/Hot.js

@@ -40,12 +40,12 @@ window.initHot = function (model) {
             , o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";
         -1 == r.indexOf("?") ? src = link + "?time=" + randomTime().getTime() + "&id=" + window.number + o : src = link + "&time=" + randomTime().getTime() + "&id=" + window.number + o
         // 定制热点的地址
-        src ='http://localhost:8081/#/?m=4QlWJ388649&time=1680838841927&id=TEST&c=1'
+        // src ='http://localhost:8081/#/?m=4QlWJ388649&time=1680838841927&id=TEST&c=1'
         // 如果是英文版
-        // if(window.location.href.includes('_1')) src=src+'&c=1'
-        // return src.replace('https://www.4dmodel.com/SuperTwo/hot_online1/', '/hot') 
+        if(window.location.href.includes('_1')) src=src+'&c=1'
+        return src.replace('https://www.4dmodel.com/SuperTwo/hot_online1/', '/webHot') 
         // return 'http://project.4dage.com:8017' + src  // 线上测试
-        return src     //打包 
+        // return src     //打包 
 
     }
     var removeSrcPostMark = function (url) {//去除texture.load时自动加上的'?'

+ 36 - 1
pc场景/src/pages/Home.vue

@@ -80,6 +80,7 @@
 </template>
 
 <script>
+import { visitSceneAPI, visitUserAPI } from "../utils/api";
 import popup from "@/views/popup";
 import guiLoading from "@/views/gui/loading";
 import hotspotList from "@/views/gui/hotspotlist";
@@ -142,7 +143,7 @@ export default {
     },
   },
 
-  mounted() {
+  async mounted() {
     this.$nextTick(() => {
       window.evt = document.createEvent("HTMLEvents");
       window.evt.initEvent("loadfinish", false, false);
@@ -161,6 +162,40 @@ export default {
         });
       });
     });
+
+    // 如果是英文版
+    // console.log("cccccccccccccc", this.Mylangue);
+    if (this.Mylangue) {
+      // 增加访问量
+      await visitSceneAPI();
+      // 增加访客量,一天一次
+      const storInfo = localStorage.getItem("HDB_oneDay");
+
+      if (storInfo) {
+        const data = JSON.parse(storInfo);
+        const time = Date.now();
+        if (time - Number(data.time) >= Number(data.sub)) {
+          // 已经过了24点
+          let d = new Date();
+          const time = d.getHours();
+          const sub = (24 - time) * 1000 * 60 * 60;
+          localStorage.setItem(
+            "HDB_oneDay",
+            JSON.stringify({ sub, time: Date.now() })
+          );
+          await visitUserAPI();
+        }
+      } else {
+        let d = new Date();
+        const time = d.getHours();
+        const sub = (24 - time) * 1000 * 60 * 60;
+        localStorage.setItem(
+          "HDB_oneDay",
+          JSON.stringify({ sub, time: Date.now() })
+        );
+        await visitUserAPI();
+      }
+    }
   },
   created() {
     // 移动端和pc端的切换

+ 18 - 5
pc场景/src/utils/api.js

@@ -1,9 +1,22 @@
 import axios from './request'
-// 获取文物列表
-export const goodList = (data) => {
+// 访问量
+export const visitSceneAPI = () => {
   return axios({
-    method: 'post',
-    url: '/show/goods/list',
-    data
+    method: 'get',
+    url: '/api/show/visit/scene',
   })
 }
+// 访客量
+export const visitUserAPI = () => {
+  return axios({
+    method: 'get',
+    url: '/api/show/visit/user',
+  })
+}
+// 区域访问量
+export const visitZoneAPI = (type) => {
+  return axios({
+    method: 'get',
+    url: `/api/show/visit/zone/${type}`,
+  })
+}

+ 2 - 2
pc场景/src/utils/request.js

@@ -2,7 +2,7 @@ import axios from 'axios'
 const service = axios.create({
   // baseURL: 'http://192.168.0.135:8017', // 本地调试
   // baseURL: 'http://project.4dage.com:8017', // 线上调试
-  baseURL: '', // build
+  baseURL: process.env.NODE_ENV === "development" ? "https://haidebao.4dage.com" : "",
   timeout: 5000
 })
 // 请求拦截器
@@ -35,4 +35,4 @@ service.interceptors.response.use(function (response) {
   return Promise.reject(error)
 })
 
-export default service
+export default service

+ 16 - 16
pc场景/src/views/gui/compomemt/mapSvg.vue

@@ -1030,22 +1030,22 @@ export default {
     return {
       activeInd: null,
       data: [
-        { id: 1, name: "速霸CX 104-8+LYYL", locId: "" },
-        { id: 2, name: "速霸XL 75-7+L", locId: "" },
-        { id: 3, name: "速霸SX 102-4-P", locId: "" },
-        { id: 4, name: "数字工厂", locId: "" },
-        { id: 5, name: "印通工作流程中心", locId: "" },
-        { id: 6, name: "波拉自动裁切系统300", locId: "" },
-        { id: 7, name: "斯塔尔折页机KH 82-P", locId: "" },
-        { id: 8, name: "Versafire EP", locId: "" },
-        { id: 9, name: "Versafire EV", locId: "" },
-        { id: 10, name: "超霸106计算机直接制版机", locId: "" },
-        { id: 11, name: "海德堡效能管家", locId: "" },
-        { id: 12, name: "培训", locId: "" },
-        { id: 13, name: "咨询", locId: "" },
-        { id: 14, name: "捷拉斯", locId: "" },
-        { id: 15, name: "海德堡金融服务", locId: "" },
-        { id: 16, name: "直播间", locId: "" },
+        {type:'speedMasterCx', id: 1, name: "速霸CX 104-8+LYYL", locId: "" },
+        {type:'speedMasterXl', id: 2, name: "速霸XL 75-7+L", locId: "" },
+        {type:'speedMasterSx', id: 3, name: "速霸SX 102-4-P", locId: "" },
+        {type:'digitalFactory', id: 4, name: "数字工厂", locId: "" },
+        {type:'prinectCenter', id: 5, name: "印通工作流程中心", locId: "" },
+        {type:'polarCuttingSystem', id: 6, name: "波拉自动裁切系统300", locId: "" },
+        {type:'stahlfolderKh', id: 7, name: "斯塔尔折页机KH 82-P", locId: "" },
+        {type:'versafireEp', id: 8, name: "Versafire EP", locId: "" },
+        {type:'versafireEv', id: 9, name: "Versafire EV", locId: "" },
+        {type:'suprasetter', id: 10, name: "超霸106计算机直接制版机", locId: "" },
+        {type:'lifecycle', id: 11, name: "海德堡效能管家", locId: "" },
+        {type:'training', id: 12, name: "培训", locId: "" },
+        {type:'consultancy', id: 13, name: "咨询", locId: "" },
+        {type:'gallus', id: 14, name: "捷拉斯", locId: "" },
+        {type:'financialService', id: 15, name: "海德堡金融服务", locId: "" },
+        {type:'livestreamingRoom', id: 16, name: "直播间", locId: "" },
       ],
     };
   },

+ 57 - 17
pc场景/src/views/gui/compomemt/mapSvgEn.vue

@@ -1066,6 +1066,7 @@
 </template>
 
 <script>
+import {visitZoneAPI} from '@/utils/api'
 export default {
   components: {},
   props: {
@@ -1078,22 +1079,57 @@ export default {
     return {
       activeInd: null,
       data: [
-        { id: 1, name: "Speedmaster CX 104-8+LYYL", locId: "" },
-        { id: 2, name: "Speedmaster XL 75-7+L", locId: "" },
-        { id: 3, name: "Speedmaster SX 102-4-P", locId: "" },
-        { id: 4, name: "Digital Factory", locId: "" },
-        { id: 5, name: "Prinect Center", locId: "" },
-        { id: 6, name: "Polar Cutting System 300", locId: "" },
-        { id: 7, name: "Stahlfolder KH 82-P", locId: "" },
-        { id: 8, name: "Versafire EP", locId: "" },
-        { id: 9, name: "Versafire EV", locId: "" },
-        { id: 10, name: "Suprasetter 106", locId: "" },
-        { id: 11, name: "Lifecycle", locId: "" },
-        { id: 12, name: "Training", locId: "" },
-        { id: 13, name: "Consultancy", locId: "" },
-        { id: 14, name: "Gallus", locId: "" },
-        { id: 15, name: "Financial Service", locId: "" },
-        { id: 16, name: "Livestreaming Room", locId: "" },
+        {
+          type: "speedMasterCx",
+          id: 1,
+          name: "Speedmaster CX 104-8+LYYL",
+          locId: "",
+        },
+        {
+          type: "speedMasterXl",
+          id: 2,
+          name: "Speedmaster XL 75-7+L",
+          locId: "",
+        },
+        {
+          type: "speedMasterSx",
+          id: 3,
+          name: "Speedmaster SX 102-4-P",
+          locId: "",
+        },
+        { type: "digitalFactory", id: 4, name: "Digital Factory", locId: "" },
+        { type: "prinectCenter", id: 5, name: "Prinect Center", locId: "" },
+        {
+          type: "polarCuttingSystem",
+          id: 6,
+          name: "Polar Cutting System 300",
+          locId: "",
+        },
+        {
+          type: "stahlfolderKh",
+          id: 7,
+          name: "Stahlfolder KH 82-P",
+          locId: "",
+        },
+        { type: "versafireEp", id: 8, name: "Versafire EP", locId: "" },
+        { type: "versafireEv", id: 9, name: "Versafire EV", locId: "" },
+        { type: "suprasetter", id: 10, name: "Suprasetter 106", locId: "" },
+        { type: "lifecycle", id: 11, name: "Lifecycle", locId: "" },
+        { type: "training", id: 12, name: "Training", locId: "" },
+        { type: "consultancy", id: 13, name: "Consultancy", locId: "" },
+        { type: "gallus", id: 14, name: "Gallus", locId: "" },
+        {
+          type: "financialService",
+          id: 15,
+          name: "Financial Service",
+          locId: "",
+        },
+        {
+          type: "livestreamingRoom",
+          id: 16,
+          name: "Livestreaming Room",
+          locId: "",
+        },
       ],
     };
   },
@@ -1104,7 +1140,7 @@ export default {
     },
   },
   methods: {
-    moveFu(id) {
+   async moveFu(id) {
       // "ce13067e8cc247b983405502dc2577ae"
       // 移动到点位
       window.player.flyToPano({
@@ -1113,6 +1149,10 @@ export default {
         ],
       });
       this.activeInd = id;
+      // 通过id拿到type发送请求
+      const type =this.data.find(v=>v.id===id).type
+      // console.log('-------',type);
+      await visitZoneAPI(type)
     },
   },
   created() {},

+ 22 - 3
后台/src/pages/Z1Gather/index.tsx

@@ -78,6 +78,14 @@ function Z1Gather() {
     }
   }, []);
 
+  // 输入框只输入空格的非法校验
+  const inputCheckFu = useCallback((_: any, value: string) => {
+    if (value) {
+      const txt = value.replaceAll(" ", "");
+      return txt === "" ? Promise.reject("Invalid input!") : Promise.resolve();
+    } else return Promise.resolve();
+  }, []);
+
   return (
     <div className={styles.Z1Gather} id="Z1Gather">
       <div className="main">
@@ -93,7 +101,10 @@ function Z1Gather() {
             <Form.Item
               label="Name"
               name="name"
-              rules={[{ required: true, message: "not null!" }]}
+              rules={[
+                { required: true, message: "not null!" },
+                { validator: inputCheckFu },
+              ]}
               // getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
             >
               <Input maxLength={50} showCount placeholder="please enter" />
@@ -115,7 +126,10 @@ function Z1Gather() {
             <Form.Item
               label="Company Name"
               name="companyName"
-              rules={[{ required: true, message: "not null!" }]}
+              rules={[
+                { required: true, message: "not null!" },
+                { validator: inputCheckFu },
+              ]}
               // getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
             >
               <Input maxLength={50} showCount placeholder="please enter" />
@@ -126,6 +140,7 @@ function Z1Gather() {
               name="email"
               rules={[
                 { required: true, message: "not null!" },
+                { validator: inputCheckFu },
                 // {
                 //   pattern: /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(.[a-zA-Z0-9_-]+)+$/,
                 //   message: "Invalid input!",
@@ -153,6 +168,7 @@ function Z1Gather() {
               name="phone"
               rules={[
                 { required: true, message: "not null!" },
+                { validator: inputCheckFu },
                 // {
                 //   pattern:
                 //     /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/,
@@ -182,7 +198,10 @@ function Z1Gather() {
             <Form.Item
               label="Country"
               name="country"
-              rules={[{ required: true, message: "not null!" }]}
+              rules={[
+                { required: true, message: "not null!" },
+                { validator: inputCheckFu },
+              ]}
               // getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
             >
               <Input maxLength={50} showCount placeholder="please enter" />