报名地址

index.html 9.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport"
  6. content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  7. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  8. <title>共叙北斗情</title>
  9. <style>
  10. *{
  11. padding: 0;
  12. margin: 0;
  13. }
  14. body{
  15. background: #F4E5D3;
  16. }
  17. .item{
  18. margin-bottom: 14px;
  19. width: 100%;
  20. }
  21. .text{
  22. font-size: 15px;
  23. color: #000;
  24. margin-bottom: 14px;
  25. display: flex;
  26. align-items: center;
  27. margin-left: 4px;
  28. }
  29. .star{
  30. color: red;
  31. font-size: 12px;
  32. margin-right: 4px;
  33. }
  34. .ipt{
  35. display: flex;
  36. width: 100%;
  37. height: 50px;
  38. background: #FFFFFF;
  39. border-radius: 6px;
  40. }
  41. .dateIpt{
  42. box-sizing: border-box;
  43. width: 100%;
  44. height: 50px;
  45. font-size: 16px;
  46. border: none!important;
  47. padding: 14px 16px;
  48. background: #fff;
  49. }
  50. input::-webkit-input-placeholder{
  51. color:#999;
  52. font-size: 16px;
  53. }
  54. input[type=text]:focus{ outline: none!important;}
  55. input[type=number]:focus{ outline: none!important;}
  56. #submitBox{
  57. margin-top: 13px;
  58. padding: 10px;
  59. }
  60. #submitBtn{
  61. text-align: center;
  62. margin: 0 auto;
  63. width: 255px;
  64. height: 54px;
  65. line-height: 54px;
  66. background: #C13E2A;
  67. border-radius: 6px;
  68. color: #fff;
  69. font-size: 18px;
  70. }
  71. #maskBox {
  72. position: absolute;
  73. top: 0;
  74. left: 0;
  75. right: 0;
  76. bottom: 0;
  77. width: 100%;
  78. height: 100%;
  79. background-color: rgba(0,0,0,.3);
  80. text-align: center;
  81. font-size: 14px;
  82. color: #fff;
  83. padding-top: 60%;
  84. display: none;
  85. }
  86. #tips{
  87. color: red;
  88. font-size: 12px;
  89. text-align: center;
  90. display: none;
  91. margin-bottom: 4px;
  92. }
  93. .imgCon{
  94. height: 280px;
  95. }
  96. #echoBox{
  97. color: #000;
  98. font-size: 16px;
  99. padding: 30px 0;
  100. display: none;
  101. }
  102. .flex{
  103. display: flex;
  104. align-items: center;
  105. justify-content: center;
  106. }
  107. .infoImg{
  108. width: 34px;
  109. height: 34px;
  110. border-radius: 50%;
  111. margin-right: 6px;
  112. }
  113. #tipsText{
  114. font-weight: 600;
  115. }
  116. </style>
  117. </head>
  118. <body>
  119. <div id="maskBox">加载中...</div>
  120. <div class="pageCon ">
  121. <div class="imgCon"><img src="https://lh-yhq.oss-cn-beijing.aliyuncs.com/image/bcg.png" alt="" style="width: 100%;height: 100%"></div>
  122. <!-- 提交后的提示框 -->
  123. <div id="echoBox">
  124. <div class="flex">
  125. <img class="infoImg" src="./info.png" alt="">
  126. <div id="tipsText">提交成功!</div>
  127. </div>
  128. </div>
  129. <!-- form框 -->
  130. <div id="submitBox">
  131. <div class="item">
  132. <div class="text"><span class="star">*</span>姓名</div>
  133. <div class="ipt">
  134. <input class="dateIpt" type="text" name="firstName" id="firstName" placeholder="请输入姓名">
  135. </div>
  136. </div>
  137. <div class="item">
  138. <div class="text"><span class="star">*</span>手机号</div>
  139. <div class="ipt">
  140. <input class="dateIpt" type="number" name="phone" id="phone" placeholder="请输入手机号">
  141. </div>
  142. </div>
  143. <div class="item">
  144. <div class="text"><span class="star">*</span>抵京时间</div>
  145. <div class="ipt">
  146. <input readonly class="dateIpt" type="text" id="startTime" name="startTime" placeholder="请选择"/>
  147. </div>
  148. </div>
  149. <div class="item">
  150. <div class="text">抵京航班/高铁班次</div>
  151. <div class="ipt">
  152. <input class="dateIpt" type="text" id="enterShift" name="enterShift" placeholder="请输入航班号 例:航班CA1230/高铁G12">
  153. </div>
  154. </div>
  155. <div class="item">
  156. <div class="text"><span class="star">*</span>离京时间</div>
  157. <div class="ipt">
  158. <input readonly class="dateIpt" type="text" id="endTime" name="endTime" placeholder="请选择"/>
  159. </div>
  160. </div>
  161. <div class="item">
  162. <div class="text">离京航班/高铁班次</div>
  163. <div class="ipt">
  164. <input class="dateIpt" type="text" id="leaveShift" name="leaveShift" placeholder="请输入航班号 例: 航班CA1230/高铁G12">
  165. </div>
  166. </div>
  167. <div class="item">
  168. <div class="text">服装尺寸</div>
  169. <div class="ipt">
  170. <input class="dateIpt" type="text" id="garmentSize" name="garmentSize" placeholder="请输入服装尺寸 例:女S/男XXL">
  171. </div>
  172. </div>
  173. <div style="margin: 58px 0">
  174. <div id="tips">* 姓名、手机号、进、离京时间为必填项哟!</div>
  175. <div id="submitBtn">提交</div>
  176. </div>
  177. </div>
  178. </div>
  179. </body>
  180. <script type="text/javascript" src="./jquery.js"></script>
  181. <script type="text/javascript" src="./rolldate.js"></script>
  182. <script type="text/javascript" src="./md5.js"></script>
  183. <script type="text/javascript">
  184. // 日期插件
  185. window.onload = function () {
  186. new Rolldate({
  187. el: '#startTime',
  188. format: 'YYYY-MM-DD hh:mm',
  189. beginYear: 2023,
  190. endYear: 2023,
  191. theme: "#F4E5D3",
  192. })
  193. new Rolldate({
  194. el: '#endTime',
  195. format: 'YYYY-MM-DD hh:mm',
  196. beginYear: 2023,
  197. endYear: 2023,
  198. theme: "#F4E5D3",
  199. })
  200. }
  201. </script>
  202. <script type="text/javascript">
  203. $(document).ready(function(){
  204. var startTime = $("#startTime");
  205. var enterShift = $("#enterShift");
  206. var endTime = $("#endTime");
  207. var leaveShift = $("#leaveShift");
  208. var firstName = $("#firstName");
  209. var phone = $("#phone");
  210. var garmentSize = $("#garmentSize");
  211. //使用js代码实现类似php的ksort方法 ---- 按键排序
  212. function ksort(o) {
  213. var sorted = {},
  214. keys = Object.keys(o);
  215. keys.sort();
  216. keys.forEach((key) => {
  217. sorted[key] = o[key];
  218. })
  219. return sorted;
  220. }
  221. //点击事件
  222. $("#submitBtn").click(function(){
  223. //为空提示
  224. if(!firstName.val() || !phone.val() || !startTime.val() || !endTime.val()){
  225. $("#tips").show()
  226. return
  227. }
  228. // 提示隐藏
  229. $("#tips").hide()
  230. //遮罩显示
  231. $("#maskBox").show()
  232. //验签
  233. var dataParams = {
  234. name:firstName.val(),
  235. phone:phone.val(),
  236. arrive_at:startTime.val()+':00',
  237. leave_at:endTime.val()+':00',
  238. arrive_flight:enterShift.val(),
  239. leave_flight:leaveShift.val(),
  240. cloth_size:garmentSize.val(),
  241. }
  242. var ksort_data = ksort(dataParams);
  243. var str = '';
  244. for (let i in ksort_data) {
  245. let str_data = Array.isArray(ksort_data[i]) ? JSON.stringify(ksort_data[i]) : (ksort_data[i] || ksort_data[i] == 0 ? ksort_data[i] : '')
  246. str = str + i + '=' + str_data;
  247. }
  248. //验签结束
  249. $.ajax({
  250. url: 'https://kx.wenxingshuju.com/api/kx/signRecords',
  251. type: 'post', // 请求方式
  252. async: true,
  253. data: Object.assign({ sign: md5(md5(str) + 'ur904wtr5pfctaw5') }, ksort_data),
  254. contentType: 'application/x-www-form-urlencoded',
  255. dataType: 'json',
  256. success: function (res) {
  257. //遮罩隐藏
  258. $("#maskBox").hide()
  259. $("#submitBox").hide()
  260. $("#echoBox").show()
  261. $("#tipsText").text(res.msg);
  262. },
  263. error: function(err) {
  264. //遮罩隐藏
  265. $("#maskBox").hide()
  266. $("#submitBox").hide()
  267. $("#echoBox").show()
  268. $("#tipsText").text(err);
  269. }
  270. })
  271. });
  272. })
  273. </script>
  274. </html>