Commit db97ea72 authored by 杨梦雪's avatar 杨梦雪

111

parent f2629470
<template> <template>
<div class="Header"> <div class="Header">
<div class="H_content com-container"> <div class="H_content com-container">
<div class="image"> <div class="image">
<img :src="system_logo" alt="" /> <img :src="system_logo" alt="" />
</div> </div>
<div class="right" v-if="!isLogin"> <div class="right" v-if="!isLogin">
<span @mouseenter="onMouserEnter(false)" :class="isHover?'':'is-hover'" @click="toLogin">登录</span> <span
<span @mouseenter="onMouserEnter(true)" :class="isHover?'is-hover':''" @click="toRegister">注册</span> @mouseenter="onMouserEnter(false)"
</div> :class="isHover ? '' : 'is-hover'"
<div class="right" v-else> @click="toLogin"
>登录</span
>
<span
@mouseenter="onMouserEnter(true)"
:class="isHover ? 'is-hover' : ''"
@click="toRegister"
>注册</span
>
</div>
<div class="right alreadyLogin" v-else>
<el-dropdown @command="handleCommand" trigger="click"> <el-dropdown @command="handleCommand" trigger="click">
<div class="el-dropdown-link"> <div class="el-dropdown-link">
<img src="@/assets/img/default.svg" class="img_user" /> <img src="@/assets/img/default.svg" class="img_user" />
...@@ -30,7 +40,7 @@ ...@@ -30,7 +40,7 @@
</template> </template>
<script> <script>
/* eslint-disable */ /* eslint-disable */
import {logout} from "r/index/login"; import { logout } from "r/index/login";
export default { export default {
name: "Header", name: "Header",
...@@ -38,9 +48,8 @@ export default { ...@@ -38,9 +48,8 @@ export default {
return { return {
isHover: true, isHover: true,
system_logo: window.localStorage.getItem("system_logo"), system_logo: window.localStorage.getItem("system_logo"),
isLogin:false, isLogin: false,
phone: window.localStorage.getItem("phone"), phone: window.localStorage.getItem("phone"),
}; };
}, },
created() { created() {
...@@ -49,7 +58,7 @@ export default { ...@@ -49,7 +58,7 @@ export default {
methods: { methods: {
toLogin() { toLogin() {
let code = localStorage.getItem("index-identity"); let code = localStorage.getItem("index-identity");
this.$router.push("/login?code="+code); this.$router.push("/login?code=" + code);
}, },
handleCommand(command) { handleCommand(command) {
if (command == 2) { if (command == 2) {
...@@ -59,13 +68,13 @@ export default { ...@@ -59,13 +68,13 @@ export default {
this.toCenter(); this.toCenter();
} }
}, },
toCenter(){ toCenter() {
let code = localStorage.getItem("index-identity"); let code = localStorage.getItem("index-identity");
this.$router.replace("/signUp/examInfo?code="+code); this.$router.replace("/signUp/examInfo?code=" + code);
}, },
toRegister() { toRegister() {
let code = localStorage.getItem("index-identity"); let code = localStorage.getItem("index-identity");
this.$router.push("/register?code="+code); this.$router.push("/register?code=" + code);
}, },
async logout() { async logout() {
const confirmResult = await this.$confirm(`确认退出登录?`, "提示", { const confirmResult = await this.$confirm(`确认退出登录?`, "提示", {
...@@ -95,76 +104,76 @@ export default { ...@@ -95,76 +104,76 @@ export default {
window.localStorage.removeItem("campindex_type"); window.localStorage.removeItem("campindex_type");
this.isLogin = false; this.isLogin = false;
}, },
onMouserEnter(val){ onMouserEnter(val) {
this.isHover = val; this.isHover = val;
}, },
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "a/scss/common"; @import "a/scss/common";
.Header { .Header {
font-family: PingFang SC; font-family: PingFang SC;
height: 80px; height: 80px;
box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.12); box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.12);
.H_content { .H_content {
height: 100%; height: 100%;
display: flex; display: flex;
flex-flow: row; flex-flow: row;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.image img { .image img {
// width: 318px; // width: 318px;
height: 62px; height: 62px;
} }
.right { .right {
span { span {
font-size: 15px; font-size: 15px;
font-weight: 500; font-weight: 500;
color: #666666; color: #666666;
line-height: 21px; line-height: 21px;
padding: 10px 36px; padding: 10px 36px;
border-radius: 4px; border-radius: 4px;
border: 2px solid transparent; border: 2px solid transparent;
&:last-child { &:last-child {
margin-left: 10px; margin-left: 10px;
}
&.is-hover{
cursor: pointer;
color: var(--color);
border-color: var(--color);
}
} }
&.is-hover {
cursor: pointer;
color: var(--color);
border-color: var(--color);
}
}
&.alreadyLogin span {
padding: 0 !important;
} }
.right {
::v-deep .el-dropdown {
height: 80px; height: 80px;
::v-deep .el-dropdown { .el-dropdown-link {
height: 80px; height: 80px;
display: flex;
flex-flow: row;
align-items: center;
.el-dropdown-link { .img_user {
height: 80px; width: 34px;
display: flex; height: 34px;
flex-flow: row; background-color: #d8d8d8;
align-items: center; border-radius: 50%;
.img_user {
width: 34px;
height: 34px;
background-color: #d8d8d8;
border-radius: 50%;
}
.phone {
margin: 0 10px 0 12px;
}
} }
&:hover { .phone {
cursor: pointer; margin: 0 10px 0 12px;
} }
} }
&:hover {
cursor: pointer;
}
} }
} }
} }
}
</style> </style>
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
width: 100%; width: 100%;
padding: 0; padding: 0;
background-color: #ffffff; background-color: #ffffff;
z-index: 10000; z-index: 2000;
.bg-top { .bg-top {
// height: 24px; // height: 24px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment