import { useLoading } from '../../../behaviors/loading'; import { fetchNews } from '../../../services/news/fetchNews'; import { openDoc } from '../../../utils/file'; Page({ behaviors: [useLoading], data: { }, onLoad(options) { this._startLoad(); }, onPullDownRefresh() { this._startLoad(); }, onReachBottom() { this._loadMore(); }, _fetchData(page) { // 执法动态 const sceneTypeId = '7'; return fetchNews({ page: page, data: { fileType: 1, sceneTypeId }, }).then(res => { this.setData({ infoList: page == 1 ? res.data : this.data.infoList.concat(res.data), }); return res.head; }); }, navToInfoPage(e) { let { url, fileType } = e.detail; switch (fileType) { // office文档 case 1: openDoc(url); break; default: break; } }, })