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

3 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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. communicateList: [],
  13. },
  14. };
  15. var tools = new Tools();
  16. module.init = function (page) {
  17. //新闻管理列表
  18. // tools.doGet(news + '/003//7', {}, module.focusNews , true);
  19. tools.doGet(getTopDeptId, {}, module.getInformation , true);
  20. };
  21. module.getInformation = function (data) {
  22. console.log(data)
  23. tools.doGet(news + '/003/'+data.data+'/7', {}, module.newList , true);
  24. tools.doGet(news + '/001/'+data.data+'/7', {}, module.noticeList , true);
  25. tools.doGet(news + '/002/'+data.data+'/7', {}, module.enforcementList , true);
  26. tools.doGet(getScheme + '/'+data.data+'/7', {}, module.schemeList , true);
  27. var tabs = $('.nyzf').find('p');
  28. tabs.on('click', function (e) {
  29. e.preventDefault();//防止打开链接
  30. var id = $(this).data('id');
  31. tabs.removeClass('active');
  32. $(this).addClass('active');
  33. tools.doGet(news + '/'+id+'/'+data.data+'/7', {}, module.enforcementList , true);
  34. });
  35. }
  36. //新闻列表
  37. module.newList = function (data) {
  38. if (data.code == 200) {
  39. var content = data.data;
  40. var focusList = [];
  41. for (var i = 0; i < content.length; i++) {
  42. var imgStrs = content[i].content.match(/<img.*?>/g)
  43. var title = content[i].title;
  44. var id = content[i].id;
  45. if (imgStrs != null && imgStrs != '') {
  46. focusList.push({img:imgStrs[0],title:title,id:id})
  47. }
  48. }
  49. module.data.focusList = focusList;
  50. var bannerFocusData = template('bannerFocusData', module.data);
  51. $("#bannerFocusContent").html(bannerFocusData);
  52. new Swiper('#bannerFocusWrap', {
  53. pagination: '.page-pagination',
  54. paginationClickable: true,
  55. autoplay : 2000,
  56. loop:true
  57. })
  58. console.log(focusList)
  59. module.data.newList = content;
  60. var newData = template('newData', module.data);
  61. $("#newContent").html(newData);
  62. }
  63. }
  64. //公告列表
  65. module.noticeList = function (data) {
  66. if (data.code == 200) {
  67. var content = data.data;
  68. module.data.noticeList = content;
  69. var noticeData = template('noticeData', module.data);
  70. $("#noticeContent").html(noticeData);
  71. }
  72. }
  73. //执法依据
  74. module.enforcementList = function (data) {
  75. if (data.code == 200) {
  76. var content = data.data;
  77. module.data.enforcementList = content;
  78. var enforcementData = template('enforcementData', module.data);
  79. $("#enforcementContent").html(enforcementData);
  80. }
  81. }
  82. //方案公开
  83. module.schemeList = function (data) {
  84. if (data.code == 200) {
  85. var content = data.data;
  86. module.data.schemeList = content;
  87. var schemeData = template('schemeData', module.data);
  88. $("#schemeContent").html(schemeData);
  89. }
  90. }
  91. //焦点图数据
  92. module.focusNews = function (data) {
  93. if (data.code == 200) {
  94. var content = data.data;
  95. var focusList = [];
  96. for (var i = 0; i < content.length; i++) {
  97. var imgStrs = content[i].content.match(/<img.*?>/g)
  98. var title = content[i].title;
  99. var id = content[i].id;
  100. if (imgStrs != null && imgStrs != '') {
  101. focusList.push({img:imgStrs[0],title:title,id:id})
  102. }
  103. }
  104. //console.log(focusList)
  105. module.data.focusList = focusList;
  106. var bannerFocusData = template('bannerFocusData', module.data);
  107. $("#bannerFocusContent").html(bannerFocusData);
  108. new Swiper('#bannerFocusWrap', {
  109. pagination: '.page-pagination',
  110. paginationClickable: true,
  111. autoplay : 2000,
  112. loop:true
  113. })
  114. }
  115. }
  116. goDetail = function(id){
  117. tools.skip('/agriculturalLawEnforcement/view/workDynamics/workDetail.html?id='+id);
  118. }
  119. goNotice = function(id){
  120. tools.skip('/agriculturalLawEnforcement/view/noticeAnnouncement/noticeDetail.html?id='+id);
  121. }
  122. goScheme = function(id){
  123. tools.skip('/agriculturalLawEnforcement/view/schemeDisclosure/schemeDetail.html?id='+id);
  124. }
  125. goEnforcement = function(id){
  126. tools.skip('/agriculturalLawEnforcement/view/basis/basisDetail.html?id='+id);
  127. }
  128. goInteractSearch = function(){
  129. tools.skip('view/interact/interactList.html?keyWord='+$('#interactInput').val());
  130. }
  131. return module;
  132. });