网站
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools", "echarts", 'swiper'], function ($, template, Tools, echarts, swiper) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. //服务器地址
  9. serverApi:'',
  10. //焦点图数据
  11. focusList: [],
  12. },
  13. };
  14. var tools = new Tools();
  15. module.init = function (page) {
  16. //新闻管理列表
  17. tools.doGet(news + '/003/7', {}, module.focusNews , true);
  18. };
  19. //焦点图数据
  20. module.focusNews = function (data) {
  21. if (data.code == 200) {
  22. var content = data.data;
  23. var focusList = [];
  24. for (var i = 0; i < content.length; i++) {
  25. var imgStrs = content[i].content.match(/<img.*?>/g)
  26. var title = content[i].title;
  27. var id = content[i].id;
  28. if (imgStrs != null && imgStrs != '') {
  29. focusList.push({img:imgStrs[0],title:title,id:id})
  30. }
  31. }
  32. //console.log(focusList)
  33. module.data.focusList = focusList;
  34. var bannerFocusData = template('bannerFocusData', module.data);
  35. $("#bannerFocusContent").html(bannerFocusData);
  36. new Swiper('#bannerFocusWrap', {
  37. pagination: '.page-pagination',
  38. paginationClickable: true,
  39. autoplay : 2000,
  40. loop:true
  41. })
  42. }
  43. }
  44. goInteractSearch = function(){
  45. tools.skip('view/interact/interactList.html?keyWord='+$('#interactInput').val());
  46. }
  47. return module;
  48. });