login.html 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8" />
  5. <title>愛摳訂会员登录页面</title>
  6. <link type="text/css" rel="stylesheet" href="../../static/css/style.css" />
  7. <script src="../../static/script/vue.js"></script>
  8. </head>
  9. <body>
  10. <div id="login_header">
  11. <a href="../../index.html">
  12. <img class="logo_img" alt="" src="../../static/img/logo.gif" />
  13. </a>
  14. </div>
  15. <div class="login_banner">
  16. <div id="l_content">
  17. <span class="login_word">欢迎登录</span>
  18. </div>
  19. <div id="content">
  20. <div class="login_form">
  21. <div class="login_box">
  22. <div class="tit">
  23. <h1>愛摳訂会员</h1>
  24. </div>
  25. <div class="msg_cont">
  26. <b></b>
  27. <span class="errorMsg">{{errorMsg}}</span>
  28. </div>
  29. <div class="form">
  30. <form action="login_success.html">
  31. <label>用户名称:</label>
  32. <input
  33. class="itxt"
  34. type="text"
  35. placeholder="请输入用户名"
  36. autocomplete="off"
  37. tabindex="1"
  38. name="username"
  39. id="username"
  40. v-model="user.username"
  41. />
  42. <br />
  43. <br />
  44. <label>用户密码:</label>
  45. <input
  46. class="itxt"
  47. type="password"
  48. placeholder="请输入密码"
  49. autocomplete="off"
  50. tabindex="1"
  51. name="password"
  52. id="password"
  53. v-model="user.password"
  54. />
  55. <br />
  56. <br />
  57. <input type="submit" value="登录" @click.prevent="submitBtn" id="sub_btn" />
  58. </form>
  59. <div class="tit">
  60. <a href="regist.html">立即注册</a>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. <div id="bottom">
  68. <span>
  69. 愛摳訂书城.Copyright &copy;2015
  70. </span>
  71. </div>
  72. </body>
  73. <script>
  74. let vue = new Vue({
  75. el:"#content",
  76. data:{
  77. //提示信息
  78. errorMsg:"",
  79. user:{
  80. username:"",
  81. password:""
  82. },
  83. },
  84. methods:{
  85. submitBtn(){
  86. //判断
  87. if (this.user.username.trim() == '' || this.user.password.trim() == ''){
  88. //提示
  89. this.errorMsg="用户或者密码不能为空"
  90. return false;
  91. }
  92. //不为空 提交到 后端 暂时在控制台输出即可
  93. console.log(this.user)
  94. this.errorMsg=""
  95. }
  96. }
  97. })
  98. </script>
  99. </html>