diff --git a/pages/information/information.vue b/pages/information/information.vue index 55667fa..e08bf61 100644 --- a/pages/information/information.vue +++ b/pages/information/information.vue @@ -248,6 +248,9 @@ } else if (e.length == 1) { this.address = e[0].localName this.query.areaCode = e[0].id + } else { + this.address = '' + this.query.areaCode = '' } }, // 显示三级地址联动 diff --git a/pages/modify/modify.vue b/pages/modify/modify.vue index 39902db..0780659 100644 --- a/pages/modify/modify.vue +++ b/pages/modify/modify.vue @@ -177,6 +177,9 @@ } else if (e.length == 1) { this.address = e[0].localName this.appPersonallist.areaCode = e[0].id + }else { + this.address = '' + this.appPersonallist.areaCode = '' } }, // 显示三级地址联动 diff --git a/pages/modifyAddress/modifyAddress.vue b/pages/modifyAddress/modifyAddress.vue index 4e31397..4df23fa 100644 --- a/pages/modifyAddress/modifyAddress.vue +++ b/pages/modifyAddress/modifyAddress.vue @@ -181,6 +181,9 @@ } else if (e.length == 1) { this.infolist.address = e[0].localName this.infolist.areaCode = e[0].id + } else { + this.infolist.address = '' + this.infolist.areaCode = '' } } }, diff --git a/pages/site/site.vue b/pages/site/site.vue index d917619..dbfe565 100644 --- a/pages/site/site.vue +++ b/pages/site/site.vue @@ -149,64 +149,36 @@ }, onShow() { var that = this - try { - const value = uni.getStorageSync('patientId'); - if (value) { - getPatientInfo(value).then(res => { - if (res.code == 200) { - this.homeLatitudeLongitude = res.data - if (res.data.homeLatitude && res.data.homeLongitude) { - that.latitude = res.data.homeLatitude - that.longitude = res.data.homeLongitude - that.markers.push({ - id: 3, - latitude: res.data.homeLatitude, - longitude: res.data.homeLongitude, - width: 20, - height: 25, - iconPath: "../../static/locatinsmall.png" - }) - that.requestinfo(); - } else { - that.latitude = that.latitude - that.longitude = that.longitude - that.requestinfo(); - // uni.getLocation({ - // type: 'wgs84', - // success: function(resp) { - // that.latitude = resp.latitude - // that.longitude = resp.longitude - // that.markers.push({ - // id: 3, - // latitude: resp.latitude, - // longitude: resp.longitude, - // width: 20, - // height: 25, - // iconPath: "../../static/locatinsmall.png" - // }) - // that.requestinfo(); - // }, - // fail(err) { - // that.mask = true; - // } - // }); - } - } else if (res.code == 9999) { - + const value = uni.getStorageSync('patientId'); + if (value) { + getPatientInfo(value).then(res => { + if (res.code == 200) { + this.homeLatitudeLongitude = res.data + if (res.data.homeLatitude && res.data.homeLongitude) { + that.latitude = res.data.homeLatitude + that.longitude = res.data.homeLongitude + that.markers.push({ + id: 3, + latitude: res.data.homeLatitude, + longitude: res.data.homeLongitude, + width: 20, + height: 25, + iconPath: "../../static/locatinsmall.png" + }) + that.requestinfo(); } else { that.latitude = that.latitude that.longitude = that.longitude that.requestinfo(); - // that.markers.push({ // uni.getLocation({ // type: 'wgs84', - // success: function(resh) { - // that.latitude = resh.latitude - // that.longitude = resh.longitude + // success: function(resp) { + // that.latitude = resp.latitude + // that.longitude = resp.longitude // that.markers.push({ // id: 3, - // latitude: resh.latitude, - // longitude: resh.longitude, + // latitude: resp.latitude, + // longitude: resp.longitude, // width: 20, // height: 25, // iconPath: "../../static/locatinsmall.png" @@ -218,32 +190,58 @@ // } // }); } - }) - } else { - that.latitude = that.latitude - that.longitude = that.longitude - that.requestinfo(); - // uni.getLocation({ - // type: 'wgs84', - // success: function(res) { - // that.latitude = res.latitude - // that.longitude = res.longitude - // that.markers.push({ - // id: 3, - // latitude: res.latitude, - // longitude: res.longitude, - // width: 20, - // height: 25, - // iconPath: "../../static/locatinsmall.png" - // }) - // that.requestinfo(); - // }, - // fail(err) { - // that.mask = true; - // } - // }); - } - } catch (e) {} + } else if (res.code == 9999) { + + } else { + that.latitude = that.latitude + that.longitude = that.longitude + that.requestinfo(); + // that.markers.push({ + // uni.getLocation({ + // type: 'wgs84', + // success: function(resh) { + // that.latitude = resh.latitude + // that.longitude = resh.longitude + // that.markers.push({ + // id: 3, + // latitude: resh.latitude, + // longitude: resh.longitude, + // width: 20, + // height: 25, + // iconPath: "../../static/locatinsmall.png" + // }) + // that.requestinfo(); + // }, + // fail(err) { + // that.mask = true; + // } + // }); + } + }) + } else { + that.latitude = that.latitude + that.longitude = that.longitude + that.requestinfo(); + // uni.getLocation({ + // type: 'wgs84', + // success: function(res) { + // that.latitude = res.latitude + // that.longitude = res.longitude + // that.markers.push({ + // id: 3, + // latitude: res.latitude, + // longitude: res.longitude, + // width: 20, + // height: 25, + // iconPath: "../../static/locatinsmall.png" + // }) + // that.requestinfo(); + // }, + // fail(err) { + // that.mask = true; + // } + // }); + } }, onLoad() {}, //1.分享给朋友