const { getNeedToDealList } = require('../../api/api') const { routeLink } = require("../../utils/route.js"); Page({ data: { listData: [], pageSize: 10, //分页条数 loadEnd: false, //加载到最底部 }, onLoad(options) { }, /** * 生命周期函数--监听页面显示 */ onShow() { this.setData({ pageNum: 1, //分页页面 }) this.getList() if (typeof this.getTabBar === 'function' && this.getTabBar()) { this.getTabBar().setData({ selected: 1 }) } }, //列表 getList(){ wx.showLoading({ title: '加载中', }) getNeedToDealList({ userId: wx.getStorageSync('userId'), traderId: wx.getStorageSync('traderId'), page: this.data.pageNum, limit: this.data.pageSize, }).then(res => { wx.hideLoading() wx.stopPullDownRefresh() if(res.code == 200){ // console.log(666, res.data) res.data.map(item=>{ let str = item.createTime; item.createTime = str.substring(5,16) }) this.data.loadEnd = res.data.length < this.data.pageSize if (this.data.pageNum == 1) { this.data.listData = res.data } else { this.data.listData = this.data.listData.concat(res.data) } if (!this.data.loadEnd) { this.data.pageNum++; } this.setData({ count: res.count, listData: this.data.listData, loadEnd: this.data.loadEnd, }) } }).catch(err => { }) }, /** 处理详情 **/ toDetail(res){ let type = res.currentTarget.dataset.type let partnerId = res.currentTarget.dataset.partnerid; if(type == '91'){ //设计审核 console.log(98989, partnerId) if(partnerId == '04'){//华融 wx.navigateTo({ url: '/home/pages/entryInfoAuditHR/entryInfoAuditHR?projectId=' + res.currentTarget.dataset.projectid + "&navTitle=设计审核", }) }else{ wx.navigateTo({ url: '/home/pages/entryInfoAudit/entryInfoAudit?projectId=' + res.currentTarget.dataset.projectid + "&navTitle=设计审核", }) } }else if(type == '92'){//档案审核 wx.navigateTo({ url: '/home/pages/filesForm/filesForm?projectId=' + res.currentTarget.dataset.projectid + "&navTitle=档案审核&type=18", }) }else if(type == '93'){//安装验收 wx.navigateTo({ url: '/home/pages/acceptanceAZ/acceptanceAZ?projectId=' + res.currentTarget.dataset.projectid + "&navTitle=安装验收", }) }else if(type == '94'){//并网验收 wx.navigateTo({ url: '/home/pages/acceptanceBW/acceptanceBW?projectId=' + res.currentTarget.dataset.projectid + "&navTitle=并网验收&status=7", }) } }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { this.setData({ pageNum: 1, pageSize: 10, loadEnd: false, }) this.getList() }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { if (!this.data.loadEnd) { this.getList() } else { wx.showToast({ title: '暂无更多数据', icon: 'none', duration: 500 }) } }, })