• 【JavaWeb - 网页编程】五 书城项目



    第一阶段 登录注册的验证(表单验证)

    创作日期:2021-12-23

    技术方法:

    • 使用 jQuery 技术对登录中的用户名、密码进行非空验证
    • 使用 jQuery 技术和正则表达式对注册中的用户名、密码、确认密码、邮箱进行格式验证,对验证码进行非空验证​​​​​​​

    ​​​​​​​​​​​​​​实现要求:​​​​​​​

    • 验证用户名:必须由字母,数字下划线组成,并且长度为 5 到 12 位
    • 验证密码:必须由字母,数字下划线组成,并且长度为 5 到 12 位
    • 验证确认密码:和密码相同
    • 邮箱验证:xxxxx.@xxx.com
    • 验证码:需要验证用户已输入

    1.1 新建项目工程和模块

    • 新建 JavaWeb 项目工程,命名为:JavaWeb
    • 新建工程模块,命名为:book_static


    1.2 导入项目静态资源

    将 pages,static,index.html 等静态资源文件拷贝到 JavaWeb [book_static] 工程模块下

    创建新目录文件,命名为:script ,将 jquery.js 拷贝其中

    将 logo.jpeg 图片资源导入到文件 static 目录下 -> img 文件中


    1.4 页面搭建

    1.4.1 书城会员注册页面(regist.html)​​​​​​​

    1

    1.4.n 页面样式(style.css)

    在 static 目录下 -> img 文件 中创建 style.css 页面样式文件

    1. /* style.css */
    2. @CHARSET "UTF-8";
    3. body {
    4. overflow: hidden;
    5. }
    6. * {
    7. margin: 0;
    8. font-family:"Microsoft Yahei";
    9. color: #666;
    10. }
    11. div{
    12. margin: auto;
    13. margin-bottom: 10px;
    14. margin-top: 10px;
    15. }
    16. #header {
    17. height: 82px;
    18. width: 1200px;
    19. }
    20. #main {
    21. height: 460px;
    22. width: 1200px;
    23. border: 1px black solid;
    24. overflow: auto;
    25. }
    26. #bottom {
    27. height: 30px;
    28. width: 1200px;
    29. text-align: center;
    30. }
    31. #book{
    32. width: 100%;
    33. height: 90%;
    34. margin: auto;
    35. }
    36. .b_list{
    37. height:300px;
    38. width:250px;
    39. margin: 20px;
    40. float: left;
    41. margin-top:0px;
    42. margin-bottom:0px;
    43. border: 1px #e3e3e3 solid;
    44. }
    45. #page_nav{
    46. width: 100%;
    47. height: 10px;
    48. margin: auto;
    49. text-align: center;
    50. }
    51. #pn_input {
    52. width: 30px;
    53. text-align: center;
    54. }
    55. .img_div{
    56. height: 150px;
    57. text-align: center;
    58. }
    59. .book_img {
    60. height:150px;
    61. width:150px;
    62. }
    63. .book_info {
    64. text-align: center;
    65. }
    66. .book_info div{
    67. height: 10px;
    68. width: 300px;
    69. text-align: left;
    70. }
    71. .wel_word{
    72. font-size: 60px;
    73. float: left;
    74. }
    75. .logo_img{
    76. float: left;
    77. }
    78. #header div a {
    79. text-decoration: none;
    80. font-size: 20px;
    81. }
    82. #header div{
    83. float: right;
    84. margin-top: 55px;
    85. }
    86. .book_cond{
    87. margin-left: 500px;
    88. }
    89. .book_cond input{
    90. width: 50px;
    91. text-align: center;
    92. }
    93. /*登录页面CSS样式 */
    94. #login_header{
    95. height: 82px;
    96. width: 1200px;
    97. }
    98. .login_banner{
    99. height:475px;
    100. background-color: #39987c;
    101. }
    102. .login_form{
    103. height:310px;
    104. width:406px;
    105. float: right;
    106. margin-right:50px;
    107. margin-top: 50px;
    108. background-color: #fff;
    109. }
    110. #content {
    111. height: 475px;
    112. width: 1200px;
    113. }
    114. .login_box{
    115. margin: 20px;
    116. height: 260px;
    117. width: 366px;
    118. }
    119. h1 {
    120. font-size: 20px;
    121. }
    122. .msg_cont{
    123. background: none repeat scroll 0 0 #fff6d2;
    124. border: 1px solid #ffe57d;
    125. color: #666;
    126. height: 18px;
    127. line-height: 18px;
    128. padding: 3px 10px 3px 40px;
    129. position: relative;
    130. border: none;
    131. }
    132. .msg_cont b {
    133. background: url("../img/pwd-icons-new.png") no-repeat scroll -104px -22px rgba(0, 0, 0, 0);
    134. display: block;
    135. height: 17px;
    136. left: 10px;
    137. margin-top: -8px;
    138. overflow: hidden;
    139. position: absolute;
    140. top: 50%;
    141. width: 16px;
    142. }
    143. .form .itxt {
    144. border: 0 none;
    145. float: none;
    146. font-family: "宋体";
    147. font-size: 14px;
    148. height: 18px;
    149. line-height: 18px;
    150. overflow: hidden;
    151. padding: 10px 0 10px 10px;
    152. width: 220px;
    153. border: 1px #e3e3e3 solid;
    154. }
    155. #sub_btn{
    156. background-color: #39987c;
    157. border: none;
    158. color: #fff;
    159. width: 360px;
    160. height: 40px;
    161. }
    162. #l_content {
    163. float: left;
    164. margin-top: 150px;
    165. margin-left: 300px;
    166. }
    167. #l_content span {
    168. font-size: 60px;
    169. color: white;
    170. }
    171. .tit h1 {
    172. float: left;
    173. margin-top: 5px;
    174. }
    175. .tit a {
    176. float: right;
    177. margin-left: 10px;
    178. margin-top: 10px;
    179. color: red;
    180. text-decoration: none;
    181. }
    182. .tit .errorMsg {
    183. float: right;
    184. margin-left: 10px;
    185. margin-top: 10px;
    186. color: red;
    187. }
    188. .tit {
    189. height: 30px;
    190. }
    191. /*购物车*/
    192. #main table{
    193. margin: auto;
    194. margin-top: 80px;
    195. border-collapse: collapse;
    196. }
    197. #main table td{
    198. width: 120px;
    199. text-align:center;
    200. border-bottom: 1px #e3e3e3 solid;
    201. padding: 10px;
    202. }
    203. .cart_info{
    204. width: 700px;
    205. text-align: right;
    206. }
    207. .cart_span {
    208. margin-left: 20px;
    209. }
    210. .cart_span span{
    211. color: red;
    212. font-size: 20px;
    213. margin: 10px;
    214. }
    215. .cart_span a , td a{
    216. font-size: 20px;
    217. color: blue;
    218. }
    219. #header div span {
    220. margin: 10px;
    221. }
    222. #header div .um_span{
    223. color: red;
    224. font-size: 25px;
    225. margin: 10px;
    226. }
    227. #header div a {
    228. color: blue;
    229. }

     


    上一节:
    下一节:

  • 相关阅读:
    强化学习 DQN 速成
    Dash 2.15版本新特性介绍
    文章分类管理接口
    【我不熟悉的javascript】commonjs和commonjs2的区别,module.exports和exports的关系
    [Linux]Windows使用ssh连接Linux虚拟机(mininet)
    Shader Graph的用法初探
    【Linux入门指北】Linux磁盘扩容
    别再用QQ的破数字邮箱了,你其实还有注册姓名全拼微软邮箱的机会
    LabVIEW学习记录4-局部变量、全局变量、共享变量
    css flex实现同行div根据内容高度自适应且保持一致
  • 原文地址:https://blog.csdn.net/woailuo8214/article/details/125895881