index.html 68 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583
  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. <button class="menu-btn" id="registerBtn2">作品提交(桌游设计挑战类比赛)</button>
  407. <span onclick="help()" class="help"></span>
  408. </div>
  409. <!-- 右侧内容区域 -->
  410. <div class="content-area">
  411. <!-- 下载区域 -->
  412. <div class="download-section active" id="downloadSection">
  413. <h2 class="content-header">比赛资料下载</h2>
  414. <div class="download-list">
  415. <div class="download-item">
  416. <div class="file-icon">📋</div>
  417. <div class="file-info">
  418. <div class="file-title">第六届广东省青少年创新思维及科技实践大赛创新思维挑战赛</div>
  419. </div>
  420. <a target="_blank"
  421. 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"
  422. class="download-btn" download="第六届广东省青少年创新思维及科技实践大赛创新思维挑战赛.pdf">下载</a>
  423. </div>
  424. <div class="download-item">
  425. <div class="file-icon">📊</div>
  426. <div class="file-info">
  427. <div class="file-title">第六届广东省青少年创新思维及科技实践大赛的通知</div>
  428. </div>
  429. <a target="_blank"
  430. 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"
  431. class="download-btn" download="第六届广东省青少年创新思维及科技实践大赛的通知.pdf">下载</a>
  432. </div>
  433. <div class="download-item">
  434. <div class="file-icon">📄</div>
  435. <div class="file-info">
  436. <div class="file-title">报名表模板</div>
  437. <div class="file-desc">完成在线报名后,请先下载该模板,经所在学校盖章确认后,将盖章后的模板上传至【资格确认】板块,即可完成赛前准备。</div>
  438. </div>
  439. <a target="_blank"
  440. href="https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%5Bobject%20HTMLInputElement%5D/%E6%8A%A5%E5%90%8D%E8%A1%A8.docx"
  441. class="download-btn" download>下载</a>
  442. </div>
  443. <div class="download-item">
  444. <div class="file-icon">🎬</div>
  445. <div class="file-info">
  446. <div class="file-title">宣讲视频</div>
  447. </div>
  448. <a target="_blank" href="https://meeting.tencent.com/crm/l71mRRMd92" class="download-btn">观看</a>
  449. </div>
  450. <div class="download-item">
  451. <div class="file-icon">🎬</div>
  452. <div class="file-info">
  453. <div class="file-title">直播培训回放视频</div>
  454. </div>
  455. <a target="_blank" href="https://meeting.tencent.com/crm/KwBR303qc0" class="download-btn">观看</a>
  456. </div>
  457. <div class="download-item">
  458. <div class="file-icon">🎬</div>
  459. <div class="file-info">
  460. <div class="file-title">智能体应用赛-进阶应用拆解</div>
  461. </div>
  462. <a target="_blank" href="https://meeting.tencent.com/crm/2rVQ4P0ea6" class="download-btn">观看</a>
  463. </div>
  464. <div class="download-item">
  465. <div class="file-icon">📊</div>
  466. <div class="file-info">
  467. <div class="file-title">智能体应用备赛平台登录指引</div>
  468. </div>
  469. <a target="_blank"
  470. 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"
  471. class="download-btn" download="智能体应用备赛平台登录指引.pdf">下载</a>
  472. </div>
  473. </div>
  474. </div>
  475. <!-- 报名区域 -->
  476. <div class="registration-section " id="registrationSection">
  477. <!-- <div class="select-type">
  478. <select id="selectType" class="form-input" required >
  479. <option value="">请选择参赛类型</option>
  480. <option value="1">桌游设计挑战类</option>
  481. <option value="2">智能体应用类</option>
  482. </select>
  483. </div> -->
  484. <div class="content-header" style="display: flex;justify-content: space-between;">
  485. <h2 style="display: inline-block;font-size: 24px;">参赛信息登记</h2>
  486. <div class="button-Contestant">
  487. <button class="menu-btn-add" onclick="addContestant()">添加选手</button>
  488. </div>
  489. </div>
  490. <!-- 步骤1:选择比赛类型 -->
  491. <div id="step1" class="step-container active">
  492. <div class="step-title">第一步:请选择您要报名的比赛类型</div>
  493. <div class="competition-grid">
  494. <div class="competition-card" data-id="1">
  495. <div class="competition-icon">🧮</div>
  496. <div class="competition-name">桌游设计挑战</div>
  497. </div>
  498. <div class="competition-card" data-id="2">
  499. <div class="competition-icon">💻</div>
  500. <div class="competition-name">智能体应用</div>
  501. </div>
  502. </div>
  503. <div class="button-group">
  504. <div></div> <!-- 占位 -->
  505. <button class="btn btn-next" id="nextToStep2">下一步</button>
  506. </div>
  507. </div>
  508. <!-- 步骤2:填写报名信息 -->
  509. <div id="step2" class="step-container">
  510. <div class="step-title">第二步:填写报名信息</div>
  511. <div class="form-group" style="display: flex;align-items: center;">
  512. <label class="form-label required" for="name">指导教师</label>
  513. <input style="width: 200px;margin-left: 20px;margin-right: 15px;" type="text" id="teacher"
  514. class="form-input">
  515. <label class="form-label required" for="name">手机号</label>
  516. <input style="width: 200px;margin-left: 20px;margin-right: 15px;" type="text" id="teacherPhone"
  517. class="form-input">
  518. </div>
  519. <div class="form-container" id="formContainer">
  520. <input type="hidden" id="competitionType" value="">
  521. <h3>选手1:</h3>
  522. <br />
  523. <form id="registrationForm1">
  524. <div class="form-row">
  525. <div class="form-col">
  526. <div class="form-group">
  527. <label class="form-label required" for="name">姓名</label>
  528. <input type="text" id="name1" class="form-input" required>
  529. <div class="error" id="name-error1">请输入姓名</div>
  530. </div>
  531. </div>
  532. <div class="form-col">
  533. <div class="form-group">
  534. <label class="form-label required" for="gender">性别</label>
  535. <select id="gender1" class="form-input" required>
  536. <option value="">请选择</option>
  537. <option value="1">男</option>
  538. <option value="2">女</option>
  539. </select>
  540. <div class="error" id="gender-error1">请选择性别</div>
  541. </div>
  542. </div>
  543. </div>
  544. <div class="form-row">
  545. <div class="form-col">
  546. <div class="form-group">
  547. <label class="form-label required" for="ethnicity">民族</label>
  548. <input type="text" id="ethnicity1" class="form-input" required>
  549. <div class="error" id="ethnicity-error1">请输入民族</div>
  550. </div>
  551. </div>
  552. <div class="form-col">
  553. <div class="form-group">
  554. <label class="form-label required" for="birthdate">出生年月</label>
  555. <input type="date" id="birthdate1" class="form-input" required>
  556. <div class="error" id="birthdate-error1">请选择出生年月</div>
  557. </div>
  558. </div>
  559. </div>
  560. <div class="form-row">
  561. <div class="form-col">
  562. <div class="form-group">
  563. <label class="form-label required" for="email">电子邮箱</label>
  564. <input type="email" id="email1" class="form-input" required>
  565. <div class="error" id="email-error1">请输入有效的电子邮箱</div>
  566. </div>
  567. </div>
  568. <div class="form-col">
  569. <div class="form-group">
  570. <label class="form-label required" for="idNumber">身份证号码</label>
  571. <input type="text" id="idNumber1" class="form-input" required
  572. pattern="\d{17}[\dXx]">
  573. <div class="error" id="idNumber-error1">请输入18位身份证号码</div>
  574. </div>
  575. </div>
  576. </div>
  577. <div class="form-row">
  578. <div class="form-col" id="group-containers">
  579. <!-- 组别:只显示一个,根据比赛类型动态显示 -->
  580. </div>
  581. <div class="form-col">
  582. <div class="form-group">
  583. <label class="form-label required" for="grade">年级</label>
  584. <input type="text" id="grade1" class="form-input" required>
  585. <div class="error" id="grade-error1">请输入年级</div>
  586. </div>
  587. </div>
  588. </div>
  589. <div class="form-row">
  590. <div class="form-col">
  591. <div class="form-group">
  592. <label class="form-label required" for="school">所在学校</label>
  593. <input type="text" id="school1" class="form-input" required>
  594. <div class="error" id="school-error1">请输入学校名称</div>
  595. </div>
  596. </div>
  597. <div class="form-col">
  598. <div class="form-group">
  599. <label class="form-label required" for="schoolRegion">学校所在地区</label>
  600. <input type="text" id="schoolRegion1" class="form-input" required
  601. placeholder="省/市/区">
  602. <div class="error" id="schoolRegion-error1">请输入学校所在地区</div>
  603. </div>
  604. </div>
  605. </div>
  606. <div class="form-group">
  607. <label class="form-label required" for="phone">联系电话</label>
  608. <input type="tel" id="phone1" class="form-input" required pattern="[0-9]{11}">
  609. <div class="error" id="phone-error1">请输入11位手机号码</div>
  610. </div>
  611. </form>
  612. </div>
  613. <div class="button-group">
  614. <button type="button" class="btn btn-prev" id="prevToStep1">上一步</button>
  615. <button type="submit" class="btn btn-submit" onclick="submitData()">提交报名</button>
  616. </div>
  617. </div>
  618. </div>
  619. <!-- 上传报名表单 -->
  620. <div class="registration-section" id="uploadSection">
  621. <h2 class="content-header">上传报名表</h2>
  622. <div class="download-list">
  623. <div class="form-row">
  624. <div class="form-col">
  625. <div class="form-group">
  626. <label class="form-label required" for="CompetitionType">比赛类型</label>
  627. <select id="CompetitionType" class="form-input" required>
  628. <option value="">请选择</option>
  629. <option value="1">桌游设计挑战</option>
  630. <option value="2">智能体应用</option>
  631. </select>
  632. </div>
  633. </div>
  634. <div class="form-col">
  635. <div class="form-group">
  636. <label class="form-label required" for="idNumber">身份证号码</label>
  637. <input type="text" id="id_number" class="form-input" required pattern="\d{17}[\dXx]"
  638. placeholder="请填写在线报名时,团队内任一选手的身份证号码">
  639. </div>
  640. </div>
  641. </div>
  642. <div class="form-row">
  643. <div class="form-col">
  644. <div class="file-upload">
  645. <label class="form-label required" for="photo">上传文件</label>
  646. <input type="file" id="uploadFile" required>
  647. </div>
  648. </div>
  649. <div class="form-col" style="display: none;" id="videoUploadDiv">
  650. <div class="file-upload">
  651. <label class="form-label required" for="photo">上传视频</label>
  652. <input type="file" id="uploadVideo" accept="video/*" required>
  653. </div>
  654. </div>
  655. </div>
  656. <button type="submit" class="submit-btn" onclick="submitRegistration()">提交报名表</button>
  657. </div>
  658. </div>
  659. <!-- 上传报名表单 -->
  660. <div class="registration-section" id="uploadSection2">
  661. <h2 class="content-header">作品提交</h2>
  662. <div class="download-list">
  663. <div class="form-row">
  664. <div class="form-col">
  665. <div class="form-group">
  666. <label class="form-label required" for="idNumber">身份证号码</label>
  667. <input type="text" id="id_number2" class="form-input" required pattern="\d{17}[\dXx]"
  668. placeholder="请填写在线报名时,团队内任一选手的身份证号码">
  669. </div>
  670. </div>
  671. </div>
  672. <div class="form-row">
  673. <div class="form-col">
  674. <div class="file-upload">
  675. <label class="form-label required" for="photo">上传作品说明文件</label>
  676. <input type="file" id="uploadFile2" required>
  677. </div>
  678. </div>
  679. </div>
  680. <button type="submit" class="submit-btn" onclick="submitRegistration2()">提交报名表</button>
  681. </div>
  682. </div>
  683. </div>
  684. </div>
  685. <script>
  686. const requesturl = window.location.href.indexOf("localhost") > -1 ? "http://localhost:11111/" : "http://183.36.25.93:888/";
  687. console.log("requesturl:", requesturl);
  688. // 获取url参数
  689. const urlSearch = window.location.search;
  690. if (urlSearch.slice(1) == "baoan") {
  691. document.getElementById("registerBtn1").innerText = `作品提交`
  692. document.getElementsByTagName("nav")[0].innerHTML = `<div class="event-name">宝安区智能体应用赛</div>`
  693. } else if (urlSearch.slice(1) == "guangming") {
  694. document.getElementById("registerBtn1").innerText = `作品提交`
  695. document.getElementsByTagName("nav")[0].innerHTML = `<div class="event-name">光明确智能体应用赛</div>`
  696. } else if (urlSearch.slice(1) == "pingshan") {
  697. document.getElementById("registerBtn1").innerText = `作品提交`
  698. document.getElementsByTagName("nav")[0].innerHTML = `<div class="event-name">坪山区智能体应用赛</div>`
  699. } else if (urlSearch.slice(1) == "longhua") {
  700. document.getElementById("registerBtn1").innerText = `作品提交`
  701. document.getElementsByTagName("nav")[0].innerHTML = `<div class="event-name">龙华区智能体应用赛</div>`
  702. } else if (urlSearch.slice(1) == "nanshan") {
  703. document.getElementById("registerBtn1").innerText = `作品提交`
  704. document.getElementsByTagName("nav")[0].innerHTML = `<div class="event-name">南山区智能体应用赛</div>`
  705. } else {
  706. if (urlSearch != "") {
  707. window.location.search = "";
  708. }
  709. document.getElementsByTagName("nav")[0].innerHTML = `<img src="./logo2.png" alt="logo" style="width: 200px;margin-right: 15px;"></img>
  710. <img src="./logo1.png" alt="logo" style="width: 200px;margin-right: 15px;"></img>
  711. <div class="event-name">第六届广东省青少年创新思维及科技实践大赛(创新思维类选手报名)</div>`
  712. }
  713. //document.getElementById("registerBtn2").style.display = "none";
  714. if (document.getElementById("registerBtn1").innerText == "作品提交") {
  715. document.getElementById("registerBtn2").style.display = "none";
  716. document.getElementsByClassName("content-header")[2].innerText = "作品提交"
  717. document.getElementById("uploadFile").previousElementSibling.innerText = "上传作品说明文件";
  718. document.getElementById("uploadVideo").previousElementSibling.innerText = "上传作品演示视频";
  719. document.getElementsByClassName("submit-btn")[0].innerText = "提交";
  720. document.getElementsByClassName("help")[0].style.display = "none";
  721. }
  722. const nowTime = new Date();
  723. const deadline = new Date("2025-09-22");
  724. // 切换下载和报名区域
  725. document.getElementById('downloadBtn').addEventListener('click', function () {
  726. document.getElementById('downloadBtn').classList.add('active');
  727. document.getElementById('registerBtn').classList.remove('active');
  728. document.getElementById('registerBtn1').classList.remove('active');
  729. document.getElementById('downloadSection').classList.add('active');
  730. document.getElementById('registrationSection').classList.remove('active');
  731. document.getElementById('uploadSection').classList.remove('active');
  732. document.getElementsByClassName("button-Contestant")[0].classList.remove('active');
  733. });
  734. document.getElementById('registerBtn1').addEventListener('click', function () {
  735. document.getElementById('registerBtn1').classList.add('active');
  736. document.getElementById('registerBtn2').classList.remove('active');
  737. document.getElementById('downloadBtn').classList.remove('active');
  738. document.getElementById('registerBtn').classList.remove('active');
  739. document.getElementById('downloadSection').classList.remove('active');
  740. document.getElementById('registrationSection').classList.remove('active');
  741. document.getElementsByClassName("button-Contestant")[0].classList.remove('active');
  742. document.getElementById('uploadSection').classList.add('active');
  743. const uploadTime = new Date("2025-10-13");
  744. if (nowTime < uploadTime && !urlSearch.length > 0) {
  745. 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>";
  746. }
  747. });
  748. document.getElementById('registerBtn2').addEventListener('click', function () {
  749. document.getElementById('registerBtn2').classList.add('active');
  750. document.getElementById('registerBtn1').classList.remove('active');
  751. document.getElementById('downloadBtn').classList.remove('active');
  752. document.getElementById('registerBtn').classList.remove('active');
  753. document.getElementById('downloadSection').classList.remove('active');
  754. document.getElementById('registrationSection').classList.remove('active');
  755. document.getElementsByClassName("button-Contestant")[0].classList.remove('active');
  756. document.getElementById('uploadSection').remove.add('active');
  757. document.getElementById('uploadSection2').classList.add('active');
  758. });
  759. let buttonContestant = false
  760. document.getElementById('registerBtn').addEventListener('click', function () {
  761. document.getElementById('registerBtn').classList.add('active');
  762. document.getElementById('registerBtn2').classList.remove('active');
  763. document.getElementById('downloadBtn').classList.remove('active');
  764. document.getElementById('registerBtn1').classList.remove('active');
  765. document.getElementById('registrationSection').classList.add('active');
  766. document.getElementById('downloadSection').classList.remove('active');
  767. document.getElementById('uploadSection').classList.remove('active');
  768. document.getElementById('uploadSection2').classList.remove('active');
  769. console.log("selectedCompetitionId:", selectedCompetitionId);
  770. if (buttonContestant) {
  771. document.getElementsByClassName("button-Contestant")[0].classList.add('active');
  772. } else {
  773. document.getElementsByClassName("button-Contestant")[0].classList.remove('active');
  774. }
  775. });
  776. let uploadFileUrl = ''
  777. // 比赛类型选择
  778. const competitionCards = document.querySelectorAll('.competition-card');
  779. let selectedCompetitionId = null;
  780. competitionCards.forEach(card => {
  781. card.addEventListener('click', function () {
  782. // 移除所有卡片的selected类
  783. competitionCards.forEach(c => {
  784. c.classList.remove('selected');
  785. });
  786. // 添加当前卡片的selected类
  787. this.classList.add('selected');
  788. // 存储选择的比赛ID
  789. selectedCompetitionId = this.getAttribute('data-id');
  790. });
  791. });
  792. // 步骤切换
  793. document.getElementById('nextToStep2').addEventListener('click', function () {
  794. if (!selectedCompetitionId) {
  795. alert('请先选择比赛类型');
  796. return;
  797. }
  798. if (selectedCompetitionId == 2) {
  799. addContestant()
  800. }
  801. // 初始化
  802. updateGroupSelect(selectedCompetitionId);
  803. // 切换到步骤2
  804. document.getElementById('step1').classList.remove('active');
  805. document.getElementById('step2').classList.add('active');
  806. document.getElementsByClassName("button-Contestant")[0].classList.add('active');
  807. buttonContestant = true
  808. });
  809. document.getElementById('prevToStep1').addEventListener('click', function () {
  810. // 切换回步骤1
  811. document.getElementById('step2').classList.remove('active');
  812. document.getElementById('step1').classList.add('active');
  813. document.getElementsByClassName("button-Contestant")[0].classList.remove('active');
  814. buttonContestant = false
  815. const html = document.getElementById('formContainer');
  816. // 删除添加的表单
  817. addList.forEach((item, idx) => {
  818. let formDiv = html.querySelector(`div#addformContainer${item}`);
  819. if (formDiv) {
  820. html.removeChild(formDiv);
  821. }
  822. });
  823. addList = []
  824. num = 1
  825. });
  826. let num = 1;
  827. let addList = []
  828. function addContestant() {
  829. const html = document.getElementById('formContainer');
  830. if (html.children.length >= 6) {
  831. alert('最多添加3个选手');
  832. return
  833. }
  834. num = num + 1;
  835. addList.push(num)
  836. const ifFirst = addList.find(item => item === 1);
  837. let addListLength = addList.length + 1;
  838. if (ifFirst) {
  839. addListLength = addList.length
  840. }
  841. console.log("addListLength:", html.children.length);
  842. const createDiv = document.createElement('div');
  843. createDiv.id = `addformContainer${num}`;
  844. createDiv.style.position = 'relative';
  845. const h3Create = document.createElement('h3');
  846. h3Create.innerText = `选手${addListLength}:`;
  847. createDiv.appendChild(h3Create);
  848. const delButton = document.createElement('button');
  849. delButton.innerText = `删除选手${addListLength}`;
  850. delButton.className = 'menu-btn-add remove-Contestant';
  851. delButton.onclick = removeContestant;
  852. createDiv.appendChild(delButton);
  853. const brCreate = document.createElement('br');
  854. createDiv.appendChild(brCreate);
  855. const formCrate = document.createElement('form');
  856. formCrate.id = `registrationForm${num}`;
  857. if (selectedCompetitionId == 2) {
  858. formCrate.innerHTML = `<div class="form-row">
  859. <div class="form-col">
  860. <div class="form-group">
  861. <label class="form-label required" for="name">姓名</label>
  862. <input type="text" id="name${num}" class="form-input" required>
  863. <div class="error" id="name-error${num}">请输入姓名</div>
  864. </div>
  865. </div>
  866. <div class="form-col">
  867. <div class="form-group">
  868. <label class="form-label required" for="gender">性别</label>
  869. <select id="gender${num}" class="form-input" required>
  870. <option value="">请选择</option>
  871. <option value="1">男</option>
  872. <option value="2">女</option>
  873. </select>
  874. <div class="error" id="gender-error${num}">请选择性别</div>
  875. </div>
  876. </div>
  877. </div>
  878. <div class="form-row">
  879. <div class="form-col">
  880. <div class="form-group">
  881. <label class="form-label required" for="ethnicity">民族</label>
  882. <input type="text" id="ethnicity${num}" class="form-input" required>
  883. <div class="error" id="ethnicity-error${num}">请输入民族</div>
  884. </div>
  885. </div>
  886. <div class="form-col">
  887. <div class="form-group">
  888. <label class="form-label required" for="birthdate">出生年月</label>
  889. <input type="date" id="birthdate${num}" class="form-input" required>
  890. <div class="error" id="birthdate-error${num}">请选择出生年月</div>
  891. </div>
  892. </div>
  893. </div>
  894. <div class="form-row">
  895. <div class="form-col">
  896. <div class="form-group">
  897. <label class="form-label required" for="email">电子邮箱</label>
  898. <input type="email" id="email${num}" class="form-input" required>
  899. <div class="error" id="email-error${num}">请输入有效的电子邮箱</div>
  900. </div>
  901. </div>
  902. <div class="form-col">
  903. <div class="form-group">
  904. <label class="form-label required" for="idNumber">身份证号码</label>
  905. <input type="text" id="idNumber${num}" class="form-input" required pattern="\d{17}[\dXx]">
  906. <div class="error" id="idNumber-error${num}">请输入正确身份证号</div>
  907. </div>
  908. </div>
  909. </div>
  910. <div class="form-row">
  911. <div class="form-col">
  912. <div class="form-group">
  913. <label class="form-label required" for="group">组别</label>
  914. <select id="group${num}" class="form-input" required>
  915. <option value="">请选择</option>
  916. <option value="1">小学组(4-6年级)</option>
  917. <option value="2">初中组(7-9年级)</option>
  918. <option value="3">高中组(10-12年级,含中职)</option>
  919. <option value="4">高校组(含高职)</option>
  920. </select>
  921. <div class="error" id="group-error${num}">请选择组别</div>
  922. </div>
  923. </div>
  924. <div class="form-col">
  925. <div class="form-group">
  926. <label class="form-label required" for="grade">年级</label>
  927. <input type="text" id="grade${num}" class="form-input" required>
  928. <div class="error" id="grade-error${num}">请输入年级</div>
  929. </div>
  930. </div>
  931. </div>
  932. <div class="form-row">
  933. <div class="form-col">
  934. <div class="form-group">
  935. <label class="form-label required" for="school">所在学校</label>
  936. <input type="text" id="school${num}" class="form-input" required>
  937. <div class="error" id="school-error${num}">请输入学校名称</div>
  938. </div>
  939. </div>
  940. <div class="form-col">
  941. <div class="form-group">
  942. <label class="form-label required" for="schoolRegion">学校所在地区</label>
  943. <input type="text" id="schoolRegion${num}" class="form-input" required
  944. placeholder="省/市/区">
  945. <div class="error" id="schoolRegion-error${num}">请输入学校所在地区</div>
  946. </div>
  947. </div>
  948. </div>
  949. <div class="form-group">
  950. <label class="form-label required" for="phone">联系电话</label>
  951. <input type="tel" id="phone${num}" class="form-input" required pattern="[0-9]{11}">
  952. <div class="error" id="phone-error${num}">请输入11位手机号码</div>
  953. </div>`;
  954. } else {
  955. formCrate.innerHTML = `<div class="form-row">
  956. <div class="form-col">
  957. <div class="form-group">
  958. <label class="form-label required" for="name">姓名</label>
  959. <input type="text" id="name${num}" class="form-input" required>
  960. <div class="error" id="name-error${num}">请输入姓名</div>
  961. </div>
  962. </div>
  963. <div class="form-col">
  964. <div class="form-group">
  965. <label class="form-label required" for="gender">性别</label>
  966. <select id="gender${num}" class="form-input" required>
  967. <option value="">请选择</option>
  968. <option value="1">男</option>
  969. <option value="2">女</option>
  970. </select>
  971. <div class="error" id="gender-error${num}">请选择性别</div>
  972. </div>
  973. </div>
  974. </div>
  975. <div class="form-row">
  976. <div class="form-col">
  977. <div class="form-group">
  978. <label class="form-label required" for="ethnicity">民族</label>
  979. <input type="text" id="ethnicity${num}" class="form-input" required>
  980. <div class="error" id="ethnicity-error${num}">请输入民族</div>
  981. </div>
  982. </div>
  983. <div class="form-col">
  984. <div class="form-group">
  985. <label class="form-label required" for="birthdate">出生年月</label>
  986. <input type="date" id="birthdate${num}" class="form-input" required>
  987. <div class="error" id="birthdate-error${num}">请选择出生年月</div>
  988. </div>
  989. </div>
  990. </div>
  991. <div class="form-row">
  992. <div class="form-col">
  993. <div class="form-group">
  994. <label class="form-label required" for="email">电子邮箱</label>
  995. <input type="email" id="email${num}" class="form-input" required>
  996. <div class="error" id="email-error${num}">请输入有效的电子邮箱</div>
  997. </div>
  998. </div>
  999. <div class="form-col">
  1000. <div class="form-group">
  1001. <label class="form-label required" for="idNumber">身份证号码</label>
  1002. <input type="text" id="idNumber${num}" class="form-input" required pattern="\d{17}[\dXx]">
  1003. <div class="error" id="idNumber-error${num}">请输入正确身份证号</div>
  1004. </div>
  1005. </div>
  1006. </div>
  1007. <div class="form-row">
  1008. <div class="form-col">
  1009. <div class="form-group">
  1010. <label class="form-label required" for="group">组别</label>
  1011. <select id="group${num}" class="form-input" required>
  1012. <option value="">请选择</option>
  1013. <option value="1">小学低龄</option>
  1014. <option value="2">小学高龄</option>
  1015. <option value="3">中学</option>
  1016. <option value="4">高校</option>
  1017. </select>
  1018. <div class="error" id="group-error${num}">请选择组别</div>
  1019. </div>
  1020. </div>
  1021. <div class="form-col">
  1022. <div class="form-group">
  1023. <label class="form-label required" for="grade">年级</label>
  1024. <input type="text" id="grade${num}" class="form-input" required>
  1025. <div class="error" id="grade-error${num}">请输入年级</div>
  1026. </div>
  1027. </div>
  1028. </div>
  1029. <div class="form-row">
  1030. <div class="form-col">
  1031. <div class="form-group">
  1032. <label class="form-label required" for="school">所在学校</label>
  1033. <input type="text" id="school${num}" class="form-input" required>
  1034. <div class="error" id="school-error${num}">请输入学校名称</div>
  1035. </div>
  1036. </div>
  1037. <div class="form-col">
  1038. <div class="form-group">
  1039. <label class="form-label required" for="schoolRegion">学校所在地区</label>
  1040. <input type="text" id="schoolRegion${num}" class="form-input" required
  1041. placeholder="省/市/区">
  1042. <div class="error" id="schoolRegion-error${num}">请输入学校所在地区</div>
  1043. </div>
  1044. </div>
  1045. </div>
  1046. <div class="form-group">
  1047. <label class="form-label required" for="phone">联系电话</label>
  1048. <input type="tel" id="phone${num}" class="form-input" required pattern="[0-9]{11}">
  1049. <div class="error" id="phone-error${num}">请输入11位手机号码</div>
  1050. </div>`;
  1051. }
  1052. createDiv.appendChild(formCrate);
  1053. html.appendChild(createDiv);
  1054. }
  1055. function removeContestant(e) {
  1056. const parentElement = Number(e.target.parentElement.id && e.target.parentElement.id.slice(16));
  1057. const html = document.getElementById('formContainer');
  1058. if (selectedCompetitionId == 2) {
  1059. if (html.children.length <= 5) {
  1060. alert('至少保留两个选手');
  1061. return
  1062. }
  1063. }
  1064. addList = addList.filter(item => item !== parentElement);
  1065. let selectForm = html.querySelector(`div#addformContainer${parentElement}`);
  1066. if (selectForm) html.removeChild(selectForm);
  1067. // 依次递增更新剩余选手的序号
  1068. addList.forEach((item, idx) => {
  1069. let formDiv = html.querySelector(`div#addformContainer${item}`);
  1070. if (formDiv) {
  1071. formDiv.querySelector('h3').innerText = `选手${idx + 2}:`;
  1072. formDiv.querySelector('button').innerText = `删除选手${idx + 2}`;
  1073. }
  1074. });
  1075. // num = num - 1;
  1076. }
  1077. async function submitData() {
  1078. const requiredFields = ['name', 'gender', 'ethnicity', 'birthdate', 'email',
  1079. 'idNumber', 'group', 'grade', 'school', 'schoolRegion', 'phone',];
  1080. let formData = [];
  1081. let idNumber = '';
  1082. let idError = '';
  1083. let phone = '';
  1084. let phoneError = '';
  1085. let i = 0
  1086. let isFirst = addList.find(item => item === 1);
  1087. if (!isFirst) addList.unshift(1);
  1088. const teacher = document.getElementById('teacher').value;
  1089. if (!teacher) {
  1090. alert('请填写指导老师');
  1091. return;
  1092. }
  1093. const teacherPhone = document.getElementById('teacherPhone').value;
  1094. if (!/^[0-9]{11}$/.test(teacherPhone)) {
  1095. alert('请正确填写指导老师手机号');
  1096. return;
  1097. }
  1098. let phoneSet = new Set();
  1099. for (let j = 0; j <= addList.length - 1; j++) {
  1100. let element = null;
  1101. let errorElement = null;
  1102. let isValid = true;
  1103. i = addList[j]
  1104. requiredFields.forEach(field => {
  1105. element = document.getElementById(field + i);
  1106. errorElement = document.getElementById(`${field}-error` + i);
  1107. if (!element.value) {
  1108. errorElement.style.display = 'block';
  1109. isValid = false;
  1110. } else {
  1111. errorElement.style.display = 'none';
  1112. }
  1113. });
  1114. // 验证身份证格式
  1115. idNumber = document.getElementById('idNumber' + i);
  1116. idError = document.getElementById('idNumber-error' + i);
  1117. if (idNumber.value.length > 5) {
  1118. idError.style.display = 'none';
  1119. } else {
  1120. idError.style.display = 'block';
  1121. isValid = false;
  1122. }
  1123. // 验证手机号格式
  1124. phone = document.getElementById('phone' + i);
  1125. phoneError = document.getElementById('phone-error' + i);
  1126. if (!/^[0-9]{11}$/.test(phone.value)) {
  1127. phoneError.style.display = 'block';
  1128. isValid = false;
  1129. } else {
  1130. phoneError.style.display = 'none';
  1131. }
  1132. if (!isValid) {
  1133. alert(`选手${j + 1}填写信息有误,请重新填写`);
  1134. return;
  1135. };
  1136. formData.push({
  1137. name: document.getElementById('name' + i).value,
  1138. gender: document.getElementById('gender' + i).value,
  1139. ethnicity: document.getElementById('ethnicity' + i).value,
  1140. birthdate: document.getElementById('birthdate' + i).value,
  1141. email: document.getElementById('email' + i).value,
  1142. id_number: document.getElementById('idNumber' + i).value,
  1143. group: document.getElementById('group' + i).value,
  1144. grade: document.getElementById('grade' + i).value,
  1145. school: document.getElementById('school' + i).value,
  1146. schoolRegion: document.getElementById('schoolRegion' + i).value,
  1147. phone: document.getElementById('phone' + i).value,
  1148. })
  1149. }
  1150. try {
  1151. // 收集表单数据
  1152. const formDataObj = {
  1153. type: selectedCompetitionId, // 报名类型,1桌游,2智能体
  1154. uploadUrl: teacher + teacherPhone, // 上传文件的URL
  1155. idCard: formData.map(item => item.id_number).join(","), // 选手身份证号拼接
  1156. registrationFormUrl: "", // 报名表上传URL
  1157. user: JSON.stringify(formData),
  1158. area: urlSearch.slice(1), // 区
  1159. };
  1160. let aa = selectedCompetitionId == 2 ? "智能体应用类比赛,手机号作为登录账号,请确认手机号填写正确且不能重复" : "桌游设计挑战类比赛"
  1161. if (!confirm(`您参加的是${aa},提交之后无法再修改信息,是否确认提交?`)) {
  1162. return;
  1163. }
  1164. // 发送报名信息请求
  1165. const registerResponse = await fetch(requesturl + 'api/user', {
  1166. method: 'POST',
  1167. headers: {
  1168. 'Content-Type': 'application/json'
  1169. },
  1170. body: JSON.stringify(formDataObj)
  1171. });
  1172. if (!registerResponse.ok) {
  1173. throw new Error('报名提交失败');
  1174. }
  1175. const registerData = await registerResponse.json();
  1176. console.log(registerData);
  1177. if (registerData.status == "ok") {
  1178. alert("报名完成,审核情况会通过邮箱通知,请注意邮箱信息");
  1179. } else {
  1180. alert(registerData.message);
  1181. }
  1182. // document.getElementById('registrationForm').reset();
  1183. } catch (error) {
  1184. console.error('提交错误:', error);
  1185. alert(`报名失败: ${error.message}`);
  1186. }
  1187. }
  1188. async function submitRegistration() {
  1189. var area = urlSearch.slice(1)
  1190. if (area.indexOf("longhua") > -1 || area.indexOf("guangming") > -1) { alert("报名时间已截止"); return }
  1191. const idNumber = document.getElementById('id_number');
  1192. const CompetitionType = document.getElementById('CompetitionType');
  1193. if (!idNumber.value && !CompetitionType.value) {
  1194. alert('请选择比赛类型和填写身份证号');
  1195. //e.target.value = ''; // 清空已选择的文件
  1196. return;
  1197. }
  1198. if (uploadFileUrl1 == "") {
  1199. alert('请上传报名文件');
  1200. return;
  1201. }
  1202. if (CompetitionType.value == 2 && document.getElementById("videoUploadDiv").style.display == "block") {
  1203. if (uploadVideoUrl == "") {
  1204. alert('请上传智能体视频');
  1205. return;
  1206. }
  1207. }
  1208. if (!confirm('如已上传过文件,本次上传会覆盖之前上传,是否确定提交吗?')) {
  1209. return;
  1210. }
  1211. try {
  1212. const response = await fetch(requesturl + "api/update", {
  1213. method: "POST",
  1214. headers: {
  1215. "Content-Type": "application/json"
  1216. },
  1217. body: JSON.stringify({
  1218. url: uploadFileUrl1,
  1219. id_number: idNumber.value,
  1220. type: CompetitionType.value,
  1221. area: urlSearch.slice(1)
  1222. })
  1223. })
  1224. if (!response.ok) {
  1225. throw new Error('信息更新失败');
  1226. }
  1227. const registerData = await response.json();
  1228. console.log(registerData);
  1229. alert(registerData.message);
  1230. } catch (error) {
  1231. console.error('信息更新失败:', error);
  1232. alert(error.message);
  1233. }
  1234. }
  1235. async function submitRegistration2() {
  1236. const idNumber = document.getElementById('id_number');
  1237. const uploadFile2 = document.getElementById('uploadFile2');
  1238. if (!idNumber.value) {
  1239. alert('请选择比赛类型和填写身份证号');
  1240. return;
  1241. }
  1242. if (uploadFile2 == "") {
  1243. alert('请上传报名文件');
  1244. return;
  1245. }
  1246. if (!confirm('如已上传过文件,本次上传会覆盖之前上传,是否确定提交吗?')) {
  1247. return;
  1248. }
  1249. try {
  1250. const response = await fetch(requesturl + "api/update", {
  1251. method: "POST",
  1252. headers: {
  1253. "Content-Type": "application/json"
  1254. },
  1255. body: JSON.stringify({
  1256. url: uploadFile2,
  1257. id_number: idNumber.value,
  1258. type: 2,
  1259. area: ""
  1260. })
  1261. })
  1262. if (!response.ok) {
  1263. throw new Error('信息更新失败');
  1264. }
  1265. const registerData = await response.json();
  1266. console.log(registerData);
  1267. alert(registerData.message);
  1268. } catch (error) {
  1269. console.error('信息更新失败:', error);
  1270. alert(error.message);
  1271. }
  1272. }
  1273. async function help() {
  1274. const img1 = `<img class="help-qrCode" src="https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/0960e9b6-2687-b858-2285-455c29eac369/code2.png" />`
  1275. const img2 = `<div><span>创新思维赛 桌游设计挑战类 答疑群</span><br /><img class="help-qrCode" src="./2.png" /></div>`
  1276. showModal(img1 + img2)
  1277. }
  1278. async function openVideo() {
  1279. // 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>`
  1280. showModal("宣讲视频暂无...")
  1281. }
  1282. let uploadFileUrl1 = "";
  1283. let uploadVideoUrl = "";
  1284. document.getElementById('uploadFile').addEventListener('change', async function (e) {
  1285. const idNumber = document.getElementById('id_number');
  1286. if (!idNumber.value) {
  1287. alert('请先填写身份证号');
  1288. e.target.value = ''; // 清空已选择的文件
  1289. return;
  1290. }
  1291. const file = e.target.files[0];
  1292. if (!file) return;
  1293. const fileName = `${idNumber.value}/${file.name}`;
  1294. uploadFileUrl1 = await uplod(fileName, file);
  1295. console.log('选择文件:', uploadFileUrl1);
  1296. });
  1297. document.getElementById('uploadVideo').addEventListener('change', async function (e) {
  1298. const idNumber = document.getElementById('id_number');
  1299. if (!idNumber.value) {
  1300. alert('请先填写身份证号');
  1301. e.target.value = ''; // 清空已选择的文件
  1302. return;
  1303. }
  1304. const file = e.target.files[0];
  1305. if (!file) return;
  1306. const fileName = `${idNumber}/${file.name}`;
  1307. uploadVideoUrl = await uplod(fileName, file);
  1308. console.log('视频文件:', uploadVideoUrl);
  1309. })
  1310. async function uplod(fileName, file) {
  1311. var bucket = new window.AWS.S3({ params: { Bucket: 'ccrb' } });
  1312. var params = {
  1313. Key: fileName,
  1314. ContentType: file.type,
  1315. Body: file,
  1316. 'Access-Control-Allow-Credentials': '*',
  1317. 'ACL': 'public-read'
  1318. };
  1319. try {
  1320. const data = await bucket.upload(params).promise();
  1321. console.log('上传成功:', data);
  1322. alert('文件上传成功');
  1323. return data.Location;
  1324. } catch (err) {
  1325. console.error('上传失败:', err);
  1326. alert('文件上传失败');
  1327. return '';
  1328. }
  1329. }
  1330. function styleHide() {
  1331. selectedCompetitionId = 2
  1332. document.getElementById('registerBtn').click();
  1333. document.getElementById('downloadBtn').style.display = 'none';
  1334. // document.getElementById('registerBtn1').style.display = 'none';
  1335. document.getElementById('prevToStep1').style.display = 'none';
  1336. addContestant()
  1337. updateGroupSelect(selectedCompetitionId);
  1338. // 切换到步骤2
  1339. document.getElementById('step1').classList.remove('active');
  1340. document.getElementById('step2').classList.add('active');
  1341. document.getElementsByClassName("button-Contestant")[0].classList.add('active');
  1342. document.getElementsByClassName("button-group")[1].style.textAlign = "center";
  1343. document.getElementsByClassName("button-group")[1].style.display = "block";
  1344. document.getElementsByClassName("step-title")[1].style.display = "none";
  1345. document.getElementById("videoUploadDiv").style.display = "block";
  1346. buttonContestant = true
  1347. }
  1348. window.onload = function () {
  1349. // updateGroupSelect("1")
  1350. if (urlSearch.slice(1) == "baoan") {
  1351. styleHide()
  1352. } else if (urlSearch.slice(1) == "guangming") {
  1353. styleHide()
  1354. } else if (urlSearch.slice(1) == "pingshan") {
  1355. styleHide()
  1356. } else if (urlSearch.slice(1) == "longhua") {
  1357. styleHide()
  1358. } else if (urlSearch.slice(1) == "nanshan") {
  1359. styleHide()
  1360. }
  1361. }
  1362. </script>
  1363. <!-- Modal -->
  1364. <div id="modal"
  1365. 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;">
  1366. <div
  1367. style="background:#fff;padding:30px 20px;border-radius:10px;width:800px;box-shadow:0 4px 24px rgba(0,0,0,0.2);position:relative;">
  1368. <span id="modalClose" style="position:absolute;top:10px;right:15px;font-size:22px;cursor:pointer;">×</span>
  1369. <div id="modalContent" style="text-align: center;"></div>
  1370. </div>
  1371. </div>
  1372. <script>
  1373. // 显示modal
  1374. function showModal(content) {
  1375. document.getElementById('modalContent').innerHTML = content;
  1376. document.getElementById('modal').style.display = 'flex';
  1377. }
  1378. // 关闭modal
  1379. document.getElementById('modalClose').onclick = function () {
  1380. document.getElementById('modal').style.display = 'none';
  1381. };
  1382. // 点击遮罩关闭
  1383. document.getElementById('modal').onclick = function (e) {
  1384. if (e.target === this) this.style.display = 'none';
  1385. };
  1386. // 示例:点击左下角问号弹出帮助
  1387. // document.querySelector('.help').onclick = function() {
  1388. // showModal('如有疑问请联系组委会邮箱:ccrb@cocorobo.cn<br>或电话:020-8251-0085');
  1389. // };
  1390. </script>
  1391. </body>
  1392. <script>
  1393. // 根据比赛类型显示对应组别
  1394. function updateGroupSelect(type) {
  1395. const groupContainers = document.getElementById('group-containers')
  1396. console.log(groupContainers)
  1397. if (type == "1") {
  1398. groupContainers.innerHTML = `<div class="form-group" id="group-container1">
  1399. <label class="form-label required" for="group">组别</label>
  1400. <select id="group1" class="form-input" required>
  1401. <option value="">请选择</option>
  1402. <option value="1">小学低龄</option>
  1403. <option value="2">小学高龄</option>
  1404. <option value="3">中学</option>
  1405. <option value="4">高校</option>
  1406. </select>
  1407. <div class="error" id="group-error1">请选择组别</div>
  1408. </div>`
  1409. } else {
  1410. groupContainers.innerHTML = `
  1411. <div class="form-group" id="group-container2" >
  1412. <label class="form-label required" for="group">组别</label>
  1413. <select id="group1" class="form-input" required>
  1414. <option value="">请选择</option>
  1415. <option value="1">小学组(4-6年级)</option>
  1416. <option value="2">初中组(7-9年级)</option>
  1417. <option value="3">高中组(10-12年级,含中职)</option>
  1418. <option value="4">高校组(含高职)</option>
  1419. </select>
  1420. <div class="error" id="group-error1">请选择组别</div>
  1421. </div>`
  1422. }
  1423. }
  1424. </script>
  1425. <script>
  1426. </script>
  1427. </html>