IM12345_Web demo - 代码源于 商丘市12345项目

gonggao.js 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. $(document).ready(function() {
  2. GetNewsList();
  3. // getClient();
  4. //顶部hover
  5. $('.topbarWx').hover(function() {
  6. $('.topbarWx .topbarWx-box').css('left', $(this).offset().left);
  7. });
  8. $('.topbarClient').hover(function() {
  9. $('.topbarClient .topbarClient-box').css('left', $(this).offset().left);
  10. });
  11. });
  12. function GetNewsList() {
  13. layui.use('table', function(){
  14. var table = layui.table;
  15. //方法级渲染
  16. table.render({
  17. elem: '#list1',
  18. url: huayi.config.callcenter_url + "Web/GetWebNewsList",
  19. method: 'get', //如果无需自定义HTTP类型,可不加该参数
  20. skin: 'row', //line (行边框风格) row (列边框风格) nob (无边框风格)
  21. even: true, //开启隔行背景
  22. where: {type:6},
  23. limit:10,
  24. limits:[10],
  25. request: {
  26. pageName: 'page' //页码的参数名称,默认:page
  27. ,limitName: 'pagesize' //每页数据量的参数名,默认:limit
  28. },
  29. response: {
  30. statusName: 'state', //状态字段名称
  31. statusCode: 'success', //状态字段成功值
  32. countName: 'total' //数据总数的字段名称,默认:count
  33. ,dataName: 'rows' //数据列表的字段名称,默认:data
  34. },
  35. cols: [[
  36. {field:'bt', minWidth: 150, title: '主题',templet: '#switchTpl'}
  37. ,{field:'sj', width:220, title: '发布时间'}
  38. ]]
  39. ,page: true
  40. });
  41. });
  42. }
  43. function ComContent1(val, row) {
  44. return '<div class="imgs" >' +
  45. '<a href="gonggao-con.html?id=' + row.id + '"> ' + val + '</a>' +
  46. '</div>';
  47. }