Przeglądaj źródła

chore: 需求调整

chenlei 2 lat temu
rodzic
commit
744e4e0b07

+ 1 - 0
.eslintrc.js

@@ -18,5 +18,6 @@ module.exports = {
     "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
     "@typescript-eslint/no-explicit-any": "off",
     "vue/multi-word-component-names": "off",
+    "@typescript-eslint/ban-ts-comment": "off",
   },
 };

+ 109 - 0
public/_config.js

@@ -0,0 +1,109 @@
+// 场馆 Record<场馆id, string>
+museum = { 3: "苏州博物馆(本馆),苏州博物馆(西馆)" };
+
+// 接口地址
+VUE_APP_BACKEND_URL = "http://114.217.51.225:7077";
+
+// 云游景区
+cloudScenicUrl =
+  "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area" +
+  "?T=" +
+  Date.now();
+
+// 单位
+company = "江苏省文化和旅游厅";
+
+// 云游景区 url 配置
+SCENIC_MUSEUM_POS = [
+  {
+    id: 37,
+    name: "徐州市",
+    top: 133,
+    left: 317,
+    url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=320300",
+  },
+  {
+    id: 47,
+    name: "宿迁市",
+    left: 416,
+    top: 251,
+    url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=321300",
+  },
+  {
+    id: 41,
+    name: "连云港市",
+    left: 570,
+    top: 82,
+    url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=320700",
+  },
+  {
+    id: 42,
+    name: "淮安市",
+    left: 531,
+    top: 302,
+    url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=320800",
+  },
+  {
+    id: 43,
+    name: "盐城市",
+    top: 304,
+    left: 719,
+    url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=320900",
+  },
+  {
+    id: 44,
+    name: "扬州市",
+    left: 587,
+    top: 392,
+    url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=321000",
+  },
+  {
+    id: 46,
+    name: "泰州市",
+    left: 712,
+    top: 605,
+    url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=321200",
+  },
+  {
+    id: 35,
+    name: "南京市",
+    left: 422,
+    top: 690,
+    url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=320100",
+  },
+  {
+    id: 45,
+    name: "镇江市",
+    left: 583,
+    top: 675,
+    url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=321100",
+  },
+  {
+    id: 40,
+    name: "南通市",
+    left: 896,
+    top: 647,
+    url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=320600",
+  },
+  {
+    id: 38,
+    name: "常州市",
+    left: 633,
+    top: 800,
+    url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=320400",
+  },
+  {
+    id: 36,
+    name: "无锡市",
+    left: 767,
+    top: 819,
+    url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=320200",
+  },
+  {
+    id: 39,
+    name: "苏州市",
+    left: 888,
+    top: 859,
+    url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=320500",
+  },
+];

+ 28 - 28
public/config.js

@@ -2,7 +2,7 @@
 museum = { 3: "苏州博物馆(本馆),苏州博物馆(西馆)" };
 
 // 接口地址
-VUE_APP_BACKEND_URL = "http://114.217.51.225:7077";
+VUE_APP_BACKEND_URL = "http://192.168.20.245:8051";
 
 // 云游景区
 cloudScenicUrl =
@@ -11,99 +11,99 @@ cloudScenicUrl =
   Date.now();
 
 // 单位
