// pages/billboards/park/index.js import { BillboardModel } from '../../../../models/billboard.js' let billboard = new BillboardModel() Page({ /** * 页面的初始数据 */ data: { list: [], curCode: '', curPage:1, }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { const {code} = options console.log(code) this.setData({ curCode: code }) this.fetchList() }, clickCardItem (e) { console.log(e.detail) const { id } = e.detail wx.navigateTo({ url: `/pages/article/index?id=${id}`, }) }, fetchList () { const {curCode} = this.data const page = this.data.curPage billboard.fetchBailList(curCode, page, res => { console.log(res) }) }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { this.setData({ curPage: 1, }) this.fetchList() }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { const page = this.data.curPage + 1 this.setData({ curPage: page }) this.fetchList() }, })