index.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. const _Http = getApp().globalData.http;
  2. let content = null;
  3. let condition = "";
  4. Page({
  5. data: {
  6. },
  7. onLoad(options) {},
  8. getList() {
  9. _Http.basic({
  10. "classname": "saletool.courseware.courseware",
  11. "method": "selectMenu",
  12. "content": {
  13. pageSize: 999,
  14. "where": {
  15. condition
  16. }
  17. }
  18. }).then(res => {
  19. console.log('分类', res)
  20. if (res.msg != '成功') return wx.showToast({
  21. title: res.msg,
  22. icon: "none"
  23. });
  24. this.setData({
  25. list: res.data
  26. })
  27. })
  28. _Http.basic({
  29. "classname": "saletool.courseware.courseware",
  30. "method": "queryReadLog",
  31. "content": {
  32. "pageNumber": 1,
  33. "pageSize": 15,
  34. "where": {
  35. condition
  36. }
  37. }
  38. }).then(res => {
  39. console.log('学习足迹', res)
  40. if (res.msg != '成功') return wx.showToast({
  41. title: res.msg,
  42. icon: "none"
  43. });
  44. this.setData({
  45. history: res.data
  46. })
  47. })
  48. },
  49. onSearch({detail}){
  50. condition = detail;
  51. this.getList()
  52. },
  53. onShow() {
  54. this.getList()
  55. },
  56. toExam() {
  57. wx.navigateTo({
  58. url: '/pages/exam/index',
  59. })
  60. }
  61. })