星火官网,前端页面(前台)
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.

service.js 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. $(function () {
  2. $(".header_root").load("./comm/header.html");
  3. $(".footer_root").load("./comm/footer.html");
  4. // 6.5.1 中文列表 学校图标
  5. var school_logo = [],
  6. html_logo = "",
  7. html_data = "";
  8. school_data = [];
  9. $.ajax({
  10. type: "POST",
  11. url: $.baseUrl + "/sl/listc",
  12. dataType: "json",
  13. async: false,
  14. contentType: "application/json; charset=utf-8",
  15. success: function (data) {
  16. if (data.code === 0) {
  17. school_logo = data.obj;
  18. $.each(school_logo, (idx, item) => {
  19. html_logo += ` <div class="ser_sc_info">
  20. <img src="${$.showImageUrl}${item.schoollogo}" />
  21. <div>${item.schoolname}</div>
  22. </div>`;
  23. });
  24. $(".ser_school").html(html_logo);
  25. } else {
  26. alert(data.msg);
  27. }
  28. }
  29. });
  30. //5.5.1 中文列表 服务数据
  31. $.ajax({
  32. type: "POST",
  33. url: $.baseUrl + "/sc/listc",
  34. dataType: "json",
  35. data: JSON.stringify({
  36. size: 30
  37. }),
  38. async: false,
  39. contentType: "application/json; charset=utf-8",
  40. success: function (data) {
  41. if (data.code === 0) {
  42. school_data = data.obj;
  43. school_data = school_data.concat(data.obj);
  44. $.each(school_data, (idx, item) => {
  45. html_data += ` <div class="swiper-slide ser_con">
  46. <img src="${$.showImageUrl}${item.scpic}" />
  47. <div>${item.scname}</div>
  48. </div>`;
  49. });
  50. $(".swiper-wrapper").html(html_data);
  51. } else {
  52. alert(data.msg);
  53. }
  54. }
  55. });
  56. var serSwiper = new Swiper(".ser_swiper_container.swiper-container", {
  57. slidesPerView: 3,
  58. loop: true,
  59. autoplay: 3000
  60. });
  61. });