// pages/appRecord/appRecord.js const {getOptList} = require('../../api/api'); Page({ /** * 页面的初始数据 */ data: { entryId: '', listData: [] }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { // console.log(2221, options) if(options.entryId){ this.setData({ entryId: options.entryId }) this.getList() } }, /** * 生命周期函数--监听页面显示 */ onShow() { }, //列表 getList(){ getOptList({ entryId: this.data.entryId, }).then(res => { if (res.code == '200' && res.data) { this.setData({ listData: JSON.parse(res.data) }) } else { wx.showToast({ title: res, icon: 'none', }) } }) }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { }, /** * 用户点击右上角分享 */ onShareAppMessage() { } })