You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

216 lines
3.6 KiB

3 years ago
<template>
<view class="page">
<view class="top">
<img src="@/static/login/banner.jpg" alt="">
<view class="tops">
</view>
</view>
<view class="items">
<view class="title">
<img mode="widthFix" src="@/static/login/title.png" alt="">
<view class="text">
欢迎登录防消一体化综合治理平台
</view>
</view>
3 years ago
<view class="item username">
3 years ago
<view class="label">
3 years ago
账号
3 years ago
</view>
<view class="input">
3 years ago
<input v-model="form.name" type="text" placeholder="请输入账号">
3 years ago
</view>
</view>
3 years ago
<view class="item password">
3 years ago
<view class="label">
密码
</view>
<view class="input">
<input v-model="form.password" type="password" placeholder="请输入密码">
</view>
</view>
3 years ago
<!-- <view class="item">
<label>
3 years ago
<checkbox :value="form.auto" /><text>自动登录</text>
3 years ago
</label>
</view> -->
3 years ago
<view class="button">
3 years ago
<button type="default" @tap="getUserInfo()">登录</button>
3 years ago
<!-- <button @tap="getToken()">登录</button> -->
</view>
3 years ago
</view>
<view class="bottom">
<image src="../../static/login/bottom.png" mode=""></image>
</view>
3 years ago
</view>
</template>
<script>
import store from '@/store.js'
export default {
data() {
return {
title: 'Hello',
form: {
3 years ago
name: "",
password: "",
3 years ago
auto: false,
}
}
},
onLoad() {
if (store.state.token) {
console.log(store.state.token);
uni.reLaunch({
url: "/pages/index/index",
success: res => {},
fail: () => {},
complete: () => {},
})
}
},
methods: {
getUserInfo() {
let body = {}
if (!this.form.name) {
return this.$alert.showError("请输入用户账号")
}
if (!this.form.password) {
return this.$alert.showError("请输入密码")
}
3 years ago
this.$auth.login(this.form)
return
3 years ago
},
3 years ago
3 years ago
}
}
</script>
<style lang="scss">
.page {
3 years ago
overflow: hidden;
3 years ago
background-color: #FAFBFF;
color: #808080;
3 years ago
display: flex;
flex-direction: column;
position: relative;
3 years ago
}
.top {
width: 100%;
height: 200rpx;
3 years ago
position: relative;
3 years ago
img {
width: 100%;
height: 200rpx;
}
3 years ago
.tops {
width: 100%;
height: 40rpx;
border-radius: 20rpx 20rpx 0 0;
position: absolute;
z-index: 10;
background-color: #FAFBFF;
bottom: 0rpx;
left: 0;
}
3 years ago
}
3 years ago
3 years ago
.items {
3 years ago
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
z-index: 999;
3 years ago
.title {
3 years ago
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-top: 58rpx;
3 years ago
.text {
margin-top: 20rpx;
3 years ago
font-size: 26rpx;
3 years ago
text-align: center;
color: #939393;
}
}
3 years ago
3 years ago
.item {
3 years ago
width: 80%;
3 years ago
.label {
font-size: 32rpx;
3 years ago
margin: 26rpx 0;
3 years ago
}
label {
color: #4963F4;
checkbox {
border: #4963F4;
}
}
3 years ago
input {
box-sizing: border-box;
padding: 0 16rpx;
3 years ago
height: 80rpx;
background: #ECF2FF;
3 years ago
border-radius: 3px;
font-size: 26rpx;
3 years ago
input {
height: 100%;
}
}
3 years ago
}
.username {
margin-top: 58rpx;
}
.password {
margin-bottom: 76rpx;
}
}
.button {
width: 100%;
button {
width: 80%;
color: #fff;
border-radius: 100rpx;
background: #4963F4;
box-shadow: 2px rgba(73, 99, 244, 0.8);
}
3 years ago
3 years ago
}
3 years ago
3 years ago
.bottom {
width: 100%;
height: 200rpx;
3 years ago
3 years ago
image {
width: 100%;
height: 100%;
3 years ago
}
}
</style>