|
@@ -12,9 +12,11 @@ import reachBottom from '~/mixins/reachBottom'
|
|
Page({
|
|
Page({
|
|
behaviors: [reachBottom],
|
|
behaviors: [reachBottom],
|
|
data: {
|
|
data: {
|
|
|
|
+ navBarHeight: app.globalData.navBarHeight,
|
|
bannerList: [],
|
|
bannerList: [],
|
|
// 1关注的人的作品,2是自己的作品
|
|
// 1关注的人的作品,2是自己的作品
|
|
currentType: '1',
|
|
currentType: '1',
|
|
|
|
+ isFixed: false
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
if (typeof this.getTabBar === 'function') {
|
|
if (typeof this.getTabBar === 'function') {
|
|
@@ -53,6 +55,21 @@ Page({
|
|
}
|
|
}
|
|
},
|
|
},
|
|
/**
|
|
/**
|
|
|
|
+ * 监听页面滚动事件
|
|
|
|
+ */
|
|
|
|
+ onPageScroll(e) {
|
|
|
|
+ console.log(e.scrollTop);
|
|
|
|
+ if (e.scrollTop >= 110 && !this.data.isFixed) {
|
|
|
|
+ this.setData({
|
|
|
|
+ isFixed: true
|
|
|
|
+ })
|
|
|
|
+ } else if (e.scrollTop < 110 && this.data.isFixed) {
|
|
|
|
+ this.setData({
|
|
|
|
+ isFixed: false
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ /**
|
|
* 页面上拉触底事件的处理函数
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
*/
|
|
onReachBottom() {
|
|
onReachBottom() {
|