2023-12-01 11:22:09 +08:00
|
|
|
<script setup lang="ts">
|
2023-12-04 17:42:11 +08:00
|
|
|
import { ref } from 'vue'
|
|
|
|
|
import { useRouter } from 'vue-router'
|
|
|
|
|
import { useStore } from '../../store/user'
|
|
|
|
|
import { useRoute } from 'vue-router'
|
|
|
|
|
const store = useStore()
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
const route = useRoute()
|
|
|
|
|
|
|
|
|
|
// 求租按钮
|
|
|
|
|
const seekingRentClick = () => {
|
|
|
|
|
store.editcurrentMenuItem('baseInfo')
|
|
|
|
|
store.editCurrentMenuType(true)
|
|
|
|
|
store.editcurrentMenuList([
|
|
|
|
|
{ title: '基础信息', name: 'baseInfo' },
|
|
|
|
|
{ title: '订单管理', name: 'orderManagement' },
|
|
|
|
|
{ title: '子账号管理', name: 'subAccount' }
|
|
|
|
|
])
|
|
|
|
|
router.push({ name: 'baseInfo' })
|
|
|
|
|
}
|
2023-12-01 11:22:09 +08:00
|
|
|
|
2023-12-04 17:42:11 +08:00
|
|
|
// 承租按钮
|
|
|
|
|
const lesseeClick = () => {
|
|
|
|
|
store.editcurrentMenuItem('orderManagementCz')
|
|
|
|
|
store.editCurrentMenuType(false)
|
|
|
|
|
store.editcurrentMenuList([
|
|
|
|
|
{ title: '订单管理', name: 'orderManagementCz' },
|
|
|
|
|
{ title: '商品管理', name: 'goodsManagement' },
|
|
|
|
|
{ title: '商品上下架', name: 'goodsUpdown' },
|
|
|
|
|
{ title: '机手管理', name: 'operatorManagement' }
|
|
|
|
|
])
|
|
|
|
|
router.push({ name: 'orderManagementCz' })
|
|
|
|
|
}
|
2023-12-01 11:22:09 +08:00
|
|
|
|
2023-12-04 17:42:11 +08:00
|
|
|
const handleSelect = (name: any, path: any) => {
|
|
|
|
|
store.editcurrentMenuItem(name)
|
|
|
|
|
}
|
|
|
|
|
const activeMenuItem = computed(() => {
|
|
|
|
|
return store.currentMenuItem
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const activeseekingRent = computed(() => {
|
|
|
|
|
return store.currentMenuType
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const menuList = computed(() => {
|
|
|
|
|
return store.menuList
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
watch(route, (newVlaue) => {
|
|
|
|
|
if (newVlaue.path.indexOf('myuser') === -1) {
|
|
|
|
|
store.editcurrentMenuItem('baseInfo')
|
|
|
|
|
store.editCurrentMenuType(true)
|
|
|
|
|
store.editcurrentMenuList([
|
|
|
|
|
{ title: '基础信息', name: 'baseInfo' },
|
|
|
|
|
{ title: '订单管理', name: 'orderManagement' },
|
|
|
|
|
{ title: '子账号管理', name: 'subAccount' }
|
|
|
|
|
])
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
</script>
|
2023-12-01 11:22:09 +08:00
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<!-- 个人中心页面 -->
|
2023-12-04 17:42:11 +08:00
|
|
|
<div class="app-container">
|
2023-12-01 11:22:09 +08:00
|
|
|
<div class="left-menu">
|
|
|
|
|
<!-- 头像 -->
|
|
|
|
|
<div class="pic-box">
|
2023-12-08 13:13:00 +08:00
|
|
|
<img src="../../assets/img/bns-logo.png" alt="" />
|
2023-12-08 12:09:54 +08:00
|
|
|
<span>15336652321</span>
|
2023-12-01 11:22:09 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 按钮 -->
|
|
|
|
|
<div class="btn-box">
|
2023-12-01 17:02:05 +08:00
|
|
|
<span @click="seekingRentClick">
|
2023-12-04 17:42:11 +08:00
|
|
|
<a :class="activeseekingRent ? 'active' : ''">求租</a>
|
2023-12-01 17:02:05 +08:00
|
|
|
</span>
|
|
|
|
|
<span @click="lesseeClick">
|
2023-12-04 17:42:11 +08:00
|
|
|
<a :class="!activeseekingRent ? 'active' : ''">承租</a>
|
2023-12-01 17:02:05 +08:00
|
|
|
</span>
|
2023-12-01 11:22:09 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 菜单 -->
|
2023-12-04 17:42:11 +08:00
|
|
|
<el-menu
|
|
|
|
|
:default-active="activeMenuItem"
|
|
|
|
|
class="el-menu-vertical-demo"
|
|
|
|
|
router
|
|
|
|
|
@select="handleSelect">
|
2023-12-01 11:22:09 +08:00
|
|
|
<el-menu-item v-for="(item, index) in menuList" :key="index" :index="item.name">
|
|
|
|
|
{{ item.title }}
|
|
|
|
|
</el-menu-item>
|
|
|
|
|
</el-menu>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="right-content">
|
|
|
|
|
<router-view />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
2023-12-04 17:42:11 +08:00
|
|
|
<style lang="scss">
|
|
|
|
|
.app-container {
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
2023-12-01 11:22:09 +08:00
|
|
|
|
2023-12-04 17:42:11 +08:00
|
|
|
.left-menu {
|
2023-12-01 17:02:05 +08:00
|
|
|
width: 260px;
|
2023-12-04 17:42:11 +08:00
|
|
|
height: 100%;
|
|
|
|
|
background-color: #f7f9fa;
|
|
|
|
|
border-radius: 5px;
|
|
|
|
|
margin-right: 15px;
|
|
|
|
|
|
|
|
|
|
.pic-box {
|
|
|
|
|
width: 260px;
|
|
|
|
|
height: 180px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
|
|
|
|
img {
|
|
|
|
|
margin: 30px 0 10px 0;
|
|
|
|
|
width: 90px;
|
|
|
|
|
height: 90px;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
span {
|
|
|
|
|
display: block;
|
|
|
|
|
}
|
2023-12-01 11:22:09 +08:00
|
|
|
}
|
2023-12-04 17:42:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btn-box {
|
|
|
|
|
height: 45px;
|
|
|
|
|
display: flex;
|
2023-12-01 11:22:09 +08:00
|
|
|
|
|
|
|
|
span {
|
2023-12-04 17:42:11 +08:00
|
|
|
height: 100%;
|
|
|
|
|
line-height: 45px;
|
|
|
|
|
flex: 1;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
text-align: center;
|
|
|
|
|
color: #82b8ff;
|
2023-12-01 11:22:09 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-04 17:42:11 +08:00
|
|
|
.right-content {
|
|
|
|
|
width: calc(100% - 260px);
|
2023-12-01 11:22:09 +08:00
|
|
|
height: 100%;
|
|
|
|
|
}
|
2023-12-01 17:02:05 +08:00
|
|
|
|
2023-12-04 17:42:11 +08:00
|
|
|
.active {
|
|
|
|
|
color: #2282ff;
|
|
|
|
|
border-bottom: 2px solid #2282ff;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
}
|
2023-12-01 11:22:09 +08:00
|
|
|
}
|
2023-12-04 17:42:11 +08:00
|
|
|
</style>
|