<!--<template>
    <header>
        <div class="container">
            <div class="home-logo">
                <h1>
                    <router-link to="/account">JS transfer</router-link>
                </h1>
            </div>
            <div class="home-nav">
                <el-menu
                    :default-active="$route.path"
                    class="el-menu-demo"
                    mode="horizontal"
                    @select="handleSelect"
                    text-color="#333"
                    active-text-color="#3d86e9"
                >
                    <el-menu-item index="/account">
                        <router-link to="/account">我的账户</router-link>
                    </el-menu-item>
                    <el-menu-item index="/query">
                        <router-link to="/query">交易查询</router-link>
                    </el-menu-item>
                    <el-menu-item index="/payment">
                        <router-link to="/payment">缴税/付款</router-link>
                    </el-menu-item>
                    <el-submenu index="4">
                        <template slot="title">店铺贷</template>
                        <el-menu-item index="/TimelyRain">
                            <router-link to="/TimelyRain">店铺贷</router-link>
                        </el-menu-item>
                        <el-menu-item index="/borrowMoney">
                            <router-link to="/borrowMoney">借款</router-link>
                        </el-menu-item>
                        <el-menu-item index="/repayment">
                            <router-link to="/repayment">还款</router-link>
                        </el-menu-item>
                        <el-menu-item index="/recordQuery">
                            <router-link to="/recordQuery">记录查询</router-link>
                        </el-menu-item>
                    </el-submenu>
                    <el-menu-item index="/help">
                        <router-link to="/help">帮助中心</router-link>
                    </el-menu-item>
                </el-menu>-->
                <!-- <ul>
                    <li v-for="(item, index) in navList" :key="index">
                        <h2>
                            <router-link :to="item.link" :target="item.target">{{item.title}}</router-link>
                            <ul class="slide-bar">
                                <li v-for="(child, index) in item.children" :key="index">
                                    <router-link
                                        :to="child.link"
                                        :target="child.target"
                                    >{{child.title}}</router-link>
                                </li>
                            </ul>
                        </h2>
                    </li>
                </ul>
            </div>-->
            <!--<div class="home-side">
                <router-link to="/center/account" class="personal-hover">个人中心</router-link>
                <div class="menu-hover box-shadow">
                    <p>{{ userShowInfo.phoneNo }}</p>
                    <ul>
                        <li
                            v-for="(item, index) in menuList"
                            :key="index"
                            :class="'center-menu'+ index"
                        >
                            <router-link :to="item.link" :target="item.target">{{item.title}}</router-link>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </header>
</template>

<script>
import { mapState } from "vuex";
import utils from "utils/utils.js";
export default {
    name: "portalHeadere",
    data() {
        return {
            activeIndex: "1",
            navList: [
                {
                    link: "/account",
                    title: "我的账户",
                    target: "_self"
                },
                {
                    link: "/query",
                    title: "交易查询",
                    target: "_self"
                },
                {
                    link: "/payment",
                    title: "缴税/付款",
                    target: "_self"
                },
                {
                    link: "/TimelyRain",
                    title: "店铺贷",
                    target: "_self",
                    children: [
                        {
                            link: "/a",
                            title: "借款",
                            target: "_self"
                        },
                        {
                            link: "/b",
                            title: "还款",
                            target: "_self"
                        },
                        {
                            link: "/c",
                            title: "记录查询",
                            target: "_self"
                        }
                    ]
                },
                {
                    link: "/help",
                    title: "帮助中心",
                    target: "_blank"
                }
            ],
            menuList: [
                {
                    link: "/center/account",
                    title: "我的账户",
                    target: "_self"
                },
                {
                    link: "/center/setting",
                    title: "安全设置",
                    target: "_self"
                },
                // {
                //     link: "/center/holder",
                //     title: "持有人管理",
                //     target: "_self"
                // },
                {
                    link: "/center/bankcard",
                    title: "银行卡管理",
                    target: "_self"
                },
                {
                    link: "/logout",
                    title: "退出登录",
                    target: "_self"
                }
            ],
            hasToken: false,
            userShowInfo: {}
        };
    },
    computed: {
        ...mapState(["userInfo"])
    },
    methods: {
        handleSelect(key, keyPath) {
            console.log(key, keyPath);
        }
    },
    created() {
        this.userShowInfo = this.userInfo.loginInfo;
    },
    updated() {
        if (localStorage.getItem("token")) {
            this.hasToken = true;
        } else {
            this.hasToken = false;
        }
    },
    mounted() {
        if (localStorage.getItem("token")) {
            this.hasToken = true;
        } else {
            this.hasToken = false;
        }
    }
};
</script>

