list.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. const _Http = getApp().globalData.http,
  2. getHeight = require("../../utils/getRheRemainingHeight");
  3. let content = null;
  4. Page({
  5. data: {
  6. },
  7. onLoad(options) {
  8. content = {
  9. nacache: true,
  10. pageNumber: 1,
  11. pageSize: 999,
  12. where: {
  13. condition: "",
  14. sat_courseware_classid: options.id,
  15. learnstatus: ""
  16. }
  17. }
  18. this.getList()
  19. },
  20. getList() {
  21. _Http.basic({
  22. "classname": "saletool.courseware.courseware",
  23. "method": "selectList",
  24. content
  25. }).then(res => {
  26. console.log('课程列表', res)
  27. this.selectComponent('#ListBox').RefreshToComplete();
  28. if (res.msg != '成功') return wx.showToast({
  29. title: res.msg,
  30. icon: "none"
  31. });
  32. this.setData({
  33. list: res.data,
  34. total: res.total
  35. })
  36. })
  37. },
  38. tabsChange(e) {
  39. content.where.learnstatus = e.detail.title == '全部' ? '' : e.detail.title;
  40. this.getList();
  41. },
  42. onSearch({
  43. detail
  44. }) {
  45. content.where.condition = detail;
  46. this.getList();
  47. },
  48. onReady() {
  49. getHeight.getHeight('.head', this).then(scrollHeight => this.setData({
  50. scrollHeight
  51. }))
  52. },
  53. toExam() {
  54. wx.navigateTo({
  55. url: '/pages/exam/index',
  56. })
  57. }
  58. })