网站
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

97 行
3.1 KiB

  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools"], function ($, template, Tools) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. //服务器地址
  9. serverApi:'',
  10. //焦点图数据
  11. focusList: [],
  12. communicateList: [],
  13. },
  14. };
  15. var tools = new Tools();
  16. module.init = function (page) {
  17. //新闻详情
  18. tools.doGet(siyigongkaiDetail, {id:getQueryVariable('id')}, module.newsDetail , true);
  19. //新闻列表
  20. tools.doGet(listSiyigongkai, {pageNum:1,pageSize:8}, module.newsList , true);
  21. tools.doGet(webList, {}, module.webList , true);
  22. };
  23. //获取地址栏参数
  24. function getQueryVariable(variable){
  25. var query = window.location.search.substring(1);
  26. var vars = query.split("&");
  27. for (var i=0;i<vars.length;i++) {
  28. var pair = vars[i].split("=");
  29. if(pair[0] == variable){return pair[1];}
  30. }
  31. return(false);
  32. }
  33. module.webList = function (data) {
  34. if (data.code == 200) {
  35. var content = data.data;
  36. module.data.webList = content;
  37. var webData = template('webData', module.data);
  38. $("#webContent").html(webData);
  39. $('#ewm').attr('src', 'static/images/'+content.top.bz);
  40. }
  41. }
  42. module.newsDetail = function (data) {
  43. if (data.code == 200) {
  44. var content = data.data;
  45. $('#name')[0].innerHTML = content.openName;
  46. $('#jueyiAt')[0].innerHTML = '決议公开日期:'+content.jueyiAt;
  47. $('#jueyiPic')[0].innerHTML = '決议公开图片:<br/>';
  48. if (content.jueyiPic){
  49. let arr = content.jueyiPic.split(',');
  50. for (let i = 0;i < arr.length; i++){
  51. $('#jueyiPic')[0].innerHTML += '<img onclick="openDialog(\'/api'+arr[i]+'\')" src="/api'+arr[i]+'" style="width: 200px;height: 150px;margin-right: 10px;">';
  52. }
  53. }
  54. $('#shishiPic')[0].innerHTML = '实施公开图片:<br/>';
  55. if (content.shishiPic){
  56. let arr2 = content.jueyiPic.split(',');
  57. for (let i = 0;i < arr2.length; i++){
  58. $('#shishiPic')[0].innerHTML += '<img onclick="openDialog(\'/api'+arr2[i]+'\')" src="/api'+arr2[i]+'" style="width: 200px;height: 150px;margin-right: 10px;">';
  59. }
  60. }
  61. $('#shishiAt')[0].innerHTML = '实施公开日期:'+content.shishiAt;
  62. $('#remark')[0].innerHTML = '备注:'+content.remark;
  63. }
  64. }
  65. openDialog = function (src){
  66. $("#dialogOp").css('display','block');
  67. $('#dialogImg').attr('src', src);
  68. }
  69. closeDia = function (){
  70. $("#dialogOp").css('display','none');
  71. $('#dialogImg').attr('src', '');
  72. }
  73. module.newsList = function (data) {
  74. if (data.code == 200) {
  75. var content = data.rows;
  76. module.data.newList = content;
  77. var newListData = template('newListData', module.data);
  78. $("#newListContent").html(newListData);
  79. }
  80. }
  81. return module;
  82. });