// pages/notices/noticedetail.js const app = getApp() Page({ /** * 页面的初始数据 */ data: { noticeContent: '', articleId: '', detailBean: null }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { this.setData({ articleId: options.id }) this.getArticleDetail() }, getArticleDetail() { var _self = this wx.showLoading({ title: '加载中...', }) app.restAjax.get(app.restAjax.path(app.apis.getArticleDetailById, [app.baseUrls.cardUrl, _self.data.articleId]), {}, {}, (code, data) => { wx.hideLoading({}) if (code == 200) { _self.setData({ detailBean: data }) } }, (code, err) => { wx.hideLoading({}) }) } })