companies.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <div class="companies">
  3. <form action="">
  4. <div><span>*</span><span>用户名:</span><input type="text" placeholder="请输入用户名作为账号" v-model="username">
  5. <p v-if="username.length > 3 && username.length < 10"><img src="../../../assets/reg_tips_proper.png" alt="">输入正确</p>
  6. <p v-else><img src="../../../assets/reg_tips_err.png" alt="">输入错误!用户名不能为空或长度过短过长</p>
  7. </div>
  8. <div><span>*</span><span>密码:</span><input type="password" placeholder="请输入6-20位(字母,数字符号)" v-model="passage1">
  9. <p v-if="passage1.length >= 6 && passage1.length <=20"><img src="../../../assets/reg_tips_proper.png" alt="">输入正确</p>
  10. <p v-else><img src="../../../assets/reg_tips_err.png" alt="">输入错误!密码不能为空或长度过短过长</p>
  11. <div class="passagepower">
  12. <span>密码强度:</span>
  13. <div class="poweritem1" v-if="passage1.length >= 6 && passage1.length <= 20"></div>
  14. <div class="poweritem2" v-if="passage1.length >= 10 && passage1.length <= 20"></div>
  15. <div class="poweritem3" v-if="passage1.length >= 15 && passage1.length <= 20"></div>
  16. </div>
  17. </div>
  18. <div><span>*</span><span>确认密码:</span><input type="password" placeholder="请输入您的密码" v-model="passage2">
  19. <p v-if="passage2 == passage1 && passage2.length >= 6 && passage2.length <= 20"><img src="../../../assets/reg_tips_proper.png" alt="">输入正确</p>
  20. <p v-else><img src="../../../assets/reg_tips_err.png" alt="">输入错误!密码不一致</p>
  21. </div>
  22. <div><span>*</span><span>公司名称:</span><input type="text" placeholder="请输入公司名称" v-model="companyname">
  23. <p v-if="companyname"><img src="../../../assets/reg_tips_proper.png" alt="">输入正确</p>
  24. <p v-else><img src="../../../assets/reg_tips_err.png" alt="">输入错误!公司不能为空或长度过短过长</p>
  25. </div>
  26. <div><span>*</span><span>联系人:</span><input type="text" placeholder="请输入联系人称呼" v-model="person">
  27. <p v-if="person"><img src="../../../assets/reg_tips_proper.png" alt="">输入正确</p>
  28. <p v-else><img src="../../../assets/reg_tips_err.png" alt="">输入错误!称呼不为空</p>
  29. </div>
  30. <button class="reg-btn" type="submit" @click="signup()">立即注册</button>
  31. <p class="reg-p">点击注册表示你同意<a href="">用户协议</a></p>
  32. </form>
  33. </div>
  34. </template>
  35. <script>
  36. export default{
  37. name:'companiessign',
  38. data(){
  39. return{
  40. username:'',
  41. passage1:'',
  42. passage2:'',
  43. companyname:'',
  44. person:'',
  45. usernameList:[],
  46. companiesList:[],
  47. }
  48. },
  49. methods:{
  50. signup:function(){
  51. for(var i = 0 ; i < this.usernameList.length ; i++)
  52. {
  53. if(this.username != this.usernameList[i])
  54. this.usernameList.push(this.username);
  55. else alert("用户名已存在");
  56. }
  57. for(var i = 0 ; i < this.companiesList.length ; i++)
  58. {
  59. if(this.companyname != this.companiesList[i])
  60. this.companiesList.push(this.companyname);
  61. else alert("公司名称已存在");
  62. }
  63. if(this.username && this.passage1 && this.passage2 && this.companyname && this.person)
  64. alert("注册成功");
  65. else alert("信息未填完");
  66. }
  67. }
  68. }
  69. </script>
  70. <style>
  71. .companies{
  72. width: 480px;
  73. height: 560px;
  74. background-color: #fcfcfe;
  75. margin: 30rem;
  76. line-height: 5rem;
  77. position: relative;
  78. }
  79. .companies > form > div > span:nth-child(1){
  80. color: red;
  81. margin-left: 5rem;
  82. justify-content: center;
  83. align-items: center;
  84. }
  85. .companies > form > div > span:nth-child(2){
  86. color: #6f6f71;
  87. justify-content: center;
  88. align-items: center;
  89. }
  90. .companies > form > div{
  91. position: relative;
  92. }
  93. .companies > form > div > p{
  94. position: absolute;
  95. font-size: 5px;
  96. top: 2rem;
  97. left: 12.8rem;
  98. }
  99. .companies > form > div > p:nth-child(1){
  100. color: #477f3e;
  101. }
  102. .companies > form > div > p:nth-child(2){
  103. color: #801d22;
  104. }
  105. .companies > form > div > p > img{
  106. width: 10px;
  107. height: 10px;
  108. }
  109. .companies > form > div > input{
  110. width: 150px;
  111. height: 26px;
  112. border: 1px solid #b7bbd4;
  113. outline: none;
  114. position: absolute;
  115. right: 8rem;
  116. margin-top: 1.8rem;
  117. z-index: 100;
  118. }
  119. .companies > form > div > input:hover{
  120. background-color: lightgoldenrodyellow;
  121. }
  122. .reg-btn{
  123. background-color: #4297e8;
  124. width: 152px;
  125. height: 26px;
  126. color: #edffff;
  127. margin-left: 12.5rem;
  128. cursor: pointer;
  129. outline: none;
  130. border: none;
  131. }
  132. .reg-p{
  133. color: #767678;
  134. font-size: 5px;
  135. margin-top: -2rem;
  136. margin-left: 12.5rem;
  137. }
  138. .reg-p > a{
  139. text-decoration: none;
  140. margin-left: 1rem;
  141. color: #6057a6;
  142. }
  143. .reg-p > a:hover{
  144. color: darkred;
  145. }
  146. .passagepower{
  147. width: 300px;
  148. height: 15px;
  149. position: relative;
  150. }
  151. .passagepower > span{
  152. color: #c2c2c4;
  153. font-size: 9px;
  154. position: absolute;
  155. top: -1.7rem;
  156. left: 12.9rem;
  157. }
  158. .poweritem1{
  159. background-color: #ff1e00;
  160. color: #b1b1b3;
  161. width: 20px;
  162. height: 10px;
  163. position: absolute;
  164. top: 0.4rem;
  165. left: 16.4rem;
  166. }
  167. .poweritem2{
  168. background-color: #f3e723;
  169. color: #b1b1b3;
  170. width: 20px;
  171. height: 10px;
  172. font-size: 5px;
  173. position: absolute;
  174. top: 0.4rem;
  175. left: 18rem;
  176. }
  177. .poweritem3{
  178. background-color: #b7e17f;
  179. color: #b1b1b3;
  180. width: 20px;
  181. height: 10px;
  182. font-size: 10px;
  183. position: absolute;
  184. top: 0.4rem;
  185. left: 19.6rem;
  186. }
  187. </style>