index.js 851 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. },
  15. /**
  16. * 生命周期函数--监听页面加载
  17. */
  18. onLoad(options) {
  19. console.log(options);
  20. let videoId = options.videoId
  21. this.getreadInfo(videoId)
  22. /* this.resetData({
  23. userReadId: videoId
  24. }) */
  25. },
  26. async getreadInfo(videoId) {
  27. let videoInfo = await getreadInfo(videoId)
  28. wx.setNavigationBarTitle({
  29. title: videoInfo.userRead.title
  30. })
  31. this.setData({
  32. videoInfo
  33. })
  34. },
  35. loadMore(data) {
  36. this.getData(getPkRecord, data)
  37. },
  38. onHide() {
  39. this.setData({
  40. currentId: ''
  41. })
  42. }
  43. })