// index.js const { index, util } = getApp().globalData Page({ data: { recruit: [ { type: 1, title: '失物招领', src: '../../images/index-icon/release.png' }, { type: 2, title: '寻物寻事', src: '../../images/index-icon/search.png' }, ], movies: [{ url: '../../images/Rotating/3.jpg' }, { url: '../../images/Rotating/news.png' }, { url: '../../images/Rotating/1.jpg' }, { url: '../../images/Rotating/2.jpg' } ], noticeList: [] }, onLoad() { this.getNotice(); // if (typeof wx.getStorageSync('user') == "object" ) { // } }, enterSearch() { wx.navigateTo({ url: '/pages/search/search', }) }, enterPush(e) { wx.navigateTo({ url: `/pages/push/push?id=${e.currentTarget.dataset.id}`, }) }, async getNotice() { let res = await index.notice(); this.setData({ noticeList: res }) } })