|
|
@ -6,33 +6,42 @@
|
|
|
|
<div class="header-wrap__logo">马士兵严选欢迎你!</div>
|
|
|
|
<div class="header-wrap__logo">马士兵严选欢迎你!</div>
|
|
|
|
<div class="header-wrap__content flex flex-middle">
|
|
|
|
<div class="header-wrap__content flex flex-middle">
|
|
|
|
<div class="header-wrap-content__login">
|
|
|
|
<div class="header-wrap-content__login">
|
|
|
|
<el-dropdown v-if="isLogin" @visible-change="menuVisible = $event">
|
|
|
|
<!-- 已登录 -->
|
|
|
|
|
|
|
|
<el-dropdown
|
|
|
|
|
|
|
|
v-if="token"
|
|
|
|
|
|
|
|
@visible-change="menuVisible = $event"
|
|
|
|
|
|
|
|
@command="handleCommandClick"
|
|
|
|
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
class="wrap-content-login__info flex flex-middle flex-center"
|
|
|
|
class="wrap-content-login__info flex flex-middle flex-center"
|
|
|
|
:class="{ 'wrap-content-login__info--hover': menuVisible }"
|
|
|
|
:class="{ 'wrap-content-login__info--hover': menuVisible }"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<span>你好,{{ userInfo.name }}</span>
|
|
|
|
<span>你好,{{ userInfo.nickname }}</span>
|
|
|
|
<img class="content-login-info__logo" :src="menuIcon" />
|
|
|
|
<img class="content-login-info__logo" :src="menuIcon" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<el-dropdown-menu slot="dropdown" class="dropdown-menu-self">
|
|
|
|
<el-dropdown-menu slot="dropdown" class="dropdown-menu-self">
|
|
|
|
<div class="menu-item__wrap flex flex-middle">
|
|
|
|
<div class="menu-item__wrap flex flex-middle">
|
|
|
|
<img class="menu-item-wrap__avatar" />
|
|
|
|
<img class="menu-item-wrap__avatar" :src="userInfo.avatar" />
|
|
|
|
<span>{{ userInfo.name }}</span>
|
|
|
|
<span>{{ userInfo.nickname }}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="menu-item__line"></div>
|
|
|
|
<div class="menu-item__line"></div>
|
|
|
|
<el-dropdown-item
|
|
|
|
<el-dropdown-item
|
|
|
|
class="flex flex-between flex-middle"
|
|
|
|
class="flex flex-between flex-middle"
|
|
|
|
v-for="item in menuList"
|
|
|
|
v-for="item in menuList"
|
|
|
|
:key="item.value"
|
|
|
|
:key="item.value"
|
|
|
|
|
|
|
|
:command="item.value"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<span> {{ item.label }}</span>
|
|
|
|
<span> {{ item.label }}</span>
|
|
|
|
<img src="@/static/images/layout/icon-arrow.png" />
|
|
|
|
<img src="@/static/images/layout/icon-arrow.png" />
|
|
|
|
</el-dropdown-item>
|
|
|
|
</el-dropdown-item>
|
|
|
|
</el-dropdown-menu>
|
|
|
|
</el-dropdown-menu>
|
|
|
|
</el-dropdown>
|
|
|
|
</el-dropdown>
|
|
|
|
|
|
|
|
<!-- 未登录 -->
|
|
|
|
<div v-else class="wrap-content-login__text flex">
|
|
|
|
<div v-else class="wrap-content-login__text flex">
|
|
|
|
<span>请先</span>
|
|
|
|
<span>请先</span>
|
|
|
|
<span class="content-login-text--light">登录/注册</span>
|
|
|
|
<span class="content-login-text--light" @click="onLoginClick">
|
|
|
|
|
|
|
|
登录/注册
|
|
|
|
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
@ -58,6 +67,7 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
|
|
|
|
import { mapState } from "vuex";
|
|
|
|
const MENU_VALUE = {
|
|
|
|
const MENU_VALUE = {
|
|
|
|
PERSONAL: 1,
|
|
|
|
PERSONAL: 1,
|
|
|
|
ADDRESS: 2,
|
|
|
|
ADDRESS: 2,
|
|
|
@ -65,12 +75,9 @@ const MENU_VALUE = {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
|
|
|
|
name: "HeaderInfoBar",
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
isLogin: true,
|
|
|
|
|
|
|
|
userInfo: {
|
|
|
|
|
|
|
|
name: "仙女广",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
menuVisible: false,
|
|
|
|
menuVisible: false,
|
|
|
|
menuList: [
|
|
|
|
menuList: [
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -89,6 +96,7 @@ export default {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
computed: {
|
|
|
|
|
|
|
|
...mapState(["userInfo", "token"]),
|
|
|
|
menuIcon() {
|
|
|
|
menuIcon() {
|
|
|
|
return this.menuVisible
|
|
|
|
return this.menuVisible
|
|
|
|
? require("@/static/images/layout/icon-up-light.png")
|
|
|
|
? require("@/static/images/layout/icon-up-light.png")
|
|
|
@ -96,7 +104,19 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
onMenuClick() {},
|
|
|
|
onLoginClick() {
|
|
|
|
|
|
|
|
this.$isLoginValidate();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
handleCommandClick(event) {
|
|
|
|
|
|
|
|
switch (event) {
|
|
|
|
|
|
|
|
case MENU_VALUE.PERSONAL:
|
|
|
|
|
|
|
|
this.$router.push('/account');
|
|
|
|
|
|
|
|
case MENU_VALUE.ADDRESS:
|
|
|
|
|
|
|
|
this.$router.push('/account');
|
|
|
|
|
|
|
|
case MENU_VALUE.LOGON_OUT:
|
|
|
|
|
|
|
|
this.$store.commit("setLoginOut");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|