|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- /**
- * Created by Administrator on 2021/4/5.
- */
- define(['jquery', "template", "Tools", "echarts", 'swiper'], function ($, template, Tools, echarts, swiper) {
- //数据存储
- var module = {
- data: {
- //服务器地址
- serverApi:'',
- //焦点图数据
- focusList: [],
- communicateList: [],
- },
- };
- var tools = new Tools();
-
- module.init = function (page) {
- //新闻管理列表
- // tools.doGet(news + '/003//7', {}, module.focusNews , true);
-
- tools.doGet(getTopDeptId, {}, module.getInformation , true);
- };
-
- module.getInformation = function (data) {
- console.log(data)
- tools.doGet(news + '/003/'+data.data+'/7', {}, module.newList , true);
- tools.doGet(news + '/001/'+data.data+'/7', {}, module.noticeList , true);
- tools.doGet(news + '/002/'+data.data+'/7', {}, module.enforcementList , true);
- tools.doGet(getScheme + '/'+data.data+'/7', {}, module.schemeList , true);
- }
-
- //新闻列表
- module.newList = function (data) {
- if (data.code == 200) {
- var content = data.data;
-
- var focusList = [];
- for (var i = 0; i < content.length; i++) {
- var imgStrs = content[i].content.match(/<img.*?>/g)
- var title = content[i].title;
- var id = content[i].id;
- if (imgStrs != null && imgStrs != '') {
- focusList.push({img:imgStrs[0],title:title,id:id})
- }
- }
- module.data.focusList = focusList;
- var bannerFocusData = template('bannerFocusData', module.data);
- $("#bannerFocusContent").html(bannerFocusData);
- new Swiper('#bannerFocusWrap', {
- pagination: '.page-pagination',
- paginationClickable: true,
- autoplay : 2000,
- loop:true
- })
- console.log(focusList)
- module.data.newList = content;
- var newData = template('newData', module.data);
- $("#newContent").html(newData);
- }
- }
-
- //公告列表
- module.noticeList = function (data) {
- if (data.code == 200) {
- var content = data.data;
- module.data.noticeList = content;
- var noticeData = template('noticeData', module.data);
- $("#noticeContent").html(noticeData);
- }
- }
-
- //执法依据
- module.enforcementList = function (data) {
- if (data.code == 200) {
- var content = data.data;
- module.data.enforcementList = content;
- var enforcementData = template('enforcementData', module.data);
- $("#enforcementContent").html(enforcementData);
- }
- }
-
- //方案公开
- module.schemeList = function (data) {
- if (data.code == 200) {
- var content = data.data;
- module.data.schemeList = content;
- var schemeData = template('schemeData', module.data);
- $("#schemeContent").html(schemeData);
- }
- }
-
- //焦点图数据
- module.focusNews = function (data) {
- if (data.code == 200) {
- var content = data.data;
- var focusList = [];
- for (var i = 0; i < content.length; i++) {
- var imgStrs = content[i].content.match(/<img.*?>/g)
- var title = content[i].title;
- var id = content[i].id;
- if (imgStrs != null && imgStrs != '') {
- focusList.push({img:imgStrs[0],title:title,id:id})
- }
- }
- //console.log(focusList)
- module.data.focusList = focusList;
- var bannerFocusData = template('bannerFocusData', module.data);
- $("#bannerFocusContent").html(bannerFocusData);
- new Swiper('#bannerFocusWrap', {
- pagination: '.page-pagination',
- paginationClickable: true,
- autoplay : 2000,
- loop:true
- })
-
- }
- }
-
- goDetail = function(id){
- tools.skip('/agriculturalLawEnforcement/view/workDynamics/workDetail.html?id='+id);
- }
-
- goNotice = function(id){
- tools.skip('/agriculturalLawEnforcement/view/noticeAnnouncement/noticeDetail.html?id='+id);
- }
-
- goScheme = function(id){
- tools.skip('/agriculturalLawEnforcement/view/schemeDisclosure/schemeDetail.html?id='+id);
- }
-
- goEnforcement = function(id){
- tools.skip('/agriculturalLawEnforcement/view/basis/basisDetail.html?id='+id);
- }
-
- goInteractSearch = function(){
- tools.skip('view/interact/interactList.html?keyWord='+$('#interactInput').val());
- }
- return module;
- });
|