|
@@ -4,8 +4,12 @@ const getReq = require('./../../config.js').getReq;
|
|
|
Page({
|
|
|
data: {
|
|
|
tabs: [],
|
|
|
+ prop_special:[],
|
|
|
+ surplus_special:[],
|
|
|
special_datas: {},
|
|
|
- summery: []
|
|
|
+ summery: [],
|
|
|
+ isScroll:false,
|
|
|
+ isSendProp:false
|
|
|
},
|
|
|
|
|
|
onShow: function() {
|
|
@@ -37,6 +41,8 @@ Page({
|
|
|
},
|
|
|
onMyEvent: function (e) {
|
|
|
this.setData({
|
|
|
+ prop_special:[],
|
|
|
+ surplus_special:[],
|
|
|
special_datas: {},
|
|
|
summery: []
|
|
|
});
|
|
@@ -57,7 +63,11 @@ Page({
|
|
|
}, function (res) {
|
|
|
console.log(res);
|
|
|
if (res.code == 200) {
|
|
|
+ let prop_special = res.datas.special_list;
|
|
|
+ let sent_down_special = prop_special.splice(0, 8);
|
|
|
self.setData({
|
|
|
+ surplus_special: prop_special,
|
|
|
+ prop_special: sent_down_special,
|
|
|
special_datas: res.datas,
|
|
|
summery: res.datas.summary
|
|
|
});
|
|
@@ -67,10 +77,58 @@ Page({
|
|
|
}, 1000)
|
|
|
})
|
|
|
},
|
|
|
+ onPageScroll(e){
|
|
|
+ clearTimeout(this.showTop);
|
|
|
+ this.showTop = setTimeout(()=>{
|
|
|
+ let scrollTop = e.scrollTop;
|
|
|
+ if (scrollTop >= 300) {
|
|
|
+ this.setData({
|
|
|
+ isScroll: true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.setData({
|
|
|
+ isScroll: false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },100);
|
|
|
+ },
|
|
|
+ backTop(){
|
|
|
+ wx.pageScrollTo({
|
|
|
+ scrollTop: 0,
|
|
|
+ duration: 300
|
|
|
+ })
|
|
|
+ },
|
|
|
onShareAppMessage: function () {
|
|
|
return {
|
|
|
title:"熊猫美妆",
|
|
|
path:"/pages/index/index"
|
|
|
}
|
|
|
},
|
|
|
+ onReachBottom: function(){
|
|
|
+ if (this.data.isSendProp){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ let surplus_special_num = this.data.surplus_special.length;
|
|
|
+ if (surplus_special_num > 0){
|
|
|
+ wx.showLoading({
|
|
|
+ title: '加载中'
|
|
|
+ });
|
|
|
+ this.setData({
|
|
|
+ isSendProp:true
|
|
|
+ });
|
|
|
+ this.data.isSendProp = true;
|
|
|
+ let prop_special = this.data.surplus_special;
|
|
|
+ let sent_down_special = prop_special.splice(0, 8);
|
|
|
+ this.setData({
|
|
|
+ surplus_special: prop_special,
|
|
|
+ prop_special: this.data.prop_special.concat(sent_down_special)
|
|
|
+ })
|
|
|
+ this.setData({
|
|
|
+ isSendProp: false
|
|
|
+ });
|
|
|
+ wx.hideLoading();
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|