Pārlūkot izejas kodu

酒店接口经纬度提交

wcni 5 gadi atpakaļ
vecāks
revīzija
4a89cce5c9
2 mainītis faili ar 16 papildinājumiem un 6 dzēšanām
  1. 7 4
      pages/index/index.vue
  2. 9 2
      pages/index/searchresult.vue

+ 7 - 4
pages/index/index.vue

@@ -134,9 +134,7 @@
 			]),
 		},
 		onLoad() {
-			console.log("kseeeesskkk");
 			if(this.beginload) {
-				
 			this.getpicture(); // 开机广告
 			//this.gethotelist(); // 酒店列表
 			if(this.allow) {
@@ -201,8 +199,10 @@
 			},
 			goinfor() {
 				if(this.successlogion && this.hasLogin) {
+					
 					uni.navigateTo({
-					   url: '../myCenter/information'  // 我的消息通知
+					   url: '../myCenter/information'  ,// 我的消息通知
+					   
 					})
 				}else {
 					uni.navigateTo({
@@ -223,9 +223,12 @@
 			// 	})
 			// },
 			goSearch() {
+				let lat = this.lat;
+				let lon = this.lot;
 				uni.navigateTo({
-					url: './searchresult'  // 我的搜索
+					url: `/pages/index/searchresult?lat=${lat}&lon=${lon}`
 				})
+				
 			},
 			// 滚动到顶部
 			upper(e) {

+ 9 - 2
pages/index/searchresult.vue

@@ -39,11 +39,16 @@
 		components: {
 			uniIcon
 		},
-		onLoad() {
-			//this.gethotelist();
+		onLoad(a) {
+			console.log(a);
+			this.lat = a.lat;
+			this.lon = a.lon;
+			
 		},
 		data() {
 			return {
+				lat: '',
+				lon: '',
 				pictureUrl: this.pictureUrl,
 				hotelist: [],
 				searchvalue:'',
@@ -79,6 +84,8 @@
 			                data: {
 			                    page: this.page,
 							    page_size: 10,
+								lat: this.lat,
+								lon: this.lon,
 								keyword: this.searchvalue
 			                 },
 							success: (res) => {