index.html 63 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>第六届广东省青少年创新思维及科技实践大赛(创新思维类选手报名)</title>
  7. <style>
  8. * {
  9. margin: 0;
  10. padding: 0;
  11. box-sizing: border-box;
  12. }
  13. body {
  14. font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  15. height: 100vh;
  16. display: flex;
  17. flex-direction: column;
  18. overflow: hidden;
  19. background-color: #f5f7fa;
  20. }
  21. /* 导航栏样式 */
  22. nav {
  23. background: linear-gradient(135deg, #1a73e8, #0d47a1);
  24. color: white;
  25. padding: 15px 30px;
  26. display: flex;
  27. align-items: center;
  28. box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  29. z-index: 100;
  30. }
  31. .logo {
  32. font-size: 24px;
  33. font-weight: bold;
  34. margin-right: 15px;
  35. }
  36. .event-name {
  37. font-size: 20px;
  38. flex-grow: 1;
  39. }
  40. /* 主内容区域 */
  41. .main-container {
  42. display: flex;
  43. flex: 1;
  44. overflow: hidden;
  45. }
  46. /* 左侧菜单 */
  47. .sidebar {
  48. width: 200px;
  49. background-color: #2c3e50;
  50. color: white;
  51. display: flex;
  52. flex-direction: column;
  53. padding: 20px 0;
  54. }
  55. .menu-btn {
  56. padding: 15px 20px;
  57. margin: 10px 15px;
  58. background-color: #3498db;
  59. color: white;
  60. border: none;
  61. border-radius: 5px;
  62. font-size: 16px;
  63. cursor: pointer;
  64. transition: all 0.3s;
  65. text-align: center;
  66. }
  67. .menu-btn:hover {
  68. background-color: #2980b9;
  69. transform: translateY(-2px);
  70. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  71. }
  72. .menu-btn.active {
  73. background-color: #1abc9c;
  74. }
  75. /* 右侧内容区域 */
  76. .content-area {
  77. flex: 1;
  78. display: flex;
  79. flex-direction: column;
  80. padding: 20px;
  81. background-color: white;
  82. border-radius: 10px;
  83. margin: 20px;
  84. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  85. overflow: hidden;
  86. }
  87. .content-header {
  88. font-size: 24px;
  89. color: #2c3e50;
  90. margin-bottom: 20px;
  91. padding-bottom: 10px;
  92. border-bottom: 2px solid #3498db;
  93. }
  94. /* 下载区域 */
  95. .download-section {
  96. display: none;
  97. flex-direction: column;
  98. height: 100%;
  99. }
  100. .download-section.active {
  101. display: flex;
  102. }
  103. .download-list {
  104. overflow-y: auto;
  105. flex: 1;
  106. }
  107. .download-item {
  108. width: calc(100% - 30px);
  109. background-color: #f8f9fa;
  110. border: 1px solid #e9ecef;
  111. border-radius: 8px;
  112. padding: 15px;
  113. margin-bottom: 15px;
  114. display: flex;
  115. align-items: center;
  116. transition: all 0.3s;
  117. }
  118. .download-item:hover {
  119. transform: translateX(5px);
  120. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  121. border-color: #3498db;
  122. }
  123. .file-icon {
  124. font-size: 24px;
  125. margin-right: 15px;
  126. color: #3498db;
  127. }
  128. .file-info {
  129. flex: 1;
  130. }
  131. .file-title {
  132. font-weight: bold;
  133. margin-bottom: 5px;
  134. }
  135. .file-desc {
  136. color: #6c757d;
  137. font-size: 14px;
  138. }
  139. .download-btn {
  140. background-color: #28a745;
  141. color: white;
  142. border: none;
  143. padding: 8px 15px;
  144. border-radius: 5px;
  145. cursor: pointer;
  146. transition: background-color 0.3s;
  147. text-decoration: none;
  148. }
  149. .download-btn:hover {
  150. background-color: #218838;
  151. }
  152. /* 报名区域 */
  153. .registration-section {
  154. display: none;
  155. flex-direction: column;
  156. height: 100%;
  157. overflow-y: auto;
  158. position: relative;
  159. }
  160. .registration-section.active {
  161. display: flex;
  162. }
  163. .form-container {
  164. flex: 1;
  165. padding-right: 10px;
  166. }
  167. .form-group {
  168. margin-bottom: 20px;
  169. }
  170. .form-label {
  171. display: block;
  172. margin-bottom: 8px;
  173. font-weight: bold;
  174. color: #495057;
  175. }
  176. .required::after {
  177. content: " *";
  178. color: #e74c3c;
  179. }
  180. .form-input {
  181. width: 100%;
  182. padding: 12px;
  183. border: 1px solid #ced4da;
  184. border-radius: 5px;
  185. font-size: 16px;
  186. transition: border-color 0.3s;
  187. }
  188. .form-input:focus {
  189. border-color: #3498db;
  190. outline: none;
  191. box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
  192. }
  193. .form-row {
  194. display: flex;
  195. gap: 20px;
  196. }
  197. .form-col {
  198. flex: 1;
  199. }
  200. .file-upload {
  201. border: 2px dashed #ced4da;
  202. padding: 30px;
  203. text-align: center;
  204. border-radius: 8px;
  205. margin: 20px 0;
  206. background-color: #f8f9fa;
  207. transition: all 0.3s;
  208. }
  209. .file-upload:hover {
  210. border-color: #3498db;
  211. background-color: #e3f2fd;
  212. }
  213. .upload-icon {
  214. font-size: 40px;
  215. color: #3498db;
  216. margin-bottom: 15px;
  217. }
  218. .submit-btn {
  219. background-color: #1a73e8;
  220. color: white;
  221. border: none;
  222. padding: 14px 25px;
  223. border-radius: 5px;
  224. font-size: 18px;
  225. cursor: pointer;
  226. transition: all 0.3s;
  227. margin-top: 20px;
  228. width: 100%;
  229. }
  230. .submit-btn:hover {
  231. background-color: #0d47a1;
  232. transform: translateY(-2px);
  233. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  234. }
  235. .error {
  236. color: #e74c3c;
  237. font-size: 14px;
  238. margin-top: 5px;
  239. display: none;
  240. }
  241. .remove-Contestant {
  242. padding: 7px 15px;
  243. font-size: 14px;
  244. background-color: #db3434;
  245. color: white;
  246. border: none;
  247. border-radius: 5px;
  248. cursor: pointer;
  249. transition: all 0.3s;
  250. text-align: center;
  251. position: absolute;
  252. top: 0;
  253. left: 80px;
  254. }
  255. .menu-btn-add:nth-last-child(1) {
  256. padding: 7px 15px;
  257. font-size: 14px;
  258. color: white;
  259. border: none;
  260. border-radius: 5px;
  261. cursor: pointer;
  262. transition: all 0.3s;
  263. text-align: center;
  264. background-color: #3498db;
  265. }
  266. .step-container {
  267. display: none;
  268. }
  269. .step-container.active {
  270. display: block;
  271. }
  272. .competition-grid {
  273. display: grid;
  274. grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  275. gap: 20px;
  276. margin-bottom: 30px;
  277. }
  278. .competition-card {
  279. border: 1px solid #e0e0e0;
  280. border-radius: 10px;
  281. padding: 20px;
  282. text-align: center;
  283. cursor: pointer;
  284. transition: all 0.3s;
  285. }
  286. .competition-card:hover {
  287. border-color: #1a73e8;
  288. box-shadow: 0 4px 12px rgba(26, 115, 232, 0.15);
  289. transform: translateY(-5px);
  290. }
  291. .competition-card.selected {
  292. border-color: #1a73e8;
  293. background-color: #e8f0fe;
  294. }
  295. .competition-icon {
  296. font-size: 36px;
  297. color: #1a73e8;
  298. margin-bottom: 15px;
  299. }
  300. .competition-name {
  301. font-weight: 500;
  302. color: #202124;
  303. }
  304. .btn {
  305. padding: 12px 30px;
  306. border-radius: 8px;
  307. font-size: 16px;
  308. font-weight: 500;
  309. cursor: pointer;
  310. transition: all 0.3s;
  311. border: none;
  312. }
  313. .btn-prev {
  314. background-color: #f8f9fa;
  315. color: #5f6368;
  316. }
  317. .btn-prev:hover {
  318. background-color: #e8f0fe;
  319. color: #1a73e8;
  320. }
  321. .btn-next {
  322. background-color: #1a73e8;
  323. color: white;
  324. }
  325. .btn-next:hover {
  326. background-color: #0d47a1;
  327. }
  328. .btn-submit {
  329. background-color: #34a853;
  330. color: white;
  331. }
  332. .btn-submit:hover {
  333. background-color: #2d9249;
  334. }
  335. .error {
  336. color: #ea4335;
  337. font-size: 14px;
  338. margin-top: 5px;
  339. display: none;
  340. }
  341. .button-group {
  342. display: flex;
  343. justify-content: space-between;
  344. margin-top: 30px;
  345. }
  346. .step-title {
  347. font-size: 18px;
  348. color: #202124;
  349. margin-bottom: 20px;
  350. padding-bottom: 10px;
  351. border-bottom: 1px solid #e0e0e0;
  352. }
  353. .button-Contestant {
  354. display: none;
  355. margin-right: 20px;
  356. }
  357. .button-Contestant.active {
  358. display: block;
  359. }
  360. .help {
  361. position: fixed;
  362. color: #000;
  363. cursor: pointer;
  364. display: inline-block;
  365. width: 50px;
  366. height: 50px;
  367. border-radius: 50%;
  368. background-color: #fff;
  369. bottom: 10px;
  370. left: 10px;
  371. }
  372. .help::after {
  373. content: '?';
  374. position: absolute;
  375. top: 50%;
  376. left: 50%;
  377. transform: translate(-50%, -50%);
  378. font-size: 24px;
  379. }
  380. .help-qrCode {
  381. width: 50%;
  382. padding: 20px;
  383. }
  384. </style>
  385. <script src="./aws-sdk-2.235.1.min.js"></script>
  386. <script>
  387. var credentials = {
  388. accessKeyId: 'AKIATLPEDU37QV5CHLMH',
  389. secretAccessKey: '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'
  390. }; //秘鑰形式的登錄上傳
  391. window.AWS.config.update(credentials);
  392. window.AWS.config.region = 'cn-northwest-1'; //設置區域
  393. </script>
  394. </head>
  395. <body>
  396. <!-- 导航栏 -->
  397. <nav>
  398. </nav>
  399. <!-- 主内容区域 -->
  400. <div class="main-container">
  401. <!-- 左侧菜单 -->
  402. <div class="sidebar">
  403. <button class="menu-btn active" id="downloadBtn">资料下载</button>
  404. <button class="menu-btn" id="registerBtn">在线报名</button>
  405. <button class="menu-btn" id="registerBtn1">资格确认</button>
  406. <span onclick="help()" class="help"></span>
  407. </div>
  408. <!-- 右侧内容区域 -->
  409. <div class="content-area">
  410. <!-- 下载区域 -->
  411. <div class="download-section active" id="downloadSection">
  412. <h2 class="content-header">比赛资料下载</h2>
  413. <div class="download-list">
  414. <div class="download-item">
  415. <div class="file-icon">📋</div>
  416. <div class="file-info">
  417. <div class="file-title">第六届广东省青少年创新思维及科技实践大赛创新思维挑战赛</div>
  418. </div>
  419. <a target="_blank"
  420. href="https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/a/%E5%88%9B%E6%96%B0%E6%80%9D%E7%BB%B4%E7%B1%BB-%E5%88%9B%E6%96%B0%E6%80%9D%E7%BB%B4%E6%8C%91%E6%88%98%E8%B5%9B.pdf"
  421. class="download-btn" download="第六届广东省青少年创新思维及科技实践大赛创新思维挑战赛.pdf">下载</a>
  422. </div>
  423. <div class="download-item">
  424. <div class="file-icon">📊</div>
  425. <div class="file-info">
  426. <div class="file-title">第六届广东省青少年创新思维及科技实践大赛的通知</div>
  427. </div>
  428. <a target="_blank"
  429. href="https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/a/%E5%85%B3%E4%BA%8E%E4%B8%BE%E5%8A%9E%E7%AC%AC%E5%85%AD%E5%B1%8A%E5%B9%BF%E4%B8%9C%E7%9C%81%E9%9D%92%E5%B0%91%E5%B9%B4%E5%88%9B%E6%96%B0%E6%80%9D%E7%BB%B4%E5%8F%8A%E7%A7%91%E6%8A%80%E5%AE%9E%E8%B7%B5%E5%A4%A7%E8%B5%9B%E7%9A%84%E9%80%9A%E7%9F%A5%286%29.pdf"
  430. class="download-btn" download="第六届广东省青少年创新思维及科技实践大赛的通知.pdf">下载</a>
  431. </div>
  432. <div class="download-item">
  433. <div class="file-icon">📄</div>
  434. <div class="file-info">
  435. <div class="file-title">报名表模板</div>
  436. <div class="file-desc">完成在线报名后,请先下载该模板,经所在学校盖章确认后,将盖章后的模板上传至【资格确认】板块,即可完成赛前准备。</div>
  437. </div>
  438. <a target="_blank"
  439. href="https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%5Bobject%20HTMLInputElement%5D/%E6%8A%A5%E5%90%8D%E8%A1%A8.docx"
  440. class="download-btn" download>下载</a>
  441. </div>
  442. <div class="download-item">
  443. <div class="file-icon">🎬</div>
  444. <div class="file-info">
  445. <div class="file-title">宣讲视频</div>
  446. </div>
  447. <a target="_blank" href="https://meeting.tencent.com/crm/l71mRRMd92" class="download-btn">观看</a>
  448. </div>
  449. <div class="download-item">
  450. <div class="file-icon">🎬</div>
  451. <div class="file-info">
  452. <div class="file-title">直播培训回放视频</div>
  453. </div>
  454. <a target="_blank" href="https://meeting.tencent.com/crm/KwBR303qc0" class="download-btn">观看</a>
  455. </div>
  456. <div class="download-item">
  457. <div class="file-icon">📊</div>
  458. <div class="file-info">
  459. <div class="file-title">智能体应用备赛平台登录指引</div>
  460. </div>
  461. <a target="_blank"
  462. href="https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/0960e9b6-2687-b858-2285-455c29eac369/%E6%99%BA%E8%83%BD%E4%BD%93%E5%BA%94%E7%94%A8%E5%A4%87%E8%B5%9B%E5%B9%B3%E5%8F%B0%E7%99%BB%E5%BD%95%E6%8C%87%E5%BC%95.pdf"
  463. class="download-btn" download="智能体应用备赛平台登录指引.pdf">下载</a>
  464. </div>
  465. </div>
  466. </div>
  467. <!-- 报名区域 -->
  468. <div class="registration-section " id="registrationSection">
  469. <!-- <div class="select-type">
  470. <select id="selectType" class="form-input" required >
  471. <option value="">请选择参赛类型</option>
  472. <option value="1">桌游设计挑战类</option>
  473. <option value="2">智能体应用类</option>
  474. </select>
  475. </div> -->
  476. <div class="content-header" style="display: flex;justify-content: space-between;">
  477. <h2 style="display: inline-block;font-size: 24px;">参赛信息登记</h2>
  478. <div class="button-Contestant">
  479. <button class="menu-btn-add" onclick="addContestant()">添加选手</button>
  480. </div>
  481. </div>
  482. <!-- 步骤1:选择比赛类型 -->
  483. <div id="step1" class="step-container active">
  484. <div class="step-title">第一步:请选择您要报名的比赛类型</div>
  485. <div class="competition-grid">
  486. <div class="competition-card" data-id="1">
  487. <div class="competition-icon">🧮</div>
  488. <div class="competition-name">桌游设计挑战</div>
  489. </div>
  490. <div class="competition-card" data-id="2">
  491. <div class="competition-icon">💻</div>
  492. <div class="competition-name">智能体应用</div>
  493. </div>
  494. </div>
  495. <div class="button-group">
  496. <div></div> <!-- 占位 -->
  497. <button class="btn btn-next" id="nextToStep2">下一步</button>
  498. </div>
  499. </div>
  500. <!-- 步骤2:填写报名信息 -->
  501. <div id="step2" class="step-container">
  502. <div class="step-title">第二步:填写报名信息</div>
  503. <div class="form-group" style="display: flex;align-items: center;">
  504. <label class="form-label required" for="name">指导教师</label>
  505. <input style="width: 200px;margin-left: 20px;margin-right: 15px;" type="text" id="teacher"
  506. class="form-input">
  507. <label class="form-label required" for="name">手机号</label>
  508. <input style="width: 200px;margin-left: 20px;margin-right: 15px;" type="text" id="teacherPhone"
  509. class="form-input">
  510. </div>
  511. <div class="form-container" id="formContainer">
  512. <input type="hidden" id="competitionType" value="">
  513. <h3>选手1:</h3>
  514. <br />
  515. <form id="registrationForm1">
  516. <div class="form-row">
  517. <div class="form-col">
  518. <div class="form-group">
  519. <label class="form-label required" for="name">姓名</label>
  520. <input type="text" id="name1" class="form-input" required>
  521. <div class="error" id="name-error1">请输入姓名</div>
  522. </div>
  523. </div>
  524. <div class="form-col">
  525. <div class="form-group">
  526. <label class="form-label required" for="gender">性别</label>
  527. <select id="gender1" class="form-input" required>
  528. <option value="">请选择</option>
  529. <option value="1">男</option>
  530. <option value="2">女</option>
  531. </select>
  532. <div class="error" id="gender-error1">请选择性别</div>
  533. </div>
  534. </div>
  535. </div>
  536. <div class="form-row">
  537. <div class="form-col">
  538. <div class="form-group">
  539. <label class="form-label required" for="ethnicity">民族</label>
  540. <input type="text" id="ethnicity1" class="form-input" required>
  541. <div class="error" id="ethnicity-error1">请输入民族</div>
  542. </div>
  543. </div>
  544. <div class="form-col">
  545. <div class="form-group">
  546. <label class="form-label required" for="birthdate">出生年月</label>
  547. <input type="date" id="birthdate1" class="form-input" required>
  548. <div class="error" id="birthdate-error1">请选择出生年月</div>
  549. </div>
  550. </div>
  551. </div>
  552. <div class="form-row">
  553. <div class="form-col">
  554. <div class="form-group">
  555. <label class="form-label required" for="email">电子邮箱</label>
  556. <input type="email" id="email1" class="form-input" required>
  557. <div class="error" id="email-error1">请输入有效的电子邮箱</div>
  558. </div>
  559. </div>
  560. <div class="form-col">
  561. <div class="form-group">
  562. <label class="form-label required" for="idNumber">身份证号码</label>
  563. <input type="text" id="idNumber1" class="form-input" required
  564. pattern="\d{17}[\dXx]">
  565. <div class="error" id="idNumber-error1">请输入18位身份证号码</div>
  566. </div>
  567. </div>
  568. </div>
  569. <div class="form-row">
  570. <div class="form-col" id="group-containers">
  571. <!-- 组别:只显示一个,根据比赛类型动态显示 -->
  572. </div>
  573. <div class="form-col">
  574. <div class="form-group">
  575. <label class="form-label required" for="grade">年级</label>
  576. <input type="text" id="grade1" class="form-input" required>
  577. <div class="error" id="grade-error1">请输入年级</div>
  578. </div>
  579. </div>
  580. </div>
  581. <div class="form-row">
  582. <div class="form-col">
  583. <div class="form-group">
  584. <label class="form-label required" for="school">所在学校</label>
  585. <input type="text" id="school1" class="form-input" required>
  586. <div class="error" id="school-error1">请输入学校名称</div>
  587. </div>
  588. </div>
  589. <div class="form-col">
  590. <div class="form-group">
  591. <label class="form-label required" for="schoolRegion">学校所在地区</label>
  592. <input type="text" id="schoolRegion1" class="form-input" required
  593. placeholder="省/市/区">
  594. <div class="error" id="schoolRegion-error1">请输入学校所在地区</div>
  595. </div>
  596. </div>
  597. </div>
  598. <div class="form-group">
  599. <label class="form-label required" for="phone">联系电话</label>
  600. <input type="tel" id="phone1" class="form-input" required pattern="[0-9]{11}">
  601. <div class="error" id="phone-error1">请输入11位手机号码</div>
  602. </div>
  603. </form>
  604. </div>
  605. <div class="button-group">
  606. <button type="button" class="btn btn-prev" id="prevToStep1">上一步</button>
  607. <button type="submit" class="btn btn-submit" onclick="submitData()">提交报名</button>
  608. </div>
  609. </div>
  610. </div>
  611. <!-- 上传报名表单 -->
  612. <div class="registration-section" id="uploadSection">
  613. <h2 class="content-header">上传报名表</h2>
  614. <div class="download-list">
  615. <div class="form-row">
  616. <div class="form-col">
  617. <div class="form-group">
  618. <label class="form-label required" for="CompetitionType">比赛类型</label>
  619. <select id="CompetitionType" class="form-input" required>
  620. <option value="">请选择</option>
  621. <option value="1">桌游设计挑战</option>
  622. <option value="2">智能体应用</option>
  623. </select>
  624. </div>
  625. </div>
  626. <div class="form-col">
  627. <div class="form-group">
  628. <label class="form-label required" for="idNumber">身份证号码</label>
  629. <input type="text" id="id_number" class="form-input" required pattern="\d{17}[\dXx]"
  630. placeholder="请填写在线报名时,团队内任一选手的身份证号码">
  631. </div>
  632. </div>
  633. </div>
  634. <div class="form-row">
  635. <div class="form-col">
  636. <div class="file-upload">
  637. <label class="form-label required" for="photo">上传文件</label>
  638. <input type="file" id="uploadFile" required>
  639. </div>
  640. </div>
  641. <div class="form-col" style="display: none;" id="videoUploadDiv">
  642. <div class="file-upload">
  643. <label class="form-label required" for="photo">上传视频</label>
  644. <input type="file" id="uploadVideo" accept="video/*" required>
  645. </div>
  646. </div>
  647. </div>
  648. <button type="submit" class="submit-btn" onclick="submitRegistration()">提交报名表</button>
  649. </div>
  650. </div>
  651. </div>
  652. </div>
  653. <script>
  654. const requesturl = window.location.href.indexOf("localhost") > -1 ? "http://localhost:11111/" : "http://183.36.25.93:888/";
  655. console.log("requesturl:", requesturl);
  656. // 获取url参数
  657. const urlSearch = window.location.search;
  658. if (urlSearch.slice(1) == "baoan") {
  659. document.getElementById("registerBtn1").innerText = `作品提交`
  660. document.getElementsByTagName("nav")[0].innerHTML = `<div class="event-name">宝安区智能体应用赛</div>`
  661. } else if (urlSearch.slice(1) == "guangming") {
  662. document.getElementById("registerBtn1").innerText = `作品提交`
  663. document.getElementsByTagName("nav")[0].innerHTML = `<div class="event-name">光明确智能体应用赛</div>`
  664. } else if (urlSearch.slice(1) == "pingshan") {
  665. document.getElementById("registerBtn1").innerText = `作品提交`
  666. document.getElementsByTagName("nav")[0].innerHTML = `<div class="event-name">坪山区智能体应用赛</div>`
  667. } else if (urlSearch.slice(1) == "longhua") {
  668. document.getElementById("registerBtn1").innerText = `作品提交`
  669. document.getElementsByTagName("nav")[0].innerHTML = `<div class="event-name">龙华区智能体应用赛</div>`
  670. } else if (urlSearch.slice(1) == "nanshan") {
  671. document.getElementById("registerBtn1").innerText = `作品提交`
  672. document.getElementsByTagName("nav")[0].innerHTML = `<div class="event-name">南山区智能体应用赛</div>`
  673. } else {
  674. if (urlSearch != "") {
  675. window.location.search = "";
  676. }
  677. document.getElementsByTagName("nav")[0].innerHTML = `<img src="./logo2.png" alt="logo" style="width: 200px;margin-right: 15px;"></img>
  678. <img src="./logo1.png" alt="logo" style="width: 200px;margin-right: 15px;"></img>
  679. <div class="event-name">第六届广东省青少年创新思维及科技实践大赛(创新思维类选手报名)</div>`
  680. }
  681. if (document.getElementById("registerBtn1").innerText == "作品提交") {
  682. document.getElementsByClassName("content-header")[2].innerText = "作品提交"
  683. document.getElementById("uploadFile").previousElementSibling.innerText = "上传作品说明文件";
  684. document.getElementById("uploadVideo").previousElementSibling.innerText = "上传作品演示视频";
  685. document.getElementsByClassName("submit-btn")[0] = "提交";
  686. }
  687. const nowTime = new Date();
  688. const deadline = new Date("2025-09-22");
  689. // 切换下载和报名区域
  690. document.getElementById('downloadBtn').addEventListener('click', function () {
  691. document.getElementById('downloadBtn').classList.add('active');
  692. document.getElementById('registerBtn').classList.remove('active');
  693. document.getElementById('registerBtn1').classList.remove('active');
  694. document.getElementById('downloadSection').classList.add('active');
  695. document.getElementById('registrationSection').classList.remove('active');
  696. document.getElementById('uploadSection').classList.remove('active');
  697. document.getElementsByClassName("button-Contestant")[0].classList.remove('active');
  698. });
  699. document.getElementById('registerBtn1').addEventListener('click', function () {
  700. document.getElementById('registerBtn1').classList.add('active');
  701. document.getElementById('downloadBtn').classList.remove('active');
  702. document.getElementById('registerBtn').classList.remove('active');
  703. document.getElementById('downloadSection').classList.remove('active');
  704. document.getElementById('registrationSection').classList.remove('active');
  705. document.getElementsByClassName("button-Contestant")[0].classList.remove('active');
  706. document.getElementById('uploadSection').classList.add('active');
  707. const uploadTime = new Date("2025-10-13");
  708. if (nowTime < uploadTime && !urlSearch.length > 0) {
  709. document.getElementById('uploadSection').innerHTML = "<div style='display:flex;justify-content:center;align-items:center;height:100vh;font-size:2rem;color:#db3434;'>资格确认在2025-10-13开放上传</div>";
  710. }
  711. });
  712. let buttonContestant = false
  713. document.getElementById('registerBtn').addEventListener('click', function () {
  714. document.getElementById('registerBtn').classList.add('active');
  715. document.getElementById('downloadBtn').classList.remove('active');
  716. document.getElementById('registerBtn1').classList.remove('active');
  717. document.getElementById('registrationSection').classList.add('active');
  718. document.getElementById('downloadSection').classList.remove('active');
  719. document.getElementById('uploadSection').classList.remove('active');
  720. console.log("selectedCompetitionId:", selectedCompetitionId);
  721. if (buttonContestant) {
  722. document.getElementsByClassName("button-Contestant")[0].classList.add('active');
  723. } else {
  724. document.getElementsByClassName("button-Contestant")[0].classList.remove('active');
  725. }
  726. });
  727. let uploadFileUrl = ''
  728. // 比赛类型选择
  729. const competitionCards = document.querySelectorAll('.competition-card');
  730. let selectedCompetitionId = null;
  731. competitionCards.forEach(card => {
  732. card.addEventListener('click', function () {
  733. // 移除所有卡片的selected类
  734. competitionCards.forEach(c => {
  735. c.classList.remove('selected');
  736. });
  737. // 添加当前卡片的selected类
  738. this.classList.add('selected');
  739. // 存储选择的比赛ID
  740. selectedCompetitionId = this.getAttribute('data-id');
  741. });
  742. });
  743. // 步骤切换
  744. document.getElementById('nextToStep2').addEventListener('click', function () {
  745. if (!selectedCompetitionId) {
  746. alert('请先选择比赛类型');
  747. return;
  748. }
  749. if (selectedCompetitionId == 2) {
  750. addContestant()
  751. }
  752. // 初始化
  753. updateGroupSelect(selectedCompetitionId);
  754. // 切换到步骤2
  755. document.getElementById('step1').classList.remove('active');
  756. document.getElementById('step2').classList.add('active');
  757. document.getElementsByClassName("button-Contestant")[0].classList.add('active');
  758. buttonContestant = true
  759. });
  760. document.getElementById('prevToStep1').addEventListener('click', function () {
  761. // 切换回步骤1
  762. document.getElementById('step2').classList.remove('active');
  763. document.getElementById('step1').classList.add('active');
  764. document.getElementsByClassName("button-Contestant")[0].classList.remove('active');
  765. buttonContestant = false
  766. const html = document.getElementById('formContainer');
  767. // 删除添加的表单
  768. addList.forEach((item, idx) => {
  769. let formDiv = html.querySelector(`div#addformContainer${item}`);
  770. if (formDiv) {
  771. html.removeChild(formDiv);
  772. }
  773. });
  774. addList = []
  775. num = 1
  776. });
  777. let num = 1;
  778. let addList = []
  779. function addContestant() {
  780. const html = document.getElementById('formContainer');
  781. if (html.children.length >= 6) {
  782. alert('最多添加3个选手');
  783. return
  784. }
  785. num = num + 1;
  786. addList.push(num)
  787. const ifFirst = addList.find(item => item === 1);
  788. let addListLength = addList.length + 1;
  789. if (ifFirst) {
  790. addListLength = addList.length
  791. }
  792. console.log("addListLength:", html.children.length);
  793. const createDiv = document.createElement('div');
  794. createDiv.id = `addformContainer${num}`;
  795. createDiv.style.position = 'relative';
  796. const h3Create = document.createElement('h3');
  797. h3Create.innerText = `选手${addListLength}:`;
  798. createDiv.appendChild(h3Create);
  799. const delButton = document.createElement('button');
  800. delButton.innerText = `删除选手${addListLength}`;
  801. delButton.className = 'menu-btn-add remove-Contestant';
  802. delButton.onclick = removeContestant;
  803. createDiv.appendChild(delButton);
  804. const brCreate = document.createElement('br');
  805. createDiv.appendChild(brCreate);
  806. const formCrate = document.createElement('form');
  807. formCrate.id = `registrationForm${num}`;
  808. if (selectedCompetitionId == 2) {
  809. formCrate.innerHTML = `<div class="form-row">
  810. <div class="form-col">
  811. <div class="form-group">
  812. <label class="form-label required" for="name">姓名</label>
  813. <input type="text" id="name${num}" class="form-input" required>
  814. <div class="error" id="name-error${num}">请输入姓名</div>
  815. </div>
  816. </div>
  817. <div class="form-col">
  818. <div class="form-group">
  819. <label class="form-label required" for="gender">性别</label>
  820. <select id="gender${num}" class="form-input" required>
  821. <option value="">请选择</option>
  822. <option value="1">男</option>
  823. <option value="2">女</option>
  824. </select>
  825. <div class="error" id="gender-error${num}">请选择性别</div>
  826. </div>
  827. </div>
  828. </div>
  829. <div class="form-row">
  830. <div class="form-col">
  831. <div class="form-group">
  832. <label class="form-label required" for="ethnicity">民族</label>
  833. <input type="text" id="ethnicity${num}" class="form-input" required>
  834. <div class="error" id="ethnicity-error${num}">请输入民族</div>
  835. </div>
  836. </div>
  837. <div class="form-col">
  838. <div class="form-group">
  839. <label class="form-label required" for="birthdate">出生年月</label>
  840. <input type="date" id="birthdate${num}" class="form-input" required>
  841. <div class="error" id="birthdate-error${num}">请选择出生年月</div>
  842. </div>
  843. </div>
  844. </div>
  845. <div class="form-row">
  846. <div class="form-col">
  847. <div class="form-group">
  848. <label class="form-label required" for="email">电子邮箱</label>
  849. <input type="email" id="email${num}" class="form-input" required>
  850. <div class="error" id="email-error${num}">请输入有效的电子邮箱</div>
  851. </div>
  852. </div>
  853. <div class="form-col">
  854. <div class="form-group">
  855. <label class="form-label required" for="idNumber">身份证号码</label>
  856. <input type="text" id="idNumber${num}" class="form-input" required pattern="\d{17}[\dXx]">
  857. <div class="error" id="idNumber-error${num}">请输入正确身份证号</div>
  858. </div>
  859. </div>
  860. </div>
  861. <div class="form-row">
  862. <div class="form-col">
  863. <div class="form-group">
  864. <label class="form-label required" for="group">组别</label>
  865. <select id="group${num}" class="form-input" required>
  866. <option value="">请选择</option>
  867. <option value="1">小学组(4-6年级)</option>
  868. <option value="2">初中组(7-9年级)</option>
  869. <option value="3">高中组(10-12年级,含中职)</option>
  870. <option value="4">高校组(含高职)</option>
  871. </select>
  872. <div class="error" id="group-error${num}">请选择组别</div>
  873. </div>
  874. </div>
  875. <div class="form-col">
  876. <div class="form-group">
  877. <label class="form-label required" for="grade">年级</label>
  878. <input type="text" id="grade${num}" class="form-input" required>
  879. <div class="error" id="grade-error${num}">请输入年级</div>
  880. </div>
  881. </div>
  882. </div>
  883. <div class="form-row">
  884. <div class="form-col">
  885. <div class="form-group">
  886. <label class="form-label required" for="school">所在学校</label>
  887. <input type="text" id="school${num}" class="form-input" required>
  888. <div class="error" id="school-error${num}">请输入学校名称</div>
  889. </div>
  890. </div>
  891. <div class="form-col">
  892. <div class="form-group">
  893. <label class="form-label required" for="schoolRegion">学校所在地区</label>
  894. <input type="text" id="schoolRegion${num}" class="form-input" required
  895. placeholder="省/市/区">
  896. <div class="error" id="schoolRegion-error${num}">请输入学校所在地区</div>
  897. </div>
  898. </div>
  899. </div>
  900. <div class="form-group">
  901. <label class="form-label required" for="phone">联系电话</label>
  902. <input type="tel" id="phone${num}" class="form-input" required pattern="[0-9]{11}">
  903. <div class="error" id="phone-error${num}">请输入11位手机号码</div>
  904. </div>`;
  905. } else {
  906. formCrate.innerHTML = `<div class="form-row">
  907. <div class="form-col">
  908. <div class="form-group">
  909. <label class="form-label required" for="name">姓名</label>
  910. <input type="text" id="name${num}" class="form-input" required>
  911. <div class="error" id="name-error${num}">请输入姓名</div>
  912. </div>
  913. </div>
  914. <div class="form-col">
  915. <div class="form-group">
  916. <label class="form-label required" for="gender">性别</label>
  917. <select id="gender${num}" class="form-input" required>
  918. <option value="">请选择</option>
  919. <option value="1">男</option>
  920. <option value="2">女</option>
  921. </select>
  922. <div class="error" id="gender-error${num}">请选择性别</div>
  923. </div>
  924. </div>
  925. </div>
  926. <div class="form-row">
  927. <div class="form-col">
  928. <div class="form-group">
  929. <label class="form-label required" for="ethnicity">民族</label>
  930. <input type="text" id="ethnicity${num}" class="form-input" required>
  931. <div class="error" id="ethnicity-error${num}">请输入民族</div>
  932. </div>
  933. </div>
  934. <div class="form-col">
  935. <div class="form-group">
  936. <label class="form-label required" for="birthdate">出生年月</label>
  937. <input type="date" id="birthdate${num}" class="form-input" required>
  938. <div class="error" id="birthdate-error${num}">请选择出生年月</div>
  939. </div>
  940. </div>
  941. </div>
  942. <div class="form-row">
  943. <div class="form-col">
  944. <div class="form-group">
  945. <label class="form-label required" for="email">电子邮箱</label>
  946. <input type="email" id="email${num}" class="form-input" required>
  947. <div class="error" id="email-error${num}">请输入有效的电子邮箱</div>
  948. </div>
  949. </div>
  950. <div class="form-col">
  951. <div class="form-group">
  952. <label class="form-label required" for="idNumber">身份证号码</label>
  953. <input type="text" id="idNumber${num}" class="form-input" required pattern="\d{17}[\dXx]">
  954. <div class="error" id="idNumber-error${num}">请输入正确身份证号</div>
  955. </div>
  956. </div>
  957. </div>
  958. <div class="form-row">
  959. <div class="form-col">
  960. <div class="form-group">
  961. <label class="form-label required" for="group">组别</label>
  962. <select id="group${num}" class="form-input" required>
  963. <option value="">请选择</option>
  964. <option value="1">小学低龄</option>
  965. <option value="2">小学高龄</option>
  966. <option value="3">中学</option>
  967. <option value="4">高校</option>
  968. </select>
  969. <div class="error" id="group-error${num}">请选择组别</div>
  970. </div>
  971. </div>
  972. <div class="form-col">
  973. <div class="form-group">
  974. <label class="form-label required" for="grade">年级</label>
  975. <input type="text" id="grade${num}" class="form-input" required>
  976. <div class="error" id="grade-error${num}">请输入年级</div>
  977. </div>
  978. </div>
  979. </div>
  980. <div class="form-row">
  981. <div class="form-col">
  982. <div class="form-group">
  983. <label class="form-label required" for="school">所在学校</label>
  984. <input type="text" id="school${num}" class="form-input" required>
  985. <div class="error" id="school-error${num}">请输入学校名称</div>
  986. </div>
  987. </div>
  988. <div class="form-col">
  989. <div class="form-group">
  990. <label class="form-label required" for="schoolRegion">学校所在地区</label>
  991. <input type="text" id="schoolRegion${num}" class="form-input" required
  992. placeholder="省/市/区">
  993. <div class="error" id="schoolRegion-error${num}">请输入学校所在地区</div>
  994. </div>
  995. </div>
  996. </div>
  997. <div class="form-group">
  998. <label class="form-label required" for="phone">联系电话</label>
  999. <input type="tel" id="phone${num}" class="form-input" required pattern="[0-9]{11}">
  1000. <div class="error" id="phone-error${num}">请输入11位手机号码</div>
  1001. </div>`;
  1002. }
  1003. createDiv.appendChild(formCrate);
  1004. html.appendChild(createDiv);
  1005. }
  1006. function removeContestant(e) {
  1007. const parentElement = Number(e.target.parentElement.id && e.target.parentElement.id.slice(16));
  1008. const html = document.getElementById('formContainer');
  1009. if (selectedCompetitionId == 2) {
  1010. if (html.children.length <= 5) {
  1011. alert('至少保留两个选手');
  1012. return
  1013. }
  1014. }
  1015. addList = addList.filter(item => item !== parentElement);
  1016. let selectForm = html.querySelector(`div#addformContainer${parentElement}`);
  1017. if (selectForm) html.removeChild(selectForm);
  1018. // 依次递增更新剩余选手的序号
  1019. addList.forEach((item, idx) => {
  1020. let formDiv = html.querySelector(`div#addformContainer${item}`);
  1021. if (formDiv) {
  1022. formDiv.querySelector('h3').innerText = `选手${idx + 2}:`;
  1023. formDiv.querySelector('button').innerText = `删除选手${idx + 2}`;
  1024. }
  1025. });
  1026. // num = num - 1;
  1027. }
  1028. async function submitData() {
  1029. const requiredFields = ['name', 'gender', 'ethnicity', 'birthdate', 'email',
  1030. 'idNumber', 'group', 'grade', 'school', 'schoolRegion', 'phone',];
  1031. let formData = [];
  1032. let idNumber = '';
  1033. let idError = '';
  1034. let phone = '';
  1035. let phoneError = '';
  1036. let i = 0
  1037. let isFirst = addList.find(item => item === 1);
  1038. if (!isFirst) addList.unshift(1);
  1039. const teacher = document.getElementById('teacher').value;
  1040. if (!teacher) {
  1041. alert('请填写指导老师');
  1042. return;
  1043. }
  1044. const teacherPhone = document.getElementById('teacherPhone').value;
  1045. if (!/^[0-9]{11}$/.test(teacherPhone)) {
  1046. alert('请正确填写指导老师手机号');
  1047. return;
  1048. }
  1049. let phoneSet = new Set();
  1050. for (let j = 0; j <= addList.length - 1; j++) {
  1051. let element = null;
  1052. let errorElement = null;
  1053. let isValid = true;
  1054. i = addList[j]
  1055. requiredFields.forEach(field => {
  1056. element = document.getElementById(field + i);
  1057. errorElement = document.getElementById(`${field}-error` + i);
  1058. if (!element.value) {
  1059. errorElement.style.display = 'block';
  1060. isValid = false;
  1061. } else {
  1062. errorElement.style.display = 'none';
  1063. }
  1064. });
  1065. // 验证身份证格式
  1066. idNumber = document.getElementById('idNumber' + i);
  1067. idError = document.getElementById('idNumber-error' + i);
  1068. if (idNumber.value.length > 5) {
  1069. idError.style.display = 'none';
  1070. } else {
  1071. idError.style.display = 'block';
  1072. isValid = false;
  1073. }
  1074. // 验证手机号格式
  1075. phone = document.getElementById('phone' + i);
  1076. phoneError = document.getElementById('phone-error' + i);
  1077. if (!/^[0-9]{11}$/.test(phone.value)) {
  1078. phoneError.style.display = 'block';
  1079. isValid = false;
  1080. } else {
  1081. phoneError.style.display = 'none';
  1082. }
  1083. if (!isValid) {
  1084. alert(`选手${j + 1}填写信息有误,请重新填写`);
  1085. return;
  1086. };
  1087. formData.push({
  1088. name: document.getElementById('name' + i).value,
  1089. gender: document.getElementById('gender' + i).value,
  1090. ethnicity: document.getElementById('ethnicity' + i).value,
  1091. birthdate: document.getElementById('birthdate' + i).value,
  1092. email: document.getElementById('email' + i).value,
  1093. id_number: document.getElementById('idNumber' + i).value,
  1094. group: document.getElementById('group' + i).value,
  1095. grade: document.getElementById('grade' + i).value,
  1096. school: document.getElementById('school' + i).value,
  1097. schoolRegion: document.getElementById('schoolRegion' + i).value,
  1098. phone: document.getElementById('phone' + i).value,
  1099. })
  1100. }
  1101. try {
  1102. // 收集表单数据
  1103. const formDataObj = {
  1104. type: selectedCompetitionId, // 报名类型,1桌游,2智能体
  1105. uploadUrl: teacher + teacherPhone, // 上传文件的URL
  1106. idCard: formData.map(item => item.id_number).join(","), // 选手身份证号拼接
  1107. registrationFormUrl: "", // 报名表上传URL
  1108. user: JSON.stringify(formData),
  1109. area: urlSearch.slice(1), // 区
  1110. };
  1111. let aa = selectedCompetitionId == 2 ? "智能体应用类比赛,手机号作为登录账号,请确认手机号填写正确且不能重复" : "桌游设计挑战类比赛"
  1112. if (!confirm(`您参加的是${aa},提交之后无法再修改信息,是否确认提交?`)) {
  1113. return;
  1114. }
  1115. // 发送报名信息请求
  1116. const registerResponse = await fetch(requesturl + 'api/user', {
  1117. method: 'POST',
  1118. headers: {
  1119. 'Content-Type': 'application/json'
  1120. },
  1121. body: JSON.stringify(formDataObj)
  1122. });
  1123. if (!registerResponse.ok) {
  1124. throw new Error('报名提交失败');
  1125. }
  1126. const registerData = await registerResponse.json();
  1127. console.log(registerData);
  1128. if (registerData.status == "ok") {
  1129. alert("报名完成,审核情况会通过邮箱通知,请注意邮箱信息");
  1130. } else {
  1131. alert(registerData.message);
  1132. }
  1133. // document.getElementById('registrationForm').reset();
  1134. } catch (error) {
  1135. console.error('提交错误:', error);
  1136. alert(`报名失败: ${error.message}`);
  1137. }
  1138. }
  1139. async function submitRegistration() {
  1140. const idNumber = document.getElementById('id_number');
  1141. const CompetitionType = document.getElementById('CompetitionType');
  1142. if (!idNumber.value && !CompetitionType.value) {
  1143. alert('请选择比赛类型和填写身份证号');
  1144. //e.target.value = ''; // 清空已选择的文件
  1145. return;
  1146. }
  1147. if (uploadFileUrl1 == "") {
  1148. alert('请上传报名文件');
  1149. return;
  1150. }
  1151. if (CompetitionType.value == 2 && document.getElementById("videoUploadDiv").style.display == "block") {
  1152. if (uploadVideoUrl == "") {
  1153. alert('请上传智能体视频');
  1154. return;
  1155. }
  1156. }
  1157. if (!confirm('如已上传过文件,本次上传会覆盖之前上传,是否确定提交吗?')) {
  1158. return;
  1159. }
  1160. try {
  1161. const response = await fetch(requesturl + "api/update", {
  1162. method: "POST",
  1163. headers: {
  1164. "Content-Type": "application/json"
  1165. },
  1166. body: JSON.stringify({
  1167. url: uploadFileUrl1,
  1168. id_number: idNumber.value,
  1169. type: CompetitionType.value,
  1170. })
  1171. })
  1172. if (!response.ok) {
  1173. throw new Error('信息更新失败');
  1174. }
  1175. const registerData = await response.json();
  1176. console.log(registerData);
  1177. alert(registerData.message);
  1178. } catch (error) {
  1179. console.error('信息更新失败:', error);
  1180. alert(error.message);
  1181. }
  1182. }
  1183. async function help() {
  1184. const img1 = `<img class="help-qrCode" src="https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/0960e9b6-2687-b858-2285-455c29eac369/code2.png" />`
  1185. const img2 = `<div><span>创新思维赛 桌游设计挑战类 答疑群</span><br /><img class="help-qrCode" src="./2.png" /></div>`
  1186. showModal(img1 + img2)
  1187. }
  1188. async function openVideo() {
  1189. // const video = `<video style="width:100%;height:100%" src="https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/f41a07d8-2cab-76b2-2b5b-8211d98bdb0c/%E9%A6%AC%E6%88%B2%E5%9C%98%E6%A9%9F%E5%99%A8%E4%BA%BA.mp4" controls autoplay></video>`
  1190. showModal("宣讲视频暂无...")
  1191. }
  1192. let uploadFileUrl1 = "";
  1193. let uploadVideoUrl = "";
  1194. document.getElementById('uploadFile').addEventListener('change', async function (e) {
  1195. const idNumber = document.getElementById('id_number');
  1196. if (!idNumber.value) {
  1197. alert('请先填写身份证号');
  1198. e.target.value = ''; // 清空已选择的文件
  1199. return;
  1200. }
  1201. const file = e.target.files[0];
  1202. if (!file) return;
  1203. const fileName = `${idNumber.value}/${file.name}`;
  1204. uploadFileUrl1 = await uplod(fileName, file);
  1205. console.log('选择文件:', uploadFileUrl1);
  1206. });
  1207. document.getElementById('uploadVideo').addEventListener('change', async function (e) {
  1208. const idNumber = document.getElementById('id_number');
  1209. if (!idNumber.value) {
  1210. alert('请先填写身份证号');
  1211. e.target.value = ''; // 清空已选择的文件
  1212. return;
  1213. }
  1214. const file = e.target.files[0];
  1215. if (!file) return;
  1216. const fileName = `${idNumber}/${file.name}`;
  1217. uploadVideoUrl = await uplod(fileName, file);
  1218. console.log('视频文件:', uploadVideoUrl);
  1219. })
  1220. async function uplod(fileName, file) {
  1221. var bucket = new window.AWS.S3({ params: { Bucket: 'ccrb' } });
  1222. var params = {
  1223. Key: fileName,
  1224. ContentType: file.type,
  1225. Body: file,
  1226. 'Access-Control-Allow-Credentials': '*',
  1227. 'ACL': 'public-read'
  1228. };
  1229. try {
  1230. const data = await bucket.upload(params).promise();
  1231. console.log('上传成功:', data);
  1232. alert('文件上传成功');
  1233. return data.Location;
  1234. } catch (err) {
  1235. console.error('上传失败:', err);
  1236. alert('文件上传失败');
  1237. return '';
  1238. }
  1239. }
  1240. function styleHide() {
  1241. selectedCompetitionId = 2
  1242. document.getElementById('registerBtn').click();
  1243. document.getElementById('downloadBtn').style.display = 'none';
  1244. // document.getElementById('registerBtn1').style.display = 'none';
  1245. document.getElementById('prevToStep1').style.display = 'none';
  1246. addContestant()
  1247. updateGroupSelect(selectedCompetitionId);
  1248. // 切换到步骤2
  1249. document.getElementById('step1').classList.remove('active');
  1250. document.getElementById('step2').classList.add('active');
  1251. document.getElementsByClassName("button-Contestant")[0].classList.add('active');
  1252. document.getElementsByClassName("button-group")[1].style.textAlign = "center";
  1253. document.getElementsByClassName("button-group")[1].style.display = "block";
  1254. document.getElementsByClassName("step-title")[1].style.display = "none";
  1255. document.getElementById("videoUploadDiv").style.display = "block";
  1256. buttonContestant = true
  1257. }
  1258. window.onload = function () {
  1259. // updateGroupSelect("1")
  1260. if (urlSearch.slice(1) == "baoan") {
  1261. styleHide()
  1262. } else if (urlSearch.slice(1) == "guangming") {
  1263. styleHide()
  1264. } else if (urlSearch.slice(1) == "pingshan") {
  1265. styleHide()
  1266. } else if (urlSearch.slice(1) == "longhua") {
  1267. styleHide()
  1268. } else if (urlSearch.slice(1) == "nanshan") {
  1269. styleHide()
  1270. }
  1271. }
  1272. </script>
  1273. <!-- Modal -->
  1274. <div id="modal"
  1275. style="display:none;position:fixed;top:0;left:0;width:100vw;height:100vh;background:rgba(0,0,0,0.4);z-index:999;justify-content:center;align-items:center;">
  1276. <div
  1277. style="background:#fff;padding:30px 20px;border-radius:10px;width:800px;box-shadow:0 4px 24px rgba(0,0,0,0.2);position:relative;">
  1278. <span id="modalClose" style="position:absolute;top:10px;right:15px;font-size:22px;cursor:pointer;">×</span>
  1279. <div id="modalContent" style="text-align: center;"></div>
  1280. </div>
  1281. </div>
  1282. <script>
  1283. // 显示modal
  1284. function showModal(content) {
  1285. document.getElementById('modalContent').innerHTML = content;
  1286. document.getElementById('modal').style.display = 'flex';
  1287. }
  1288. // 关闭modal
  1289. document.getElementById('modalClose').onclick = function () {
  1290. document.getElementById('modal').style.display = 'none';
  1291. };
  1292. // 点击遮罩关闭
  1293. document.getElementById('modal').onclick = function (e) {
  1294. if (e.target === this) this.style.display = 'none';
  1295. };
  1296. // 示例:点击左下角问号弹出帮助
  1297. // document.querySelector('.help').onclick = function() {
  1298. // showModal('如有疑问请联系组委会邮箱:ccrb@cocorobo.cn<br>或电话:020-8251-0085');
  1299. // };
  1300. </script>
  1301. </body>
  1302. <script>
  1303. // 根据比赛类型显示对应组别
  1304. function updateGroupSelect(type) {
  1305. const groupContainers = document.getElementById('group-containers')
  1306. console.log(groupContainers)
  1307. if (type == "1") {
  1308. groupContainers.innerHTML = `<div class="form-group" id="group-container1">
  1309. <label class="form-label required" for="group">组别</label>
  1310. <select id="group1" class="form-input" required>
  1311. <option value="">请选择</option>
  1312. <option value="1">小学低龄</option>
  1313. <option value="2">小学高龄</option>
  1314. <option value="3">中学</option>
  1315. <option value="4">高校</option>
  1316. </select>
  1317. <div class="error" id="group-error1">请选择组别</div>
  1318. </div>`
  1319. } else {
  1320. groupContainers.innerHTML = `
  1321. <div class="form-group" id="group-container2" >
  1322. <label class="form-label required" for="group">组别</label>
  1323. <select id="group1" class="form-input" required>
  1324. <option value="">请选择</option>
  1325. <option value="1">小学组(4-6年级)</option>
  1326. <option value="2">初中组(7-9年级)</option>
  1327. <option value="3">高中组(10-12年级,含中职)</option>
  1328. <option value="4">高校组(含高职)</option>
  1329. </select>
  1330. <div class="error" id="group-error1">请选择组别</div>
  1331. </div>`
  1332. }
  1333. }
  1334. </script>
  1335. <script>
  1336. </script>
  1337. </html>