import 'css/bootstrap.less'; import 'bootstrap/dist/js/bootstrap.js'; import 'css/thinkTank/policyList.css'; import 'css/newMenu/public.css'; import 'css/newMenu/header.css' import 'js/public'; import { provinceList } from 'js/NewDicProvinceList'; let globalConfig={ context:''} $(function () { //数据处理 var pageSize, Province,theKeyword; var thePageNo = 1, thePageLength = 1, dataList={type:''}, pageSize =6; jump(); //一级界面跳转此页面 function jump() { let hash = window.location.search; if (hash) { if (hash.indexOf('name') > -1||hash.indexOf('type')>-1) { let newHash = hash.substr(1, hash.length) if (newHash.indexOf('&') > -1) { let hashArr = newHash.split('&'); hashArr.map(item => { if (item.indexOf('name') > -1) { let names = item.split('='); theKeyword = decodeURIComponent(names[1]); dataList.title=theKeyword; $('.demandSearch').val(theKeyword); $('.policyContent .type ol li').eq(0).addClass('active').siblings().removeClass('active') } }) } else { if (newHash.indexOf('name') > -1) { let names = newHash.split('=') theKeyword = decodeURIComponent(names[1]); dataList.title=theKeyword; $('.demandSearch').val(theKeyword); $('.policyContent .type ol li').eq(0).addClass('active').siblings().removeClass('active') } if (newHash.indexOf('type') > -1) { let types = newHash.split('='); dataList.type = decodeURIComponent(types[1]); switch(dataList.type){ case '': $('.type ol li').eq(0).addClass('active').siblings().removeClass('active'); break; case '1': $('.type ol li').eq(1).addClass('active').siblings().removeClass('active'); break; case '0': $('.type ol li').eq(2).addClass('active').siblings().removeClass('active'); break; case '99': $('.type ol li').eq(3).addClass('active').siblings().removeClass('active'); break; case '98': $('.type ol li').eq(4).addClass('active').siblings().removeClass('active'); break; default: $('.type ol li').eq(0).addClass('active').siblings().removeClass('active'); break; } } } loadDate(); } } else { dataList.title=''; $('.type ol li').eq(0).addClass('active'); loadDate(); } } function loadDate(pageNo) { $('.loading').show(); $('.pagination_box').css('display', 'block'); $.ajax({ method: "get", dataType: "json", url: globalConfig.context + "/portal/policyAndNewsList", data: { pageNo: pageNo || 1, pageSize: pageSize, type:dataList.type, title: dataList.title, province: dataList.province?dataList.province:'' }, success: function (data) { var theArr = []; thePageLength = data.data.totalCount ? Math.ceil(data.data.totalCount / pageSize) : 1; if (data.data && data.data.list) { for (let i = 0; i < data.data.list.length; i++) { let thisdata = data.data.list[i], id = thisdata.id, title = thisdata.title, //标题 timeAll =new Date(thisdata.releaseDate), day = timeAll.getDate()>9?timeAll.getDate():'0'+timeAll.getDate(), //号 month =timeAll.getMonth()+1>9?timeAll.getMonth()+1:'0'+(timeAll.getMonth()+1), //年、月 year =timeAll.getFullYear(), summary = (thisdata.summary).length>90?(thisdata.summary).substr(0,90)+'...':thisdata.summary; //简介 if (summary == null) { summary == '暂无内容' } var srctt = globalConfig.context + '/portal/news/newsDetail.html?id=' + id+'&type='+thisdata.type; theArr.push([ '
'+month+'-'+day+'
', ''+year+'
', ''+summary+'
', '