wjx 1 ano atrás
pai
commit
3496cc590e
3 arquivos alterados com 9 adições e 2 exclusões
  1. 6 0
      src/App.tsx
  2. 0 2
      src/components/floatingWindow.tsx
  3. 3 0
      src/index.css

+ 6 - 0
src/App.tsx

@@ -46,11 +46,17 @@ function App() {
 			dispatch({ type: 'setOrientation', params: { orientation: orientationType } })
 		}
 		handleOrientationChange()
+		function handlePopstate () {
+			window.history.pushState(null, '');
+		}
+		handlePopstate()
 		// 添加事件监听器
 		window.addEventListener("resize", handleOrientationChange);
+		window.addEventListener("popstate", handlePopstate);
 		// 组件卸载时移除事件监听器
 		return () => {
 			window.removeEventListener("resize", handleOrientationChange);
+			window.removeEventListener("popstate", handlePopstate);
 		};
 	}, [])
 

+ 0 - 2
src/components/floatingWindow.tsx

@@ -51,9 +51,7 @@ const FloatingWindow: React.FC<Props> = ({ isVer, onClick }) => {
     const handleMouseUp = (e: any) => {
         setIsDragging(false);
         if (new Date().getTime() - nowTimer < 200) {
-            setNowTimer(0)
             onClick?.(e)
-            return
         }
         setNowTimer(0)
         let drawW = size?.width || 0;

+ 3 - 0
src/index.css

@@ -23,6 +23,9 @@ body {
   place-items: center;
   min-width: 100%;
   min-height: 100vh;
+  /* 禁止触发默认的手势操作,微信浏览器下拉动作 */
+  touch-action: none;
+  overflow: hidden;
 }
 
 .loadingPop {