iphoneLogin.zml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <html lang="en">
  2. <head>
  3. <meta charset="UTF-8">
  4. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>【HTML+CSS】实现移动端高级简约的登录注册界面</title>
  7. </head>
  8. ${Scripts.src(zhiqim_uploadlarge.js)}
  9. <style>
  10. * {
  11. margin: 0;
  12. padding: 0;
  13. }
  14. /* 去除a标签的下划线 */
  15. a {
  16. text-decoration: none;
  17. }
  18. /* 去除li标签的序列符号(小黑点) */
  19. li {
  20. list-style: none;
  21. }
  22. body {
  23. background-image: linear-gradient(to right, #3e9597, #214c52);
  24. }
  25. .box {
  26. /* 分布式布局 */
  27. display: flex;
  28. justify-self: center;
  29. }
  30. /* 登录、注册外div公用样式 */
  31. .login,
  32. .register {
  33. width: 20rem;
  34. height: 30.5rem;
  35. background-color: white;
  36. border-radius: 0.5rem;
  37. margin: 1.25rem;
  38. }
  39. /* 登录、注册顶部div共同样式 */
  40. .login_top,.register_top{
  41. width: 20rem;
  42. height: 12rem;
  43. color: white;
  44. border-radius: 0.5rem 0.5rem 0 0;
  45. text-align: center;
  46. }
  47. .login_top{
  48. background: #214c52;
  49. }
  50. .register_top{
  51. background: #3e9597;
  52. }
  53. .login_top img {
  54. width: 5.5rem;
  55. height: 5.5rem;
  56. margin-top: 2rem;
  57. }
  58. .register_top {
  59. padding-top: 2.5rem;
  60. /* 添加内间距防止div扩充 */
  61. box-sizing:border-box;
  62. }
  63. .register_top div{
  64. width: 5.5rem;
  65. height: 5.5rem;
  66. background: white;
  67. border-radius: 10rem;
  68. color: silver;
  69. font-size: 4rem;
  70. margin: 0 auto;
  71. text-align: center;
  72. line-height: 5.5rem;
  73. }
  74. .login_bottom,.register_bottom{
  75. text-align: center;
  76. }
  77. /* 登录、注册表单共同样式 */
  78. .login_bottom .input{
  79. width: 17.5rem;
  80. height: 2.5rem;
  81. margin-top: 2rem;
  82. padding-left: 0.6rem;
  83. border-radius: 0.6rem;
  84. border: 0.1rem solid silver;
  85. /* 去除表单点击后出现的边框 */
  86. outline: none;
  87. color: reb(107,107,107);
  88. }
  89. .register_bottom .input{
  90. width: 17.5rem;
  91. height: 2.5rem;
  92. margin-top: 1rem;
  93. padding-left: 0.6rem;
  94. border-radius: 0.6rem;
  95. border: 0.1rem solid silver;
  96. /* 去除表单点击后出现的边框 */
  97. outline: none;
  98. color: reb(107,107,107);
  99. }
  100. .login_bottom p{
  101. font-size: 0.8rem;
  102. margin-top: 1rem;
  103. }
  104. /* 使复选框与后面文字水平对齐 */
  105. .login_bottom p input{
  106. vertical-align: middle;/* vertical 垂直的 middle 中间 */
  107. }
  108. .login_bottom p span{
  109. margin-right: 0.5rem;
  110. color: #757575;
  111. }
  112. .login_bottom p a{
  113. color: #214c52;
  114. }
  115. .register_bottom p{
  116. font-size: 0.8rem;
  117. margin-top: 1rem;
  118. }
  119. .register_bottom p span{
  120. margin-right: 0.5rem;
  121. color: #757575;
  122. }
  123. .register_bottom p a{
  124. color: #214c52;
  125. }
  126. /* 登录、注册按钮共同样式 */
  127. .login_bottom button,.register_bottom button{
  128. width: 18rem;
  129. height: 2.8rem;
  130. color: white;
  131. margin-top: 2rem;
  132. border-radius: 0.6rem;
  133. border: none;
  134. }
  135. .login_bottom button{
  136. background: #214c52;
  137. margin-top: 3.6rem;
  138. }
  139. .register_bottom button{
  140. background: #3e9597;
  141. }
  142. /* 鼠标滑过按钮出现阴影效果 */
  143. .login_bottom button:hover,.register_bottom button:hover{
  144. box-shadow: 0.2rem 0.2rem 0 rgba(0,0,0,0.3);
  145. }
  146. .login_bottom .inputYzm{
  147. width: 10.5rem;
  148. height: 2.5rem;
  149. margin-top: 0.1rem;
  150. padding-left: 0.6rem;
  151. border-radius: 0.6rem;
  152. border: 0.1rem solid silver;
  153. /* 去除表单点击后出现的边框 */
  154. outline: none;
  155. color: reb(107,107,107);
  156. }
  157. .login_bottom .sendYzm{
  158. width: 6rem;
  159. height: 2.5rem;
  160. color: white;
  161. border-radius: 0.6rem;
  162. border: none;
  163. }
  164. </style>
  165. <script>
  166. function iphoneLogin(){
  167. var yzm = designId = Z("#yzm").val();
  168. var mobile = designId = Z("#mobile").val();
  169. if(mobile == null || mobile == ""){
  170. Z.alert("请填写手机号");
  171. return;
  172. }
  173. if(yzm == null || yzm == ""){
  174. Z.alert("请填写验证码");
  175. return;
  176. }
  177. var ajax = new Z.Ajax();
  178. ajax.setClassName("IphoneLoginPresenter");
  179. ajax.setMethodName("doLogin");
  180. ajax.addParam("yzm", yzm);
  181. ajax.addParam("mobile", mobile);
  182. ajax.setFailureAlert();
  183. ajax.setSuccess();
  184. ajax.execute();
  185. }
  186. function doSendSmsCode(){
  187. var operatorMobile = Z("#mobile").val();
  188. if (Z.V.isEmptyBlank(operatorMobile))
  189. {
  190. Z.failure("手机号不能为空!");
  191. Z("#mobile").focus();
  192. return;
  193. }
  194. if (Z('#getsms-submit')[0].innerHTML != "获取验证码" && Z('#getsms-submit')[0].innerHTML != "重新发送") {
  195. Z.failure("请稍后再试");
  196. return ;
  197. }
  198. var ajax = new Z.Ajax();
  199. ajax.setContextPath("${context.getContextPath()}");
  200. ajax.setClassName("IphoneLoginPresenter");
  201. ajax.setMethodName("sendSms");
  202. ajax.addParam("operatorCode", "简奈编辑器用户");
  203. ajax.addParam("mobile", operatorMobile);
  204. ajax.setFailureAlert();
  205. ajax.setSuccess();
  206. ajax.execute();
  207. setYzmLabel();
  208. }
  209. var wait = 60;
  210. function setYzmLabel() {
  211. if (wait == 0)
  212. {
  213. Z('#getsms-submit')[0].innerHTML = "重新发送";
  214. wait = 60;
  215. }
  216. else
  217. {
  218. Z('#getsms-submit')[0].innerHTML = "已发送(" + wait + ")";
  219. wait--;
  220. setTimeout(function () {
  221. setYzmLabel()
  222. }, 1000);
  223. }
  224. };
  225. </script>
  226. <body>
  227. <div class="box" style="margin-left:20px;">
  228. <!-- 登录 -->
  229. <div class="login">
  230. <div class="login_top">
  231. <img src="/zinc/images/login_new.png">
  232. <h2>欢迎登录简奈自助设计平台</h2>
  233. </div>
  234. <div class="login_bottom">
  235. <!-- 密码输入框 -->
  236. <input type="textt" id="mobile" class="input" placeholder="请输入手机号" />
  237. <!--验证码-->
  238. <input type="text" id="yzm" class="inputYzm" placeholder="请输入验证码" />
  239. <button class="sendYzm" id="getsms-submit" onclick="doSendSmsCode()">获取验证码</button>
  240. <!-- 登录按钮 -->
  241. <button OnClick="iphoneLogin();">登录</button>
  242. </div>
  243. </div>
  244. </div>
  245. </body>
  246. </html>