-company = "珠海四维看看";
+company = "江苏省文化和旅游厅";
 
 // 云游景区 url 配置
 SCENIC_MUSEUM_POS = [
   {
     id: 37,
     name: "徐州市",
-    top: 133,
-    left: 317,
+    top: 136,
+    left: 300,
     url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=320300",
   },
   {
     id: 47,
     name: "宿迁市",
-    left: 416,
-    top: 251,
+    left: 400,
+    top: 227,
     url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=321300",
   },
   {
     id: 41,
     name: "连云港市",
-    left: 570,
-    top: 82,
+    left: 550,
+    top: 60,
     url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=320700",
   },
   {
     id: 42,
     name: "淮安市",
-    left: 531,
-    top: 302,
+    left: 525,
+    top: 270,
     url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=320800",
   },
   {
     id: 43,
     name: "盐城市",
-    top: 304,
-    left: 719,
+    top: 300,
+    left: 710,
     url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=320900",
   },
   {
     id: 44,
     name: "扬州市",
-    left: 587,
-    top: 392,
+    left: 570,
+    top: 380,
     url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=321000",
   },
   {
     id: 46,
     name: "泰州市",
-    left: 712,
-    top: 605,
+    left: 700,
+    top: 585,
     url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=321200",
   },
   {
     id: 35,
     name: "南京市",
-    left: 422,
-    top: 690,
+    left: 404,
+    top: 677,
     url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=320100",
   },
   {
     id: 45,
     name: "镇江市",
-    left: 583,
-    top: 675,
+    left: 555,
+    top: 665,
     url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=321100",
   },
   {
     id: 40,
     name: "南通市",
-    left: 896,
-    top: 647,
+    left: 882,
+    top: 616,
     url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=320600",
   },
   {
     id: 38,
     name: "常州市",
-    left: 633,
-    top: 800,
+    left: 610,
+    top: 770,
     url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=320400",
   },
   {
     id: 36,
     name: "无锡市",
-    left: 767,
-    top: 819,
+    left: 750,
+    top: 800,
     url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=320200",
   },
   {
     id: 39,
     name: "苏州市",
-    left: 888,
-    top: 859,
+    left: 875,
+    top: 800,
     url: "http://127.0.0.1:18080/ms-mechanism-bs/default/on-cloud-scenic-area?areaCode=320500",
   },
 ];

+ 8 - 5
src/App.vue

@@ -5,6 +5,7 @@
       @click="clearTimer"
       @touch="clearTimer"
       @touchmove="clearTimer"
+      @mousemove="clearTimer"
     >
       <keep-alive>
         <component :is="Component" />
@@ -12,7 +13,7 @@
     </router-view>
 
     <ScreenSavers
-      v-if="showScreenSavers"
+      v-if="showScreenSavers && screenList.length > 0"
       :autoPlay="autoPlay"
       :list="screenList"
       @onClick="closeScreen"
