// pages/html/notice/index.js import { getIndexInfo } from "../../api/ztb" const util = require('../../../utils/util') Page({ /** * 页面的初始数据 */ data: { noticeInfo: null }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { if(!util.isEmpty(options.id)){ wx.showLoading({ title: '加载中', mask: true }) getIndexInfo(options.id).then(result => { wx.hideLoading() this.setData({ noticeInfo: result.data }) }).catch(err => { wx.hideLoading() }) } } })