policyIndex.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. <!DOCTYPE html>
  2. <html lang="en"
  3. xmlns:th="http://www.thymeleaf.org"
  4. xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  5. layout:decorate="~{home/common/common}">
  6. <head>
  7. <meta charset="UTF-8">
  8. <title th:text="${navigation_name}"></title>
  9. </head>
  10. <body layout:fragment="content">
  11. <!-- 头部导航 -->
  12. <div th:replace="~{home/common/header :: header}"></div>
  13. <!--nav-->
  14. <div class="center_nav">
  15. <div th:replace="~{home/common/header :: nav}"></div>
  16. </div>
  17. <div class="policy-bg">
  18. <div class="policy-content">
  19. <!--面包屑-->
  20. <div class="row">
  21. <div class="col-sm-6 col-md-6 col-lg-8 hidden-xs" style="padding-left: 0;">
  22. <ol class="breadcrumb" style="padding-top: 15px;border-bottom: 0px solid #fff;margin-bottom: 0;">
  23. <li>
  24. <a th:href="@{/home}">首页</a>
  25. </li>
  26. <li class="active"><a><cite>[[${navigation_name}]]</cite></a></li>
  27. </ol>
  28. </div>
  29. <!--搜索框-->
  30. <div class="col-sm-6 col-md-6 col-lg-4 col-xs-12">
  31. <div style="display: inline-block;float: right;padding-top: 10px;width: 100%;">
  32. <span style="display: inline-block;width:100%">
  33. <input type="text" id="keyWord" name="keyword" placeholder="请输入政策搜索关键词" class="layui-input" style="width: 100%;display: inline-block">
  34. </span>
  35. <button id="keywordSearch"style="display: inline-block;float: right;background:none;border:none;">
  36. <i class=" iconfont icon-sousuo"></i>
  37. </button>
  38. </div>
  39. </div>
  40. </div>
  41. <!--内容-->
  42. <div class="clearfix">
  43. <div class="clearfix">
  44. <div class="focus-img swiper-container">
  45. <div class="swiper-wrapper">
  46. </div>
  47. <div class="pagination"></div>
  48. <!--<img src="/image/banner-bg.jpg">-->
  49. </div>
  50. <div class="focus-news">
  51. <div class="tab-nav">
  52. <ul class="clearfix">
  53. <li class="active" dataValue="0"><a href="javascript:;">全部</a></li>
  54. <li dataValue="4"><a href="javascript:;">国家</a></li>
  55. <li dataValue="1"><a href="javascript:;">江苏省</a></li>
  56. <li dataValue="2"><a href="javascript:;">苏州市</a></li>
  57. <li dataValue="3"><a href="javascript:;">高新区</a></li>
  58. </ul>
  59. </div>
  60. <div class="policy-tab-content">
  61. <div class="news-tab">
  62. <ul id="newsList">
  63. </ul>
  64. <p class="t-right"><a href="" class="view-more j-more">更多>></a></p>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. <div class="p-index-content">
  70. <div class="policy-index-title">
  71. <span>
  72. <p class="p-titile-zh">专项解读</p>
  73. <p class="p-title-en">Special interpretation</p>
  74. </span>
  75. <p class="policy-title-line"></p>
  76. <a th:href="@{/policy/toSpecialList}" class="special-more">更多>></a>
  77. </div>
  78. <div class="p-interpretation-list">
  79. <ul id="interpretationList" class="clearfix">
  80. </ul>
  81. </div>
  82. </div>
  83. <div class="p-index-content">
  84. <div class="policy-index-title">
  85. <span>
  86. <p class="p-titile-zh">政策顾问</p>
  87. <p class="p-title-en">Special interpretation</p>
  88. </span>
  89. <p class="policy-title-line"></p>
  90. </div>
  91. <div class="p-interpretation-list">
  92. <div class="p-zcgw p-cx"><a onclick="checkLogin()">创新能力体检</a></div>
  93. <div class="p-zcgw p-tj"><a onclick="recommend()">项目申报推荐</a></div>
  94. </div>
  95. </div>
  96. <div class="p-index-content">
  97. <div class="policy-index-title">
  98. <span>
  99. <p class="p-titile-zh">分类阅读</p>
  100. <p class="p-title-en">Category reading</p>
  101. </span>
  102. <p class="policy-title-line"></p>
  103. </div>
  104. <div class="read-list">
  105. <ul id="readList" class="clearfix">
  106. </ul>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. <!--页底-->
  113. <div th:replace="~{home/common/footer :: footer}"></div>
  114. <script>
  115. $(function () {
  116. //头部导航栏
  117. $("li[role='presentation']").removeClass();
  118. var id = [[${navigation_id}]];
  119. $("#" + id).parent().attr("class", "active");
  120. var pagePath = $("meta[name='_ctx']").attr("content");
  121. pagePath = pagePath.substring(0, pagePath.length - 1);
  122. var type = "", criteria = "0", isinvalid = "0";
  123. layui.use('element', function () {
  124. var element = layui.element; //导航的hover效果、二级菜单等功能,需要依赖element模块
  125. });
  126. // 搜索
  127. $("#keywordSearch").on("click",function () {
  128. var keywordVal = encodeURI($("#keyWord").val());
  129. window.location.href = pagePath +"/home/policySearchList?lkey="+keywordVal;
  130. });
  131. specialData();
  132. readData();
  133. getNewsData(0);
  134. $(".j-more").attr("href",pagePath +"/home/policyList?lb=0");
  135. $(".tab-nav ul li").on("click",function () {
  136. var index = $(this).attr("dataValue");
  137. $(this).addClass("active").siblings().removeClass("active");
  138. $(".j-more").attr("href",pagePath +"/home/policyList?lb="+index);
  139. getNewsData(index);
  140. });
  141. // 焦点图
  142. $.ajax({
  143. url: pagePath+"/policy/radar?apikey=snd_apis&at=1&page=1&pagesize=10",
  144. type: 'get',
  145. dataType: 'json',
  146. success: function (json) {
  147. json = json.obj;
  148. var _html = '';
  149. $.each(json.list, function (index, item) {
  150. _html += '<div class="swiper-slide">\
  151. <a href="'+pagePath+'/home/policyDetail?bno='+ item.bno +'" target="_blank">\
  152. <img src="'+item.picurl+'" />\
  153. <div class="focus-img-name">'+ item.title +'</div>\
  154. </a>\
  155. </div>';
  156. });
  157. $(".swiper-wrapper").html(_html);
  158. var mySwiper = new Swiper('.swiper-container',{
  159. loop: true,
  160. autoplay: 3000,
  161. autoplayDisableOnInteraction : false,
  162. pagination : '.pagination',
  163. paginationClickable :true
  164. });
  165. }
  166. });
  167. // 信息列表
  168. function getNewsData(lbIndex) {
  169. $.ajax({
  170. url: pagePath+"/policy/radar?apikey=snd_apis&at=2&page=1&pagesize=8",
  171. type: 'get',
  172. dataType: 'json',
  173. data:{lb:lbIndex},
  174. success: function (json) {
  175. json = json.obj;
  176. var _html = '';
  177. var moreHtml = '';
  178. $.each(json.list, function (index, item) {
  179. _html += '<li>\
  180. <span>['+ item.lx +']</span>\
  181. <a href="'+pagePath+'/home/policyDetail?bno='+ item.bno +'" target="_blank">'+ item.title +'</a>\
  182. </li>';
  183. });
  184. $("#newsList").html(_html);
  185. }
  186. });
  187. }
  188. // 专项解读
  189. function specialData() {
  190. $.ajax({
  191. url: pagePath+'/policy/radar?apikey=snd_apis&at=3&page=1&pagesize=5',
  192. type: 'get',
  193. dataType: 'json',
  194. success: function (json) {
  195. json = json.obj;
  196. var _html = '';
  197. $.each(json.list, function (index, item) {
  198. _html += '<li>\
  199. <a href="'+pagePath+'/home/policySpecialDetail?bno='+ item.bno +'" target="_blank">\
  200. <img src="'+ item.picurl +'" />\
  201. <div class="p-interpretation-name">'+ item.title +'</div>\
  202. </a>\
  203. </li>';
  204. });
  205. $("#interpretationList").html(_html);
  206. }
  207. });
  208. }
  209. // 分类阅读
  210. function readData() {
  211. var colorItem = ["ft-color-deepblue","ft-color-lightred","ft-color-lightblue","ft-color-lightgreen","ft-color-violet","ft-color-orange","ft-color-deepgreen","ft-color-brown","ft-color-lightblue","ft-color-deepred","ft-color-pink","ft-color-deepgreen"];
  212. var iconItem = ["&#xe6c7;","&#xe73d;","&#xe632;","&#xe6d5;","&#xe673;","&#xe63f;","&#xe6aa;","&#xe62b;","&#xe648;","&#xe66f;","&#xe608;","&#xe663;"]
  213. $.ajax({
  214. url: pagePath+'/policy/radar?apikey=snd_apis&at=4&page=1&pagesize=12',
  215. type: 'get',
  216. dataType: 'json',
  217. success: function (json) {
  218. json = json.obj;
  219. var _html = '';
  220. $.each(json.list, function (index, item) {
  221. _html += '<li>\
  222. <a href="'+pagePath+'/home/policyList?k4='+ item.lb +'">\
  223. <span class="p-icon-bg '+ colorItem[index] +'"><i class="iconfont">'+ iconItem[index] +'</i></span>\
  224. <p>'+ item.title +'</p>\
  225. </a>\
  226. </li>';
  227. });
  228. $("#readList").html(_html);
  229. }
  230. })
  231. }
  232. });
  233. function isPermission(){
  234. $.ajax({
  235. url: pagePath + "/policy/isPermission",
  236. type: "get",
  237. dataType: "json",
  238. success: function (result) {
  239. if (result.success){
  240. // window.location.href = pagePath + "/policy/toPolicyExamination";
  241. return true;
  242. }
  243. else {
  244. // errorMessage('您还未进行诊断,请在诊断后查看推荐的项目申报!');
  245. errorMessage(result.message);
  246. return false;
  247. }
  248. }
  249. });
  250. }
  251. function recommend(){
  252. $.ajax({
  253. url: pagePath + "/policy/recommendProjectApi",
  254. type: "get",
  255. dataType: "json",
  256. success: function (result) {
  257. if (result.success){
  258. checkLogin();
  259. }
  260. else {
  261. errorMessage('您还未进行诊断,请在诊断后查看推荐的项目申报!');
  262. // errorMessage(result.message);
  263. }
  264. }
  265. });
  266. }
  267. function checkLogin() {
  268. $.ajax({
  269. url: pagePath + "/home/checkLogin/",
  270. type: "get",
  271. dataType: "json",
  272. data:{
  273. timeStamp: new Date()
  274. },
  275. success: function (result) {
  276. if (result.success) {
  277. var obj = result.obj;
  278. if (obj.isLogin) {
  279. //已登录
  280. if(!obj.userType==3){
  281. errorMessage('仅供企业用户诊断!');
  282. }else{
  283. // isPermission();//是否有权限
  284. $.ajax({
  285. url: pagePath + "/policy/isPermission",
  286. type: "get",
  287. dataType: "json",
  288. success: function (result) {
  289. if (result.success){
  290. window.location.href = pagePath + "/policy/toPolicyExamination";
  291. }
  292. else {
  293. // errorMessage('您还未进行诊断,请在诊断后查看推荐的项目申报!');
  294. errorMessage(result.message);
  295. }
  296. }
  297. });
  298. // location.href = pagePath + '/policy/toPolicyExamination';
  299. }
  300. } else {
  301. //errorMessage("请登陆!");
  302. location.href = pagePath + "/home/login";
  303. localStorage.setItem("activityUrl", pagePath + '/home/informList/3');
  304. localStorage.setItem("returnUrl", pagePath + '/home/informList/3');
  305. localStorage.setItem("requiredUserType", "3");
  306. localStorage.setItem("errorMsg", "仅供企业用户诊断!");
  307. }
  308. } else {
  309. errorMessage(result.message);
  310. }
  311. },
  312. error: function () {
  313. errorMessage('系统错误!');
  314. }
  315. });
  316. }
  317. </script>
  318. </body>
  319. </html>