index.html 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <!DOCTYPE html>
  2. <html lang="zh-cn">
  3. <head>
  4. {include file="public/meta_header"/}
  5. <style>
  6. :root {
  7. --el-color-primary: #dd4250;
  8. }
  9. .el-tabs__item {
  10. font-size: 18px;
  11. }
  12. .el-form-item {
  13. padding-top: 15px;
  14. }
  15. .el-input__inner, .el-form-item__label {
  16. height: 40px;
  17. line-height: 40px;
  18. }
  19. .el-form-item__label {
  20. font-size: 16px;
  21. }
  22. .login-box {
  23. width: 472px;
  24. margin: 0 auto;
  25. padding-bottom: 150px;
  26. padding-top: 90px;
  27. }
  28. .login-box .login-logo {
  29. margin-bottom: 35px;
  30. margin-left: 50px;
  31. }
  32. .login-box .login-logo a {
  33. display: inline-block;
  34. vertical-align: middle;
  35. }
  36. .login-box .login-logo img {
  37. width: 40px;
  38. }
  39. .login-box .login-logo .backhome {
  40. background: url("/static/home/images/bg_back.png") no-repeat center;
  41. padding: 5px 15px;
  42. font-size: 13px;
  43. color: #616887;
  44. margin-top: 10px;
  45. }
  46. .login-box .login-box-per-body {
  47. background-color: #fff;
  48. width: 472px;
  49. border-radius: 5px;
  50. -moz-box-shadow: 2px 2px 10px 0 rgba(0, 0, 0, 0.1);
  51. -webkit-box-shadow: 2px 2px 10px 0 rgba(0, 0, 0, 0.1);
  52. box-shadow: 2px 2px 10px 0 rgba(0, 0, 0, 0.1);
  53. }
  54. .form-box {
  55. width: 332px;
  56. margin: 0 auto;
  57. padding: 30px 0;
  58. }
  59. .login-box .txt-group {
  60. font-size: 12px;
  61. width: 332px;
  62. margin-bottom: 30px;
  63. height: 16px;
  64. }
  65. .login-box .txt-group .txt-r {
  66. float: right;
  67. color: #9ea1b1;
  68. text-decoration: none;
  69. }
  70. .login-box .btn-group {
  71. width: 332px;
  72. height: 50px;
  73. background-color: #dd4250;
  74. border-radius: 25px;
  75. text-align: center;
  76. line-height: 42px;
  77. color: #ffffff;
  78. margin-bottom: 20px;
  79. cursor: pointer;
  80. border: none;
  81. font-size: 20px;
  82. letter-spacing: 10px;
  83. }
  84. .login-box .reg-link-box {
  85. width: 332px;
  86. color: #9ea1b1;
  87. font-size: 14px;
  88. margin-bottom: 15px;
  89. line-height: 26px;
  90. height: 26px;
  91. text-align: right;
  92. }
  93. .login-box .reg-link-box .reg-txt {
  94. display: inline-block;
  95. color: #fe2e5f;
  96. text-decoration: none;
  97. }
  98. .bind_code {
  99. position: relative;
  100. }
  101. .bind_code .el-button {
  102. border: 0;
  103. background: none;
  104. padding: 0;
  105. border-radius: 0;
  106. }
  107. .bind_code .bind_code_gain {
  108. position: absolute;
  109. right: 10px;
  110. font-size: 14px;
  111. color: #dd4250;
  112. cursor: pointer;
  113. padding-left: 10px;
  114. border-left: 1px solid #d8d8d8;
  115. height: 40px;
  116. line-height: 40px;
  117. }
  118. </style>
  119. </head>
  120. <body>
  121. <div id="app">
  122. <div class="login-box">
  123. <div class="login-logo">
  124. <a href="{:url('/')}"><img src="/static/home/images/img_logo.png" alt="logo"></a>
  125. <a href="{:url('/')}" class="backhome">返回首页</a>
  126. </div>
  127. <div class="login-box-per-body">
  128. <div class="form-box">
  129. <el-form :model="form" label-width="auto" style="max-width: 600px">
  130. <el-form-item label="手机号">
  131. <el-input v-model="form.mobile" placeholder="请输入手机号"></el-input>
  132. </el-form-item>
  133. <el-form-item label="验证码">
  134. <div class="bind_code margin_top">
  135. <el-input
  136. class="bind_code_input code"
  137. v-model="form.verify"
  138. type="text"
  139. placeholder="请输入验证码"
  140. ></el-input>
  141. <el-button
  142. @click="bindSendCode"
  143. class="bind_code_gain"
  144. :disabled="disabled"
  145. >{{ btnText }}
  146. </el-button>
  147. </div>
  148. </el-form-item>
  149. <el-form-item label="密码" prop="password">
  150. <el-input v-model="form.password" type="password" autocomplete="off"
  151. placeholder="请输入密码"></el-input>
  152. </el-form-item>
  153. <el-form-item label="确认密码" prop="re_password">
  154. <el-input v-model="form.re_password" type="password" autocomplete="off"
  155. placeholder="请确认密码"></el-input>
  156. </el-form-item>
  157. <input style="margin-top:20px;" class="btn-group login-account" @click="doRegister" type="button" value="注册">
  158. <div class="reg-link-box">
  159. 已有账号?<a class="reg-txt register_user" href="{:url('login/index')}">立刻登录</a>
  160. </div>
  161. </el-form>
  162. </div>
  163. </div>
  164. </div>
  165. <div class="index_footer">
  166. <div class="index_footer_links">
  167. <a target="_blank" href="http://hxks.hxrc-app.com">网站首页</a>
  168. <a target="_blank" href="http://hxks.hxrc-app.com/content/explain/show/9">单位介绍</a>
  169. <a target="_blank" href="http://hxks.hxrc-app.com/content/suggest/index">意见建议</a>
  170. </div>
  171. <div class="index_footertxt">
  172. <p>招考服务热线:0595-82008296</p>
  173. <p>地址:福建省泉州市晋江市梅岭街道碧山社区梅岭路273号</p>
  174. <p>网站备案:<a href="https://beian.miit.gov.cn/" target="_blank">闽ICP备17033895号</a></p>
  175. </div>
  176. </div>
  177. </div>
  178. <script>
  179. function v_setup() {
  180. let base = {};
  181. base.form = Vue.reactive({mobile: '', verify: '', password: '', re_password: ''});
  182. base.btnText = Vue.ref('获取验证码');
  183. base.disabled = Vue.ref(false);
  184. base.bindSendCode = () => {
  185. //手机号 为空的话
  186. if (base.form.mobile != '') {
  187. postJson('/register/sendSms',base.form).then(() => {
  188. ElMessage.success('已发送验证码,请查收')
  189. base.disabled.value = true;
  190. base.btnText.value = "请稍候...";
  191. setTimeout(() => {
  192. base.doLoop(60);
  193. }, 500);
  194. });
  195. } else {
  196. ElMessage.error('请输入手机号')
  197. }
  198. }
  199. base.doLoop = function (seconds) {
  200. seconds = seconds ? seconds : 60;
  201. base.btnText.value = seconds + "s后获取";
  202. let countdown = setInterval(() => {
  203. if (seconds > 0) {
  204. base.btnText.value = seconds + "s后获取";
  205. --seconds;
  206. } else {
  207. base.btnText.value = "获取验证码";
  208. base.disabled.value = false;
  209. clearInterval(countdown);
  210. }
  211. }, 1000);
  212. }
  213. base.doRegister = () => {
  214. if (base.form.mobile === '') {
  215. ElMessage.error('请输入手机号');
  216. return false;
  217. }
  218. if (base.form.verify === '') {
  219. ElMessage.error('请输入验证码');
  220. return false;
  221. }
  222. if (base.form.password === '') {
  223. ElMessage.error('请输入密码');
  224. return false;
  225. }
  226. if (base.form.password !== base.form.re_password) {
  227. ElMessage.error('两次密码不一致');
  228. return false;
  229. }
  230. postJson('/register/doRegister',base.form).then(({data}) => {
  231. location.href = "{:url('login/index')}";
  232. });
  233. }
  234. return base;
  235. }
  236. </script>
  237. <script>
  238. const vue3 = {
  239. setup() {
  240. return v_setup();
  241. }
  242. };
  243. const app = Vue.createApp(vue3);
  244. for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  245. app.component(key, component);
  246. }
  247. app.use(ElementPlus);
  248. const ElMessageBox = ElementPlus.ElMessageBox;
  249. const ElMessage = ElementPlus.ElMessage;
  250. </script>
  251. {block name="vue"}{/block}
  252. <script>
  253. app.mount('#app');
  254. </script>
  255. </body>
  256. </html>