chenlei 2 лет назад
Родитель
Сommit
049ff34be9

+ 0 - 1
components.d.ts

@@ -17,7 +17,6 @@ declare module 'vue' {
     ElFormItem: typeof import('element-plus/es')['ElFormItem']
     ElImage: typeof import('element-plus/es')['ElImage']
     ElInput: typeof import('element-plus/es')['ElInput']
-    ElProgress: typeof import('element-plus/es')['ElProgress']
     RouterLink: typeof import('vue-router')['RouterLink']
     RouterView: typeof import('vue-router')['RouterView']
     ScreenSavers: typeof import('./src/components/screen-savers/index.vue')['default']

+ 3 - 0
public/config.js

@@ -10,6 +10,9 @@ openCloudApi = false;
 // 接口地址
 VUE_APP_BACKEND_URL = "http://192.168.20.245:8051";
 
+// 场馆预约
+venueReservationUrl = "";
+
 // 云游景区
 cloudScenicUrl =
   "http://192.168.9.78:18080/ms-mechanism-bs/default/on-cloud-scenic-area" +

+ 0 - 80
public/limit.json

@@ -1,80 +0,0 @@
-{
-  "江苏省文化和旅游厅": {
-    "南京博物院": {
-      "2023-08-15": 20,
-      "2023-08-16": 20,
-      "2023-08-17": 20,
-      "2023-08-18": 20,
-      "2023-08-19": 50,
-      "2023-08-20": 50,
-      "2023-08-22": 20,
-      "2023-08-23": 20,
-      "2023-08-24": 20,
-      "2023-08-25": 20,
-      "2023-08-26": 50,
-      "2023-08-27": 50,
-      "2023-08-29": 20,
-      "2023-08-30": 20,
-      "2023-08-31": 20,
-      "2023-09-01": 20,
-      "2023-09-02": 50,
-      "2023-09-03": 50,
-      "2023-09-05": 20,
-      "2023-09-06": 20,
-      "2023-09-07": 20,
-      "2023-09-08": 20,
-      "2023-09-09": 50,
-      "2023-09-10": 50,
-      "2023-09-12": 20,
-      "2023-09-13": 20,
-      "2023-09-14": 20,
-      "2023-09-15": 20,
-      "2023-09-16": 50,
-      "2023-09-17": 50,
-      "2023-09-19": 20,
-      "2023-09-20": 20,
-      "2023-09-21": 20,
-      "2023-09-22": 20,
-      "2023-09-23": 50,
-      "2023-09-24": 50
-    },
-    "扬州中国大运河博物馆": {
-      "2023-08-15": 15,
-      "2023-08-16": 15,
-      "2023-08-17": 15,
-      "2023-08-18": 15,
-      "2023-08-19": 30,
-      "2023-08-20": 30,
-      "2023-08-22": 15,
-      "2023-08-23": 15,
-      "2023-08-24": 15,
-      "2023-08-25": 15,
-      "2023-08-26": 30,
-      "2023-08-27": 30,
-      "2023-08-29": 15,
-      "2023-08-30": 15,
-      "2023-08-31": 15,
-      "2023-09-01": 15,
-      "2023-09-02": 30,
-      "2023-09-03": 30,
-      "2023-09-05": 15,
-      "2023-09-06": 15,
-      "2023-09-07": 15,
-      "2023-09-08": 15,
-      "2023-09-09": 30,
-      "2023-09-10": 30,
-      "2023-09-12": 15,
-      "2023-09-13": 15,
-      "2023-09-14": 15,
-      "2023-09-15": 15,
-      "2023-09-16": 30,
-      "2023-09-17": 30,
-      "2023-09-19": 15,
-      "2023-09-20": 15,
-      "2023-09-21": 15,
-      "2023-09-22": 15,
-      "2023-09-23": 30,
-      "2023-09-24": 30
-    }
-  }
-}

+ 3 - 3
src/App.vue

@@ -19,7 +19,7 @@
       @onClick="closeScreen"
     />
 
-    <el-dialog
+    <!-- <el-dialog
       title="正在更新新版本,请稍候..."
       v-model="versionDialog"
       width="60%"
@@ -27,7 +27,7 @@
       :close-on-press-escape="false"
       :show-close="false"
       center
-    >
+      >
       <div style="height: 20vh; line-height: 20vh; text-align: center">
         <el-progress
           status="success"
@@ -38,7 +38,7 @@
           :show-text="true"
         />
       </div>
-    </el-dialog>
+    </el-dialog> -->
   </el-config-provider>
 </template>
 

+ 1 - 0
src/global.d.ts

@@ -12,6 +12,7 @@ interface Window {
   }[];
   VUE_APP_BACKEND_URL: string;
   venueDebug: boolean;
+  venueReservationUrl: string;
   openCloudApi: boolean;
   MUSEUM_LIST_TIME: Record<number, string[]>;
 }

