From f91c4b0c2bd83c9078c0dd92851bd0c831090957 Mon Sep 17 00:00:00 2001
From: liuyg <liuyg@qq.com>
Date: Tue, 15 Feb 2022 17:27:17 +0800
Subject: [PATCH] +保按考试系统,动态提出滚动条,解决1366分辨率题目完成按钮点不到,改签到系统搜索栏和字段位置

---
 src/store/onresize.js |   37 +++++++++++++++++++++----------------
 1 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/src/store/onresize.js b/src/store/onresize.js
index da66589..436fe75 100644
--- a/src/store/onresize.js
+++ b/src/store/onresize.js
@@ -3,16 +3,21 @@
 
 // 设置 init 函数
 function init() {
-    if (_this) {
-        let innerWH = {
-            innerWidth: window.innerWidth,
-            innerHeight: window.innerHeight,
-        }
-        _this.$store.commit('setWindowSize', innerWH);
-        // console.log(' window.innerWidth', window.innerWidth);
-        // console.log(' window.innerHeight', window.innerHeight);
-
+  if (_this) {
+    let innerWH = {
+      innerWidth: window.innerWidth,
+      innerHeight: window.innerHeight,
     }
+    _this.$store.commit('setWindowSize', innerWH);
+    // console.log(' window.innerWidth', window.innerWidth);
+    // console.log(' window.innerHeight', window.innerHeight);
+    _this.$store.commit("setWindowSizeHeight", innerWH.innerHeight);
+    _this.$store.commit("setScreenSize", {
+      w: window.screen.width,
+      h: window.screen.height
+    });
+    _this.$store.dispatch("changeZoom");
+  }
 }
 
 // 节流 ms 触发间隔毫秒
@@ -20,7 +25,7 @@
 var lastClick = Date.now() - ms;
 // 初始化
 setTimeout(() => {
-    init();
+  init();
 }, 500);
 // 改变窗口大小时重新设置 rem
 // window.onresize = function () {
@@ -31,9 +36,9 @@
 //     }
 // }
 window.addEventListener('resize', () => {
-    // 节流 
-    if (Date.now() - lastClick >= ms) {
-        init();
-        lastClick = Date.now();
-    }
-}, false)
\ No newline at end of file
+  // 节流 
+  if (Date.now() - lastClick >= ms) {
+    init();
+    lastClick = Date.now();
+  }
+}, false)

--
Gitblit v1.9.3