一、效果
二、代码
loging.vue文件
<template>
<view class="login">
<view class="content-wrapper">
<view class="title">
<h1>欢迎使用运动app</h1>
</view>
<view class="login-form">
<view class="login-form-items">
<view class="login-form-items-title">手机号</view>
<input type="text" class="login-input" placeholder="手机号" />
</view>
<view class="login-form-items">
<view class="login-form-items-title">登录密码</view>
<input :type="pwd_show?'text':'password'" class="login-input" placeholder="请输入登录密码" />
<image class="password_img" @click="change_pwd" style="width: 50px; height: 30px;"
:src="pwd_show? '/static/show_pswd.png':'/static/no_pswd.png'"></image>
</view>
<view class="login-form-items">
<view class="login-form-items-title">验证码</view>
<input type="text" class="login-input" placeholder="请输入验证码" />
<view class="captcha-wrapper">
<image class="img_code" src="/static/code.png"></image>
</view>
</view>
</view>
</view>
<div class="submit-wrapper">
<button style="background-color: aqua;" type="primary" class="login-btn">登录</button>
</div>
</view>
</template>
<script>
export default {
data() {
return {
pwd_show:false
};
},
methods:{
change_pwd(){
this.pwd_show=!this.pwd_show
}
}
}
</script>
<style lang="scss">
page {
background: #F4F5F6;
}
.img_code {
width: 60px;
height: 30px;
}
.login {
.content-wrapper {
width: 100%;
.title {
margin-top: 35rpx;
width: 100%;
margin-bottom: 10px;
h1 {
border: 0px;
width: 60%;
margin: 0 auto;
text-align: center;
border-bottom: 1px solid #E3E3E3;
height: 50px;
line-height: 50px;
font-size: 17px;
overflow: hidden;
font-weight: 400;
}
}
.login-form {
margin: 20px 10px 20px 15px;
background: #FFFFFF;
.login-form-items {
padding: 15px 10px;
border-bottom: 1px solid #F3F4F5;
position: relative;
display: -webkit-flex;
display: flex;
.login-form-items-title {
width: 30%;
line-height: 22px;
height: 22px;
flex-shrink: 0;
}
.login-input {
width: 100%
}
}
}
}
.submit-wrapper {
padding: 10px;
padding-top: 10px;
background-color: 11ffff;
}
}
</style>
验证码图片自行截图下载
显示影藏密码图标