var app = getApp(); var that; Page({ data: { noticeList: [] }, onLoad(e) { that = this dd.setNavigationBar({ title: "公告列表" }); }, onShow() { if (app.globalData.userData) { dd.hideLoading(); that.getList(); } else { app.login(app.globalData.corpId, function (is) { if (is) { dd.hideLoading(); that.getList(); } else { dd.reLaunch({ url: '../../noJurisdiction/noJurisdiction' }) } }, function () { }) } }, getList() { app.$get("api/information/list").then((res) => { console.log(res.data.data) this.setData({ noticeList: res.data.data.list }) }) }, getDetails(e) { var id = e.target.dataset.id; console.log(id) dd.navigateTo({ url: '../noticeDetail/noticeDetail?id=' + id }) } });