uni-app简洁的移动端登录注册界面

非常简洁的登录、注册界面模板,使用uni-app编写,直接复制粘贴即可,无任何引用,全部公开。


废话不多说,代码如下:

login.vue文件

javascript 复制代码
<template>
	<view class="content">
		<view class="logo">
			LOGO
		</view>
		<view class="form-box">
			<view class="tab-menu">
				<view class="tab-name" @click="tabChange(0)">
					<text :class="tabIndex==0?'tab-txt':''">登录</text>
					<text v-show="tabIndex==0" class="tab-active"></text>
				</view>
				<view class="tab-name" @click="tabChange(1)">
					<text :class="tabIndex==1?'tab-txt':''">注册</text>
					<text v-show="tabIndex==1" class="tab-active"></text>
				</view>
			</view>
			<view v-show="tabIndex==0">
				<view class="row-input">
					<image mode="aspectFit" src="../../static/phone.png"></image>
					<input placeholder="输入账号/手机号" maxlength="11" />
				</view>
				<view class="row-input">
					<image mode="aspectFit" src="../../static/password.png"></image>
					<input placeholder="输入密码" maxlength="18" />
				</view>
				<view class="menu-link">
					<text>忘记密码?</text>
				</view>
				<view class="login-btn">
					登录
				</view>
			</view>
			<view v-show="tabIndex==1">
				<view class="row-input-code">
					<view class="input-box">
						<image class="img" mode="aspectFit" src="../../static/phone.png"></image>
						<input placeholder="输入手机号" maxlength="11" type="number" />
					</view>
					<view class="code-box" @click="getCode">
						获取验证码
					</view>
				</view>
				<view class="row-input">
					<image mode="aspectFit" src="../../static/code.png"></image>
					<input placeholder="输入验证码" maxlength="6" type="number" />
				</view>
				<view class="row-input">
					<image mode="aspectFit" src="../../static/password.png"></image>
					<input placeholder="输入6位密码" maxlength="6" />
				</view>
				<view class="login-btn register">
					注册
				</view>
				<view class="agree-txt">查看<text>《演示效果》</text></view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tabIndex: 0, //登录注册下标
			}
		},
		methods: {
			// tab切换
			tabChange(id) {
				this.tabIndex = id
			},
			// 获取验证码
			getCode() {
				uni.showToast({
					title: "获取验证码"
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #5de97f;
	}

	.logo {
		height: 25vh;
		display: flex;
		align-items: center;
		justify-content: center;
		color: #FFFFFF;
		font-size: 120rpx;
		letter-spacing: 5rpx;
		font-weight: bold;
	}

	.form-box {
		padding: 0 50rpx;
		margin: 0 70rpx;
		height: 750rpx;
		background-color: #FFFFFF;
		border-radius: 20rpx;


		.tab-menu {
			padding-top: 50rpx;
			display: flex;
			justify-content: flex-start;
			align-items: center;
			height: 100rpx;

			.tab-name {
				height: 100%;
				display: flex;
				justify-content: flex-start;
				align-items: center;
				flex-direction: column;
				width: 150rpx;
				font-size: 40rpx;
				font-weight: bold;
				color: #afafaf;
			}

			.tab-txt {
				color: #5b5b5b;
			}

			.tab-active {
				margin-top: 10rpx;
				width: 100rpx;
				height: 13rpx;
				background-color: #6bb3fe;
				border-radius: 15rpx;
			}
		}

		.row-input {
			margin: 60rpx 0 0 0;
			padding: 0 20rpx;
			display: flex;
			justify-content: flex-start;
			align-items: center;
			height: 80rpx;
			border: 5rpx solid #bbf7c8;
			border-radius: 8rpx;

			image {
				width: 30rpx;
				height: 30rpx;
			}

			input {
				padding-left: 20rpx;
				font-size: 28rpx;
				width: 400rpx;
			}
		}

		.row-input-code {
			margin-top: 20rpx;
			width: 100%;
			display: flex;
			justify-content: space-between;
			align-items: center;
			height: 80rpx;
			font-size: 28rpx;

			.input-box {
				padding: 0 20rpx;
				width: 60%;
				display: flex;
				justify-content: flex-start;
				align-items: center;
				height: 100%;
				border: 5rpx solid #bbf7c8;
				border-top-left-radius: 8rpx;
				border-bottom-left-radius: 8rpx;
				box-sizing: border-box;

				.img {
					width: 40rpx;
					height: 30rpx;
				}

				input {
					padding-left: 20rpx;
					font-size: 28rpx;
					width: 300rpx;
				}
			}

			.code-box {
				display: flex;
				justify-content: center;
				align-items: center;
				width: 40%;
				height: 100%;
				color: #FFFFFF;
				border-top-right-radius: 8rpx;
				border-bottom-right-radius: 8rpx;
				background: linear-gradient(#44aae8, #4889e2);
			}
		}

		.menu-link {
			display: flex;
			justify-content: flex-end;
			align-items: center;
			height: 70rpx;
			color: #007AFF;
			font-size: 24rpx;
		}

		.login-btn {
			margin-top: 30rpx;
			display: flex;
			justify-content: center;
			align-items: center;
			height: 80rpx;
			background: linear-gradient(#44aae8, #4889e2);
			border-radius: 50rpx;
			color: #FFFFFF;
			font-size: 35rpx;
			font-weight: bold;
			letter-spacing: 4rpx;
		}

		.register {
			margin-top: 50rpx;
		}

		.agree-txt {
			display: flex;
			justify-content: center;
			align-items: center;
			height: 70rpx;
			font-size: 24rpx;

			text {
				color: #007AFF;
			}
		}
	}
</style>

素材!


更多移动端登录注册界面模板,请点击以下链接访问查看 ↓

更多模板地址:https://ext.dcloud.net.cn/plugin?id=8937

几十款移动端登录/注册界面模板,源码全部公开,拿来即用,点击即可查看

相关推荐
Thanks_ks17 小时前
JavaScript 事件循环机制详解:同步任务、微任务与宏任务的执行顺序
javascript·promise·前端面试·async/await·事件循环·宏任务·微任务
ZhengEnCi19 小时前
前端日志和后端日志怎么记:分级、JSON 格式、按天分文件与保留策略
前端·后端·python
kyriewen20 小时前
我给 61 个前端库排了两次名,最多差了 46 位
前端·javascript·程序员
亲亲小宝宝鸭21 小时前
Cesium启动:TLE数据是如何变成轨迹线的
前端·cesium
阿里云云原生21 小时前
对话即构建,在 AgentCore 构建 Agent 就是这么简单
前端·agent
夕水1 天前
我给我的诗写了个后台,顺手写了 一个组件库ew-solid-ui
前端·javascript·typescript
KevinWang_1 天前
iOS 开发计划(五) - 做一个离线音乐播放器
javascript
狗头大军之江苏分军1 天前
前端转行干能干什么?我转行试了下(被迫)
前端·后端
孟陬1 天前
Foobar 技术周刊#2:约会已死?用户急剧下滑,约会App大概率会弱化约会属性转向轻陪伴。我有个建议:
前端·后端·rust
parade岁月1 天前
VTable Guild 3.0.0 发布,面向 Vue 3 的 ProTable 式业务表格
前端