仿小米商城注册登录 —— vue

对于一个前端人员来说,小米商城一直都是一个经典的练手案例。本篇文章也是也将继续仿写一下小米商城的登录个注册功能,只不过不再是原生,而是vue。 

因为本次知识简单的作业,所以并没有用脚手架、也没有写接口,只是简单的实现了一下功能。

话不多说,直接上代码

html:



  
    
    
    
    
    
  

  
    

css:

*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

a{
  text-decoration: none;
  color: #838383;
}

.box {
  display: flex;
  justify-content: space-between;
}

.left_bg {
  width: 25%;
  height: 100vh;
  background-image: url(https://cdn.web-global.fds.api.mi-img.com/mcfe--mi-account/static/static/media/banner.92c693b4..jpg);
  background-size: 100%;
  /* background-color: pink; */
}

.right {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 75%;
  height: 100vh;
  background-color: #fff;
  /* background-color: lightblue; */
}

.right_header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 80px;
  padding: 0 30px;
  /* background-color: pink; */
}
.logo{
  display: flex;
  align-items: center;
  height: 100%;
}
.logo span{
  font-size: 26px;
  color: #333;
  margin-left: 10px;
}
.r_option{
  display: flex;
  align-items: center;
  height: 100%;
}
.r_option a{
  font-size: 14px;
  margin: 0 10px;
}
.r_option a:hover{
  color: orange;
}
select{
  color: #838383;
  border: 0;
}

.right_body {
  width: 35%;
  /* height: 75%; */
  margin-top: 3%;
  padding-bottom: 15px;
  border: 1px solid #eee;
  box-shadow: 2px 3px 5px #eee;
}
.log_reg{
  width: 100%;
  height: 50px;
  line-height: 50px;
  margin: 30px;
  /* background-color: pink; */
}
.log_reg a{
  font-size: 22px;
  margin: 0 10px;
  padding: 5px 0;
  cursor: pointer;
}
.isActice{
  color: #000;
  font-weight: 400;
  border-bottom: 3px solid rgb(255,92,0);
}
.login_content,
.register_content{
  width: 100%;
  text-align: center;
  margin-top: 20px;
}
form{
  width: 100%;
  text-align: center;
  /* background-color: pink; */
}

.ipt{
  width: 80%;
  height: 60px;
  border: none;
  outline: none;
  padding: 0 20px;
  margin: 10px 0;
  font-size: 17px;
  background-color: #f9f9f9;
}
.change{
  width: 80%;
  margin: 0 auto;
  text-align: left;
  font-size: 14px;
  color: #838383;
  margin-top: 10px;
}
.change input{
  vertical-align: middle;
  margin-right: 5px;
}
.change a{
  color: #000;
  margin: 0 5px;
}
.log_btn,
.reg_btn{
  width: 80%;
  height: 50px;
  margin-top: 20px;
  margin-bottom: 10px;
  border: none;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  border-radius: 5px;
  outline: none;
  background-color: #ff5c00;
}
.forget{
  width: 80%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
}
.forget a{
  font-size: 17px;
  color: #ff5c00;
}
.other{
  color: #aaa;
  font-size: 17px;
  font-weight: 400;
  line-height: 40px;
  text-align: center;
}
.other_content{
  width: 100%;
  /* background-color: pink; */
}
.other_content img{
  width: 10%;
  margin: 10px 10px 0;
}

/* 注册 */
.register_content{
  margin-top: 10px;
}
.yzm{
  position: relative;
}
.yzm .span{
  position: absolute;
  right: 0;
}
.yzm span{
  position: absolute;
  right: 12%;
  top: 50%;
  transform: translateY(-50%);
  color: orange;
  font-size: 14px;
  z-index: 99;
  cursor: pointer;
}
.Unavailable{
  width: 80%;
  margin: 0 auto;
  text-align: left;
  font-size: 17px;
  color: #ff5c00;
  /* background-color: pink; */
}

js:

 

效果图: 

代码和我,反正有一个能跑。 

代码并不完美,各位看官需要可自行优化改进。

我们都在改变,又何必感慨从前!

你可能感兴趣的:(作业,vue.js,javascript,前端)