news.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import Config from "../../model/config";
  2. import {htmlTypes} from "../../model/enum";
  3. Page({
  4. dict: {
  5. [htmlTypes.BANNER]: {url: 'propagandaVideo.html?', title: 'banner链接'},
  6. [htmlTypes.NEWS]: {url: 'articles.html?', title: '文章链接'},
  7. [htmlTypes.COURSE]: {url: 'courseMng.html?', title: '精品课链接'},
  8. [htmlTypes.HELP]: {url: 'appInfoList.html?', title: '帮助文档链接'},
  9. [htmlTypes.SEAT]: {url: 'seatArrange.html?scheduleId=', title: '座位图'},
  10. [htmlTypes.STUDENT_BOOK]: {url: 'studentBook.html?teamId=', title: '学员手册'},
  11. },
  12. data: {
  13. url: '',
  14. },
  15. onLoad: function (options) {
  16. const {title, type, id, eId, teamId, index} = options;
  17. wx.setNavigationBarTitle({
  18. title,
  19. })
  20. if (type == htmlTypes.SEAT) {
  21. this.setData({
  22. url: `${Config.HTML_API}${this.dict[htmlTypes.SEAT].url}${id}&studentId=${eId}`
  23. })
  24. } else if (type == htmlTypes.STUDENT_BOOK) {
  25. this.setData({
  26. url: `${Config.HTML_API}${this.dict[htmlTypes.STUDENT_BOOK].url}${teamId}&active=${index}`
  27. })
  28. } else {
  29. this.setData({
  30. url: `${Config.HTML_API}${this.dict[type].url}${id}`
  31. })
  32. }
  33. },
  34. })