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

111

parent f2629470
...@@ -5,10 +5,20 @@ ...@@ -5,10 +5,20 @@
<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)"
:class="isHover ? '' : 'is-hover'"
@click="toLogin"
>登录</span
>
<span
@mouseenter="onMouserEnter(true)"
:class="isHover ? 'is-hover' : ''"
@click="toRegister"
>注册</span
>
</div> </div>
<div class="right" v-else> <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,15 +104,15 @@ export default { ...@@ -95,15 +104,15 @@ 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);
...@@ -129,15 +138,15 @@ export default { ...@@ -129,15 +138,15 @@ export default {
&:last-child { &:last-child {
margin-left: 10px; margin-left: 10px;
} }
&.is-hover{ &.is-hover {
cursor: pointer; cursor: pointer;
color: var(--color); color: var(--color);
border-color: var(--color); border-color: var(--color);
} }
} }
&.alreadyLogin span {
padding: 0 !important;
} }
.right {
height: 80px;
::v-deep .el-dropdown { ::v-deep .el-dropdown {
height: 80px; height: 80px;
...@@ -166,5 +175,5 @@ export default { ...@@ -166,5 +175,5 @@ export default {
} }
} }
} }
} }
</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