xiaohaizhao 8 mesi fa
parent
commit
90855108f0

+ 8 - 3
Bluetooth/index/index.vue

@@ -119,8 +119,13 @@ export default {
     startBluetooth(services = []) {
       let that = this;
       uni.onBluetoothDeviceFound(function ({ devices }) {
-        that.devices = that.devices.concat(devices);
-        that.empty = devices.length == 0;
+        try {
+          if (devices[0].name.includes("IBP")) {
+            console.log("IBP开头的蓝牙设备", devices[0]);
+            that.devices = that.devices.concat(devices);
+          }
+        } catch (error) {}
+        that.empty = that.devices.length == 0;
       });
       uni.startBluetoothDevicesDiscovery({
         // services,
@@ -171,7 +176,7 @@ export default {
                   let services = res.services.find(
                     (v) => v.uuid.split("-")[0] == "0000FFE0"
                   );
-                  
+
                   try {
                     uni.setBLEMTU({
                       deviceId: item.deviceId,

+ 67 - 0
control/components/prodnum-FW01/modules/Identity.vue

@@ -0,0 +1,67 @@
+<template>
+  <view class="reset" v-if="ctrlModel.funcname">
+    <view class="update-line">
+      <view class="label">
+        {{ ctrlModel.funcname }}
+      </view>
+      <view
+        class="content"
+        hover-class="navigator-hover"
+        @click="onClick(ctrlModel)"
+        >验证
+      </view>
+    </view>
+    <My_input ref="MyInput" />
+  </view>
+</template>
+<script>
+export default {
+  name: "Identity",
+  data() {
+    return {
+      ctrlModel: {},
+    };
+  },
+  methods: {
+    onClick() {
+      let that = this;
+      uni.showModal({
+        title: "提示",
+        content: "确定验证身份吗?",
+        success: ({ confirm }) => {
+          if (confirm) {
+            that.$refs.MyInput.submit(that.ctrlModel.w_functionid, {E013:this.bluetoothcode});
+          }
+        },
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.reset {
+  margin-bottom: 12px;
+
+  .update-line {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    .label {
+      font-size: 3.7333333333333vw;
+      color: #fff;
+      font-weight: bold;
+      text-indent: 1.6vw;
+    }
+
+    .content {
+      background-color: #004a92;
+      font-size: 12px;
+      padding: 4px 8px;
+      border-radius: 4px;
+      box-sizing: border-box;
+      color: #fff;
+    }
+  }
+}
+</style>

+ 11 - 3
control/components/prodnum-FW01/prodnum-FW01.vue

@@ -1,6 +1,7 @@
 <template>
   <view>
     <view style="height: 20px" />
+    <Identity ref="Identity" />
     <basics ref="basics" />
     <pilotLamp ref="pilotLamp" itemW="21%" />
     <view class="control-title">设备参数</view>
@@ -14,14 +15,21 @@ import controlPanel from "../prodnum-YK01/modules/controlPanel.vue";
 import preview from "../prodnum-YK01/modules/preview.vue";
 import pilotLamp from "../prodnum-MT03/modules/pilotLamp.vue";
 import basics from "./modules/basics.vue";
+import Identity from "./modules/Identity.vue";
+
 export default {
   name: "prodnum-FW01",
-  components: { controlPanel, pilotLamp, preview, basics },
+  components: { controlPanel, pilotLamp, preview, Identity, basics },
   props: {
     control: Object,
   },
   watch: {
     control: function (newVal) {
+      this.$refs.Identity.ctrlModel = this.__proto__.getControlItem(
+        ["身份验证"],
+        newVal
+      )[0];
+      this.$refs.Identity.bluetoothcode = newVal.bluetoothcode;
       if (newVal) {
         try {
           this.$refs.preview.list = [
@@ -34,7 +42,7 @@ export default {
 
         try {
           this.$refs.mpattern.itemList = this.__proto__.getControlItem(
-            ["上传时间间隔", "开度变更提醒值"],
+            ["上传时间间隔", "开度变更提醒值", "阀门圈数", "当前阀门开度"],
             newVal
           );
         } catch (error) {
@@ -57,7 +65,7 @@ export default {
               ["开度提醒复位"],
               newVal
             )[0];
-            console.log("ctrlModel",this.$refs.basics.ctrlModel);
+            console.log("ctrlModel", this.$refs.basics.ctrlModel);
           }
           function getBoole(name, expect = 1) {
             try {

+ 5 - 6
control/components/prodnum-FW01B/prodnum-FW01B.vue

@@ -88,12 +88,11 @@ export default {
         });
         const E013 = this.list.find((v) => v.paramName == "E013");
         if (E013) {
-          this.$refs.refCD.send(
-            { password: E013.params.options[0].value },
-            E013
-          );
+          this.$refs.refCD.send({ password: this.control.bluetoothcode }, E013);
         }
-      } catch (error) {}
+      } catch (error) {
+        console.error("下发身份验证失败", error);
+      }
     },
     onClick(item) {
       this.$refs.MyInput.openInput(item);
@@ -155,7 +154,7 @@ export default {
               cancelText: "断开连接",
               complete: ({ confirm }) => {
                 if (confirm) {
-                  that.authentication();
+                  that.authentication().bind(that);
                 } else {
                   uni.closeBLEConnection({
                     deviceId: that.connected,

+ 1 - 0
control/modules/connectingDevice.vue

@@ -49,6 +49,7 @@ export default {
             content: "蓝牙设备已断开连接",
             showCancel: false,
           });
+          uni.hideLoading();
           that.$Http.setDetailMode(0);
           clearInterval(that.circulation);
           that.circulation = null;

+ 4 - 0
pages/login/modules/account.vue

@@ -92,6 +92,7 @@ export default {
     },
     /* 开始登录 */
     startLogging() {
+      console.log("this.memory",this.memory)
       if (this.loading) return;
       if (!this.isAgreement) return this.$emit("getPermission", "account");
       this.loading = true;
@@ -112,6 +113,9 @@ export default {
             });
           } else {
             //存储是否记住密码 以及登录方式
+            uni.removeStorageSync("account");
+            uni.removeStorageSync("memory");
+
             uni.setStorageSync("memory", this.memory + "");
             uni.setStorageSync("loginMethod", "account");
             uni.setStorageSync("account", {