index.js 950 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. readingType: ''
  15. },
  16. /**
  17. * 生命周期函数--监听页面加载
  18. */
  19. onLoad(options) {
  20. console.log(options);
  21. this.storeBindings = createStoreBindings(this, {
  22. store,
  23. fields: {
  24. userInfo: 'userInfo',
  25. readDetail: 'readDetail'
  26. },
  27. })
  28. this.storeBindings.updateStoreBindings()
  29. let score = this.data.readDetail
  30. wx.setNavigationBarTitle({
  31. title: score.title
  32. })
  33. this.setData({
  34. score,
  35. readingType: options.readingType ? options.readingType : ''
  36. })
  37. },
  38. backReading() {
  39. wx.redirectTo({
  40. url: `/pages/reading/index?videoId=${this.data.score.id}&reset=true`,
  41. })
  42. },
  43. onShareAppMessage() {
  44. }
  45. })