Jelajahi Sumber

fix: 1.解决扫码框不显示的问题

suwenjiang 1 bulan lalu
induk
melakukan
e34ed6e507
2 mengubah file dengan 12 tambahan dan 10 penghapusan
  1. 7 5
      .env.development
  2. 5 5
      src/pages/scan/index.vue

+ 7 - 5
.env.development

@@ -1,9 +1,11 @@
 VITE_APP_ENV=development
 
 # VITE_APP_BASE_URL=https://service.xiaoyaotravel.com/api/
-# VITE_APP_BASE_URL=http://101.126.146.250:8082/
-# VITE_APP_IM_URL=ws://101.126.146.250:8082/system/message
-# # 测试服
+VITE_APP_BASE_URL=http://101.126.146.250:8082/
+VITE_APP_IM_URL=ws://101.126.146.250:8082/system/message
+
+
+# 测试服
 
 
 
@@ -19,8 +21,8 @@ VITE_APP_ENV=development
 # 本地socoket
 # VITE_APP_IM_URL=ws://192.168.1.44:8082/system/message
 # 花生壳
-VITE_APP_BASE_URL=http://q9943037p3.goho.co
-VITE_APP_IM_URL=ws://q9943037p3.goho.co/system/message
+# VITE_APP_BASE_URL=http://q9943037p3.goho.co
+# VITE_APP_IM_URL=ws://q9943037p3.goho.co/system/message
 
 # 张维本地
 # VITE_APP_BASE_URL=http://192.168.1.73:8082/

+ 5 - 5
src/pages/scan/index.vue

@@ -37,11 +37,11 @@ const openQrcode = async () => {
           height: 250
         },
         videoConstraints: {
-          // width: window.visualViewport.width,
-          width: 375,
-          aspectRatio: 6 / 18
-          // aspectRatio: window.visualViewport.height / window.visualViewport.width
-        }
+          width: window.visualViewport.width, // 框宽的
+          height: '100%', // 框高的
+          aspectRatio: 5 / 5
+        },
+        aspectRatio: window.visualViewport.width / window.visualViewport.height // 视频的宽高
       }
       if (devices && devices.length) {
         // 当前环境下能识别出摄像头,并且摄像头的数据可能不止一个