网站
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.
 
 
 

58 lines
1.8 KiB

  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. tools.doGet(getTopDeptId, {}, module.getInformation , true);
  19. };
  20. module.getInformation = function (data) {
  21. console.log(data)
  22. }
  23. //焦点图数据
  24. module.focusNews = function (data) {
  25. if (data.code == 200) {
  26. var content = data.data;
  27. var focusList = [];
  28. for (var i = 0; i < content.length; i++) {
  29. var imgStrs = content[i].content.match(/<img.*?>/g)
  30. var title = content[i].title;
  31. var id = content[i].id;
  32. if (imgStrs != null && imgStrs != '') {
  33. focusList.push({img:imgStrs[0],title:title,id:id})
  34. }
  35. }
  36. //console.log(focusList)
  37. module.data.focusList = focusList;
  38. var bannerFocusData = template('bannerFocusData', module.data);
  39. $("#bannerFocusContent").html(bannerFocusData);
  40. new Swiper('#bannerFocusWrap', {
  41. pagination: '.page-pagination',
  42. paginationClickable: true,
  43. autoplay : 2000,
  44. loop:true
  45. })
  46. }
  47. }
  48. goInteractSearch = function(){
  49. tools.skip('view/interact/interactList.html?keyWord='+$('#interactInput').val());
  50. }
  51. return module;
  52. });