index.js 767 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import {
  2. createStoreBindings
  3. } from 'mobx-miniprogram-bindings'
  4. import {
  5. store
  6. } from '~/store/index'
  7. Page({
  8. /**
  9. * 页面的初始数据
  10. */
  11. data: {
  12. score: {},
  13. },
  14. /**
  15. * 生命周期函数--监听页面加载
  16. */
  17. onLoad(options) {
  18. this.storeBindings = createStoreBindings(this, {
  19. store,
  20. fields: {
  21. userInfo: 'userInfo',
  22. readDetail: 'readDetail'
  23. },
  24. })
  25. this.storeBindings.updateStoreBindings()
  26. let score = this.data.readDetail
  27. wx.setNavigationBarTitle({
  28. title: score.title
  29. })
  30. this.setData({
  31. score,
  32. })
  33. },
  34. backReading() {
  35. wx.redirectTo({
  36. url: `/pages/reading/index?videoId=${this.data.score.id}&reset=true`,
  37. })
  38. },
  39. onShareAppMessage() {
  40. }
  41. })