9.登入页面

2024-03-20 16:36
文章标签 页面 登入

本文主要是介绍9.登入页面,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

登入页面

在pages中新建页面login

修改代码

<template><view></view>
</template><script setup></script><style lang="scss"></style>

添加头像组件

官网
https://vkuviewdoc.fsq.pub/components/avatar.html

<template><view class="u-p-t-40 u-p-r-60 u-p-b-30 u-p-l-60"><!-- circle 圆形头像 --><u-avatar :src="/static/user.jpg" mode="circle"></u-avatar></view>
</template>

查看登入页面

在pages.json中将登入页面放置第一个

{"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages{"path" : "pages/login/login","style" : {"navigationBarTitleText" : "登入","enablePullDownRefresh" : false}},{"path": "pages/index/index","style": {"navigationBarTitleText": "首页"}},{"path" : "pages/write/write","style" : {"navigationBarTitleText" : "发布","enablePullDownRefresh" : false}},{"path" : "pages/unused/unused","style" : {"navigationBarTitleText" : "闲置","enablePullDownRefresh" : false}},{"path" : "pages/buy/buy","style" : {"navigationBarTitleText" : "求购","enablePullDownRefresh" : false}},{"path" : "pages/mine/mine","style" : {"navigationBarTitleText" : "我的","enablePullDownRefresh" : false}}],"globalStyle": {//导航字体颜色,仅支持black和white"navigationBarTextStyle": "white",//导航全局标题,当前页面没有配置时生效"navigationBarTitleText": "简易二手交易",//导航颜色"navigationBarBackgroundColor": "#79b2f8",//下拉显示出来的窗口的背景色"backgroundColor": "#F8F8F8"},"tabBar": {"color": "#7A7E83",//默认文字颜色"selectedColor": "#376199",//选中文字颜色"borderStyle": "black",//上边框颜色"backgroundColor": "#ffffff","list": [{"pagePath": "pages/index/index","iconPath": "static/home.png",//默认图片"selectedIconPath": "static/home_select.png",//选中后图片"text": "首页"}, {"pagePath": "pages/unused/unused","iconPath": "static/unused.png","selectedIconPath": "static/unused_select.png","text": "闲置"}, {"pagePath": "pages/write/write","iconPath": "static/write.png","selectedIconPath": "static/write_select.png","text": "发布"}, {"pagePath": "pages/buy/buy","iconPath": "static/buy.png","selectedIconPath": "static/buy_select.png","text": "求购"}, {"pagePath": "pages/mine/mine","iconPath": "static/mine.png","selectedIconPath": "static/mine_select.png","text": "我的"}]}
}

修改样式

