diff --git a/components/recommend/index.vue b/components/recommend/index.vue
index 26a81fc..4d510c0 100644
--- a/components/recommend/index.vue
+++ b/components/recommend/index.vue
@@ -64,21 +64,30 @@
-
-
-
- {{item.name}}
- {{item.desc}}
-
-
-
-
-
-
+
+
+
+ {{item.name}}
+ {{item.desc}}
+
+
+
+
{{ hotTitle }}
+
+
+
+
@@ -171,11 +180,19 @@
}],
currTabs: 1,
list: [],
- tabsTop: ''
+ tabsTop: '',
+ isShow: true
};
},
mounted() {
this.getArticleList();
+ uni.$on('scroll', res => {
+ if (res.scrollTop > this.tabsTop) {
+ this.isShow = false;
+ } else {
+ this.isShow = true;
+ }
+ })
},
methods: {
@@ -197,16 +214,17 @@
limit: 10
}).then(res => {
this.list = res.data.list;
-
setTimeout(() => {
this.$util.getDom(this, '.tabs', res => {
// #ifdef APP
- this.tabsTop = res.top + 10;
+ this.tabsTop = res.top - 10;
// #endif
// #ifdef H5
this.tabsTop = res.top;
// #endif
+
+ console.log(this.tabsTop);
})
}, 300)
})
@@ -236,6 +254,11 @@