lessonsList.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // pages/Components/lessonsList/lessonsList.js
  2. Component({
  3. lifetimes: {
  4. attached: function () {
  5. // 在组件实例进入页面节点树时执行
  6. },
  7. detached: function () {
  8. // 在组件实例被从页面节点树移除时执行
  9. },
  10. },
  11. /**
  12. * 组件的属性列表
  13. */
  14. properties: {
  15. list: {
  16. type: Array,
  17. value: []
  18. },
  19. showBtn: {
  20. type: Boolean,
  21. value: true,
  22. },
  23. showDate: {
  24. type: Boolean,
  25. value: true,
  26. },
  27. action: {
  28. type: String,
  29. value: '0'
  30. }
  31. },
  32. /**
  33. * 组件的初始数据
  34. */
  35. data: {
  36. },
  37. /**
  38. * 组件的方法列表
  39. */
  40. methods: {
  41. toPages: function (e) {
  42. let item = this.properties.list.filter(o => o.attenceStudentId == e.currentTarget.dataset.id)[0]
  43. let action = e.currentTarget.dataset.action
  44. if (action == 1) {
  45. item.classRoomId = ''// 补课不指定教室
  46. item.curDate = item.beginTime.substring(0, 10)
  47. }
  48. wx.navigateTo({
  49. url: e.currentTarget.dataset.url + '?data=' + JSON.stringify({ source: item, action: (action ? action : 0), dayScope: 14 }),
  50. })
  51. },
  52. }
  53. })