柒零 hace 1 año
padre
commit
fdbb8110ca

+ 6 - 4
subpages/addMattresses/addMattresses.js

@@ -69,10 +69,10 @@ Page({
   commitData() { 
     console.log(this.data.placeOfUse);
     console.log(this.data.usingHuman);
-    console.log(this.data.deviceId);
+    console.log(this.data.sn);
     console.log(this.data.ssid);
     console.log(this.data.password);
-    this.checkSn(this.data.deviceId);
+    this.checkSn(this.data.sn);
    
     
   },
@@ -85,7 +85,7 @@ Page({
         data: {
           token: "89835e65993fee4a6a6cbbe4c271da51e5521822934e13769e61cadabaed72c3" || wx.getStorageSync('token'),
           pid: this.data.pid,
-          sntram: this.data.deviceId,
+          sntram: this.data.sn,
           per: this.data.usingHuman,
           loc: this.data.placeOfUse,
         },
@@ -273,9 +273,11 @@ Page({
   commitBluetooth() {
     this.onClose();
     var deviceId = this.data.deviceList[this.data.bluetoothSelectIndex].deviceId;
+    var name = this.data.deviceList[this.data.bluetoothSelectIndex].name;
+    var nameList = this.data.deviceList[this.data.bluetoothSelectIndex].name.split(' ');
     this.setData({
       deviceId: deviceId,
-      sn:deviceId
+      sn: nameList[1]
     })
   },
 // 开始配网

+ 1 - 1
subpages/addMattresses/addMattresses.wxml

@@ -13,7 +13,7 @@
             clearable border="{{ true }}" />
         <van-field model:value="{{ usingHuman }}" center title-width="150rpx" label="使用人:" placeholder="可填写本人或者其他人名称"
             clearable border="{{ true }}" />
-        <van-field model:value="{{ deviceId }}" center title-width="150rpx" clearable label="SN:" placeholder="请输入"
+        <van-field model:value="{{ sn }}" center title-width="150rpx" clearable label="SN:" placeholder="请输入"
             border="{{ true }}" use-button-slot>
             <view slot="button" class="lysb-btn" bindtap="bindViewBlue">
                 <image src="/subpages/images/ic_ly.png" class="ly-icon"></image>