const api = require('../../../../utils/home') import { getTimestamp } from '../../../../utils/common' Page({ data: { pageNo: 1, pageSize: 10, timestamp: getTimestamp(), issueLoadMoreVisible: false, loadMoreType: 'loading', noticeList: [] }, onLoad() { this.getNoticeList() }, onReachBottom() { console.log('加载翻页') this.setData({ issueLoadMoreVisible: true }) if (this.data.loadMoreType === 'loading') { this.setData({ pageNo: this.data.pageNo + 1, pageSize: this.data.pageSize, pageIndex: getTimestamp() }) this.getNoticeList() } }, to_call: function (e) { console.log('e', e.currentTarget.dataset.phone) wx.makePhoneCall({ phoneNumber: e.currentTarget.dataset.phone }) }, // 加载网格长管辖的网格列表 getNoticeList() { let that = this let para = { pageIndex: this.data.pageNo, pageSize: this.data.pageSize, timestamp: getTimestamp() } api.getConsultion(para).then(res => { that.setData({ noticeList: that.data.noticeList.concat(res.data), loadMoreType: res.data.length === 10 ? 'loading' : 'none' }) }).catch(err => { console.log(err) that.setData({ preloadVisible: false, loadMoreType: 'none' }) }) }, // toDetail (e) { // console.log(e.currentTarget.dataset.id) // wx.navigateTo({ url: '/subpages/home/pages/noticeDetail/noticeDetail?id='+e.currentTarget.dataset.id }) // } })