import { API } from './../../../utils/network/api' const api = new API() const app = getApp() Page({ data: { navbarData: { showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示 title: '服务通知', //导航栏 中间的标题 }, height: app.globalData.height, visible: false, list: [], current_page: 0, total: 0, per_page: 0, last_page: 0, }, onShow(){ this.getList(); }, getList(){ let current_page = this.data.current_page; current_page = current_page + 1; this.setData({ current_page: current_page }) let list = this.data.list; api.getDoctorMessageService({page: current_page}).then(response => { console.log(response); this.setData({ list: list.concat(response.data.data), current_page: response.data.current_page, total: response.data.total, per_page: response.data.per_page, last_page: response.data.last_page, }) }).catch(errors => {console.error(errors);}) }, onReachBottom() { console.log('===触底了!!==='); if(this.data.current_page < this.data.last_page){//最后一页时停止分页 this.getList() } }, putMessageReadNoticeAll(){ api.putMessageReadNoticeAll({notice_type: 1}).then(response => { console.log(response); }).catch(errors => {console.error(errors);}) } })