index.html 62 KB

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