ggxq.js 1.65 KB
$(function () {
  // newsDetail()
  if (decodeURI(GetQueryString('title')) == '首页') {
    $('.notice-second-label').hide();
    $('.notice-second-label').next().hide();
}else {
    $('.notice-second-label').show();
    $('.notice-second-label').next().show();
    $('.notice-second-label').attr('href',GetQueryString('href'));
    $('.notice-second-label').attr('title', decodeURI(GetQueryString('title')));
    $('.notice-second-label').text(decodeURI(GetQueryString('title')));
}
})

layui.use('element', function () {
  var element = layui.element; //导航的hover效果、二级菜单等功能,需要依赖element模块
  //监听导航点击
  element.on('nav(demo)', function (elem) {
  });
});
// 新闻详情数据
function newsDetail() {
  var newsDetail = $("#newsDetail");
  newsDetail.empty();
  $.ajax({
      type: "get",  //提交方式  
      url: portal.api_url + "/portal/MhNotice/getMHDetailById",//路径
      data:{
          "id":GetQueryString('id'),
      },  
      dataType: "json",
      //数据,这里使用的是Json格式进行传输  
      success: function (result) {//返回数据根据结果进行相应的处理           
          if (result.code == 200 && result.data != null) {
              $('.newsTitle').html(result.data.title)
              $('.source p').html(result.data.issuer)
              $('.releaseTime').html(result.data.addtime)
              newsDetail.append(result.data.content)
          }
      }
  });
}

function GetQueryString(name) {
  var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  var r = window.location.search.substr(1).match(reg);
  if (r != null) return decodeURIComponent(r[2]);
  return null;
}