epmet 工作端 小程序
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.

85 lines
1.8 KiB

const app = getApp()
import { getCheckLogList } from "../../../../utils/api"
Page({
/**
* 页面的初始数据
*/
data: {
statusHeight: '',
navigationHeight: '',
tableData: [],
lowerThreshold: '10',
loadMoreVisible: false,
nodata: false,
loadMoreType: 'more',
resiId: '',
pageSize: 10,
pageNo: 1
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
statusHeight: app.globalData.deviceInfo.statusHeight,
navigationHeight: app.globalData.deviceInfo.navigationHeight,
resiId: options.resiId
})
this.getTable()
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
},
onScrollToLower(e) {
if (this.data.loadMoreType === 'more') {
this.setData({
loadMoreVisible: true,
})
this.data.pageNo += 1
this.getTable()
}
},
getTable() {
this.setData({
loadMoreVisible: true,
nodata: false,
loadMoreType: "more",
})
let parm = {
resiId: this.data.resiId,
pageSize: this.data.pageSize,
pageNo: this.data.pageNo
}
getCheckLogList(parm).then(res => {
console.log(res, 'rrr')
if (res.data) {
this.setData({
loadMoreType: res.data.list.length === this.data.pageSize ? 'more' : 'none',
tableData: this.data.tableData.concat(res.data.list),
})
if (this.data.tableData.length == 0) {
this.setData({
loadMoreVisible: false,
loadMoreType: '',
nodata: true
})
}
} else {
this.setData({
loadMoreType: '',
nodata: true
})
}
}).catch(err => {
console.log(err);
})
},
back() {
wx.navigateBack()
},
})