ui设计
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
<template>
|
||||
<div class="main">
|
||||
<!-- <button @click="callPython">设置数据"123"到 Python</button>
|
||||
<button @click="getPythonData">从 Python 获取数据</button> -->
|
||||
<!-- <input type="text" id="input" v-model="inputValue"></input>
|
||||
<div id="output">{{ output }}</div> -->
|
||||
|
||||
<div class="container">
|
||||
<div class="left">
|
||||
|
||||
</div>
|
||||
<div class="right">
|
||||
<!-- 视频背景 -->
|
||||
<video autoplay loop muted class="background-video">
|
||||
<source :src="require('@/assets/video/bg.mp4')" type="video/mp4">
|
||||
您的浏览器不支持 HTML5 视频。
|
||||
</video>
|
||||
|
||||
<!-- 设置 -->
|
||||
<div class="center-align">
|
||||
<div></div>
|
||||
@@ -28,53 +26,45 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- logo -->
|
||||
<div class="logo">
|
||||
<div style="height: 80px; width: 300px; background-color: aqua;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- From -->
|
||||
<div class="from">
|
||||
<div class="from-title">
|
||||
<div>账号登陆</div>
|
||||
<div class="center-line" style="margin-top: 15vh;">
|
||||
<!-- logo -->
|
||||
<div class="logo">
|
||||
<div class="center-justify" style="height: 80px; width: 300px;">
|
||||
<img style="margin-right: 20px;" src="@/assets/logo.png">
|
||||
<img src="@/assets/logotext.png">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="from-input">
|
||||
<el-form label-position="left" label-width="100px" :model="formData">
|
||||
<!-- From -->
|
||||
<div class="from">
|
||||
<div class="from-title center-justify">
|
||||
<div>账号登陆</div>
|
||||
</div>
|
||||
|
||||
<div class="from-input-item">
|
||||
<div class="from-input-item-title center-justify">
|
||||
账号:
|
||||
<div class="from-input">
|
||||
<el-form label-position="left" label-width="100px" :model="formData">
|
||||
|
||||
<div class="from-input-item1">
|
||||
<img src="@/assets/password.png" alt="">
|
||||
<el-input style="height: 25px;" v-model="formData.userId" placeholder="账号" clearable
|
||||
@keyup.enter="onSubmit" />
|
||||
</div>
|
||||
<el-input style="height: 50px;" v-model="formData.userId" placeholder="请输入登录账号"
|
||||
clearable />
|
||||
</div>
|
||||
|
||||
<div class="from-input-item">
|
||||
<div class="from-input-item-title center-justify">
|
||||
密码:
|
||||
<div class="from-input-item1">
|
||||
<img src="@/assets/password.png" alt="">
|
||||
<el-input style="height: 25px; " v-model="formData.password" type="password"
|
||||
placeholder="密码" show-password @keyup.enter="onSubmit" />
|
||||
</div>
|
||||
<el-input style="height: 50px;" v-model="formData.password" type="password"
|
||||
placeholder="请输入登录密码" show-password />
|
||||
</div>
|
||||
|
||||
<div class="from-input-item">
|
||||
<el-button style="width: 100%; height: 40px;" type="primary"
|
||||
@click="onSubmit">登录</el-button>
|
||||
</div>
|
||||
|
||||
|
||||
</el-form>
|
||||
<div class="from-input-item">
|
||||
<el-button class="loginButton" color="#8f7ee7" type="primary"
|
||||
@click="onSubmit">登录</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -82,65 +72,72 @@
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { login } from '@/api/account';
|
||||
import { getToken, setToken, setUser } from '@/utils/storage'
|
||||
import { getToken, setToken, setUser, setUserPass, getUserPass } from '@/utils/storage';
|
||||
import { ElLoading } from 'element-plus';
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
// import { usePythonBridge } from '@/utils/pythonBridge';
|
||||
|
||||
// let inputValue = ref('999');
|
||||
// const output = ref('');
|
||||
// const { callPython, getPythonData } = usePythonBridge();
|
||||
|
||||
|
||||
|
||||
const formData = ref({
|
||||
userId: '',
|
||||
password: '',
|
||||
})
|
||||
|
||||
userId: getUserPass() == null ? '' : getUserPass().userId,
|
||||
password: getUserPass() == null ? '' : getUserPass().password,
|
||||
});
|
||||
|
||||
const onSubmit = () => {
|
||||
console.log('submit!')
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
});
|
||||
console.log('submit!');
|
||||
setUserPass(formData.value);
|
||||
login({
|
||||
userId: formData.value.userId,
|
||||
password: formData.value.password,
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
setToken(res.currcode)
|
||||
setUser(res)
|
||||
}).then((res) => {
|
||||
loading.close();
|
||||
setToken(res.currcode);
|
||||
setUser(res);
|
||||
router.push('/nav');
|
||||
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
}).catch((err) => {
|
||||
loading.close();
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.main {
|
||||
width: 100vw;
|
||||
overflow: hidden;
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
|
||||
.left {
|
||||
width: 40%;
|
||||
height: 100vh;
|
||||
box-sizing: border-box;
|
||||
background-color: #1db97d;
|
||||
padding: 20px 40px;
|
||||
|
||||
}
|
||||
box-sizing: border-box;
|
||||
|
||||
.right {
|
||||
width: 60%;
|
||||
background-color: #ffffff;
|
||||
position: relative;
|
||||
width: 1600px;
|
||||
height: 900px;
|
||||
padding: 20px 40px 20px 50px;
|
||||
border-left: 3px solid #23516e;
|
||||
position: relative;
|
||||
/* 添加 position: relative */
|
||||
overflow: hidden;
|
||||
/* 防止内容溢出 */
|
||||
|
||||
.background-video {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
z-index: -1;
|
||||
/* 确保视频在内容之下 */
|
||||
}
|
||||
|
||||
.setup {
|
||||
display: flex;
|
||||
color: #fff;
|
||||
|
||||
.setup-item {
|
||||
padding: 10px 6px;
|
||||
@@ -150,7 +147,7 @@ const onSubmit = () => {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
background-color: red;
|
||||
background-color: rgb(255, 255, 255);
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
@@ -161,15 +158,27 @@ const onSubmit = () => {
|
||||
}
|
||||
|
||||
.from {
|
||||
width: 420px;
|
||||
height: 320px;
|
||||
color: #107A4E;
|
||||
background-color: #ffffff44;
|
||||
border-radius: 20px;
|
||||
border: 1px solid #fff;
|
||||
padding: 32px;
|
||||
box-sizing: border-box;
|
||||
|
||||
.from-title {
|
||||
display: flex;
|
||||
padding: 10px 0 0 0;
|
||||
font-family: Source Han Sans SC;
|
||||
font-weight: 500;
|
||||
font-size: 24px;
|
||||
color: #107A4E;
|
||||
line-height: 37px;
|
||||
|
||||
|
||||
div {
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
border-bottom: 4px solid #1db97d;
|
||||
// border-bottom: 4px solid #1db97d;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,25 +188,53 @@ const onSubmit = () => {
|
||||
|
||||
.from-input-item {
|
||||
display: flex;
|
||||
padding: 20px 0;
|
||||
padding: 8px 0;
|
||||
|
||||
.from-input-item-title {
|
||||
color: #107A4E;
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
width: 80px;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
.loginButton {
|
||||
width: 359px;
|
||||
height: 50px;
|
||||
background: #FFFFFF;
|
||||
border-radius: 24px;
|
||||
border: 1px solid #FFFFFF;
|
||||
|
||||
|
||||
font-family: Source Han Sans SC;
|
||||
font-weight: 500;
|
||||
font-size: 18px;
|
||||
color: #107A4E;
|
||||
line-height: 37px;
|
||||
}
|
||||
}
|
||||
|
||||
.from-input-item1 {
|
||||
display: flex;
|
||||
width: 359px;
|
||||
height: 50px;
|
||||
background: rgba(147, 174, 158, 0.37);
|
||||
border-radius: 24px;
|
||||
border: 1px solid #FFFFFF;
|
||||
padding: 12px 25px 13px 25px;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.center-line {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
// justify-content: center;
|
||||
}
|
||||
|
||||
.center-justify {
|
||||
@@ -209,7 +246,6 @@ const onSubmit = () => {
|
||||
.center-align {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
}
|
||||
|
||||
.center-flex {
|
||||
@@ -217,4 +253,27 @@ const onSubmit = () => {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.el-input__wrapper {
|
||||
--el-input-focus-border-color: rgba(255, 255, 0, 0);
|
||||
--el-menu-hover-bg-color: rgba(255, 255, 0, 0);
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
::v-deep(.el-input__wrapper) {
|
||||
background-color: rgba(255, 0, 0, 0);
|
||||
box-shadow: none;
|
||||
|
||||
}
|
||||
|
||||
::v-deep(.el-input__inner) {
|
||||
color: #107A4E;
|
||||
|
||||
}
|
||||
|
||||
::v-deep(.el-input__inner::placeholder) {
|
||||
color: #107A4E;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user