You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.1 KiB
60 lines
1.1 KiB
6 years ago
|
// 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()
|
||
|
},
|
||
|
})
|