index.html 62 KB

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