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

111

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