<style lang="less" scoped>
@import "../../../assets/styles/common.css";
.home-nav /deep/ .el-menu {
    a {
        display: block;
    }
}
.el-menu--horizontal {
    .el-menu-item.is-active {
        a {
            display: block;
            color: #3d86e9;
        }
    }
}
header {
    height: 60px;
    line-height: 60px;
    font-size: 14px;
    background: #fff;
    position: fixed;
    width: 100%;
    left: 0;
    top: 0;
    z-index: 999;
    box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.08);
    .container {
        width: 1080px;
        margin: 0 auto;
    }
    .home-logo {
        float: left;
        display: block;
        width: 326px;
        height: 36px;
        margin: 12px 0;
        background-image: url(~assets/images/logo.png);
        background-size: 326px 36px;
        background-repeat: no-repeat;
        background-position: 50%;
        text-indent: -9999px;
        h1 {
            margin: 0;
        }
        a {
            display: block;
            height: 36px;
            line-height: 36px;
            width: 326px;
        }
    }
    .home-nav {
        margin-left: 75px;
        float: left;
        ul {
            margin: 0;
            padding: 0;
            height: 60px;
            list-style: none;
            li {
                float: left;
                position: relative;
                h2 {
                    font-weight: 500;
                    margin: 0;
                    padding: 0;
                    a {
                        color: #484848;
                        display: block;
                        text-decoration: none;
                        padding: 0 25px;
                        border-top: 4px solid transparent;
                        border-bottom: 4px solid transparent;
                        line-height: 52px;
                        font-size: 14px;
                        &:hover {
                            color: #3d86e9;
                        }
                        &.router-link-exact-active {
                            color: #3d86e9;
                            border-bottom: 4px solid #3d86e9;
                        }
                    }
                }
            }
        }
    }
    .home-side {
        position: relative;
        float: right;
        text-align: center;
        &:hover {
            .menu-hover {
                display: block;
            }
        }
        .personal-hover {
            position: relative;
            display: block;
            color: #3d86e9;
            &::before {
                content: "";
                display: block;
                position: absolute;
                left: -28px;
                top: 20px;
                width: 20px;
                height: 20px;
                background: url(~assets/images/icon-center.png) no-repeat;
            }
        }
        .menu-hover {
            display: none;
            position: absolute;
            top: 60px;
            right: 0;
            width: 156px;
            padding: 0 4px 10px;
            border-radius: 4px;
            box-sizing: border-box;
            background: #fff;
            &::before {
                content: "";
                position: absolute;
                top: -20px;
                left: 50%;
                margin-left: -10px;
                border-top: 10px solid transparent;
                border-right: 10px solid transparent;
                border-bottom: 10px solid #eaeaea;
                border-left: 10px solid transparent;
            }
            &::after {
                content: "";
                position: absolute;
                top: -19px;
                left: 50%;
                margin-left: -10px;
                border-top: 10px solid transparent;
                border-right: 10px solid transparent;
                border-bottom: 10px solid #fff;
                border-left: 10px solid transparent;
            }
            p {
                height: 40px;
                line-height: 40px;
                border-bottom: 1px solid #eaeaea;
            }
            ul {
                list-style: none;
                margin-top: 15px;
                li {
                    float: left;
                    margin: 0 0 0 10px;
                    //padding-left: 28px;
                    position: relative;
                    a {
                        text-decoration: none;
                        padding: 0 20px 0 28px;
                        line-height: 34px;
                        height: 34px;
                        display: block;
                        font-weight: 500;
                        &.radius2 {
                            border-radius: 2px;
                        }
                    }
                }
                .center-menu0 {
                    background: url(~assets/images/icon-center-account.png) left
                        center no-repeat;
                    &:hover {
                        background: url(~assets/images/icon-center-account2.png)
                            left center no-repeat;
                    }
                }
                .center-menu1 {
                    background: url(~assets/images/icon-center-setting.png) left
                        center no-repeat;
                    &:hover {
                        background: url(~assets/images/icon-center-setting2.png)
                            left center no-repeat;
                    }
                }
                .center-menu2 {
                    background: url(~assets/images/icon-center-holder.png) left
                        center no-repeat;
                    &:hover {
                        background: url(~assets/images/icon-center-holder2.png)
                            left center no-repeat;
                    }
                }
                .center-menu3 {
                    background: url(~assets/images/icon-center-bankcard.png)
                        left center no-repeat;
                    &:hover {
                        background: url(~assets/images/icon-center-bankcard2.png)
                            left center no-repeat;
                    }
                }
                .center-menu4 {
                    background: url(~assets/images/icon-center-logout.png) left
                        center no-repeat;
                    &:hover {
                        background: url(~assets/images/icon-center-logout2.png)
                            left center no-repeat;
                    }
                }
            }
        }
    }
    .com-btn {
        background: #3d86e9;
        color: #fff;
    }
}
</style>-->
