Files
aida_front/src/views/SellerDashboard/index.vue

118 lines
2.5 KiB
Vue
Raw Normal View History

2026-04-08 11:06:31 +08:00
<template>
<div class="seller-dashboard-index">
2026-04-08 13:27:20 +08:00
<div class="nav">
<div
v-for="v in list"
:key="v.path"
2026-04-09 17:17:52 +08:00
:class="{ active: new RegExp(`^${v.path}`).test(activePath) }"
2026-04-08 13:27:20 +08:00
@click="handleClick(v.path)"
>
<div class="icon"><svg-icon :name="v.icon" size="20" /></div>
<span class="layer">{{ v.layer }}</span>
</div>
</div>
2026-04-08 11:06:31 +08:00
2026-04-09 11:40:17 +08:00
<router-view></router-view>
2026-04-27 11:07:51 +08:00
<toolTipBox v-model:visible="visible" @close="() => {}" ref="toolTipBoxRef"></toolTipBox>
2026-04-08 11:06:31 +08:00
</div>
</template>
2026-04-08 13:27:20 +08:00
<script setup>
2026-04-24 17:30:07 +08:00
import { Https } from "@/tool/https"
2026-04-27 10:49:37 +08:00
import { ref, computed, onMounted, onUnmounted } from "vue"
2026-04-08 13:27:20 +08:00
import { useRoute, useRouter } from "vue-router"
2026-04-09 11:40:17 +08:00
import toolTipBox from "./toolTipBox.vue"
2026-04-10 14:40:48 +08:00
import myEvent from "@/tool/myEvents.js"
2026-04-27 10:49:37 +08:00
import { useStore } from "vuex"
const store = useStore()
store.dispatch("seller/get_designerInfo")
2026-04-08 13:27:20 +08:00
const route = useRoute()
const router = useRouter()
2026-04-08 14:19:42 +08:00
const visible = ref(false)
2026-04-08 13:27:20 +08:00
const list = ref([
{
icon: "seller-brandProfile",
layer: "Brand Profile",
path: "/home/seller/brandProfile"
},
{
icon: "seller-myListings",
layer: "My Listings",
path: "/home/seller/myListings"
},
{
icon: "seller-myOrders",
layer: "My Orders",
path: "/home/seller/myOrders"
},
{
icon: "seller-settings",
layer: "Settings",
path: "/home/seller/settings"
}
])
2026-04-27 11:07:51 +08:00
const toolTipBoxRef = ref(null)
2026-04-08 13:27:20 +08:00
const activePath = computed(() => route.path)
const handleClick = (path) => {
if (path === activePath.value) return
router.push(path)
}
2026-04-10 14:40:48 +08:00
onMounted(()=>{
2026-04-27 11:07:51 +08:00
myEvent.add('newListing',(path)=>{
toolTipBoxRef.value.routerPath = path
2026-04-10 14:40:48 +08:00
visible.value = true
})
})
2026-04-27 10:49:37 +08:00
onUnmounted(() => {
myEvent.remove("newListing")
2026-04-10 14:40:48 +08:00
})
2026-04-08 11:06:31 +08:00
</script>
<style scoped lang="less">
.seller-dashboard-index {
width: 100%;
height: 100%;
position: relative;
display: flex;
flex-direction: column;
2026-04-08 13:27:20 +08:00
> .nav {
width: 100%;
display: flex;
align-items: center;
gap: 3.6rem;
2026-04-09 11:40:17 +08:00
margin-bottom: 4rem;
2026-04-08 13:27:20 +08:00
> div {
width: 18rem;
height: 6rem;
display: flex;
align-items: center;
justify-content: center;
position: relative;
cursor: pointer;
> .icon {
margin-right: 1rem;
color: #b0b0b0;
}
> .layer {
font-size: 2rem;
color: #999999;
}
&.active {
> .icon,
> .layer {
color: #000;
}
&::after {
content: "";
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 0.4rem;
background-color: #000;
}
}
}
}
2026-04-08 11:06:31 +08:00
}
</style>