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.

studentSee.js 2.7 KiB

4 years ago
4 years ago
4 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. (function () {
  2. //数据
  3. var studentSeeData = {
  4. dataTimeList: [{
  5. value: "1",
  6. text: "2014-2015学年第一学期5月月考"
  7. }, {
  8. value: "2",
  9. text: "2014-2015学年第一学期4月月考"
  10. }],
  11. data: {
  12. classRanking: 11,
  13. achievement: 400,
  14. dataList: [
  15. { name: '酒店管理1(礼仪、会议)', achievement: '98' },
  16. { name: '酒店管理2(礼仪、会议)', achievement: '96' }
  17. ]
  18. }
  19. }
  20. var dataTimeList = studentSeeData.dataTimeList;
  21. var page = {
  22. isScroll: false,
  23. init: function ($page) {
  24. //获取学年学期列表
  25. learun.layer.loading(true, '获取数据中');
  26. learun.httpget(config.webapi + "scoreSearch/academicAndSemesterList", {}, (data) => {
  27. if (data == null || data.length <= 0) {
  28. $('.studSeeSec2 .studSeeSec2Top').hide();
  29. $('.studSeeSec2 .tips').show();
  30. return;
  31. }
  32. studentSeeData.dataTimeList = data;
  33. dataTimeList = studentSeeData.dataTimeList;
  34. //获取成绩列表
  35. studentSeeAjax(dataTimeList[0].value);
  36. //学年学期选择框
  37. $page.find('.studSeeSec1Box').lrpicker({
  38. placeholder: dataTimeList[0].text,
  39. data: dataTimeList,
  40. callbacks: function (res) {
  41. studentSeeAjax(res.value)
  42. }
  43. });
  44. learun.layer.loading(false);
  45. });
  46. }
  47. };
  48. //数据处理
  49. function studentSeeAjax(id) {
  50. var param = { value: id };
  51. learun.httpget(config.webapi + "scoreSearch/scoreList", param, (data) => {
  52. if(data != null){
  53. var html1 = '<div class="studSeeSec2Txt">' +
  54. '<div><span>' + data.Rank + '</span>名</div><div>班级排名</div>' +
  55. '</div>' +
  56. '<div class="studSeeSec2Line"></div>' +
  57. '<div class="studSeeSec2Txt">' +
  58. '<div><span>' + data.TotalScore + '</span>分</div><div>综合成绩</div>' +
  59. '</div>';
  60. $('.studSeeSec2TopBox').html(html1);
  61. var html2 = '';
  62. $.each(data.ScoreList, function (i, n) {
  63. html2 += '<li><img src="images/book.png" alt="" />' + n.LessonName + '<span>' + n.Score + '分</span></li>';
  64. });
  65. $('.studSeeSec2List').html(html2);
  66. }
  67. });
  68. }
  69. return page;
  70. })();