diff --git a/src/view/goods-classify.vue b/src/view/goods-classify.vue index a13ed03..1dc2f6d 100644 --- a/src/view/goods-classify.vue +++ b/src/view/goods-classify.vue @@ -105,6 +105,14 @@ that.showLoading = false if ( res.code == 0 ){ this.goodsList = res.data || [] + this.$nextTick(function(){ + //调用scroll函数,实现滚动 + this._initScroll() + //拿到数据以后计算高度 + this._calculateHeight(); + // 自动选中 + this.autoSelect() + }) } else { this.$vux.toast.text(res.msg,"middle"); } @@ -139,7 +147,7 @@ let item = foodList[i]; height += item.clientHeight; this.listHeight.push(height); - } + } }, selectMenu(index, event) { if(event && !event._constructed) { @@ -155,18 +163,15 @@ this.selectMenu(i) } } - } + }, + ShareWenXin (){ + var merchantNo = this.no + this.wxShare({"merchantNo":merchantNo,"source":0,"url":encodeURIComponent(location.href)}) + } }, mounted() { this.getParams() - window.onload = () =>{ - //调用scroll函数,实现滚动 - this._initScroll() - //拿到数据以后计算高度 - this._calculateHeight(); - // 自动选中 - this.autoSelect() - } + this.ShareWenXin() }, } diff --git a/src/view/home.vue b/src/view/home.vue index 2a8aece..eee542e 100644 --- a/src/view/home.vue +++ b/src/view/home.vue @@ -20,7 +20,7 @@