projectDetail.html 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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. <style>
  10. .bFind-wrapper-top {
  11. background: #fff;
  12. border-color: #ccc #aaa #aaa #ccc;
  13. border-style: solid;
  14. border-width: 1px;
  15. height: 25px !important;
  16. padding: 4px;
  17. margin: 0;
  18. }
  19. </style>
  20. </head>
  21. <body layout:fragment="content">
  22. <!-- 头部导航 -->
  23. <div th:replace="~{home/common/header :: header}"></div>
  24. <!--nav-->
  25. <div class="center_nav">
  26. <div th:replace="~{home/common/header :: nav}"></div>
  27. </div>
  28. <!-- 主体内容 -->
  29. <div class="main">
  30. <div class="container projects">
  31. <div class="row">
  32. <div class="hidden-xs" style="padding-left: 0;">
  33. <ol class="breadcrumbFixed clearfix" style="border-bottom: 0px solid #fff;margin-bottom: 0;margin-top:40px;">
  34. <li>
  35. <a th:href="@{/home}">首页</a>
  36. </li>
  37. <li th:if="${navigation_id!=2}" class="active"><a th:href="@{'/home/informList/'+${navigation_id}}">[[${navigation_name}]]</a>
  38. </li>
  39. <li th:if="${navigation_id==2}" class="active"><a th:href="@{/home/unionCompany}">[[${navigation_name}]]</a>
  40. </li>
  41. <li class="active"><a><cite>内容详情</cite></a></li>
  42. </ol>
  43. </div>
  44. </div>
  45. </div>
  46. <div class="container projects" style="margin-top: 20px;">
  47. <div id="news_top" class="row">
  48. <div class="col-sm-12 col-md-12 col-lg-12">
  49. <div>
  50. <h2 style="text-align: center;">
  51. [[${content.project_name}]]
  52. </h2>
  53. </div>
  54. <div class="post_meta">
  55. <ul>
  56. <li>发布时间:&nbsp;<span th:text="${content.create_time}"></span></li>
  57. <li>浏览:&nbsp;<span>[[${content.browse_count}]]</span></li>
  58. <li>来源:&nbsp;<span th:text="${content.project_source_name}"></span></li>
  59. <li>发布单位:&nbsp;<span th:text="${content.release_departments_name}"></span></li>
  60. <li><span id="" style="vertical-align: middle;">分享:</span>&nbsp;
  61. <div class="bshare-custom" style="display: inline-block">
  62. <!--<div class="bsPromo bsPromo2"></div>-->
  63. <a title="分享到QQ空间" class="bshare-qzone" href="javascript:void(0);"></a>
  64. <a title="分享到微信" class="bshare-weixin" href="javascript:void(0);"></a>
  65. <a title="分享到新浪微博" class="bshare-sinaminiblog"></a>
  66. <a title="更多平台" class="bshare-more bshare-more-icon more-style-addthis"></a>
  67. <!--<span class="BSHARE_COUNT bshare-share-count" style="float: none;">41K</span>-->
  68. </div>
  69. <script type="text/javascript" charset="utf-8"
  70. src="http://static.bshare.cn/b/buttonLite.js#style=-1&amp;uuid=&amp;pophcol=2&amp;lang=zh"></script>
  71. <script type="text/javascript" charset="utf-8"
  72. src="http://static.bshare.cn/b/bshareC0.js"></script>
  73. </li>
  74. </ul>
  75. </div>
  76. </div>
  77. </div>
  78. <div class="row">
  79. <div class="col-sm-12 col-md-12 col-lg-12">
  80. <div class="centerContent" style="padding-top: 20px;">
  81. <div th:utext="${content.project_content}">
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. <div class="row" th:if="${content.fileDown}">
  87. <div class="col-sm-12 col-md-12 col-lg-12">
  88. <div><label>附件(备注:如直接点击文件无法下载,请右击另存为。):</label><a title="如直接点击文件无法下载,请右击另存为。" download target="_blank" th:href="${fileUrl} +${content.fileDown.file_url}">[[${content.fileDown.file_name}]]</a></div>
  89. </div>
  90. </div>
  91. <div class="row" id="applyButton" style="display:none;">
  92. <div class="col-sm-12 col-md-12 col-lg-12" style="text-align:center;">
  93. <div style="padding-top: 20px;">
  94. <a class="btn btn-warning j-signup-btn" onclick="checkLogin()">项目申报</a>
  95. </div>
  96. </div>
  97. </div>
  98. </div>
  99. <input type="hidden" id="navigation_id" th:value="${navigation_id}"/>
  100. <input type="hidden" id="project_id" th:value="${content.id}"/>
  101. <input type="hidden" id="apply_startDate" th:value="${content.apply_startdate}"/>
  102. <input type="hidden" id="apply_endDate" th:value="${content.apply_enddate}"/>
  103. <input type="hidden" id="is_online_application" th:value="${content.is_online_application}"/>
  104. </div>
  105. <!--页底-->
  106. <div th:replace="~{home/common/footer :: footer}"></div>
  107. <!--右侧悬浮目录-->
  108. <script th:src="@{/home/plugin/rightMenu.js}" type="text/javascript"></script>
  109. <script th:inline="javascript">
  110. var userType = [[${userType}]];
  111. var fileUrl = [[${fileUrl}]];
  112. $("li[role='presentation']").removeClass();
  113. var id = $("#navigation_id").val();
  114. var projectId = $("#project_id").val();
  115. $("#" + id).parent().attr("class", "active");
  116. layui.use('element', function () {
  117. var element = layui.element; //导航的hover效果、二级菜单等功能,需要依赖element模块
  118. });
  119. var pagePath = $("meta[name='_ctx']").attr("content");
  120. pagePath = pagePath.substring(0, pagePath.length - 1);
  121. $(function () {
  122. if(canApply()){
  123. $("#applyButton").show();
  124. }
  125. });
  126. function canApply(){
  127. var canApply = false;
  128. if(null != userType){
  129. //已登录,不是企业用户就不显示申报按钮
  130. if(userType!=3){
  131. return canApply;
  132. }
  133. }
  134. //未登录或者是企业用户
  135. //是否在线申报项目
  136. var is_online = $("#is_online_application").val();
  137. if(is_online && is_online==1){
  138. //是否过期
  139. var apply_startDate = $("#apply_startDate").val();
  140. var apply_endDate = $("#apply_endDate").val();
  141. if(apply_endDate && apply_endDate!= "" ){
  142. var curTime = new Date();
  143. //2把字符串格式转换为日期类
  144. //"2018-07-17" ,带时分秒的ie会转换出错
  145. var startTime = new Date(Date.parse(apply_startDate.substring(0, 10)));
  146. var endTime = new Date(Date.parse(apply_endDate.substring(0, 10)));
  147. //3进行比较
  148. canApply = (curTime>=startTime && curTime<=endTime);
  149. }
  150. }else{
  151. $("#applyButton").remove();
  152. }
  153. //return canApply;
  154. return true
  155. }
  156. function checkLogin() {
  157. $.ajax({
  158. url: pagePath + "/home/checkLogin/",
  159. type: "get",
  160. dataType: "json",
  161. data:{
  162. timeStamp: new Date()
  163. },
  164. success: function (result) {
  165. if (result.success) {
  166. var obj = result.obj;
  167. if (obj.isLogin) {
  168. //已登录
  169. if(!obj.userType==3){
  170. errorMessage('仅供企业用户申报!');
  171. }else{
  172. location.href = pagePath + '/projectApplication/add/' + projectId;
  173. }
  174. } else {
  175. //errorMessage("请登陆!");
  176. location.href = pagePath + "/home/login"
  177. localStorage.setItem("activityUrl", pagePath + '/projectApplication/add/' + projectId);
  178. localStorage.setItem("returnUrl", pagePath + '/home/projectDetail/' + projectId + '/0');
  179. localStorage.setItem("requiredUserType", "3");
  180. localStorage.setItem("errorMsg", "仅供企业用户申报!");
  181. }
  182. } else {
  183. errorMessage(result.message);
  184. }
  185. },
  186. error: function () {
  187. errorMessage('系统错误!');
  188. }
  189. });
  190. }
  191. </script>
  192. </body>
  193. </html>