网站
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

discussionsDetail_01.js 3.3 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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(financePublicDetail, {
  19. id:getQueryVariable('id'),
  20. bookId: JSON.parse(tools.getCookie('user')).bookId,
  21. deptId: JSON.parse(tools.getCookie('user')).deptId
  22. }, module.newsDetail , true);
  23. //新闻列表
  24. tools.doGet(financePublicList, {
  25. pageNum:1,
  26. pageSize:10,
  27. orderByColumn: 'openNy',
  28. isAsc: 'desc',
  29. bookId: JSON.parse(tools.getCookie('user')).bookId,
  30. deptId: JSON.parse(tools.getCookie('user')).deptId
  31. }, module.newsList , true);
  32. tools.doGet(webList, {}, module.webList , true);
  33. };
  34. //获取地址栏参数
  35. function getQueryVariable(variable){
  36. var query = window.location.search.substring(1);
  37. var vars = query.split("&");
  38. for (var i=0;i<vars.length;i++) {
  39. var pair = vars[i].split("=");
  40. if(pair[0] == variable){return pair[1];}
  41. }
  42. return(false);
  43. }
  44. module.webList = function (data) {
  45. if (data.code == 200) {
  46. var content = data.data;
  47. module.data.webList = content;
  48. var webData = template('webData', module.data);
  49. $("#webContent").html(webData);
  50. $('#ewm').attr('src', 'static/images/'+content.top.bz);
  51. }
  52. }
  53. module.newsDetail = function (data) {
  54. if (data.code == 200) {
  55. var content = data.data;
  56. $('#name')[0].innerHTML = content.openName;
  57. $('#jueyiAt')[0].innerHTML = '公开年月:'+content.openNy;
  58. $('#jueyiPic')[0].innerHTML = '公开图片:<br/>';
  59. if (content.openPic){
  60. let arr = content.openPic.split(',');
  61. for (let i = 0;i < arr.length; i++){
  62. $('#jueyiPic')[0].innerHTML += '<img onclick="openDialog(\'/api'+arr[i]+'\')" src="/api'+arr[i]+'" style="width: 200px;height: 150px;margin-right: 10px;">';
  63. }
  64. }
  65. $('#shishiPic')[0].innerHTML = '附件:<br/>';
  66. if (content.openFile){
  67. let arr2 = content.openFile.split(',');
  68. for (let i = 0;i < arr2.length; i++){
  69. $('#shishiPic')[0].innerHTML += '<a href="/api'+arr2[i]+'">';
  70. }
  71. }
  72. $('#remark')[0].innerHTML = '备注:'+content.remark;
  73. }
  74. }
  75. openDialog = function (src){
  76. $("#dialogOp").css('display','block');
  77. $('#dialogImg').attr('src', src);
  78. }
  79. closeDia = function (){
  80. $("#dialogOp").css('display','none');
  81. $('#dialogImg').attr('src', '');
  82. }
  83. module.newsList = function (data) {
  84. if (data.code == 200) {
  85. var content = data.rows;
  86. module.data.newList = content;
  87. var newListData = template('newListData', module.data);
  88. $("#newListContent").html(newListData);
  89. }
  90. }
  91. return module;
  92. });