news.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import Config from "../../model/config";
  2. import {htmlTypes} from "../../model/enum";
  3. Page({
  4. dict: {
  5. [htmlTypes.BANNER]: {
  6. url: 'propagandaVideo.html?',
  7. title: 'banner链接'
  8. },
  9. [htmlTypes.NEWS]: {
  10. url: 'articles.html?',
  11. title: '文章链接'
  12. },
  13. [htmlTypes.COURSE]: {
  14. url: 'courseMng.html?',
  15. title: '精品课链接'
  16. },
  17. [htmlTypes.HELP]: {
  18. url: 'appInfoList.html?',
  19. title: '帮助文档链接'
  20. },
  21. [htmlTypes.SEAT]: {
  22. url: 'seatArrange.html?scheduleId=',
  23. title: '座位图'
  24. },
  25. [htmlTypes.STUDENT_BOOK]: {
  26. url: 'studentBook.html?teamId=',
  27. title: '学员手册'
  28. },
  29. [htmlTypes.INTEGRAL_RULE]: {
  30. url: 'integralRule.html?',
  31. title: '积分规则'
  32. },
  33. },
  34. data: {
  35. url: '',
  36. },
  37. onLoad: function (options) {
  38. const {
  39. title,
  40. type,
  41. id,
  42. eId,
  43. teamId,
  44. index
  45. } = options;
  46. wx.setNavigationBarTitle({
  47. title,
  48. })
  49. // if (type == htmlTypes.SEAT) {
  50. // this.setData({
  51. // url: `${Config.HTML_API}${this.dict[htmlTypes.SEAT].url}${id}&studentId=${eId}`
  52. // })
  53. // } else if (type == htmlTypes.STUDENT_BOOK) {
  54. // this.setData({
  55. // url: `${Config.HTML_API}${this.dict[htmlTypes.STUDENT_BOOK].url}${teamId}&active=${index}`
  56. // })
  57. // } else {
  58. // this.setData({
  59. // url: `${Config.HTML_API}${this.dict[type].url}${id}`
  60. // })
  61. // }
  62. let url = "";
  63. switch (parseInt(type)) {
  64. case htmlTypes.SEAT:
  65. url = `${Config.HTML_API}${this.dict[htmlTypes.SEAT].url}${id}&studentId=${eId}`;
  66. break;
  67. case htmlTypes.STUDENT_BOOK:
  68. url = `${Config.HTML_API}${this.dict[htmlTypes.STUDENT_BOOK].url}${teamId}&active=${index}`;
  69. break;
  70. case htmlTypes.INTEGRAL_RULE:
  71. url = `${Config.HTML_API}${this.dict[htmlTypes.INTEGRAL_RULE].url}`;
  72. break;
  73. default:
  74. url = `${Config.HTML_API}${this.dict[type].url}${id}`;
  75. break;
  76. }
  77. this.setData({
  78. url
  79. });
  80. },
  81. })