gkml.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>四平市政府</title>
  6. <link rel="stylesheet" href="css/mui.min.css" />
  7. <link rel="stylesheet" href="css/basic.css" />
  8. <script type="text/javascript" src="js/jquery-1.8.3.min.js" ></script>
  9. <script type="text/javascript" src="js/basic.js" ></script>
  10. <script type="text/javascript" src="js/idealDic/idealDicInclude.js"></script>
  11. <script type="text/javascript" src="js/plusShare.js"></script>
  12. <script src="js/mui.min.js"></script>
  13. <script>
  14. function formattext(text){
  15. var style_p = "<p style='font-size:40px'>";
  16. var centerStr = text.match(/<p align="center">([^>]*)([</p>])/gi);
  17. if(centerStr!=null){
  18. for(var i=0;i<centerStr.length;i++){
  19. text = text.replace(centerStr[i],style_p+"<center>"+centerStr[i]+"</center></p>");
  20. }}
  21. text = text.replace(/<br(\/?)>/gi, style_p);//替换成<p>
  22. text = text.replace(/<\/p>/gi, "\n");
  23. text = text.replace(/<p([^>]*)>/gi, style_p);
  24. text = text.replace(/<div([^>]*)>/gi, style_p); //消除DIV格式 替换成<p>
  25. text = text.replace(/<\/div>/gi, "\n");
  26. text = text.replace(/<span([^>]*)>/gi, "");
  27. text = text.replace(/<font([^>]*)>/gi, "");
  28. text = text.replace(/<a([^>]*)>/gi, "<a>");
  29. text = text.replace(/<style([^]*)\/style>/gi, "");
  30. text = text.replace(/ /g,"");
  31. var img = text.match(/<img([^>]*)>/gi);
  32. if(img!=null){
  33. for(var i=0;i<img.length;i++){
  34. text = text.replace(img[i],"<center>"+img[i]+"</center>");
  35. }
  36. }
  37. return text;
  38. }
  39. function close_page(){
  40. mui.currentWebview.close();
  41. }
  42. (function($){
  43. $.getUrlParam = function(name)
  44. {
  45. var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
  46. var r = window.location.search.substr(1).match(reg);
  47. if (r!=null) return unescape(r[2]); return null;
  48. }
  49. })(jQuery);
  50. var doc_id = $.getUrlParam('doc_id');
  51. var sharehrefTitle,sharehref,sharehrefDes;
  52. mui.post(projectUrl+'trsdataAction!query_gkml.action',{
  53. doc_id:doc_id
  54. },function(data){
  55. if(data.success == true){
  56. var json =data.data[0];
  57. var pubdate=json.pubdate.substring(0,json.pubdate.length-5);
  58. var efectdate=json.efectdate.substring(0,json.efectdate.length-5);
  59. var url=json.docpuburl;
  60. var a=url.substring(0,url.lastIndexOf("\/"));
  61. var new1 = json.content.replace(/src=\"W020/g, "src=\""+a+"\/W020");
  62. var news = new1.replace(/href=\"/g, "download='w3logo' href=\""+a+"\/");
  63. $('#bhbf').append("<p><b>索引号:</b><i>"+json.idxid+"</i></p>");
  64. $('#bhbf').append("<p><b>主题分类:</b><i>"+json.subcat+"; "+json.themecat+"</i></p>");
  65. $('#bhbf').append("<p><b>发文机关:</b><i>"+json.publisher+"</i></p>");
  66. $('#bhbf').append("<p><b>成文日期:</b><i>"+pubdate+"</i></p>");
  67. $('#bhbf').append("<p><b>标 题:</b><i>"+json.title+"</i></p>");
  68. $('#bhbf').append("<p><b>发文字号:</b><i>"+json.filenum+"</i></p>");
  69. $('#bhbf').append("<p><b>发布日期:</b><i>"+efectdate+"</i></p>");
  70. $('#bhbf').append("<p><b>主题词:</b><i>"+json.keywords+"</i></p>");
  71. $('#nrbf').append(formattext(news));
  72. //$('#bhbf').append(formattext(news));
  73. //数据加载结束后显示页面
  74. sharehref=projectUrl+'gkml.html?doc_id='+doc_id;
  75. sharehrefTitle=json.title;
  76. sharehrefDes=pubdate;
  77. }
  78. },'json'
  79. );
  80. window.onload=function(){
  81. document.getElementById("shggg").addEventListener("click", function() {
  82. //分享内容,开发者可自定义
  83. var message = {
  84. title: sharehrefTitle, //应用名字
  85. content: sharehrefDes,
  86. href: sharehref, //分享出去后,点击跳转地址
  87. thumbs: ["images/28x28.png"] //分享缩略图
  88. }
  89. //调起分享
  90. plusShare(message, function(res) {
  91. //分享回调函数
  92. if(res) {
  93. plus.nativeUI.toast("分享成功");
  94. } else {
  95. plus.nativeUI.toast("分享失败");
  96. }
  97. })
  98. });
  99. }
  100. </script>
  101. </head>
  102. <body>
  103. <header class="sjheader">
  104. <div class="back fl mui-action-back"><a href="#" onclick="close_page()"><img src="images/cwfsz_03.png"></a></div>
  105. <div class="centerlogo fl"><img src="images/spzf_03.png"></div>
  106. <div class="searchbtn fr"><img id="shggg" src="images/cwfsz_06.png"></div>
  107. </header>
  108. <div class="rztz" style="margin-top: 130px;">
  109. <div id="bhbf" class="tzk">
  110. </div>
  111. <div id="nrbf" class="tznr">
  112. </div>
  113. </div>
  114. </body>
  115. </html>