@@ -51,10 +52,12 @@ const getScreenConfig = async () => {
   const c = JSON.parse(data.config.content);
   autoPlay.value = c.autoPlay === "true";
   showScreenTime.value = Number(c.time);
-  screenList.value = data.img.map((i) => ({
-    ...i,
-    thumb: window.VUE_APP_BACKEND_URL + i.thumb,
-  }));
+  screenList.value = data.img
+    .filter((i) => i.display === 1)
+    .map((i) => ({
+      ...i,
+      thumb: window.VUE_APP_BACKEND_URL + i.thumb,
+    }));
 
   setInterval(() => {
     store.commit("setTime", store.state.time + 1);

+ 1 - 1
src/api/types.ts

@@ -35,5 +35,5 @@ export interface GetExhibitListApiRequest {
 
 export interface GetScreenConfigApiResponse {
   config: { content: string };
-  img: { id: number; thumb: string }[];
+  img: { id: number; thumb: string; display: 1 | 0 }[];
 }

+ 4 - 4
src/background.ts

@@ -17,12 +17,12 @@ async function createWindow() {
     width: 800,
     height: 600,
     fullscreen: true,
+    frame: isDevelopment,
     webPreferences: {
       // Use pluginOptions.nodeIntegration, leave this alone
       // See nklayman.github.io/vue-cli-plugin-electron-builder/guide/security.html#node-integration for more info
-      nodeIntegration: process.env
-        .ELECTRON_NODE_INTEGRATION as unknown as boolean,
-      contextIsolation: !process.env.ELECTRON_NODE_INTEGRATION,
+      nodeIntegration: true,
+      contextIsolation: false,
       webSecurity: false,
     },
     icon: path.join(__dirname, "./public/imgs/app.png"),
@@ -38,7 +38,7 @@ async function createWindow() {
     win.loadURL("app://./index.html");
   }
 
-  win.setMenu(null);
+  // win.setMenu(null);
 
   globalShortcut.register("CommandOrControl+Shift+i", () => {
     win.webContents.openDevTools();

+ 10 - 0
src/utils/open-keyboard.ts

@@ -0,0 +1,10 @@
+const { exec } = window.require("child_process");
+const os = window.require("os");
+
+export const OpenVirtualKeyBoard = () => {
+  if (os.platform() === "win32") {
+    exec("osk.exe");
+  } else {
+    exec("onboard");
+  }
+};

+ 2 - 0
src/views/cloud-museum/index.scss

@@ -85,6 +85,8 @@
     &__item {
       position: relative;
       cursor: pointer;
+      min-width: 0.9375rem /* 75/80 */;
+      text-align: center;
 
       &.active {
         font-family: Source Han Serif CN-Bold;

+ 17 - 2
src/views/cloud-museum/index.vue

@@ -2,7 +2,11 @@
   <div v-loading="loading" class="cloud-museum">
     <BackBtn />
 
-    <div v-infinite-scroll="load" :infinite-scroll-delay="500" class="list">
+    <div
+      v-infinite-scroll="load"
+      :infinite-scroll-delay="500"
+      style="position: relative"
+    >
       <div class="cloud-museum__title">云上博物</div>
 
       <div class="cloud-museum__search">
@@ -10,7 +14,8 @@
           v-model="searchKey"
           clearable
           placeholder="请输入关键词"
-          @clear="getCityMuseumList"
+          @clear="handleClear"
+          @click="handleFocus"
         />
         <div class="btn" @click="handleSearch" />
       </div>
@@ -69,6 +74,7 @@ import { onActivated, ref } from "vue";
 import Card from "./components/card.vue";
 import { useRoute, useRouter } from "vue-router";
 import "./index.scss";
+import { OpenVirtualKeyBoard } from "@/utils/open-keyboard";
 
 const loading = ref(false);
 const pLoading = ref(false);
@@ -138,6 +144,15 @@ const resetPage = () => {
   total = 0;
 };
 
+const handleClear = () => {
+  resetPage();
+  getCityMuseumList();
+};
+
+const handleFocus = () => {
+  OpenVirtualKeyBoard();
+};
+
 const getCityMuseumList = async (load?: boolean) => {
   const params: GetCityMuseumListApiRequest = {
     pageSize,

+ 3 - 0
src/views/iframe/index.vue

@@ -29,6 +29,9 @@ const goBack = (e: MessageEvent<any>) => {
 onActivated(() => {
   window.addEventListener("message", goBack);
   iframeRef.value.onload = () => {
+    iframeRef.value.contentWindow.addEventListener("mousedown", () => {
+      store.dispatch("clearTime");
+    });
     iframeRef.value.contentWindow.addEventListener("touchmove", () => {
       store.dispatch("clearTime");
     });

+ 32 - 4
src/views/venue-reservation/index.vue

@@ -52,17 +52,26 @@
               class="vr-visitor__item"
             >
               <div class="vr-input">
-                <el-input v-model="item.name" placeholder="请输入姓名" />
+                <el-input
+                  v-model="item.name"
+                  placeholder="请输入姓名"
+                  @click="handleFocus"
+                />
               </div>
               <div class="vr-input">
                 <el-input
                   v-model="item.phone"
                   placeholder="请输入手机号"
                   type="number"
+                  @click="handleFocus"
                 />
               </div>
               <div class="vr-input">
-                <el-input v-model="item.idcard" placeholder="请输入身份证号" />
+                <el-input
+                  v-model="item.idcard"
+                  placeholder="请输入身份证号"
+                  @click="handleFocus"
+                />
               </div>
 
               <div
@@ -72,7 +81,11 @@
               />
             </div>
 
-            <div class="vr-visitor__add" @click="addVisitor" />
+            <div
+              v-if="visitorList.length < 5"
+              class="vr-visitor__add"
+              @click="addVisitor"
+            />
           </div>
         </el-form-item>
         <el-form-item label="预约时间">
@@ -124,8 +137,10 @@
               v-model="form.description"
               resize="none"
               :rows="3"
+              :maxlength="200"
               type="textarea"
               placeholder="请输入备注"
+              @click="handleFocus"
             />
           </div>
         </el-form-item>
@@ -153,6 +168,7 @@ import DYHImg from "./imgs/img_yangzhou.jpg";
 import SZImg from "./imgs/img_suzhou.jpg";
 
 import "./index.scss";
+import { OpenVirtualKeyBoard } from "@/utils/open-keyboard";
 
 type DateType = {
   label: string;
@@ -233,6 +249,10 @@ watch(venues, (list) => {
   form.venues = list[0];
 });
 
+const handleFocus = () => {
+  OpenVirtualKeyBoard();
+};
+
 const clear = () => {
   Object.assign(form, {
     ...DEFAULT_FORM,
@@ -240,6 +260,7 @@ const clear = () => {
     venues: venues.value[0],
     exhibitionName: MUSEUM_LIST[0].name,
   });
+  bookDay.value = "";
   visitorList.length = 0;
   visitorList.push({ ...DEFAULT_VISITOR });
   curExhibitionId.value = MUSEUM_LIST[0].id;
@@ -275,7 +296,7 @@ const initDate = () => {
 };
 
 function checkTelephone(telephone: string) {
-  var reg = /^[1][3,4,5,7,8][0-9]{9}$/;
+  var reg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
   return reg.test(telephone);
 }
 
@@ -285,6 +306,13 @@ function checkIdCard(idCard: string) {
 }
 
 const submit = async () => {
+  if (!form.bookDay && !bookDay.value) {
+    dialogErrType.value = false;
+    dialogText.value = "请选择预约时间";
+    dialogVisible.value = true;
+    return;
+  }
+
   if (!formRef.value || !(await formRef.value.validate())) return;
 
   for (let i = 0; i < visitorList.length; i++) {

+ 50 - 1
src/views/ver-scroll-home/index.vue

@@ -5,6 +5,9 @@
       @touchstart="onTouchstart"
       @touchmove="onTouchmove"
       @touchend="onTouchend"
+      @mousedown="onMousedown"
+      @mousemove="onMousemove"
+      @mouseup="onMouseup"
     >
       <div
         class="swiper-wrapper"
@@ -13,8 +16,8 @@
           transform: `translateY(${translateY}px)`,
         }"
       >
-        <ScenicHome />
         <Home />
+        <ScenicHome />
       </div>
     </div>
 
@@ -90,6 +93,52 @@ const menuList = computed(() => [
 ]);
 const translateY = ref(0);
 
+const onMousedown = (e: MouseEvent) => {
+  startY = e.screenY;
+  scroll = true;
+};
+const onMousemove = (e: MouseEvent) => {
+  if (!scroll) return;
+
+  moveY = e.screenY - startY;
+
+  if (
+    (curIndex.value === 0 && moveY > 0) ||
+    (curIndex.value === 1 && moveY < 0)
+  )
+    return;
+
+  translateY.value = _moveY + moveY;
+};
+const onMouseup = () => {
+  scroll = false;
+  animation.value = true;
+  if (curIndex.value === 0) {
+    if (moveY < -250) {
+      translateY.value = -innerHeight;
+      curIndex.value = 1;
+      _moveY = -innerHeight;
+      return;
+    }
+    translateY.value = 0;
+    curIndex.value = 0;
+    _moveY = 0;
+  } else {
+    if (moveY > 250) {
+      translateY.value = 0;
+      curIndex.value = 0;
+      _moveY = 0;
+      return;
+    }
+    translateY.value = -innerHeight;
+    curIndex.value = 1;
+    _moveY = -innerHeight;
+  }
+  setTimeout(() => {
+    animation.value = false;
+  }, 200);
+};
+
 const onTouchstart = (e: TouchEvent) => {
   startY = e.changedTouches[0].screenY;
   scroll = true;