家长须知 行业快报
MIP.setData({ p:urlParams('p'), keywords:urlParams('keywords') }) function urlParams(paramName) { var reg = new RegExp("[\?&]" + paramName + "=([^&]*)[&]?", "i"); var paramVal = window.location.search.match(reg); return paramVal == null ? "" : decodeURIComponent(paramVal[1]); } getNews(); MIP.watch('page', (newVal, oldVal) => { getNews() }) function getNews(){ fetch('/rest/news/list/mobile?page=' + MIP.getData("page") +'&newsType=1&rows=5') .then(data => { return data.json() }) .then(data => { if(data.status == 200){ var isEnd = data.data.total>data.data.page*data.data.rows?0:1; MIP.setData({ newsList: data.data.data, isEnd: isEnd }) } }) .catch(e => { console.error(e.message); }) }