|
@@ -46,7 +46,12 @@ Page({
|
|
|
url: '../Mall/presaleCommodity/presaleCommodity',
|
|
url: '../Mall/presaleCommodity/presaleCommodity',
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
|
|
+ // 进入sort页
|
|
|
|
|
+ sortBut: function(){
|
|
|
|
|
+ wx.navigateTo({
|
|
|
|
|
+ url: '../Mall/sortCommodity/sortCommodity',
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
onLoad: async function (options) {
|
|
onLoad: async function (options) {
|
|
|
|
|
|
|
|
// 生命周期函数--监听页面加载
|
|
// 生命周期函数--监听页面加载
|
|
@@ -69,38 +74,30 @@ Page({
|
|
|
this.setData({
|
|
this.setData({
|
|
|
prodClassList : resCategory.prodClassList
|
|
prodClassList : resCategory.prodClassList
|
|
|
});
|
|
});
|
|
|
- // this.setData({
|
|
|
|
|
- // prodClassList: [
|
|
|
|
|
- // { classUrl: 'someprod.jpg', title: '火影忍者' },
|
|
|
|
|
- // { classUrl: 'someprod.jpg', title: '初音' },
|
|
|
|
|
- // { classUrl: 'someprod.jpg', title: '原神' },
|
|
|
|
|
- // { classUrl: 'someprod.jpg', title: '柯南' },
|
|
|
|
|
- // { classUrl: 'someprod.jpg', title: '非人哉' },
|
|
|
|
|
- // { classUrl: 'someprod.jpg', title: '全部' },
|
|
|
|
|
- // ]
|
|
|
|
|
- // });
|
|
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- onPageScroll: function(e) {
|
|
|
|
|
- wx.createSelectorQuery()
|
|
|
|
|
- .select('.container')
|
|
|
|
|
- .boundingClientRect((rect) => {
|
|
|
|
|
- if (rect) {
|
|
|
|
|
- const shouldBrandBeMini = rect.top <= -480; // 在container上移到-480px时,品牌栏mini出现
|
|
|
|
|
- if (this.data.isBrandMini !== shouldBrandBeMini) {
|
|
|
|
|
- this.setData({
|
|
|
|
|
- isBrandMini: shouldBrandBeMini
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- const shouldCategoryBeMini = rect.top <= -680; // 在container上移到-680px时,分类栏mini出现
|
|
|
|
|
- if (this.data.isCategoryMini !== shouldCategoryBeMini) {
|
|
|
|
|
- this.setData({
|
|
|
|
|
- isCategoryMini: shouldCategoryBeMini
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- .exec();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // onPageScroll: function(e) {
|
|
|
|
|
+ // wx.createSelectorQuery()
|
|
|
|
|
+ // .select('.container')
|
|
|
|
|
+ // .boundingClientRect((rect) => {
|
|
|
|
|
+ // if (rect) {
|
|
|
|
|
+ // console.log("top" + rect.top);
|
|
|
|
|
+ // const shouldBrandBeMini = rect.top <= -475; // 在container上移到-480px时,品牌栏mini出现
|
|
|
|
|
+ // if (this.data.isBrandMini !== shouldBrandBeMini) {
|
|
|
|
|
+ // this.setData({
|
|
|
|
|
+ // isBrandMini: shouldBrandBeMini
|
|
|
|
|
+ // });
|
|
|
|
|
+ // }
|
|
|
|
|
+ // const shouldCategoryBeMini = rect.top <= -600; // 在container上移到-680px时,分类栏mini出现
|
|
|
|
|
+ // if (this.data.isCategoryMini !== shouldCategoryBeMini) {
|
|
|
|
|
+ // this.setData({
|
|
|
|
|
+ // isCategoryMini: shouldCategoryBeMini
|
|
|
|
|
+ // });
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .exec();
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
})
|
|
})
|