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

[复制链接]
发表于 2025-12-12 12:29:29 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

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

  


废话不多说,代码如下:

   login.vue文件
  1. <template>
  2.         <view class="content">
  3.                 <view class="logo">
  4.                         LOGO
  5.                 </view>
  6.                 <view class="form-box">
  7.                         <view class="tab-menu">
  8.                                 <view class="tab-name" @click="tabChange(0)">
  9.                                         <text :class="tabIndex==0?'tab-txt':''">登录</text>
  10.                                         <text v-show="tabIndex==0" class="tab-active"></text>
  11.                                 </view>
  12.                                 <view class="tab-name" @click="tabChange(1)">
  13.                                         <text :class="tabIndex==1?'tab-txt':''">注册</text>
  14.                                         <text v-show="tabIndex==1" class="tab-active"></text>
  15.                                 </view>
  16.                         </view>
  17.                         <view v-show="tabIndex==0">
  18.                                 <view class="row-input">
  19.                                         <image mode="aspectFit" src="../../static/phone.png"></image>
  20.                                         <input placeholder="输入账号/手机号" maxlength="11" />
  21.                                 </view>
  22.                                 <view class="row-input">
  23.                                         <image mode="aspectFit" src="../../static/password.png"></image>
  24.                                         <input placeholder="输入密码" maxlength="18" />
  25.                                 </view>
  26.                                 <view class="menu-link">
  27.                                         <text>忘记密码?</text>
  28.                                 </view>
  29.                                 <view class="login-btn">
  30.                                         登录
  31.                                 </view>
  32.                         </view>
  33.                         <view v-show="tabIndex==1">
  34.                                 <view class="row-input-code">
  35.                                         <view class="input-box">
  36.                                                 <image class="img" mode="aspectFit" src="../../static/phone.png"></image>
  37.                                                 <input placeholder="输入手机号" maxlength="11" type="number" />
  38.                                         </view>
  39.                                         <view class="code-box" @click="getCode">
  40.                                                 获取验证码
  41.                                         </view>
  42.                                 </view>
  43.                                 <view class="row-input">
  44.                                         <image mode="aspectFit" src="../../static/code.png"></image>
  45.                                         <input placeholder="输入验证码" maxlength="6" type="number" />
  46.                                 </view>
  47.                                 <view class="row-input">
  48.                                         <image mode="aspectFit" src="../../static/password.png"></image>
  49.                                         <input placeholder="输入6位密码" maxlength="6" />
  50.                                 </view>
  51.                                 <view class="login-btn register">
  52.                                         注册
  53.                                 </view>
  54.                                 <view class="agree-txt">查看<text>《演示效果》</text></view>
  55.                         </view>
  56.                 </view>
  57.         </view>
  58. </template>
  59. <script>
  60.         export default {
  61.                 data() {
  62.                         return {
  63.                                 tabIndex: 0, //登录注册下标
  64.                         }
  65.                 },
  66.                 methods: {
  67.                         // tab切换
  68.                         tabChange(id) {
  69.                                 this.tabIndex = id
  70.                         },
  71.                         // 获取验证码
  72.                         getCode() {
  73.                                 uni.showToast({
  74.                                         title: "获取验证码"
  75.                                 })
  76.                         }
  77.                 }
  78.         }
  79. </script>
  80. <style lang="scss">
  81.         page {
  82.                 background-color: #5de97f;
  83.         }
  84.         .logo {
  85.                 height: 25vh;
  86.                 display: flex;
  87.                 align-items: center;
  88.                 justify-content: center;
  89.                 color: #FFFFFF;
  90.                 font-size: 120rpx;
  91.                 letter-spacing: 5rpx;
  92.                 font-weight: bold;
  93.         }
  94.         .form-box {
  95.                 padding: 0 50rpx;
  96.                 margin: 0 70rpx;
  97.                 height: 750rpx;
  98.                 background-color: #FFFFFF;
  99.                 border-radius: 20rpx;
  100.                 .tab-menu {
  101.                         padding-top: 50rpx;
  102.                         display: flex;
  103.                         justify-content: flex-start;
  104.                         align-items: center;
  105.                         height: 100rpx;
  106.                         .tab-name {
  107.                                 height: 100%;
  108.                                 display: flex;
  109.                                 justify-content: flex-start;
  110.                                 align-items: center;
  111.                                 flex-direction: column;
  112.                                 width: 150rpx;
  113.                                 font-size: 40rpx;
  114.                                 font-weight: bold;
  115.                                 color: #afafaf;
  116.                         }
  117.                         .tab-txt {
  118.                                 color: #5b5b5b;
  119.                         }
  120.                         .tab-active {
  121.                                 margin-top: 10rpx;
  122.                                 width: 100rpx;
  123.                                 height: 13rpx;
  124.                                 background-color: #6bb3fe;
  125.                                 border-radius: 15rpx;
  126.                         }
  127.                 }
  128.                 .row-input {
  129.                         margin: 60rpx 0 0 0;
  130.                         padding: 0 20rpx;
  131.                         display: flex;
  132.                         justify-content: flex-start;
  133.                         align-items: center;
  134.                         height: 80rpx;
  135.                         border: 5rpx solid #bbf7c8;
  136.                         border-radius: 8rpx;
  137.                         image {
  138.                                 width: 30rpx;
  139.                                 height: 30rpx;
  140.                         }
  141.                         input {
  142.                                 padding-left: 20rpx;
  143.                                 font-size: 28rpx;
  144.                                 width: 400rpx;
  145.                         }
  146.                 }
  147.                 .row-input-code {
  148.                         margin-top: 20rpx;
  149.                         width: 100%;
  150.                         display: flex;
  151.                         justify-content: space-between;
  152.                         align-items: center;
  153.                         height: 80rpx;
  154.                         font-size: 28rpx;
  155.                         .input-box {
  156.                                 padding: 0 20rpx;
  157.                                 width: 60%;
  158.                                 display: flex;
  159.                                 justify-content: flex-start;
  160.                                 align-items: center;
  161.                                 height: 100%;
  162.                                 border: 5rpx solid #bbf7c8;
  163.                                 border-top-left-radius: 8rpx;
  164.                                 border-bottom-left-radius: 8rpx;
  165.                                 box-sizing: border-box;
  166.                                 .img {
  167.                                         width: 40rpx;
  168.                                         height: 30rpx;
  169.                                 }
  170.                                 input {
  171.                                         padding-left: 20rpx;
  172.                                         font-size: 28rpx;
  173.                                         width: 300rpx;
  174.                                 }
  175.                         }
  176.                         .code-box {
  177.                                 display: flex;
  178.                                 justify-content: center;
  179.                                 align-items: center;
  180.                                 width: 40%;
  181.                                 height: 100%;
  182.                                 color: #FFFFFF;
  183.                                 border-top-right-radius: 8rpx;
  184.                                 border-bottom-right-radius: 8rpx;
  185.                                 background: linear-gradient(#44aae8, #4889e2);
  186.                         }
  187.                 }
  188.                 .menu-link {
  189.                         display: flex;
  190.                         justify-content: flex-end;
  191.                         align-items: center;
  192.                         height: 70rpx;
  193.                         color: #007AFF;
  194.                         font-size: 24rpx;
  195.                 }
  196.                 .login-btn {
  197.                         margin-top: 30rpx;
  198.                         display: flex;
  199.                         justify-content: center;
  200.                         align-items: center;
  201.                         height: 80rpx;
  202.                         background: linear-gradient(#44aae8, #4889e2);
  203.                         border-radius: 50rpx;
  204.                         color: #FFFFFF;
  205.                         font-size: 35rpx;
  206.                         font-weight: bold;
  207.                         letter-spacing: 4rpx;
  208.                 }
  209.                 .register {
  210.                         margin-top: 50rpx;
  211.                 }
  212.                 .agree-txt {
  213.                         display: flex;
  214.                         justify-content: center;
  215.                         align-items: center;
  216.                         height: 70rpx;
  217.                         font-size: 24rpx;
  218.                         text {
  219.                                 color: #007AFF;
  220.                         }
  221.                 }
  222.         }
  223. </style>
复制代码
  素材!

  


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

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

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

使用道具 举报

登录后关闭弹窗

登录参与点评抽奖  加入IT实名职场社区
去登录
快速回复 返回顶部 返回列表