|
@@ -133,8 +133,16 @@
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
url: "./index"
|
|
url: "./index"
|
|
|
})
|
|
})
|
|
|
- localStorage.removeItem("typeid")
|
|
|
|
|
- localStorage.removeItem("location")
|
|
|
|
|
|
|
+ // localStorage.removeItem("typeid")
|
|
|
|
|
+ // localStorage.removeItem("location")
|
|
|
|
|
+
|
|
|
|
|
+ uni.removeStorage({
|
|
|
|
|
+ key:'typeid'
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ uni.removeStorage({
|
|
|
|
|
+ key:'location'
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
binding() {
|
|
binding() {
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
@@ -194,7 +202,7 @@
|
|
|
duration: 2000,
|
|
duration: 2000,
|
|
|
icon: "none"
|
|
icon: "none"
|
|
|
});
|
|
});
|
|
|
- } else if (this.baseinfo.base_id == '') {
|
|
|
|
|
|
|
+ } else if (!this.baseobj.length && !this.base_id.length) {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: '请绑定基地设备',
|
|
title: '请绑定基地设备',
|
|
|
duration: 2000,
|
|
duration: 2000,
|
|
@@ -217,8 +225,15 @@
|
|
|
}
|
|
}
|
|
|
console.log(this.baseinfo)
|
|
console.log(this.baseinfo)
|
|
|
this.addbase()
|
|
this.addbase()
|
|
|
- localStorage.removeItem("typeid")
|
|
|
|
|
- localStorage.removeItem("location")
|
|
|
|
|
|
|
+ // localStorage.removeItem("typeid")
|
|
|
|
|
+ // localStorage.removeItem("location")
|
|
|
|
|
+ uni.removeStorage({
|
|
|
|
|
+ key:'typeid'
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ uni.removeStorage({
|
|
|
|
|
+ key:'location'
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -254,7 +269,7 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
|
- console.log(JSON.parse(option.id))
|
|
|
|
|
|
|
+ console.log(JSON.parse(option.id),'on load ')
|
|
|
this.baseinfo = JSON.parse(option.id)
|
|
this.baseinfo = JSON.parse(option.id)
|
|
|
this.baseinfo.base_id = JSON.parse(option.id).id
|
|
this.baseinfo.base_id = JSON.parse(option.id).id
|
|
|
this.baseinfo.ret = "modify"
|
|
this.baseinfo.ret = "modify"
|
|
@@ -263,10 +278,11 @@
|
|
|
this.ybase()
|
|
this.ybase()
|
|
|
},
|
|
},
|
|
|
onShow() {
|
|
onShow() {
|
|
|
|
|
+ console.warn('on show modification -------------')
|
|
|
uni.getStorage({
|
|
uni.getStorage({
|
|
|
key: "location",
|
|
key: "location",
|
|
|
success: (res) => {
|
|
success: (res) => {
|
|
|
- console.log(res.data)
|
|
|
|
|
|
|
+ console.log(res.data,'get storage location')
|
|
|
this.selectaddress(res.data[1], res.data[0])
|
|
this.selectaddress(res.data[1], res.data[0])
|
|
|
this.baseinfo.lat = res.data[1]
|
|
this.baseinfo.lat = res.data[1]
|
|
|
this.baseinfo.lng = res.data[0]
|
|
this.baseinfo.lng = res.data[0]
|
|
@@ -276,7 +292,7 @@
|
|
|
key: 'typeid',
|
|
key: 'typeid',
|
|
|
success: (res) => {
|
|
success: (res) => {
|
|
|
this.baseobjtf = false
|
|
this.baseobjtf = false
|
|
|
- console.log(JSON.parse(res.data))
|
|
|
|
|
|
|
+ console.log(JSON.parse(res.data),'get storage type id')
|
|
|
var arr = []
|
|
var arr = []
|
|
|
for (var key in JSON.parse(res.data)) {
|
|
for (var key in JSON.parse(res.data)) {
|
|
|
console.log(key)
|
|
console.log(key)
|