mediaDetail.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. const pages = require('../../mixin/pages')
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. ...pages.data(),
  8. listUrl: '/api/user/video/comment/list',
  9. searchForm: {
  10. 'video_id': ''
  11. },
  12. videoConfig: {}
  13. },
  14. ...pages.methods,
  15. /**
  16. * 生命周期函数--监听页面加载
  17. */
  18. onLoad(options) {
  19. const { videoConfig } = options
  20. if (videoConfig) {
  21. const temp = JSON.parse(videoConfig)
  22. this.setData({
  23. videoConfig: temp,
  24. 'searchForm.video_id': temp.id
  25. }, () => {
  26. this.fetchOrderList()
  27. })
  28. }
  29. },
  30. /**
  31. * 生命周期函数--监听页面初次渲染完成
  32. */
  33. onReady() {
  34. },
  35. /**
  36. * 生命周期函数--监听页面显示
  37. */
  38. onShow() {
  39. },
  40. /**
  41. * 生命周期函数--监听页面隐藏
  42. */
  43. onHide() {
  44. },
  45. /**
  46. * 生命周期函数--监听页面卸载
  47. */
  48. onUnload() {
  49. },
  50. /**
  51. * 页面相关事件处理函数--监听用户下拉动作
  52. */
  53. onPullDownRefresh() {
  54. if (this.data.freshing) {
  55. return
  56. }
  57. this.setData({
  58. freshing: true
  59. })
  60. this.bindCallBack()
  61. },
  62. /**
  63. * 页面上拉触底事件的处理函数
  64. */
  65. onReachBottom() {
  66. this.fetchOrderList()
  67. },
  68. bindCallBack() {
  69. this.refreshOrderList()
  70. }
  71. })