首页 > 其他分享 >登陆页面

登陆页面

时间:2022-12-02 17:13:25浏览次数:40  
标签:border phone 登陆 background rem password margin 页面

vue 框架 主要看样式,其他的根据需求改

<!-- 登陆 -->
<template>
  <div class="login">
    <div class="loginTop">欢迎登陆</div>
    <div class="loginContent">
      <input
        type="text"
        name="phone"
        class="phone"
        v-model="phone"
        placeholder="请输入手机号"
        required
      />
      <input
        type="text"
        name="password"
        class="password"
        v-model="password"
        placeholder="请输入密码"
        required
      />
      <div>
        <button class="btn" @click="login">登陆</button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      phone: '',
      password: '',
    }
  },
  methods: {
    login: async function () {
      // let res = await this.$store.dispatch('getLogin', {
      //   phone: this.phone,
      //   password: this.password,
      // })
      // if (res.data.code === 200) {
      //   this.$store.commit('updateIsLogin',true)
      //   this.$router.push('/infoUser')
      // }else{
      //   console.log("error");
      //   showFailToast("用户名或密码错误")
      //   this.password = ""
      // }
      var myreg = /^[1][3,4,5,7,8][0-9]{9}$/
      if (this.phone.trim() === '') {
        this.$toast({
          message: '手机号不能为空',
          icon: 'manager',
        })
      } else if (this.password.trim() === '') {
        this.$toast({
          message: '密码不能为空',
          icon: 'warning',
        })
      } else if (this.phone.trim() !== '' && this.password.trim() !== '') {
        if (!myreg.test(this.phone)) {
          this.$toast({
            message: '手机号格式不正确',
            icon: 'warning',
          })
        } else {
          this.$toast({
            type: 'success',
            message: '登陆成功',
            icon: 'success',
          })
          this.$store.commit('updateIsLogin', true)
          this.$router.push('/infoUser')
        }
      }
    },
  },
}
</script>

<style lang="less" scoped>
.login {
  width: 100%;
  height: 100vh;
  padding: 0.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: rgba(57, 92, 120, 0.607);
  .loginTop {
    margin-top: 1rem;
    font-size: .6rem;
    color: #fff;
  }
  .loginContent {
    margin-top: 1rem;
    // background-color: aqua;
    width: 6rem;
    text-align: center;
    height: 4rem;
    color: #fff;
    .phone {
      width: 90%;
      height: 0.8rem;
      margin-top: 0.6rem;
      margin-bottom: 10px;
      background: none;
      border: none;
      border-bottom: 1px solid rgb(214, 212, 212);
    }
    .password {
      width: 90%;
      height: 0.8rem;
      margin-top: 0.6rem;
      margin-bottom: 10px;
      background: none;
      border: none;
      border-bottom: 1px solid rgb(214, 212, 212);
    }
    .btn {
      width: 90%;
      background-color: rgb(228, 133, 179);
      height: 40px;
      border: none;
      border-radius: 5px;
      margin-top: 0.8rem;
    }
  }
}
</style>

结果
image

标签:border,phone,登陆,background,rem,password,margin,页面
From: https://www.cnblogs.com/Fantasyfzg/p/16944987.html

相关文章

  • 关于Namespace的值是怎么影响jsp页面位置不同访问方法的
    小记:​​<constantname="struts.devMode"value="true"/>​​这个是设置开发模式的语句,保证项目配置在修改之后能直接刷新体现出来的。首先在完成项目的配置之后,web.xml文......
  • 使用fullcalendar构建简单会议室预约页面
    <linkhref="./plugins/fullcalendar-5.11.2/fullcalendar-scheduler/main.min.css"rel="stylesheet"/><scripttype="text/javascript"language="javascript"src=".......
  • form表单提交后,页面弹出成功或者失败的信息
    Ssm 中用RedirectAttributes做提示消息`@RequiresPermissions("hic:zybl:hicZybl:edit") @RequestMapping(value="save") publicStringsave(HicZyblhicZybl,Model......
  • iframe框架页面实现自适应高度解决方案
    经常会有父页面需要通过iframe嵌入另一个子页面,又要适时根据子页面的高度调整父页面中iframe的高度,这就要求页面必须具有自适应功能。自适应思想比较简单:就是父页面中ifra......
  • 直播平台开发,scroll-view如何自适应页面剩余高度
    直播平台开发,scroll-view如何自适应页面剩余高度首先想到的方法是通过计算得出scroll-view的高度,使用100vh即视口高度,减去上下两个组件和手机状态栏的高度,得到剩余的高度......
  • react native中刷新页面
    在reactnative中刷新页面就是改变页面的数据源,如果页面的数据源是state或者是store那么当数据源改变了.页面就会自动刷新的.所以刷新页面的两种方式1:用redux来做数据源......
  • 解决VLC前端遮挡页面元素问题
    说实话也就360浏览器还可以用vlc了,目前是为了播放海康视频流同时绘制报警框,因为对实时性有要求,转码延迟不大好控制因此考虑vlc。反正是针对个别用户的,也不会在公网部署主......
  • 使用HTTPCLIENT去生成静态HTML页面
    一般生成HTML页时,都会用比如freemarker等去搞,但今天看到和学到一个还应该不错的方法,是使用httpclient的get方法,去读某个动态的URL,然后把读出的内容再......
  • C++输出页面的相关操作
    下文需要用到的头文件等#include<bits/stdc++.h>#include<Windows.h>#include<stdlib.h>#include<time.h>#include<conio.h>#defineintlonglongusingnamesp......
  • 页面css哀悼模式
      查找的一波样式原来是css的:filter:grayscale(100%);//灰度   ......