You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

preface.js 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. $(function() {
  2. function getGradeName (gradeid) {
  3. var gradename = "";
  4. if (gradeid == 1) {
  5. gradename = "一年级";
  6. } else if (gradeid == 2) {
  7. gradename = "二年级";
  8. } else if (gradeid == 3) {
  9. gradename = "三年级";
  10. } else if (gradeid == 4) {
  11. gradename = "四年级";
  12. } else if (gradeid == 5) {
  13. gradename = "五年级";
  14. } else if (gradeid == 6) {
  15. gradename = "六年级";
  16. } else if (gradeid == 7) {
  17. gradename = "七年级";
  18. } else if (gradeid == 8) {
  19. gradename = "八年级";
  20. } else if (gradeid == 9) {
  21. gradename = "九年级";
  22. } else if (gradeid == 10) {
  23. gradename = "高一";
  24. } else if (gradeid == 11) {
  25. gradename = "高二";
  26. } else if (gradeid == 12) {
  27. gradename = "高三";
  28. }
  29. return gradename;
  30. };
  31. // 考试类型 10期末20期中30月考40周考
  32. function getExamTypeName (examtype) {
  33. var examname = "";
  34. if (examtype == 10) {
  35. examname = "期末";
  36. } else if (examtype == 20) {
  37. examname = "期中";
  38. } else if (examtype == 30) {
  39. examname = "月考";
  40. } else if (examtype == 40) {
  41. examname = "周考";
  42. }
  43. return examname;
  44. };
  45. // outerHeight(true) 高度为 height+margin+padding+border
  46. var parameter =JSON.parse($(".preface_html_root").data("page-params"));
  47. console.log("preface:parameter", parameter);
  48. var gradename = getGradeName(parameter.ksgk.gradeid);
  49. var examname = getExamTypeName(parameter.ksgk.examtype);
  50. $(".preface .gradename").text(gradename);
  51. $(".preface .examtype").text(examname);
  52. $(".preface .classnum").text(parameter.ksgk.classnum);
  53. $(".preface .subjectnum").text(parameter.ksgk.subjectnum);
  54. $(".preface .allscore").text(parameter.ksgk.allscore);
  55. $(".preface .stunum").text(parameter.ksgk.stunum);
  56. $(".preface .qkunum").text(parameter.ksgk.missnum);
  57. $(".preface .sjnum").text(parameter.ksgk.stunum);
  58. $(".preface .maxscore").text(parameter.ksgk.maxscore);
  59. $(".preface .avgscore").text(parameter.ksgk.avgscore);
  60. });