From 2cddcc5f2e4ce21526980d9e9d7c7972ba51fcb8 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 19 Mar 2021 16:57:58 +0800
Subject: [PATCH] 逻辑处理部分
---
src/views/realTimePolice/real.vue | 77 +++++++++++++++++++++-----------------
1 files changed, 42 insertions(+), 35 deletions(-)
diff --git a/src/views/realTimePolice/real.vue b/src/views/realTimePolice/real.vue
index 330dfcd..cf5395b 100644
--- a/src/views/realTimePolice/real.vue
+++ b/src/views/realTimePolice/real.vue
@@ -2,7 +2,7 @@
* @Author: Morpheus
* @Date: 2021-03-17 15:21:33
* @Last Modified by: Morpheus
- * @Last Modified time: 2021-03-19 15:21:40
+ * @Last Modified time: 2021-03-19 16:56:35
*/
<template>
<basic-container>
@@ -797,12 +797,18 @@
...params,
};
- console.log(this.$router.query, 111)
+ console.log(this.$router.query, 111);
- params = {
- alarmType:this.$router.query.alarmType
+ if (
+ this.$router.query &&
+ this.$router.query != null &&
+ this.$router.query != ""
+ ) {
+ params = {
+ alarmType: this.$router.query.alarmType,
+ };
}
-
+
if (releaseTimeRange) {
values = {
...params,
@@ -1163,7 +1169,6 @@
// });
});
},
-
closeRealVideoBox() {
var dom = document.getElementById("video_conversation");
@@ -1197,9 +1202,9 @@
},
});
var that = this;
- setInterval(() => {
- // 一键呼叫相关函数
- Recorder.getPermission().then(() => {
+ Recorder.getPermission().then(() => {
+ setInterval(() => {
+ // 一键呼叫相关函数
that.recorder.start().then(() => {
// 开始录音
newCallAxios
@@ -1213,37 +1218,39 @@
}
)
.then((result) => {
- var formData = new FormData();
- var blob = that.recorder.getPCMBlob(); //获取pcm格式音频数据
- //此处获取到blob对象后需要设置fileName满足当前项目上传需求,其它项目可直接传把blob作为file塞入formData
- var newbolb = new Blob([blob], { type: "audio/pcm" });
- var fileOfBlob = new File(
- [newbolb],
- new Date().getTime() + ".pcm"
- );
- formData.append("file", fileOfBlob);
+ setTimeout(() => {
+ var formData = new FormData();
+ var blob = that.recorder.getPCMBlob(); //获取pcm格式音频数据
+ //此处获取到blob对象后需要设置fileName满足当前项目上传需求,其它项目可直接传把blob作为file塞入formData
+ var newbolb = new Blob([blob], { type: "audio/pcm" });
+ var fileOfBlob = new File(
+ [newbolb],
+ new Date().getTime() + ".pcm"
+ );
+ formData.append("file", fileOfBlob);
- // var dom = document.getElementById("real_audio");
- // dom.setAttribute("src", URL.createObjectURL(blob));
+ // var dom = document.getElementById("real_audio");
+ // dom.setAttribute("src", URL.createObjectURL(blob));
- // this.recorder.play();
+ // this.recorder.play();
- newCallAxios
- .post(`/api_control`, blob, {
- params: {
- param: {
- PktType: "Talk",
- accessToken: result.data.data.accessToken,
- // deviceCode: form.channelNumber,
- deviceCode: "001231663A45",
+ newCallAxios
+ .post(`/api_control`, blob, {
+ params: {
+ param: {
+ PktType: "Talk",
+ accessToken: result.data.data.accessToken,
+ // deviceCode: form.channelNumber,
+ deviceCode: "001231663A45",
+ },
},
- },
- })
- .then((result) => {});
+ })
+ .then((result) => {});
+ }, 10000);
});
});
- });
- }, 5000);
+ }, 5000);
+ });
},
aKeyToCall111(e, form) {
@@ -1300,7 +1307,7 @@
});
});
});
-
+
// 一键呼叫相关函数
}, 200000);
},
--
Gitblit v1.9.3