柒零 1 rok pred
rodič
commit
f3667d900d

+ 11 - 7
subpages/addMattresses/addMattresses.js

@@ -591,13 +591,17 @@ Page({
       wx.setNavigationBarTitle({
         title:"编辑床垫"
       })
-      this.setData({
-        placeOfUse: "",
-        usingHuman: "",
-        sn: "",
-        ssid: "",
-        password: "",
-      })
+      const item = wx.getStorageSync("item");
+      if (item) {
+        this.setData({
+          placeOfUse: item.location,
+          usingHuman: item.person,
+          sn: item.sn,
+          ssid: "",
+          password: "",
+        })
+        wx.removeStorageSync("item")
+      }
     }
 
   },

+ 1 - 0
subpages/myMattress/myMattress.js

@@ -41,6 +41,7 @@ Page({
         console.log(e.tapIndex) //没有item项下的key或index
         if (e.tapIndex == 0) {
           // 编辑
+          wx.setStorageSync('item', item);
           wx.navigateTo({
             url:"/subpages/addMattresses/addMattresses?type=edit"
           })