...
|
...
|
@@ -4,7 +4,6 @@ import listModel from '../../models/product/list'; |
|
|
|
|
|
let yas;
|
|
|
const app = getApp();
|
|
|
const {windowHeight} = getApp().getSystemInfo();
|
|
|
|
|
|
Page({
|
|
|
data: {
|
...
|
...
|
@@ -20,7 +19,7 @@ Page({ |
|
|
allLoaded: false,
|
|
|
productList: [],
|
|
|
totalZero: false,
|
|
|
windowHeight
|
|
|
windowHeight: 0
|
|
|
},
|
|
|
onLoad: function(options) {
|
|
|
Object.keys(options).map(key => {
|
...
|
...
|
@@ -38,10 +37,17 @@ Page({ |
|
|
yas = new Yas();
|
|
|
yas.pageOpenReport();
|
|
|
},
|
|
|
onReady: function() {
|
|
|
wx.getSystemInfo().then(({windowHeight}) => {
|
|
|
this.setData({
|
|
|
windowHeight
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
onPageScroll: function({scrollTop}) {
|
|
|
if (scrollTop > windowHeight * 2 !== this.data.showBackTop) {
|
|
|
if (scrollTop > this.data.windowHeight * 2 !== this.data.showBackTop) {
|
|
|
this.setData({
|
|
|
showBackTop: scrollTop > windowHeight * 2
|
|
|
showBackTop: scrollTop > this.data.windowHeight * 2
|
|
|
});
|
|
|
}
|
|
|
},
|
...
|
...
|
@@ -123,7 +129,7 @@ Page({ |
|
|
loading: false,
|
|
|
allLoaded: this.data.page > this.data.totalPage,
|
|
|
productList: this.data.productList.concat(list),
|
|
|
totalZero: this.data.productList.concat(list).length
|
|
|
totalZero: this.data.productList.concat(list).length === 0
|
|
|
});
|
|
|
}
|
|
|
}).catch(() => {});
|
...
|
...
|
|