This commit is contained in:
huangjinming 2023-03-10 13:19:32 +08:00
parent 411d4a38e2
commit 26c8dfdd76

View File

@ -1,7 +1,11 @@
<template>
<div>
<div class="header header-top">
<div class="header-logo"><a href="#"> <img src="../../assets/img/home/header-logo.png" alt=""></a></div>
<div class="header-logo">
<a href="#">
<img src="../../assets/img/home/header-logo.png" alt=""
/></a>
</div>
<div class="nav">
<a
class="nav-item duration-200"
@ -14,7 +18,13 @@
<div class="dropdown">
<ul>
<li v-for="(item, index) in nav.submenu" :key="index">
<a class="link-name" href="#" v-if="i !== 2"> {{ item.label }} <img class="link-img" src="../../assets/img/home/link-icon.png" alt=""></a>
<a class="link-name" href="#" v-if="i !== 2">
{{ item.label }}
<img
class="link-img"
src="../../assets/img/home/link-icon.png"
alt=""
/></a>
<span v-else>{{ item.label }}</span>
</li>
</ul>
@ -54,21 +64,23 @@
import { ref, reactive, onMounted, computed } from "vue";
import { useChainStore } from "@/store/chain";
import { useAppStore } from "@/store/app";
import { useRouter, useRoute } from "vue-router";
import ChainModel from "../../components/home/ChainModel.vue";
const AppModule = useAppStore();
const router = useRouter();
const chain = useChainStore();
const app = useAppStore();
function click(event) {
router.push(event.key);
}
const formatAddress = computed(() => {
console.log(AppModule.accountId,'AppModule.accountId');
if(!AppModule.accountId){
return '-'
}
console.log(AppModule.accountId, "AppModule.accountId");
if (!AppModule.accountId) {
return "-";
}
if (AppModule.accountId.length >= 10) {
return (
AppModule.accountId.substring(0, 6) +
@ -79,7 +91,7 @@ const formatAddress = computed(() => {
AppModule.accountId.length > 0 &&
AppModule.accountId.length < 10
) {
return AppModule.accountId
return AppModule.accountId;
} else {
return "-";
}
@ -90,7 +102,7 @@ async function login(event) {
await chain.chainManager.login();
console.log("logined:", chain.chainManager.isLogined);
chain.logined = chain.chainManager.isLogined;
}
}
}
const logout = async () => {
await chain.chainManager.logout();
@ -145,17 +157,17 @@ function handNavCurent(nav) {
align-items: center;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
0 2px 4px -2px rgba(0, 0, 0, 0.1);
.header-logo{
margin-left: 20PX;
// padding-left: 20px;
width: 54px;
height: 54px;
}
.header-logo {
margin-left: 29px;
// padding-left: 20px;
width: 64px;
height: 63px;
}
.nav {
padding-left: 83px;
display: flex;
justify-content: space-between;
width: 1130px;
width: 830px;
// position: relative;
a {
padding-top: 20px;
@ -390,9 +402,9 @@ function handNavCurent(nav) {
border: 2px solid rgba(215, 68, 88, 1);
border-radius: 50%;
}
.link-name{
.link-name {
position: relative;
.link-img{
.link-img {
position: absolute;
top: 24px;
right: -18px;