3bf69fb8 by 任超

style:办事指南

1 parent 10378774
......@@ -162,6 +162,7 @@ div.navigation {
color: #006cff;
font-size: 16px;
margin-right: 10px;
cursor: pointer;
}
.download-attachment a:hover {
color: #006cff;
......
......@@ -8,7 +8,7 @@ $(function () {
downLoad()
})
function downLoad() {
$('.item_notice a').click(function () {
$('.download-attachment a').click(function () {
var url = $(this).attr('url')
var ua = navigator.userAgent;
if (/chrome/i.test(ua)) {
......
......@@ -55,7 +55,7 @@ $(function () {
addTabs('#index');
initData();
recentlyDay = getDate();
// NewsData();
NewsData();
// NoticeData();
// LawsData();
// policiesData();
......@@ -74,40 +74,40 @@ function initData() {
}
//加载新闻数据
function NewsData() {
var ulNews = $("#ulNews");
ulNews.empty();
var li, publishTime;
$.ajax({
type: "get", //提交方式
url: portal.api_url + "/portal/MhNews/getNewsList",//路径
dataType: "json",
//数据,这里使用的是Json格式进行传输
success: function (result) {//返回数据根据结果进行相应的处理
if (result.code == 200 && result.data != null) {
if (result.data[0].preViewUrl) {
$('.news-img img').attr('src', result.data[0].preViewUrl);
} else {
$('.news-img img').attr('src', './staticImages/news_demo.jpg');
}
for (var i = 0; i < result.data.length; i++) {
if (i == 6) return;
publishTime = CutDate(result.data[i].publishTime);
if (result.data[i].preViewUrl) {
li = '<li url="' + result.data[i].preViewUrl + '"><a href="./staticViews/news/' + result.data[i].id + '.html" title="' + result.data[i].headline + '" target="_blank">';
} else {
li = '<li><a href="./staticViews/news/' + result.data[i].id + '.html" title="' + result.data[i].headline + '" target="_blank">';
}
li += '<div class="news_item">';
if (recentlyDay.indexOf(publishTime) > -1) {
li += '<svg class="icon svg-icon" aria-hidden="true"> <use xlink:href="#iconzuixin"></use> </svg>';
}
li += result.data[i].headline + '</div>';
li += '<span>' + publishTime + '</span></a></li>';
ulNews.append(li);
}
}
}
});
// var ulNews = $("#ulNews");
// ulNews.empty();
// var li, publishTime;
// $.ajax({
// type: "get", //提交方式
// url: portal.api_url + "/portal/MhNews/getNewsList",//路径
// dataType: "json",
// //数据,这里使用的是Json格式进行传输
// success: function (result) {//返回数据根据结果进行相应的处理
// if (result.code == 200 && result.data != null) {
// if (result.data[0].preViewUrl) {
// $('.news-img img').attr('src', result.data[0].preViewUrl);
// } else {
// $('.news-img img').attr('src', './staticImages/news_demo.jpg');
// }
// for (var i = 0; i < result.data.length; i++) {
// if (i == 6) return;
// publishTime = CutDate(result.data[i].publishTime);
// if (result.data[i].preViewUrl) {
// li = '<li url="' + result.data[i].preViewUrl + '"><a href="./staticViews/news/' + result.data[i].id + '.html" title="' + result.data[i].headline + '" target="_blank">';
// } else {
// li = '<li><a href="./staticViews/news/' + result.data[i].id + '.html" title="' + result.data[i].headline + '" target="_blank">';
// }
// li += '<div class="news_item">';
// if (recentlyDay.indexOf(publishTime) > -1) {
// li += '<svg class="icon svg-icon" aria-hidden="true"> <use xlink:href="#iconzuixin"></use> </svg>';
// }
// li += result.data[i].headline + '</div>';
// li += '<span>' + publishTime + '</span></a></li>';
// ulNews.append(li);
// }
// }
// }
// });
$(document).on("mouseover", "#ulNews li", function (e) {
if ($(this).attr('url')) {
......