ソースを参照

commit -m 优化

zhengjinyi 4 年 前
コミット
10a4b730cd

+ 10 - 0
components/cm-module/homeIndex/hotProduct.vue

@@ -138,6 +138,15 @@
 		created(){
 			this.initData(this.list)
 		},
+		watch: {
+			list: {
+				handler: function (el) {//监听对象的变换使用 function,箭头函数容易出现this指向不正确
+					this.list = el
+					this.initData(this.list)
+				},
+				deep: true
+			}
+		},
 		computed: {
 			...mapState(['hasLogin','userInfo','isActivity'])
 		},
@@ -147,6 +156,7 @@
 					this.shopId = resolve.shopID
 				})
 				if(res.length>0){
+					this.hotProductList.splice(0,this.hotProductList.length);
 					for (var i = 0, j = res.length; i < j; i += this.pageSize) {
 						this.hotProductList.push(res.slice(i, i + this.pageSize));
 					}

+ 0 - 1
components/cm-module/homeIndex/pagesProduct.vue

@@ -54,7 +54,6 @@
 				this.pagesProductList = res
 			},
 			NavToDetailPage(floor) {//跳转
-				console.log(floor)
 				/**
 				 * 页面跳转类型
 				 * 1、二级页面,2、搜索项目仪器,3、直播页面,4、自由页面,5、商品详情,6、仪器项目详情,7、供应商主页

+ 1 - 1
pages/search/search.vue

@@ -221,7 +221,7 @@
 			},
 			subMitSearch() {//搜索
 				if (this.listQuery.keyword == '') {
-					this.$util.msg('请输入商品关键词',2000);
+					this.$util.msg('请输入搜索关键词',2000);
 				}else{
 					switch(this.searchKeyType){
 						case 1: