my-log.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. var app = getApp()
  2. var api = require('../../utils/api.js');
  3. Page({
  4. data: {
  5. loged: [
  6. {
  7. month: 'current',
  8. day: '1',
  9. color: '#77b9b9'
  10. },
  11. {
  12. month: 'current',
  13. day: '2',
  14. color: '#77b9b9'
  15. },
  16. {
  17. month: 'current',
  18. day: '3',
  19. color: '#f65556'
  20. },
  21. {
  22. month: 'current',
  23. day: '4',
  24. color: '#f65556'
  25. },
  26. {
  27. month: 'current',
  28. day: '5',
  29. color: '#f65556'
  30. }, {
  31. month: 'current',
  32. day: '6',
  33. color: '#77b9b9'
  34. },
  35. {
  36. month: 'current',
  37. day: '7',
  38. color: '#77b9b9'
  39. },
  40. {
  41. month: 'current',
  42. day: '8',
  43. color: '#77b9b9'
  44. },
  45. {
  46. month: 'current',
  47. day: '9',
  48. color: '#77b9b9'
  49. },
  50. ],
  51. thisMonthLearnTime: 0,
  52. totalLearnTime: 0,
  53. checkCardDays: 0
  54. },
  55. onLoad: function () {
  56. var pt_student = wx.getStorageSync('pt_student')
  57. wx.request({
  58. url: api.getMyLearnInfoUrl,
  59. method: 'GET',
  60. data: {
  61. 'student_id': pt_student.id
  62. },
  63. success: res => {
  64. if (res.data.status == 'success') {
  65. console.log(res)
  66. this.setData({
  67. loged: res.data.checkCardList,
  68. thisMonthLearnTime: res.data.thisMonthLearnTime,
  69. totalLearnTime: res.data.totalLearnTime,
  70. checkCardDays: res.data.checkCardDays
  71. })
  72. }
  73. }
  74. })
  75. }
  76. })