瀏覽代碼

定位问题

twt 3 年之前
父節點
當前提交
ecddc2d0d5
共有 1 個文件被更改,包括 8 次插入7 次删除
  1. 8 7
      pages/index/index.vue

+ 8 - 7
pages/index/index.vue

@@ -112,15 +112,15 @@
 
 			this.uid = uni.getStorageSync("logodata").uid;
 
-			this.location = uni.getStorageSync("location");
+			var location = uni.getStorageSync("location");
 
 
-			if (this.location) {
-				this.lng = this.location.lng;
-				this.lat = this.location.lat;
-				this.cityname = this.location.cityname;
-				this.cityCode = this.location.cityCode;
-
+			if (location) {
+				this.lng = location.lng;
+				this.lat = location.lat;
+				this.cityname = location.cityname;
+				this.cityCode = location.cityCode;
+                this.location=location
 
 				that.queryHomeDetail();
 
@@ -177,6 +177,7 @@
 			},
 			selectCity(item) {
 				console.log('-您选择的城市-', item)
+				console.log(this.location)
 				this.location.cityname = item.name;
 				this.location.cityCode = item.citycode;
 				this.cityname = item.name;