diff --git a/pages/tabbar/cate/cate.vue b/pages/tabbar/cate/cate.vue index 78a5020..c60e070 100644 --- a/pages/tabbar/cate/cate.vue +++ b/pages/tabbar/cate/cate.vue @@ -12,16 +12,16 @@ - - + {{cateList[current].title}} + - - {{cateList[index].title}} + @@ -76,7 +76,8 @@ ifLoading:false, pid:'',//分类id doms:'', - topList:[] + topList:[], + heightData: 0 } }, computed:{ @@ -116,7 +117,12 @@ }) this.dataList[i] = newArr; if(i == this.cateList.length-1){ - console.log(i,123) + setTimeout(()=>{ + const query = uni.createSelectorQuery().in(this); + query.select('.cate-title').boundingClientRect(data => { + this.heightData = data.height + }).exec(); + },200) this.getNodesInfo(); this.ifLoading = false; } @@ -153,6 +159,7 @@ chooseCate(index,id) { this.current =index this.doms = 'product'+index + console.log(index,222) }, // 滚动 @@ -172,16 +179,15 @@ setTimeout(()=>{ const query = uni.createSelectorQuery().in(this); query.selectAll('.posir').boundingClientRect().exec((res)=>{ - console.log(res,234) let nodes = res[0] let rel =[]; nodes.map(item=>{ - rel.push(item.top) + rel.push(item.top-uni.getSystemInfoSync().statusBarHeight-50-this.heightData) }) this.topList = rel + // console.log(this.topList,234) }) },200) - }, // 跳转详情页 @@ -212,5 +218,5 @@ .cate-txt{ display: flex; } -.cate-title{width: 100%;font-size: 24rpx;line-height: 1.5;padding-bottom: 30rpx;color: #666;} +.cate-title{position: absolute;left:0; top:0; width: 100%; background-color: #fff; font-size: 24rpx;line-height: 60rpx;color: #666; z-index: 9;text-indent: 20rpx;} diff --git a/pages/tabbar/my/my.vue b/pages/tabbar/my/my.vue index 1b45c25..9e76fd1 100644 --- a/pages/tabbar/my/my.vue +++ b/pages/tabbar/my/my.vue @@ -1,7 +1,7 @@