list.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // pages/list/list.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. listData: []
  8. },
  9. //获取国产热播剧
  10. getGuochan() {
  11. wx.request({
  12. url: 'https://m.douban.com/rexxar/api/v2/subject_collection/tv_domestic/items?start=0&count=8',
  13. success: (res) => {
  14. console.log(res.data)
  15. this.setData({
  16. listData: res.data.subject_collection_items
  17. })
  18. }
  19. })
  20. },
  21. /**
  22. * 生命周期函数--监听页面加载
  23. */
  24. onLoad(options) {
  25. console.log(options)
  26. this.getGuochan()
  27. },
  28. /**
  29. * 生命周期函数--监听页面初次渲染完成
  30. */
  31. onReady() {
  32. },
  33. /**
  34. * 生命周期函数--监听页面显示
  35. */
  36. onShow() {
  37. },
  38. /**
  39. * 生命周期函数--监听页面隐藏
  40. */
  41. onHide() {
  42. },
  43. /**
  44. * 生命周期函数--监听页面卸载
  45. */
  46. onUnload() {
  47. },
  48. /**
  49. * 页面相关事件处理函数--监听用户下拉动作
  50. */
  51. onPullDownRefresh() {
  52. },
  53. /**
  54. * 页面上拉触底事件的处理函数
  55. */
  56. onReachBottom() {
  57. },
  58. /**
  59. * 用户点击右上角分享
  60. */
  61. onShareAppMessage() {
  62. }
  63. })