<template><view class="u-p-t-40 u-p-r-60 u-p-b-30 u-p-l-60 logincontaine"><!-- circle 圆形头像 --><u-avatar size="150" src="/static/user.jpg" mode="circle"></u-avatar></view>
</template><script setup></script><style lang="scss">.logincontaine{height: 100%;display: flex;align-items: center;flex-direction: column;// 垂直方向布局}
</style>

设置表单

表单官网
https://vkuviewdoc.fsq.pub/components/form.html

图标官网
https://vkuviewdoc.fsq.pub/components/icon.html

<template><view class="u-p-t-40 u-p-r-60 u-p-b-30 u-p-l-60 logincontaine"><!-- circle 圆形头像 --><u-avatar size="150" src="/static/user.jpg" mode="circle"></u-avatar><!-- model 中是绑定对象 --><!-- left-icon	左侧自定义字体图标(限uView内置图标)或图片地址 left-icon-style	左侧图标的样式,对象形式--><u-form class="forms" :model="loginModel" ref="form1"><u-form-item left-icon="account" left-icon-style="font-size:26px;color:#77aeff"><u-input placeholder="请输入账号" v-model="loginModel.username" /></u-form-item><u-form-item left-icon="lock" left-icon-style="font-size:26px;color:#77aeff"><u-input placeholder="请输入密码" v-model="loginModel.possword" /></u-form-item></u-form></view>
</template><script setup>
import { reactive } from 'vue';const loginModel = reactive({username: '',possword: ''})
</script><style lang="scss">.logincontaine {height: 100%;display: flex;align-items: center;flex-direction: column;// 垂直方向布局}.forms{width: 100%;margin-top: 30px;}
</style>

效果图

在这里插入图片描述

登入按钮与忘记密码

<view class="passtext">忘记密码
</view>
<view class="button"><u-button class="left-b" :custom-style="customStyle1">登入</u-button><u-button class="right-b" :custom-style="customStyle2">注册</u-button>
</view>

login.vue代码

<template><view class="u-p-t-60 u-p-r-60 u-p-b-30 u-p-l-60 logincontaine"><!-- circle 圆形头像 --><u-avatar size="170" src="/static/user.jpg" mode="circle"></u-avatar><!-- model 中是绑定对象 --><!-- left-icon	左侧自定义字体图标(限uView内置图标)或图片地址 left-icon-style	左侧图标的样式,对象形式--><u-form class="forms" :model="loginModel" ref="form1"><u-form-item left-icon="account" left-icon-style="font-size:26px;color:#77aeff"><u-input placeholder="请输入账号" v-model="loginModel.username" /></u-form-item><u-form-item left-icon="lock" left-icon-style="font-size:26px;color:#77aeff"><u-input placeholder="请输入密码" v-model="loginModel.possword" /></u-form-item><view class="passtext">忘记密码</view><view class="button"><u-button class="left-b" :custom-style="customStyle1">登入</u-button><u-button class="right-b" :custom-style="customStyle2">注册</u-button></view></u-form></view>
</template><script setup>
import { reactive } from 'vue';const loginModel = reactive({username: '',possword: ''})const customStyle1 = reactive({marginTop: '80px',background: '#3773d4',color: '#fff',width:'130px'})const customStyle2 = reactive({marginTop: '80px',background: '#3773d4',color: '#fff',width:'130px'})
</script><style lang="scss">.logincontaine {height: 100%;display: flex;align-items: center;flex-direction: column;// 垂直方向布局}.forms{width: 100%;margin-top: 40px;}.button{display: flex;justify-content: space-between;// 水平分布}.passtext{display: flex;justify-content: flex-end;color: #0d7adf;margin-top: 30px;}
</style>

效果图

在这里插入图片描述

这篇关于9.登入页面的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/830077

相关文章

通过React实现页面的无限滚动效果

《通过React实现页面的无限滚动效果》今天我们来聊聊无限滚动这个现代Web开发中不可或缺的技术,无论你是刷微博、逛知乎还是看脚本,无限滚动都已经渗透到我们日常的浏览体验中,那么,如何优雅地实现它呢?... 目录1. 早期的解决方案2. 交叉观察者:IntersectionObserver2.1 Inter

C#自动化实现检测并删除PDF文件中的空白页面

《C#自动化实现检测并删除PDF文件中的空白页面》PDF文档在日常工作和生活中扮演着重要的角色,本文将深入探讨如何使用C#编程语言,结合强大的PDF处理库,自动化地检测并删除PDF文件中的空白页面,感... 目录理解PDF空白页的定义与挑战引入Spire.PDF for .NET库核心实现:检测并删除空白页

一文详解如何使用Java获取PDF页面信息

《一文详解如何使用Java获取PDF页面信息》了解PDF页面属性是我们在处理文档、内容提取、打印设置或页面重组等任务时不可或缺的一环,下面我们就来看看如何使用Java语言获取这些信息吧... 目录引言一、安装和引入PDF处理库引入依赖二、获取 PDF 页数三、获取页面尺寸(宽高)四、获取页面旋转角度五、判断

Python Selenium动态渲染页面和抓取的使用指南

《PythonSelenium动态渲染页面和抓取的使用指南》在Web数据采集领域,动态渲染页面已成为现代网站的主流形式,本文将从技术原理,环境配置,核心功能系统讲解Selenium在Python动态... 目录一、Selenium技术架构解析二、环境搭建与基础配置1. 组件安装2. 驱动配置3. 基础操作模

C#实现查找并删除PDF中的空白页面

《C#实现查找并删除PDF中的空白页面》PDF文件中的空白页并不少见,因为它们有可能是作者有意留下的,也有可能是在处理文档时不小心添加的,下面我们来看看如何使用Spire.PDFfor.NET通过C#... 目录安装 Spire.PDF for .NETC# 查找并删除 PDF 文档中的空白页C# 添加与删

SpringSecurity 认证、注销、权限控制功能(注销、记住密码、自定义登入页)

《SpringSecurity认证、注销、权限控制功能(注销、记住密码、自定义登入页)》SpringSecurity是一个强大的Java框架,用于保护应用程序的安全性,它提供了一套全面的安全解决方案... 目录简介认识Spring Security“认证”(Authentication)“授权” (Auth

Android WebView无法加载H5页面的常见问题和解决方法

《AndroidWebView无法加载H5页面的常见问题和解决方法》AndroidWebView是一种视图组件,使得Android应用能够显示网页内容,它基于Chromium,具备现代浏览器的许多功... 目录1. WebView 简介2. 常见问题3. 网络权限设置4. 启用 JavaScript5. D

Flutter监听当前页面可见与隐藏状态的代码详解

《Flutter监听当前页面可见与隐藏状态的代码详解》文章介绍了如何在Flutter中使用路由观察者来监听应用进入前台或后台状态以及页面的显示和隐藏,并通过代码示例讲解的非常详细,需要的朋友可以参考下... flutter 可以监听 app 进入前台还是后台状态,也可以监听当http://www.cppcn

MySQL表锁、页面锁和行锁的作用及其优缺点对比分析

《MySQL表锁、页面锁和行锁的作用及其优缺点对比分析》MySQL中的表锁、页面锁和行锁各有特点,适用于不同的场景,表锁锁定整个表,适用于批量操作和MyISAM存储引擎,页面锁锁定数据页,适用于旧版本... 目录1. 表锁(Table Lock)2. 页面锁(Page Lock)3. 行锁(Row Lock

禁止HTML页面滚动的操作方法

《禁止HTML页面滚动的操作方法》:本文主要介绍了三种禁止HTML页面滚动的方法:通过CSS的overflow属性、使用JavaScript的滚动事件监听器以及使用CSS的position:fixed属性,每种方法都有其适用场景和优缺点,详细内容请阅读本文,希望能对你有所帮助... 在前端开发中,禁止htm