const pages = require('../../mixin/pages') Page({ /** * 页面的初始数据 */ data: { ...pages.data(), listUrl: '/api/user/video/comment/list', searchForm: { 'video_id': '' }, videoConfig: {} }, ...pages.methods, /** * 生命周期函数--监听页面加载 */ onLoad(options) { const { videoConfig } = options if (videoConfig) { const temp = JSON.parse(videoConfig) this.setData({ videoConfig: temp, 'searchForm.video_id': temp.id }, () => { this.fetchOrderList() }) } }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() { }, /** * 生命周期函数--监听页面显示 */ onShow() { }, /** * 生命周期函数--监听页面隐藏 */ onHide() { }, /** * 生命周期函数--监听页面卸载 */ onUnload() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { if (this.data.freshing) { return } this.setData({ freshing: true }) this.bindCallBack() }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { this.fetchOrderList() }, bindCallBack() { this.refreshOrderList() } })