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.
150 lines
3.4 KiB
150 lines
3.4 KiB
import {getInspRecord} from "../../../../utils/api"
|
|
const app = getApp()
|
|
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
title:'社区满意度自查',
|
|
tableData:[],
|
|
lowerThreshold:'10',
|
|
loadMoreVisible:false,
|
|
loadMoreType: "none",
|
|
nodata:false,
|
|
pageNo:1,
|
|
pageSize:10,
|
|
type:''
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad(options) {
|
|
this.setData({
|
|
statusHeight: app.globalData.deviceInfo.statusHeight,
|
|
navigationHeight: app.globalData.deviceInfo.navigationHeight,
|
|
share:app.globalData.share,
|
|
type:options.type,
|
|
keyWord:options.keyWord
|
|
})
|
|
this.getTable()
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
onReady() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
onShow() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面隐藏
|
|
*/
|
|
onHide() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面卸载
|
|
*/
|
|
onUnload() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
*/
|
|
onPullDownRefresh() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
onReachBottom() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 用户点击右上角分享
|
|
*/
|
|
onShareAppMessage() {
|
|
|
|
},
|
|
getTable(){
|
|
this.setData({
|
|
loadMoreVisible: true,
|
|
nodata: false,
|
|
loadMoreType: "more",
|
|
})
|
|
let parm ={
|
|
searchKey:this.data.keyWord,
|
|
pageSize:this.data.pageSize,
|
|
pageNo:this.data.pageNo
|
|
}
|
|
|
|
getInspRecord(parm).then(res=>{
|
|
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,
|
|
nodata: true
|
|
})
|
|
}
|
|
console.log(this.data.tableData);
|
|
}).catch(err=>{
|
|
console.log(err);
|
|
})
|
|
|
|
},
|
|
onScrollToLower(e){
|
|
if (this.data.loadMoreType === 'more') {
|
|
this.setData({
|
|
loadMoreVisible: true,
|
|
})
|
|
this.data.pageNo += 1
|
|
this.getTable()
|
|
}
|
|
},
|
|
jumpAdd(){
|
|
if(this.data.type == 'resi'){
|
|
wx.navigateTo({
|
|
url: '/subpages/addResi/pages/addResi/addResi',
|
|
})
|
|
}else{
|
|
wx.navigateTo({
|
|
url: '/subpages/addhouse/pages/addhouse/addhouse',
|
|
})
|
|
}
|
|
},
|
|
handelClickedit(e){
|
|
console.log(e);
|
|
if(this.data.type == 'resi'){
|
|
wx.navigateTo({
|
|
url: `/subpages/addResi/pages/addResi/addResi?type=edit&resiId=${e.currentTarget.dataset.item.resiId}`,
|
|
})
|
|
}else{
|
|
wx.navigateTo({
|
|
url: `/subpages/addhouse/pages/addhouse/addhouse?type=edit&houseId=${e.currentTarget.dataset.item.id}`,
|
|
})
|
|
}
|
|
|
|
},
|
|
back() {
|
|
//返回上一级,关闭当前页面
|
|
wx.navigateBack({
|
|
delta: 1
|
|
})
|
|
},
|
|
})
|