|
|
@ -2,12 +2,14 @@ |
|
|
|
// 获取应用实例
|
|
|
|
const app = getApp() |
|
|
|
import api, {getIntelligentMessage,getToken,getStaffbasicinfo,clearMessage,getSituation,overView} from "../../utils/api" |
|
|
|
import {getInspRecord} from '../../utils/api' |
|
|
|
import config from "../../utils/config" |
|
|
|
Page({ |
|
|
|
data: { |
|
|
|
topDisplay:false, |
|
|
|
selectList:['全部消息','居民信息采集','房屋信息采集','社区满意度自查'], |
|
|
|
selectValue:0, |
|
|
|
communitySelfInspList:[], |
|
|
|
pageSize:5, |
|
|
|
pageNo:1, |
|
|
|
tableData:[], |
|
|
@ -32,12 +34,13 @@ Page({ |
|
|
|
navigationHeight: app.globalData.deviceInfo.navigationHeight, |
|
|
|
share:app.globalData.share, |
|
|
|
}) |
|
|
|
this.getInspRecord() |
|
|
|
|
|
|
|
}, |
|
|
|
onShow(){ |
|
|
|
this.getIntelligentMessage() |
|
|
|
this.getSituation() |
|
|
|
|
|
|
|
this.getInspRecord() |
|
|
|
}, |
|
|
|
onPullDownRefresh() { |
|
|
|
this.setData({ |
|
|
@ -46,8 +49,48 @@ Page({ |
|
|
|
}) |
|
|
|
this.getIntelligentMessage() |
|
|
|
this.getStaffbasicinfo() |
|
|
|
this.getInspRecord() |
|
|
|
}, |
|
|
|
getInspRecord(){ |
|
|
|
let parm ={ |
|
|
|
pageSize:1000, |
|
|
|
pageNo:1 |
|
|
|
} |
|
|
|
getInspRecord(parm).then(res=>{ |
|
|
|
res.data.list = res.data.list.reverse(); |
|
|
|
let curMonth = new Date().getMonth() - 0 + 1 |
|
|
|
let communitySelfInspTop = res.data.list.filter(item => item.monthName-0 === curMonth).length?res.data.list.filter(item => item.monthName-0 === curMonth)[0]:{} |
|
|
|
let communitySelfInspList = res.data.list.filter(item => item.monthName-0 !== curMonth).splice(0,2) |
|
|
|
this.setData({ |
|
|
|
communitySelfInspTop,communitySelfInspList,curMonth |
|
|
|
}) |
|
|
|
// this.setData({
|
|
|
|
// communitySelfInspTop:res.data.list.splice(0,1)[0],
|
|
|
|
// communitySelfInspList:res.data.list.splice(0,2),
|
|
|
|
// })
|
|
|
|
app.globalData.questionnaireUrl = this.data.communitySelfInspTop.questionnaireUrl |
|
|
|
}).catch(err=>{ |
|
|
|
wx.hideLoading() |
|
|
|
console.log(err); |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
toDetaill(e){ |
|
|
|
wx.navigateTo({ |
|
|
|
url: `/subpages/communitySelfInsp/pages/synthesis/synthesis?inspRecordId=${encodeURIComponent(e.currentTarget.dataset.item.id)}&qrCodeImgUrl=${encodeURIComponent(e.currentTarget.dataset.item.qrCodeImgUrl)}&agencyName=${encodeURIComponent(e.currentTarget.dataset.item.agencyName)}&monthName=${encodeURIComponent(e.currentTarget.dataset.item.monthName)}&questionnaireUrl=${encodeURIComponent(e.currentTarget.dataset.item.questionnaireUrl)}&status=${encodeURIComponent(e.currentTarget.dataset.item.status)}` |
|
|
|
}) |
|
|
|
}, |
|
|
|
toSynthesis(){ |
|
|
|
wx.navigateTo({ |
|
|
|
url: `/subpages/communitySelfInsp/pages/synthesis/synthesis?inspRecordId=${this.data.communitySelfInspTop.id}&qrCodeImgUrl=${this.data.communitySelfInspTop.qrCodeImgUrl}&agencyName=${this.data.communitySelfInspTop.agencyName}&monthName=${this.data.communitySelfInspTop.monthName}&questionnaireUrl=${this.data.communitySelfInspTop.questionnaireUrl}`, |
|
|
|
}) |
|
|
|
}, |
|
|
|
toHistoryQuery(){ |
|
|
|
wx.navigateTo({ |
|
|
|
url: '/subpages/communitySelfInsp/pages/historyQuery/historyQuery', |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
onScrollToLower(e){ |
|
|
|
if (this.data.loadMoreType === 'more') { |
|
|
|
this.setData({ |
|
|
|