|
@@ -107,6 +107,7 @@ export default {
|
|
|
computed: {},
|
|
|
methods: {
|
|
|
authorizeIot() {
|
|
|
+ this.hanledList("Voice");
|
|
|
this.sn = this.clientId;
|
|
|
this.alarmModel = false;
|
|
|
// const { name, sn, voipDevices } = this;
|
|
@@ -173,11 +174,13 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
handleAlarm() {
|
|
|
+ this.hanledList("noVoice");
|
|
|
this.alarmModel = false;
|
|
|
},
|
|
|
// voip相关方法
|
|
|
async getVoipDevices() {
|
|
|
const { list } = await getDeviceVoIPList();
|
|
|
+ console.log("getDeviceVoIPList:", list);
|
|
|
if (list && list.length > 0) {
|
|
|
const authorizeFlag = list.some(
|
|
|
(item) => item.sn === this.clientId
|
|
@@ -185,6 +188,9 @@ export default {
|
|
|
console.log("authorizeFlag:", list, authorizeFlag);
|
|
|
this.authorizeFlag = authorizeFlag;
|
|
|
}
|
|
|
+ if (!list || list.length === 0) {
|
|
|
+ this.authorizeFlag = false;
|
|
|
+ }
|
|
|
if (typeof list === "object") {
|
|
|
this.voipDevices = list;
|
|
|
}
|
|
@@ -250,6 +256,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
async gotoCallPage() {
|
|
|
+ this.hanledList("Voice");
|
|
|
wx.showToast({
|
|
|
title: "通话加载中...",
|
|
|
icon: "loading",
|
|
@@ -492,12 +499,36 @@ export default {
|
|
|
const minutes = now.getMinutes().toString().padStart(2, "0");
|
|
|
const formattedTime = `${year}-${month}-${day} ${hours}:${minutes}`;
|
|
|
this.nowTime = formattedTime;
|
|
|
+ console.log("isWmpf:", isWmpf);
|
|
|
if (!isWmpf) {
|
|
|
+ console.log("isWmpf:", isWmpf);
|
|
|
this.getVoipDevices();
|
|
|
}
|
|
|
console.log("接收到消息:", topic, data);
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ hanledList(type) {
|
|
|
+ this.$http
|
|
|
+ .get(`wap/event/handleEvent/${this.eventListId}`)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ if (type === "noVoice") {
|
|
|
+ uni.showToast({
|
|
|
+ title: "已处理",
|
|
|
+ icon: "success",
|
|
|
+ duration: 1500,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: "处理失败",
|
|
|
+ icon: "none",
|
|
|
+ duration: 1500,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
beforeMount() {
|
|
|
if (uni.getStorageSync("userId")) {
|