uni-app 23登录注册页

52 篇文章 2 订阅

直接看效果图

在这里插入图片描述

如下是主页面代码

login.nvue
<template>
	<view class="">
		<view v-if="show" class="position-fixed top-0 bottom-0 left-0  right-0 bg-light flex align-center justify-center">
			<text class="text-muted font">正在加载...</text>
		</view>
		<view class="" v-else>
			<view class="flex align-center justify-center pt-5" style="height: 350rpx;">
				<text style="font-size: 50rpx;">LOGO</text>
			</view>
			<view class="px-3">
				<input type="text" class="bg-light px-3 mb-3 font" style="height: 100rpx;" value="" placeholder="请输入用户名" />
				<input type="text" class="bg-light px-3 mb-3 font" style="height: 100rpx;" value="" placeholder="请输入密码" />
					<input v-if="type==='reg'" type="text" class="bg-light px-3 mb-3 font" style="height: 100rpx;" value="" placeholder="请输入确认密码" />
			</view>
			<view class="p-3 flex align-center justify-center">
				<view class="flex-1 main-bg-color rounded p-3 flex align-center justify-center" hover-class="main-bg-hover-color">
					<text class="text-white font-md">{{type==='login' ? '登 录' : '注 册'}}</text>
				</view>
			</view>
			
			<view class="flex align-center justify-center">
				<text class='text-light-muted font  p-2' @click="changeType">{{type==='login' ? '注册账号' : '登录账号'}}</text>
				<text class='text-light-muted font'>|</text>
				<text class='text-light-muted font  p-2'>忘记密码</text>
			</view>
		</view>
	  
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type:'login',
				show:false
			}
		},
		created() {
			// uni.switchTab({
			// 	url:'../../tabbar/index/index'
			// })
			// setTimeout(()=>{
			// 	// 用户登录
			// 	this.show = true;
			// 	用户登录
			// 	uni.switchTab({
			// 		url:'../../tabbar/index/index',
			// 	})
			// },800);
		},
		methods: {
			changeType(){
				this.type = this.type==='login' ? 'reg' : 'login';
			}
		}
	}
</script>

<style>
.page-loading{
	background-color: #C8C7CC;
	/* #ifdef APP-PLUS-NVUE */
	min-height: 100%;
	height: auto;
	/* #endif */
	/* #ifdef APP-PLUS-NVUE */
	flex:1;
	/* #endif */
}
</style>

感谢大家观看,我们下期见

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

2019ab

你的鼓励就是我的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值