myread.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. import APIClient from '../../../utils/APIClient.js'
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. wareCards: [
  8. {
  9. title: "古诗词诵读(一)江南",
  10. grade: "一年级(上学期)",
  11. avatarUrl: '../../../static/image/timg.jpg',
  12. previewUrl: "../../../static/image/timg.jpg",
  13. plays: "17230",
  14. likes: "71230",
  15. classId: "1",
  16. avatar: '../../static/image/timg.jpg',
  17. nickName: '喔喔',
  18. time: '10-18 09:56'
  19. },
  20. {
  21. title: "古诗词诵读(一)江南",
  22. grade: "一年级(上学期)",
  23. avatarUrl: '../../../static/image/timg.jpg',
  24. previewUrl: "../../../static/image/timg.jpg",
  25. plays: "17230",
  26. likes: "71230",
  27. classId: "1",
  28. avatar: '../../static/image/timg.jpg',
  29. nickName: '喔喔',
  30. time: '10-18 09:56'
  31. },
  32. {
  33. title: "古诗词诵读(一)江南",
  34. grade: "一年级(上学期)",
  35. avatarUrl: '../../../static/image/timg.jpg',
  36. previewUrl: "../../../static/image/timg.jpg",
  37. plays: "17230",
  38. likes: "71230",
  39. classId: "1",
  40. avatar: '../../static/image/timg.jpg',
  41. nickName: '喔喔',
  42. time: '10-18 09:56'
  43. },
  44. {
  45. title: "古诗词诵读(一)江南",
  46. grade: "一年级(上学期)",
  47. avatarUrl: '../../../static/image/timg.jpg',
  48. previewUrl: "../../../static/image/timg.jpg",
  49. plays: "17230",
  50. likes: "71230",
  51. classId: "1",
  52. avatar: '../../static/image/timg.jpg',
  53. nickName: '喔喔',
  54. time: '10-18 09:56'
  55. },
  56. {
  57. title: "古诗词诵读(一)江南",
  58. grade: "一年级(上学期)",
  59. avatarUrl: '../../../static/image/timg.jpg',
  60. previewUrl: "../../../static/image/timg.jpg",
  61. plays: "17230",
  62. likes: "71230",
  63. classId: "1",
  64. avatar: '../../static/image/timg.jpg',
  65. nickName: '喔喔',
  66. time: '10-18 09:56'
  67. },
  68. {
  69. title: "古诗词诵读(一)江南",
  70. grade: "一年级(上学期)",
  71. avatarUrl: '../../../static/image/timg.jpg',
  72. previewUrl: "../../../static/image/timg.jpg",
  73. plays: "17230",
  74. likes: "71230",
  75. classId: "1",
  76. avatar: '../../static/image/timg.jpg',
  77. nickName: '喔喔',
  78. time: '10-18 09:56'
  79. }
  80. ]
  81. },
  82. toWork: function (e) {
  83. let lessonId = e.currentTarget.dataset.lessonid;
  84. let title = e.currentTarget.dataset.title;
  85. wx.navigateTo({
  86. url: `../../social/works/works?id=${lessonId}&title=${title}`
  87. });
  88. },
  89. /**
  90. * 生命周期函数--监听页面加载
  91. */
  92. onLoad: function (option) {
  93. console.log(option.title);
  94. if (option.title) {
  95. wx.setNavigationBarTitle({
  96. title: option.title//页面标题为路由参数
  97. });
  98. this.setData({
  99. title: option.title
  100. });
  101. }
  102. APIClient.myRead().success(res => {
  103. console.log(res.data.data.list);
  104. debugger;
  105. this.setData({
  106. wareCards: res.data.data.list
  107. });
  108. }).fail(err => {
  109. console.log(err);
  110. });
  111. },
  112. /**
  113. * 生命周期函数--监听页面初次渲染完成
  114. */
  115. onReady: function () {
  116. },
  117. /**
  118. * 生命周期函数--监听页面显示
  119. */
  120. onShow: function () {
  121. },
  122. /**
  123. * 生命周期函数--监听页面隐藏
  124. */
  125. onHide: function () {
  126. },
  127. /**
  128. * 生命周期函数--监听页面卸载
  129. */
  130. onUnload: function () {
  131. },
  132. /**
  133. * 页面相关事件处理函数--监听用户下拉动作
  134. */
  135. onPullDownRefresh: function () {
  136. },
  137. /**
  138. * 页面上拉触底事件的处理函数
  139. */
  140. onReachBottom: function () {
  141. },
  142. /**
  143. * 用户点击右上角分享
  144. */
  145. onShareAppMessage: function () {
  146. }
  147. })