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

discussionsDetail.js 3.2 KiB

1 个月前
1 个月前
1 个月前
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. var titData = template('titData', module.data);
  40. $("#titContent").html(titData);
  41. $('#ewm').attr('src', 'static/images/'+content.top.bz);
  42. }
  43. }
  44. module.newsDetail = function (data) {
  45. if (data.code == 200) {
  46. var content = data.data;
  47. $('#name')[0].innerHTML = content.openName;
  48. $('#jueyiAt')[0].innerHTML = '決议公开日期:'+content.jueyiAt;
  49. $('#jueyiPic')[0].innerHTML = '決议公开图片:<br/>';
  50. if (content.jueyiPic){
  51. let arr = content.jueyiPic.split(',');
  52. for (let i = 0;i < arr.length; i++){
  53. $('#jueyiPic')[0].innerHTML += '<img onclick="openDialog(\'/api'+arr[i]+'\')" src="/api'+arr[i]+'" style="width: 200px;height: 150px;margin-right: 10px;">';
  54. }
  55. }
  56. $('#shishiPic')[0].innerHTML = '实施公开图片:<br/>';
  57. if (content.shishiPic){
  58. let arr2 = content.jueyiPic.split(',');
  59. for (let i = 0;i < arr2.length; i++){
  60. $('#shishiPic')[0].innerHTML += '<img onclick="openDialog(\'/api'+arr2[i]+'\')" src="/api'+arr2[i]+'" style="width: 200px;height: 150px;margin-right: 10px;">';
  61. }
  62. }
  63. $('#shishiAt')[0].innerHTML = '实施公开日期:'+content.shishiAt;
  64. $('#remark')[0].innerHTML = '备注:'+content.remark;
  65. }
  66. }
  67. openDialog = function (src){
  68. $("#dialogOp").css('display','block');
  69. $('#dialogImg').attr('src', src);
  70. }
  71. closeDia = function (){
  72. $("#dialogOp").css('display','none');
  73. $('#dialogImg').attr('src', '');
  74. }
  75. module.newsList = function (data) {
  76. if (data.code == 200) {
  77. var content = data.rows;
  78. module.data.newList = content;
  79. var newListData = template('newListData', module.data);
  80. $("#newListContent").html(newListData);
  81. }
  82. }
  83. return module;
  84. });