// pages/movie/movie.js Page({ /** * 页面的初始数据 */ data: { guochan: {}, zongyi: {}, meiju: {} }, //跳转 goListPage(event) { let _id = event.currentTarget.dataset.id wx.navigateTo({ url: '/pages/list/list?id=' + _id, }) }, //获取国产热播剧 getGuochan() { wx.request({ url: 'https://m.douban.com/rexxar/api/v2/subject_collection/tv_domestic/items?start=0&count=8', success: (res) => { console.log(res.data) this.setData({ guochan: res.data }) } }) }, //获取综艺节目 getZongyi() { wx.request({ url: 'https://m.douban.com/rexxar/api/v2/subject_collection/tv_variety_show/items?start=0&count=8', success: (res) => { console.log(res.data) this.setData({ zongyi: res.data }) } }) }, //获取美剧 getMeiju() { wx.request({ url: 'https://m.douban.com/rexxar/api/v2/subject_collection/tv_american/items?start=0&count=8', success: (res) => { this.setData({ meiju: res.data }) } }) }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { this.getGuochan() this.getZongyi() this.getMeiju() }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() { }, /** * 生命周期函数--监听页面显示 */ onShow() { }, /** * 生命周期函数--监听页面隐藏 */ onHide() { }, /** * 生命周期函数--监听页面卸载 */ onUnload() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { console.log(111) }, /** * 用户点击右上角分享 */ onShareAppMessage() { } })