Browse Source

日常开发

林旭祥 7 months ago
parent
commit
f159e5c166
2 changed files with 11 additions and 1 deletions
  1. 2 1
      src/views/gesture/index.vue
  2. 9 0
      src/views/home/index.vue

+ 2 - 1
src/views/gesture/index.vue

@@ -33,6 +33,7 @@ import { Navigation } from 'swiper/modules';
 import 'swiper/css';
 import 'swiper/scss/navigation';
 const router = useRouter();
+const route = useRoute();
 const { proxy } = getCurrentInstance() as any;
 const optionWindowRef = ref();
 const mySwiper = ref();
@@ -209,7 +210,7 @@ onBeforeMount(() => {
     //发送设备
     if (e?.wksid) {
       console.log("e.wksid", e.wksid)
-      startDevice({ deviceid: '53986765' })
+      startDevice({ deviceid: route.query.deviceid })
     }
     //接收百度语音token
     if (e?.bdapi_token) {

+ 9 - 0
src/views/home/index.vue

@@ -55,6 +55,15 @@ const getJump = (url: string, name: string) => {
       }
     }).finally(() => {
     });
+  } else if (url == '/gesture') {
+    proxy?.$modal.prompt('请输入设备码').then((e: any) => {
+      // console.log("e", e)
+      if (e.action == 'confirm' && e.value) {
+
+        router.push({ path: url, query: { deviceid: e.value } });
+      }
+    }).finally(() => {
+    });
   } else {
     router.push({ path: url });
   }