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.
46 lines
1.1 KiB
46 lines
1.1 KiB
6 years ago
|
const api = require('../../../../utils/home')
|
||
|
import { getTimestamp } from '../../../../utils/common'
|
||
|
Page({
|
||
|
data: {
|
||
|
pageNo: 1,
|
||
|
pageSize: 10,
|
||
|
timestamp: getTimestamp(),
|
||
|
noticeList: [],
|
||
|
gridName: ''
|
||
|
},
|
||
|
onLoad () {
|
||
|
this.setData({
|
||
|
gridName: wx.getStorageSync('topGridName')
|
||
|
})
|
||
|
this.getNoticeList()
|
||
|
},
|
||
|
onReachBottom () {
|
||
|
console.log('加载翻页')
|
||
|
this.setData({
|
||
|
pageNo: this.data.pageNo + 1,
|
||
|
pageSize: this.data.pageSize,
|
||
|
pageIndex: getTimestamp()
|
||
|
})
|
||
|
this.getNoticeList()
|
||
|
},
|
||
|
// 加载网格长管辖的网格列表
|
||
|
getNoticeList () {
|
||
|
let that = this
|
||
|
let para = {
|
||
|
pageIndex: this.data.pageNo,
|
||
|
pageSize: this.data.pageSize,
|
||
|
timestamp: getTimestamp()
|
||
|
}
|
||
|
api.getNoticeList(para).then(res => {
|
||
|
that.setData({
|
||
|
noticeList: that.data.noticeList.concat(res.data)
|
||
|
})
|
||
|
}).catch(err => {
|
||
|
console.log(err)
|
||
|
})
|
||
|
},
|
||
|
toDetail (e) {
|
||
|
console.log(e.currentTarget.dataset.id)
|
||
|
wx.navigateTo({ url: '/subpages/home/pages/noticeDetail/noticeDetail?id='+e.currentTarget.dataset.id })
|
||
|
}
|
||
|
})
|