yijianjun 1 deň pred
rodič
commit
ce68459b7f

+ 16 - 2
mer_uniapp/pages/index/index.vue

@@ -260,6 +260,9 @@
 					});
 				})
 			},
+			getTag(){
+				return this.labelList.filter((ite => ite.checked)).map(ite => ite.id).join(',')
+			},
 			getHomeData() {
 				getHomeInfo({
 					latitude: uni.getStorageSync('user_latitude'),
@@ -281,7 +284,8 @@
 					getMerchantList({
 						latitude: uni.getStorageSync('user_latitude'),
 						longitude: uni.getStorageSync('user_longitude'),
-						cateId: this.cateId
+						cateId: this.cateId,
+						queryLabels: this.getTag()
 					}).then(res => {
 						this.merchantList = res.data.list;
 						console.log('商品信息:', this.merchantList);
@@ -294,6 +298,15 @@
 			},
 			item2Click(item) {
 				item.checked = !item.checked;
+				getMerchantList({
+					latitude: uni.getStorageSync('user_latitude'),
+					longitude: uni.getStorageSync('user_longitude'),
+					cateId: this.cateId,
+					queryLabels: this.getTag()
+				}).then(res => {
+					this.merchantList = res.data.list;
+					console.log('商品信息:', this.merchantList);
+				});
 			},
 			startScroll() {
 				setInterval(() => {
@@ -358,7 +371,8 @@
 							getMerchantList({
 								latitude: res.latitude,
 								longitude: res.longitude,
-								cateId: this.cateId							
+								cateId: this.cateId,
+								queryLabels: this.getTag()						
 							}).then(data => {
 								this.merchantList = data.data.list;
 								console.log('商品信息:', this.merchantList);

+ 8 - 1
mer_uniapp/pages/merchant_search/index.vue

@@ -185,6 +185,9 @@
 			})
 		},
 		methods: {
+			getTag(){
+				return this.labelList.filter((ite => ite.checked)).map(ite => ite.id).join(',')
+			},
 			getMatchedData() {
 				if (this.loading) return;
 				this.loading = true
@@ -195,7 +198,8 @@
 					keywords: this.searchValue,
 					typeIds: this.optionIndex==0?"":this.optionIndex,
 					page: this.page,
-					limit: 10
+					limit: 10,
+					queryLabels: this.getTag()
 				}).then(res => {
 					let list = res.data.list || [];
 					this.merchantList = this.$util.SplitArray(list, this.merchantList);
@@ -216,6 +220,9 @@
 			},
 			item2Click(item) {
 				item.checked = !item.checked;
+				this.merchantList = []
+				this.page = 1
+				this.getMatchedData()
 			},
 			onOptionClick(item) {
 				if (this.optionIndex === item.id) return

+ 8 - 1
mer_uniapp/pages/takeout/index.vue

@@ -225,6 +225,9 @@
 					this.getMatchedData()
 				}
 			},
+			getTag(){
+				return this.labelList.filter((ite => ite.checked)).map(ite => ite.id).join(',')
+			},
 			getMatchedData() {
 				if (this.loading) return;
 				this.loading = true
@@ -234,7 +237,8 @@
 					productType: this.takeoutId,
 					typeIds: this.optionIndex==0?"":this.optionIndex,
 					page: this.page,
-					limit: 10
+					limit: 10,
+					queryLabels: this.getTag()
 				}).then(res => {
 					let list = res.data.list || [];
 					this.merchantList = this.$util.SplitArray(list, this.merchantList);
@@ -263,6 +267,9 @@
 			},
 			item2Click(item) {
 				item.checked = !item.checked;
+				this.merchantList = []
+				this.page = 1
+				this.getMatchedData()
 			},
 			// getMatchedData() {
 			// 	getMerchantList({