mycourse.js 549 B

12345678910111213141516171819202122232425262728
  1. var app = getApp()
  2. var api = require('../../utils/api.js');
  3. Page({
  4. data: {
  5. courseInfo: null,
  6. is_new: true
  7. },
  8. onLoad: function () {
  9. let pt_student = wx.getStorageSync('pt_student')
  10. wx.request({
  11. url: api.getCourseInfoUrl,
  12. method: 'GET',
  13. data: {
  14. 'student_id': pt_student.id
  15. },
  16. success: res => {
  17. if (res.data.status == 'success') {
  18. this.setData({
  19. courseInfo: res.data.courseInfo,
  20. is_new: res.data.is_new
  21. })
  22. }
  23. }
  24. })
  25. }
  26. })