index.js 903 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import behavior from '~/mixins/video'
  2. import reachBottom from '~/mixins/reachBottom'
  3. import share from '~/mixins/share'
  4. import {
  5. getreadInfo
  6. } from '~/api/video'
  7. import {
  8. getPkRecord
  9. } from '~/api/works'
  10. Page({
  11. behaviors: [behavior, share, reachBottom],
  12. data: {
  13. videoInfo: {},
  14. videoId: ''
  15. },
  16. /**
  17. * 生命周期函数--监听页面加载
  18. */
  19. onLoad(options) {
  20. console.log(options);
  21. let videoId = options.videoId
  22. this.setData({
  23. videoId
  24. })
  25. this.getreadInfo(videoId)
  26. this.resetData()
  27. },
  28. async getreadInfo(videoId) {
  29. let videoInfo = await getreadInfo(videoId)
  30. wx.setNavigationBarTitle({
  31. title: videoInfo.userRead.title
  32. })
  33. this.setData({
  34. videoInfo
  35. })
  36. },
  37. loadMore() {
  38. this.getData(getPkRecord, {
  39. userReadId: this.data.videoId
  40. })
  41. },
  42. onHide() {
  43. this.setData({
  44. currentId: ''
  45. })
  46. }
  47. })