Sfoglia il codice sorgente

提交报警弹窗

wangming 2 mesi fa
parent
commit
bad3e7fbf6

+ 5 - 1
src/components/component/alarModel.vue

@@ -494,6 +494,10 @@ export default {
             client.on("close", () => {});
 
             client.on("message", (topic, message) => {
+                let userId = uni.getStorageSync("userId");
+                const noticeMatch = /^\/mps\/wx_(.+)\/notice$/;
+                const match = topic.match(noticeMatch);
+                if (!match) return;
                 this.alarmModel = true;
                 const data = JSON.parse(message.toString());
                 this.clientId = data.clientId;
@@ -501,7 +505,7 @@ export default {
                 this.sn = data.clientId;
                 this.eventListId = data.eventListId;
 
-                console.log(data, "接收到消息222:");
+                console.log(data, topic, "接收到消息222:");
                 console.log(
                     "接收到消息:",
                     this.clientId,

+ 7 - 0
src/pagesA/adDevice/adDevice.vue

@@ -492,6 +492,13 @@ export default {
             });
         },
         startDisNet() {
+            if (!this.clientId) {
+                uni.showModal({
+                    content: "请先扫描设备二维码",
+                    showCancel: false,
+                });
+                return;
+            }
             if (!this.wifiName) {
                 uni.showModal({
                     content: "请连接无线网络,连接后点击刷新",

+ 2 - 2
src/pagesA/my/my.vue

@@ -27,7 +27,7 @@
                     <image src="../../static/arrTwo.png" mode="" />
                 </view>
             </view>
-            <!-- <view class="menu-item" @click="serverchange()">
+            <view class="menu-item" @click="serverchange()">
                 <view class="meanLeft">
                     <image src="../../static/setting.png" mode="" />
                     <text>网络配置</text>
@@ -35,7 +35,7 @@
                 <view class="meanRight">
                     <image src="../../static/arrTwo.png" mode="" />
                 </view>
-            </view> -->
+            </view>
             <view class="menu-item" @click="deaAccount()">
                 <view class="meanLeft">
                     <image src="../../static/logoff.png" mode="" />