contentDetail.html 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  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. .bsBox {
  20. width: auto !important;
  21. height: auto !important;
  22. }
  23. .text-overflow {
  24. overflow: hidden;
  25. text-overflow: ellipsis;
  26. white-space: nowrap;
  27. }
  28. </style>
  29. </head>
  30. <body layout:fragment="content">
  31. <!-- 头部导航 -->
  32. <div th:replace="~{home/common/header :: header}"></div>
  33. <!--nav-->
  34. <div class="center_nav">
  35. <div th:replace="~{home/common/header :: nav}"></div>
  36. </div>
  37. <!-- 主体内容 -->
  38. <div class="main">
  39. <div class="container projects">
  40. <div class="row">
  41. <div class="hidden-xs" style="padding-left: 0;">
  42. <ol class="breadcrumbFixed clearfix"
  43. style="margin-top: 40px;border-bottom: 0px solid #fff;margin-bottom: 0;">
  44. <li>
  45. <a th:href="@{/home}">首页</a>
  46. </li>
  47. <li th:if="${navigation_id!=2}" class="active"><a th:href="@{'/home/informList/'+${navigation_id}}">[[${navigation_name}]]</a>
  48. </li>
  49. <li th:if="${navigation_id==2}" class="active"><a th:href="@{/home/unionCompany}">[[${navigation_name}]]</a>
  50. </li>
  51. <li class="active"><a><cite>内容详情</cite></a></li>
  52. </ol>
  53. </div>
  54. </div>
  55. </div>
  56. <div class="container projects" style="margin-top: 20px;">
  57. <div id="news_top" class="row">
  58. <div class="col-sm-12 col-md-12 col-lg-12">
  59. <div>
  60. <h2 style="text-align: center;">
  61. [[${content.title}]]
  62. </h2>
  63. </div>
  64. <div class="post_meta">
  65. <ul>
  66. <li>发布时间:&nbsp;<span th:text="${content.create_time}"></span></li>
  67. <li>浏览:&nbsp;<span>[[${content.browse_count}]]</span></li>
  68. <li>来源:&nbsp;<span th:text="${content.resource}"></span></li>
  69. <li>发布人:&nbsp;<span th:text="${content.create_name}"></span></li>
  70. <li><span id="" style="vertical-align: middle;">分享:</span>&nbsp;
  71. <div class="bshare-custom" style="display: inline-block">
  72. <!--<div class="bsPromo bsPromo2"></div>-->
  73. <a title="分享到QQ空间" class="bshare-qzone" href="javascript:void(0);"></a>
  74. <a title="分享到微信" class="bshare-weixin" href="javascript:void(0);"></a>
  75. <a title="分享到新浪微博" class="bshare-sinaminiblog"></a>
  76. <a title="更多平台" class="bshare-more bshare-more-icon more-style-addthis"></a>
  77. <!--<span class="BSHARE_COUNT bshare-share-count" style="float: none;">41K</span>-->
  78. </div>
  79. </li>
  80. </ul>
  81. </div>
  82. </div>
  83. </div>
  84. <div id="activity_top" class="row">
  85. <input hidden id="activityId" th:value="${content.title}"/>
  86. <div class="col-sm-5 col-md-5 col-lg-5">
  87. <!--<img src="http://172.18.1.101:81/images/2017/12/26/20171226171952%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20171226171936.jpg"
  88. class="notice-img"/>-->
  89. <!-- ${content.fileDown.download_uri} -->
  90. <img id="preImg" th:src="${fileUrl} +${content.fileDown.file_url}"
  91. class="notice-img"/>
  92. </div>
  93. <div class="col-sm-7 col-md-7 col-lg-7 home-activity-left">
  94. <span id="tag" hidden
  95. style="float:right;border: 1px solid transparent;border-radius: 4px;color: #fff;background-color: #FF9900; border-color: #FF9900;padding: 0px 12px;">重要</span>
  96. <h2 class="activity-title" id="activity_title">
  97. </h2>
  98. <p id="activity_time"><i class="iconfont">&#xe62d;</i></p>
  99. <p id="activity_location"><i class="iconfont">&#xe6e5;</i></p>
  100. <p id="activity_quota"><i class="iconfont">&#xe722;</i></p>
  101. <p id="activity_remain"><i class="iconfont">&#xe722;</i></p>
  102. <div style="margin-bottom: 20px;">距离报名结束还剩 <span id="timer"></span></div>
  103. <div class="clearfix">
  104. <div class="pull-left" style="position: relative; margin-right: 10px;">
  105. <a class="btn btn-warning j-signup-btn" onclick="checkLogin()">我要报名</a>
  106. <div class="popup-signUp" style="display: none;">
  107. <p style="margin-bottom: 10px; font-size: 16px;">报名信息</p>
  108. <div>
  109. <table class="table table-border table-bordered table-bg table-hover"
  110. style="table-layout: fixed;width:100%;">
  111. <thead>
  112. <tr class="text-c">
  113. <th>姓名</th>
  114. <th>手机号</th>
  115. <th>邮箱</th>
  116. <th>职位</th>
  117. <th width="80">操作</th>
  118. </tr>
  119. </thead>
  120. <tbody id="infoList">
  121. </tbody>
  122. </table>
  123. </div>
  124. <p id="add-btn" style="text-align: center;"><span class="add-btn btn btn-default j-add-btn">+ 添加报名者</span>
  125. </p>
  126. <div id="add-mes" style="display: none">
  127. <p><label style="width: 60px;">姓名:</label><span
  128. style="width: 507px; display: inline-block;"><input placeholder="请输入姓名"
  129. id="info_name"></span></p>
  130. <p><label style="width: 60px;">手机号:</label><span
  131. style="width: 507px; display: inline-block;"><input placeholder="请输入手机号"
  132. id="info_phone"></span></p>
  133. <p><label style="width: 60px;">邮箱:</label><span
  134. style="width: 507px; display: inline-block;"><input placeholder="请输入邮箱"
  135. id="info_mail"></span></p>
  136. <p><label style="width: 60px;">职位:</label><span
  137. style="width: 507px; display: inline-block;"><input placeholder="请输入职位"
  138. id="info_position"></span>
  139. </p>
  140. <p style="text-align: center">
  141. <a class="btn btn-primary radius" id="add" onclick="addToList()">添加</a>
  142. <a class="btn btn-default radius j-back-btn">返回</a>
  143. </p>
  144. </div>
  145. <p id="submit_box" style="text-align: center; margin-top: 20px;">
  146. <a class="btn btn-primary radius" id="submit" onclick="submit()">提交</a>
  147. <a class="btn btn-default radius j-cancel-btn">取消</a>
  148. </p>
  149. </div>
  150. </div>
  151. <div id="favourite"><a class="btn btn-default"><i class="iconfont">&#xe605;</i>收藏</a></div>
  152. <span style="vertical-align: middle;">分享:</span>&nbsp;
  153. <div class="bshare-custom" style="display: inline-block">
  154. <a title="分享到QQ空间" class="bshare-qzone" href="javascript:void(0);"></a>
  155. <a title="分享到微信" class="bshare-weixin" href="javascript:void(0);"></a>
  156. <a title="分享到新浪微博" class="bshare-sinaminiblog"></a>
  157. <a title="更多平台" class="bshare-more bshare-more-icon more-style-addthis"></a>
  158. </div>
  159. <span style="vertical-align: middle;">阅读量:</span>&nbsp;
  160. <span id="reading_number" style="vertical-align: middle;"></span>
  161. </div>
  162. </div>
  163. </div>
  164. <div class="row">
  165. <div class="col-sm-12 col-md-12 col-lg-12">
  166. <div class="centerContent" style="padding-top: 20px;">
  167. <div th:utext="${content.content}">
  168. </div>
  169. </div>
  170. </div>
  171. </div>
  172. <div id="download_message" class="row" th:if="${content.addFileDown}" hidden>
  173. <div class="col-sm-12 col-md-12 col-lg-12">
  174. <div><label>附件(备注:如直接点击文件无法下载,请右击另存为。):</label>
  175. <a title="如直接点击文件无法下载,请右击另存为。" download target="_blank"
  176. th:href="${fileUrl} +${content.addFileDown.file_url}">[[${content.addFileDown.file_name}]]</a>
  177. </div>
  178. </div>
  179. </div>
  180. </div>
  181. <input type="hidden" id="navigation_id" th:value="${navigation_id}"/>
  182. </div>
  183. <!--页底-->
  184. <div th:replace="~{home/common/footer :: footer}"></div>
  185. <script type="text/javascript" charset="utf-8"
  186. src="http://static.bshare.cn/b/buttonLite.js#style=-1&amp;uuid=&amp;pophcol=2&amp;lang=zh"></script>
  187. <script type="text/javascript" charset="utf-8"
  188. src="http://static.bshare.cn/b/bshareC0.js"></script>
  189. <script th:inline="javascript">
  190. var fileUrl = [[${fileUrl}]];
  191. $("li[role='presentation']").removeClass();
  192. var id = $("#navigation_id").val();
  193. var activityId = $("#activityId").val();
  194. var pagePath = $("meta[name='_ctx']").attr("content");
  195. pagePath = pagePath.substring(0, pagePath.length - 1);
  196. var infoList = new Array(), infoedList = new Array(), index = 0;
  197. var time = 0;//时间差
  198. var activity_quota = "", activity_remain = "";
  199. $("#" + id).parent().attr("class", "active");
  200. layui.use('element', function () {
  201. var element = layui.element; //导航的hover效果、二级菜单等功能,需要依赖element模块
  202. });
  203. $(function () {
  204. if ($("#navigation_id").val() == 1) {
  205. $("#news_top").hide();
  206. $("#activity_top").show();
  207. $("#download_message").hide();
  208. }
  209. else {
  210. $("#news_top").show();
  211. $("#download_message").show();
  212. $("#activity_top").hide();
  213. }
  214. ;
  215. if ($("#navigation_id").val() == 1) {
  216. $.ajax({
  217. url: pagePath + "/home/activityDetails/" + activityId,
  218. type: "get",
  219. dataType: "json",
  220. success: function (result) {
  221. if (result.success) {
  222. //console.log(result)
  223. var obj = result.obj;
  224. var activity_title = obj.activity_title
  225. var activity_starttime = obj.activity_starttime
  226. var activity_endtime = obj.activity_endtime
  227. var activity_location = obj.activity_location
  228. var push_level = obj.push_level
  229. activity_quota = obj.activity_quota
  230. activity_remain = obj.activity_remain
  231. var activity_deadline = obj.activity_deadline
  232. var reading_number = obj.reading_number
  233. var imgSrc = fileUrl + obj.fileDown.file_url
  234. /* var imgSrc = obj.fileDown.download_uri + obj.fileDown.file_url */
  235. $("#activity_title").text(activity_title)
  236. $("#activity_time").html('<i class="iconfont">&#xe62d;</i>' + activity_starttime.substring(0, 4) + "年" + activity_starttime.substring(5, 7) + "月" + activity_starttime.substring(8, 10) + "日" + " " + activity_starttime.substring(10, 16) + "~" + activity_endtime.substring(0, 4) + "年" + activity_endtime.substring(5, 7) + "月" + activity_endtime.substring(8, 10) + "日" + " " + activity_endtime.substring(10, 16))
  237. $("#activity_location").html('<i class="iconfont">&#xe6e5;</i>' + activity_location)
  238. $("#reading_number").text(reading_number)
  239. if (activity_quota) {
  240. $("#activity_quota").html('<i class="iconfont">&#xe722;</i>限额' + activity_quota + "人")
  241. } else {
  242. $("#activity_quota").html('<i class="iconfont">&#xe722;</i>名额不限')
  243. }
  244. if (activity_quota) {
  245. $("#activity_remain").html('<i class="iconfont">&#xe722;</i>剩余' + activity_remain + "个名额")
  246. } else {
  247. $("#activity_remain").text("")
  248. }
  249. if (push_level == '1') {
  250. $("#tag").show()
  251. }
  252. $("#preImg").attr("src", imgSrc);
  253. //var d1 = new Date(activity_deadline)
  254. var d1 = new Date(Date.parse(activity_deadline.replace(/-/g, "/")))
  255. var d2 = new Date()
  256. time = parseInt((d1.getTime() - d2.getTime()) / 1000, 10)
  257. if (time <= 0) {
  258. $("#timer").html("<span>" + 0 + "天</span>:<span>" + 0 + "小时</span>:<span>" + 0 + "分</span>:<span>" + 0 + "秒</span>")
  259. } else {
  260. countDown(time)
  261. }
  262. checkIsFavourite(activityId)
  263. } else {
  264. errorMessage(result.message);
  265. }
  266. },
  267. error: function () {
  268. errorMessage('系统错误!');
  269. }
  270. });
  271. }
  272. function checkIsFavourite(activityId) {
  273. $.ajax({
  274. url: pagePath + "/home/isFavourite/" + activityId,
  275. type: "get",
  276. dataType: "json",
  277. data: {
  278. timeStamp: new Date()
  279. },
  280. success: function (result) {
  281. if (result.success) {
  282. //console.log(result)
  283. var obj = result.obj;
  284. if (obj == 2) {
  285. //errorMessage("请登陆!");
  286. //未收藏
  287. $("#favourite").empty()
  288. var str = "<a class=\"btn btn-default\" onclick='addFavourite()'><i class=\"iconfont\">&#xe605;</i>收藏</a>"
  289. $("#favourite").append(str)
  290. } else if (obj == 0) {
  291. //已收藏
  292. $("#favourite").empty()
  293. var str = "<a class=\"btn btn-default\" onclick='removeFavourite()'><i class=\"iconfont\">&#xe605;</i>已收藏</a>"
  294. $("#favourite").append(str)
  295. } else if (obj == 1) {
  296. //未收藏
  297. $("#favourite").empty()
  298. var str = "<a class=\"btn btn-default\" onclick='addFavourite()'><i class=\"iconfont\">&#xe605;</i>收藏</a>"
  299. $("#favourite").append(str)
  300. }
  301. } else {
  302. errorMessage(result.message);
  303. }
  304. },
  305. error: function () {
  306. errorMessage('系统错误!');
  307. }
  308. });
  309. }
  310. function countDown(times) {
  311. var timer = null;
  312. timer = setInterval(function () {
  313. var day = 0,
  314. hour = 0,
  315. minute = 0,
  316. second = 0;//时间默认值
  317. if (times > 0) {
  318. day = Math.floor(times / (60 * 60 * 24));
  319. hour = Math.floor(times / (60 * 60)) - (day * 24);
  320. minute = Math.floor(times / 60) - (day * 24 * 60) - (hour * 60);
  321. second = Math.floor(times) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60);
  322. }
  323. if (day <= 9) day = '0' + day;
  324. if (hour <= 9) hour = '0' + hour;
  325. if (minute <= 9) minute = '0' + minute;
  326. if (second <= 9) second = '0' + second;
  327. //
  328. $("#timer").html("<span>" + day + "天</span>:<span>" + hour + "小时</span>:<span>" + minute + "分</span>:<span>" + second + "秒</span>")
  329. times--;
  330. }, 1000);
  331. if (times <= 0) {
  332. clearInterval(timer);
  333. }
  334. }
  335. });
  336. function addFavourite() {
  337. $.ajax({
  338. url: pagePath + "/home/addFavourite/" + activityId,
  339. type: "get",
  340. dataType: "json",
  341. data: {
  342. timeStamp: new Date()
  343. },
  344. success: function (result) {
  345. if (result.success) {
  346. //console.log(result)
  347. var obj = result.obj;
  348. if (obj == 2) {
  349. errorMessage("请登陆!");
  350. //未收藏
  351. } else {
  352. smileMessage(result.message);
  353. setTime();
  354. }
  355. } else {
  356. errorMessage(result.message);
  357. }
  358. },
  359. error: function () {
  360. errorMessage('系统错误!');
  361. }
  362. });
  363. }
  364. function removeFavourite() {
  365. $.ajax({
  366. url: pagePath + "/home/removeFavourite/" + activityId,
  367. type: "get",
  368. dataType: "json",
  369. data: {
  370. timeStamp: new Date()
  371. },
  372. success: function (result) {
  373. if (result.success) {
  374. //console.log(result)
  375. var obj = result.obj;
  376. smileMessage(result.message);
  377. setTime();
  378. } else {
  379. errorMessage(result.message);
  380. }
  381. },
  382. error: function () {
  383. errorMessage('系统错误!');
  384. }
  385. });
  386. }
  387. function checkLogin() {
  388. if (time <= 0) {
  389. errorMessage("报名时间已过!");
  390. return;
  391. }
  392. if (activity_quota) {
  393. if (parseInt(activity_remain) <= 0) {
  394. errorMessage("名额不足,无法报名!");
  395. return;
  396. }
  397. }
  398. $.ajax({
  399. url: pagePath + "/home/checkLogin/",
  400. type: "get",
  401. dataType: "json",
  402. data: {
  403. timeStamp: new Date()
  404. },
  405. success: function (result) {
  406. if (result.success) {
  407. var obj = result.obj;
  408. //console.log(result)
  409. if (obj.isLogin) {
  410. //渲染已报名用户
  411. getRegUsers()
  412. //绑定事件
  413. $(".popup-signUp").show();
  414. $(".j-signup-btn").on("click", function () {
  415. $(".popup-signUp").show();
  416. });
  417. $(".j-cancel-btn").on("click", function () {
  418. $(".popup-signUp").hide();
  419. });
  420. $(".j-add-btn").on("click", function () {
  421. $("#add-btn").hide();
  422. $("#add-mes").show();
  423. $("#submit_box").hide();
  424. });
  425. $(".j-back-btn").on("click", function () {
  426. $("#add-btn").show();
  427. $("#add-mes").hide();
  428. $("#submit_box").show();
  429. });
  430. } else {
  431. //errorMessage("请登陆!");
  432. location.href = pagePath + "/home/login"
  433. localStorage.setItem("activityUrl", pagePath + '/home/activityDetail/' + activityId);
  434. }
  435. } else {
  436. errorMessage(result.message);
  437. }
  438. },
  439. error: function () {
  440. errorMessage('系统错误!');
  441. }
  442. });
  443. }
  444. function getRegUsers() {
  445. $.ajax({
  446. url: pagePath + "/home/getRegUsers",
  447. type: "get",
  448. dataType: "json",
  449. data: {
  450. timeStamp: new Date(),
  451. activity_id: activityId
  452. },
  453. success: function (result) {
  454. if (result.success) {
  455. var obj = result.obj;
  456. infoedList = obj;
  457. renderInfoList(infoList)
  458. /* $("#infoList").empty()
  459. if (obj && obj.length > 0) {
  460. var str = ''
  461. for (var i = 0; i < obj.length; i++) {
  462. str += '<tr>'
  463. str += '<td class="text-overflow" title="' + obj[i].name + '">' + obj[i].name + '</td>'
  464. str += '<td class="text-overflow" title="' + obj[i].phone + '">' + obj[i].phone + '</td>'
  465. str += '<td class="text-overflow" title="' + obj[i].mail + '">' + obj[i].mail + '</td>'
  466. str += '<td class="text-overflow" title="' + obj[i].position + '">' + obj[i].position + '</td>'
  467. str += '<td class="text-overflow" title="已报名">已报名</td>'
  468. str += '</tr>'
  469. }
  470. $("#infoList").prepend(str)
  471. }*/
  472. } else {
  473. errorMessage(result.message);
  474. }
  475. },
  476. error: function () {
  477. errorMessage('系统错误!');
  478. }
  479. });
  480. }
  481. function addToList() {
  482. var reg1 = /^[0-9]+.?[0-9]*$/;
  483. var reg2 = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
  484. var reg3 = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
  485. var name = $("#info_name").val().trim()
  486. var phone = $("#info_phone").val().trim()
  487. var mail = $("#info_mail").val().trim()
  488. var position = $("#info_position").val().trim()
  489. if (name == null || name == "") {
  490. errorMessage("请输入姓名!");
  491. return
  492. } else if (reg1.test(name)) {
  493. errorMessage("姓名不能为数字!");
  494. return
  495. } else if (name.trim().length > 50) {
  496. errorMessage("姓名最多支持50个字符!");
  497. return
  498. }
  499. if (phone == null || phone == "") {
  500. errorMessage("请输入手机号!");
  501. return
  502. } else if (!reg2.test(phone)) {
  503. errorMessage("请输入正确的手机号!");
  504. return
  505. }
  506. if (mail == null || mail == "") {
  507. errorMessage("请输入邮箱!");
  508. return
  509. } else if (!reg3.test(mail)) {
  510. errorMessage("请输入正确的邮箱!");
  511. return
  512. } else if (mail.trim().length > 50) {
  513. errorMessage("邮箱最多支持50个字符!");
  514. return
  515. }
  516. if (position == null || position == "") {
  517. errorMessage("请输入职位!");
  518. return
  519. } else if (position.trim().length > 50) {
  520. errorMessage("职位最多支持50个字符!");
  521. return
  522. }
  523. if (infoedList.length > 0) {
  524. for (var i = 0; i < infoedList.length; i++) {
  525. if (infoedList[i].name == name && infoedList[i].phone == phone) {
  526. errorMessage("报名者重复!");
  527. return
  528. }
  529. }
  530. }
  531. if (infoList.length > 0) {
  532. for (var i = 0; i < infoList.length; i++) {
  533. if (infoList[i].name == name.trim() && infoList[i].phone == phone.trim()) {
  534. errorMessage("报名者重复!");
  535. return
  536. }
  537. }
  538. }
  539. var infoId = "info" + (++index)
  540. var info = {
  541. index: infoId,
  542. name: name.trim(),
  543. phone: phone.trim(),
  544. mail: mail.trim(),
  545. position: position.trim(),
  546. activity_id: activityId,
  547. registration_way: "0",
  548. }
  549. infoList.push(info)
  550. renderInfoList(infoList)
  551. $("#info_name").val("")
  552. $("#info_phone").val("")
  553. $("#info_mail").val("")
  554. $("#info_position").val("")
  555. }
  556. function removeFromList(index) {
  557. if (infoList) {
  558. for (var i = 0; i < infoList.length; i++) {
  559. if (infoList[i].id = index) {
  560. infoList.splice(index, 1);
  561. break;
  562. }
  563. }
  564. renderInfoList(infoList)
  565. }
  566. }
  567. function renderInfoList(infoList) {
  568. if (infoList) {
  569. var str = "";
  570. $("#infoList").empty()
  571. if (infoedList && infoedList.length > 0) {
  572. for (var i = 0; i < infoedList.length; i++) {
  573. str += '<tr>'
  574. str += '<td class="text-overflow" title="' + infoedList[i].name + '">' + infoedList[i].name + '</td>'
  575. str += '<td class="text-overflow" title="' + infoedList[i].phone + '">' + infoedList[i].phone + '</td>'
  576. str += '<td class="text-overflow" title="' + infoedList[i].mail + '">' + infoedList[i].mail + '</td>'
  577. str += '<td class="text-overflow" title="' + infoedList[i].position + '">' + infoedList[i].position + '</td>'
  578. str += '<td class="text-overflow" title="已报名">已报名</td>'
  579. str += '</tr>'
  580. }
  581. }
  582. for (var i = 0; i < infoList.length; i++) {
  583. str += '<tr>'
  584. str += '<td class="text-overflow" title="' + infoList[i].name + '">' + infoList[i].name + '</td>'
  585. str += '<td class="text-overflow" title="' + infoList[i].phone + '">' + infoList[i].phone + '</td>'
  586. str += '<td class="text-overflow" title="' + infoList[i].mail + '">' + infoList[i].mail + '</td>'
  587. str += '<td class="text-overflow" title="' + infoList[i].position + '">' + infoList[i].position + '</td>'
  588. str += '<td class="td-manage"><a onclick="removeFromList(\'' + infoList[i].index + '\')" style="color: #0c80fe">删除</a></td>'
  589. str += '</tr>'
  590. }
  591. $("#infoList").append(str)
  592. }
  593. }
  594. var submitFlag = true;
  595. function submit() {
  596. if (submitFlag) {
  597. submitFlag = false;
  598. if (infoList.length <= 0) {
  599. errorMessage("请添加报名信息!");
  600. return
  601. }
  602. var data = {}
  603. data.registrationList = infoList
  604. $.ajax({
  605. url: pagePath + "/home/joinActivity",
  606. type: "post",
  607. data: JSON.stringify(data),
  608. dataType: "json",
  609. contentType: "application/json;charset=utf-8",
  610. //contentType:"text/plain;charset=UTF-8",
  611. success: function (result) {
  612. if (result.success) {
  613. $(".popup-signUp").hide();
  614. var obj = result.obj;
  615. if (obj) {
  616. smileMessage(result.message);
  617. setTimeClose();
  618. } else {
  619. smileMessage(result.message);
  620. }
  621. } else {
  622. errorMessage(result.message);
  623. }
  624. },
  625. error: function () {
  626. errorMessage('系统错误!');
  627. },
  628. complete: function (XMLHttpRequest, textStatus) {
  629. submitFlag = true;
  630. }
  631. });
  632. }
  633. }
  634. </script>
  635. </body>
  636. </html>