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.
 
 
 
 
 
 

75 lines
2.7 KiB

  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. console.log(data)
  28. if (data == null || data.length <= 0) {
  29. $('.studSeeSec2 .studSeeSec2Top').hide();
  30. $('.studSeeSec2 .tips').show();
  31. return;
  32. }
  33. studentSeeData.dataTimeList = data;
  34. dataTimeList = studentSeeData.dataTimeList;
  35. //获取成绩列表
  36. studentSeeAjax(dataTimeList[0].value);
  37. //学年学期选择框
  38. $page.find('.studSeeSec1Box').lrpicker({
  39. placeholder: dataTimeList[0].text,
  40. data: dataTimeList,
  41. callbacks: function (res) {
  42. studentSeeAjax(res.value)
  43. }
  44. });
  45. learun.layer.loading(false);
  46. });
  47. }
  48. };
  49. //数据处理
  50. function studentSeeAjax(id) {
  51. var param = { value: id };
  52. learun.httpget(config.webapi + "scoreSearch/scoreList", param, (data) => {
  53. console.log(data)
  54. if(data != null){
  55. var html1 = '<div class="studSeeSec2Txt">' +
  56. '<div><span>' + data.Rank + '</span>名</div><div>班级排名</div>' +
  57. '</div>' +
  58. '<div class="studSeeSec2Line"></div>' +
  59. '<div class="studSeeSec2Txt">' +
  60. '<div><span>' + data.TotalScore + '</span>分</div><div>综合成绩</div>' +
  61. '</div>';
  62. $('.studSeeSec2TopBox').html(html1);
  63. var html2 = '';
  64. $.each(data.ScoreList, function (i, n) {
  65. html2 += '<li><img src="images/book.png" alt="" />' + n.LessonName + '<span>' + n.Score + '分</span></li>';
  66. });
  67. $('.studSeeSec2List').html(html2);
  68. }
  69. });
  70. }
  71. return page;
  72. })();