榆山
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
1.8 KiB

var utils = require('../../utils/util');
const app = getApp()
Page({
data: {
floorstatus:false,
pageIndex: 1,
currenttab: 'new',
date: utils.formatTimestamp(new Date()),
},
onLoad: function (options) {
const eventId = options.eventId;//事件id
this.setData({
clear:0,
eventId: eventId,
date: utils.formatTimestamp(new Date())
})
this.selectComponent("#state-1").getCommentList(this.data)
},
onReachBottom: function () {//上拉
this.setData({
clear: 1,//1不清除数据 2清除
pageIndex: this.data.pageIndex + 1,
})
this.selectComponent("#state-1").getCommentList(this.data)
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
this.setData({
clear: 0,
pageIndex: 1,
date: utils.formatTimestamp(new Date())
})
wx.stopPullDownRefresh();
this.selectComponent("#state-1").getCommentList(this.data)
},
newhot: function (e) {
let currenttab = e.currentTarget.dataset.case
this.setData({
currenttab: currenttab,
clear: 0,
pageIndex: 1,
date: utils.formatTimestamp(new Date())
})
this.selectComponent("#state-1").getCommentList(this.data)
},
// 获取滚动条当前位置
onPageScroll: function (e) {
if (e.scrollTop > 100) {
this.setData({
floorstatus: true
});
} else {
this.setData({
floorstatus: false
});
}
},
//回到顶部
goTop: function (e) { // 一键回到顶部
if (wx.pageScrollTo) {
wx.pageScrollTo({
scrollTop: 0
})
} else {
wx.showModal({
title: '提示',
content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
})
}
}
})