+ 4 - 1
src/utils/update.js

@@ -66,7 +66,10 @@ export function updateHandle(window, feedUrl) {
   ipcMain.on("checkForUpdate", (e, arg) => {
     //执行自动更新检查
     // sendUpdateMessage({ cmd: "checkForUpdate", message: arg });
-    autoUpdater.checkForUpdates();
+    autoUpdater.checkForUpdatesAndNotify({
+      body: "新版本已经下载完成,重启应用将会自动更新",
+      title: "发现更新",
+    });
   });
 }
 

+ 19 - 3
src/views/venue-reservation/form-2.vue

@@ -76,7 +76,9 @@
             剩余可预约人数:{{ maxVisitorNum }}
           </p>
         </template>
-        <p v-else class="form-error-tips">该日期已被约满,请选择其他日期</p>
+        <p v-else-if="!configLoading" class="form-error-tips">
+          该日期已被约满,请选择其他日期
+        </p>
       </el-form-item>
 
       <el-form-item v-if="form.bookDay && maxVisitorNum > 0" label="参观人员">
@@ -175,9 +177,12 @@ const DEFAULT_FORM = {
 };
 
 const loading = ref(false);
+/** 展馆配置是否加载中 */
+const configLoading = ref(false);
 const dateList = ref<DateType[]>([]);
 const formRef = ref<FormInstance>();
 const form = reactive({ ...DEFAULT_FORM });
+/** 最大参观人数 */
 const maxVisitorNum = ref(0);
 const rules = reactive<FormRules>({
   exhibitionName: [
@@ -189,12 +194,16 @@ const rules = reactive<FormRules>({
     { required: true, message: "请选择预约时段", trigger: "blur" },
   ],
 });
+/** 当前展馆id */
 const curExhibitionId = ref(0);
+/** 展馆可预约日期配置 */
 const exhibitionConfig = ref<null | GetExhibitionConfigApiResponse>(null);
+/** 展馆列表 */
 const venues = computed(() => {
   const str = window.museum[curExhibitionId.value];
   return str ? str.split(",") : [];
 });
+/** 入馆时段列表 */
 const timeAreaList = computed(() => {
   const date = dateList.value.find((i) => i.value === form.bookDay);
   return exhibitionConfig.value && date
@@ -203,6 +212,7 @@ const timeAreaList = computed(() => {
         .map((i) => i.timeScope)
     : [];
 });
+/** 存在时间段的日期 */
 const hasTimeAreaWeeks = computed(() =>
   Array.from(
     new Set(
@@ -212,6 +222,7 @@ const hasTimeAreaWeeks = computed(() =>
     )
   )
 );
+/** 参观人员 */
 const visitorList = reactive<
   {
     id: number;
@@ -318,7 +329,7 @@ const handleFocus = () => {
   OpenVirtualKeyBoard();
 };
 
-const handleDate = (item: DateType) => {
+const handleDate = async (item: DateType) => {
   if (item.value === form.bookDay) return;
 
   if (
@@ -326,10 +337,15 @@ const handleDate = (item: DateType) => {
     hasTimeAreaWeeks.value.includes(item.week + "") &&
     !exhibitionConfig.value?.unableDate.includes(item.value)
   ) {
+    configLoading.value = true;
     form.bookDay = item.value;
     form.bootTimeScope = "";
 
-    getVenueNum();
+    try {
+      await getVenueNum();
+    } finally {
+      configLoading.value = false;
+    }
   }
 };
 

+ 8 - 0
src/views/ver-scroll-home/index.vue

@@ -126,6 +126,14 @@ const menuList = computed(() => [
         } else if (window.venueDebug || !online) {
           dialogText.value = !online ? "网络异常" : "预约功能调试中";
           dialogVisible.value = true;
+        } else if (window.venueReservationUrl) {
+          router.push({
+            name: "iframe",
+            params: {
+              url: encodeURIComponent(window.venueReservationUrl),
+              showBtn: 0,
+            },
+          });
         } else {
           router.push({ name: "venueReservation" });
         }