2020-09-25 07:13:39 +00:00
|
|
|
<template>
|
|
|
|
<div class="menu">
|
|
|
|
<div class="user" style="overflow: hidden;">
|
|
|
|
<div class="user" :class="{'seltop': selnum == 0}">
|
2020-10-10 02:19:38 +00:00
|
|
|
<img :src="userinfo.head" alt="" class="head">
|
|
|
|
<div class="name">{{userinfo.username}}</div>
|
2020-09-25 07:13:39 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="list">
|
|
|
|
<div v-for="(i,j) in list" :key="j" style="overflow: hidden;" @click="routeto(j)">
|
|
|
|
<div class="item" :class="{'selitem': j == selnum, 'seltop': j == selnum - 1, 'selbottom': j == selnum + 1}">
|
|
|
|
<div class="route">
|
2020-10-05 08:31:06 +00:00
|
|
|
<img :src="i.icon" alt="" class="icon">
|
2020-09-25 07:13:39 +00:00
|
|
|
<div class="title">{{i.name}}</div>
|
|
|
|
</div>
|
2020-10-10 06:34:23 +00:00
|
|
|
<img alt="" src="../static/images/jiantou.png" class="right">
|
2020-09-25 07:13:39 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="overflow: hidden;">
|
|
|
|
<div class="item" :class="{'selbottom': selnum == list.length - 1}"></div>
|
|
|
|
</div>
|
|
|
|
<div class="item loginout">
|
2020-10-14 01:32:12 +00:00
|
|
|
<div class="route" @click="logout">
|
2020-10-10 06:34:23 +00:00
|
|
|
<img src="../static/images/tuichu.png" alt="" class="icon">
|
2020-09-25 07:13:39 +00:00
|
|
|
<div class="title">
|
|
|
|
帐号退出
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.menu{
|
|
|
|
user-select: none;
|
|
|
|
width: 171px;
|
2020-09-25 08:34:20 +00:00
|
|
|
height: 100%;
|
2020-09-25 07:13:39 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
background: linear-gradient(0deg, #0EDCC2, #50DF98, #7EE278, #A2E562);
|
|
|
|
.user{
|
|
|
|
width: 100%;
|
|
|
|
height: 150px;
|
|
|
|
display: flex;
|
2020-09-25 07:46:03 +00:00
|
|
|
flex-shrink: 0;
|
2020-09-25 07:13:39 +00:00
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
.head{
|
|
|
|
width: 57px;
|
|
|
|
height: 57px;
|
|
|
|
margin-bottom: 15px;
|
|
|
|
border-radius: 50%;
|
|
|
|
}
|
|
|
|
.name{
|
|
|
|
font-size: 15rpx;
|
|
|
|
line-height: 1;
|
|
|
|
color: #fff;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
.list{
|
|
|
|
position: relative;
|
|
|
|
display: flex;
|
|
|
|
height: 100%;
|
|
|
|
padding-left: 6px;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
.item{
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
height: 50px;
|
|
|
|
padding: 0 18px;
|
|
|
|
justify-content: space-between;
|
|
|
|
.route{
|
|
|
|
display: flex;
|
|
|
|
.icon{
|
|
|
|
width: 15px;
|
|
|
|
height: 15px;
|
|
|
|
}
|
|
|
|
.title{
|
|
|
|
font-size: 13px;
|
|
|
|
color: #fff;
|
|
|
|
line-height: 1;
|
|
|
|
margin-left: 6px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.right{
|
|
|
|
width: 5px;
|
|
|
|
height: 10px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.loginout{
|
|
|
|
position: absolute;
|
|
|
|
bottom: 10px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.seltop{
|
|
|
|
border-radius: 0 0 25px 0;
|
|
|
|
box-shadow: 0 0 0 30px #f5f5f5 ;
|
|
|
|
}
|
|
|
|
.selbottom{
|
|
|
|
border-radius: 0 25px 0 0;
|
|
|
|
box-shadow: 0 0 0 30px #f5f5f5 ;
|
|
|
|
}
|
|
|
|
.selitem{
|
|
|
|
border-radius: 25px 0 0 25px;
|
|
|
|
background-color: #F5F5F5;
|
|
|
|
.title{
|
|
|
|
color: #08AE98 !important;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
<script lang="ts">
|
2020-10-05 08:31:06 +00:00
|
|
|
import router from '@/router';
|
2020-10-10 02:19:38 +00:00
|
|
|
import store from '@/store';
|
|
|
|
import { computed, defineComponent, ref } from 'vue';
|
2020-10-10 06:34:23 +00:00
|
|
|
import { useRoute } from 'vue-router';
|
2020-09-25 07:13:39 +00:00
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
setup(){
|
|
|
|
interface MenuItem {
|
|
|
|
icon: string;
|
2020-10-05 08:31:06 +00:00
|
|
|
sleicon: string;
|
2020-09-25 07:13:39 +00:00
|
|
|
name: string;
|
|
|
|
route: string;
|
|
|
|
}
|
2020-09-25 08:27:33 +00:00
|
|
|
// 左侧的列表数组
|
2020-09-25 07:13:39 +00:00
|
|
|
const list: Array<MenuItem> = [
|
|
|
|
{
|
2020-10-10 06:34:23 +00:00
|
|
|
icon: require("../static/images/wode1.png"),
|
2020-10-05 08:31:06 +00:00
|
|
|
sleicon:"",
|
2020-09-25 07:13:39 +00:00
|
|
|
name: "我的档案",
|
2020-10-05 08:31:06 +00:00
|
|
|
route: "/mine/archives"
|
2020-09-25 07:13:39 +00:00
|
|
|
},
|
|
|
|
{
|
2020-10-10 06:34:23 +00:00
|
|
|
icon: require("../static/images/xiayig.png"),
|
2020-10-05 08:31:06 +00:00
|
|
|
sleicon:"",
|
2020-09-25 07:13:39 +00:00
|
|
|
name: "发布直播",
|
2020-10-05 08:31:06 +00:00
|
|
|
route: "/mine/webcast"
|
2020-09-25 07:13:39 +00:00
|
|
|
},
|
|
|
|
{
|
2020-10-10 06:34:23 +00:00
|
|
|
icon: require("../static/images/shipin.png"),
|
2020-10-05 08:31:06 +00:00
|
|
|
sleicon:"shipin.png",
|
2020-09-25 07:13:39 +00:00
|
|
|
name: "上传视频",
|
2020-10-05 08:31:06 +00:00
|
|
|
route: "/mine/video"
|
2020-09-25 07:13:39 +00:00
|
|
|
},
|
|
|
|
{
|
2020-10-10 06:34:23 +00:00
|
|
|
icon: require("../static/images/yinhangka.png"),
|
2020-10-05 08:31:06 +00:00
|
|
|
sleicon:"",
|
2020-09-25 07:13:39 +00:00
|
|
|
name: "我的钱包",
|
2020-10-05 08:31:06 +00:00
|
|
|
route: "/mine/wallet"
|
2020-09-25 07:13:39 +00:00
|
|
|
},
|
|
|
|
{
|
2020-10-10 06:34:23 +00:00
|
|
|
icon: require("../static/images/tongji.png"),
|
2020-10-05 08:31:06 +00:00
|
|
|
sleicon:"",
|
2020-09-25 07:13:39 +00:00
|
|
|
name: "列表统计",
|
2020-10-05 08:31:06 +00:00
|
|
|
route: "/mine/liststatistic"
|
2020-09-25 07:13:39 +00:00
|
|
|
},
|
|
|
|
{
|
2020-10-10 06:34:23 +00:00
|
|
|
icon: require("../static/images/bangzhu.png"),
|
2020-10-05 08:31:06 +00:00
|
|
|
sleicon:"",
|
2020-09-25 07:13:39 +00:00
|
|
|
name: "关于Beelink",
|
2020-10-05 08:31:06 +00:00
|
|
|
route: "/mine/aboutus"
|
2020-09-25 07:13:39 +00:00
|
|
|
}
|
|
|
|
]
|
2020-09-25 08:27:33 +00:00
|
|
|
// 当前选中的index
|
2020-09-25 07:13:39 +00:00
|
|
|
const selnum = ref(0);
|
2020-10-10 02:19:38 +00:00
|
|
|
|
|
|
|
const userinfo = computed(() => store.state.userinfo)
|
2020-10-10 06:34:23 +00:00
|
|
|
// 设置当前路由
|
|
|
|
for(const i in list){
|
|
|
|
if(list[i].route == useRoute().path){
|
|
|
|
selnum.value = parseInt(i);
|
|
|
|
}
|
|
|
|
}
|
2020-09-25 08:27:33 +00:00
|
|
|
/**
|
|
|
|
* 跳转路由与赋值对应的下标
|
|
|
|
* @param index 选中的下标 方便赋值与跳转
|
|
|
|
*/
|
|
|
|
function routeto(index: number): void {
|
2020-09-25 07:13:39 +00:00
|
|
|
console.log(index)
|
|
|
|
selnum.value = index;
|
2020-10-05 08:31:06 +00:00
|
|
|
router.push({
|
|
|
|
path: list[index].route
|
|
|
|
})
|
2020-09-25 07:13:39 +00:00
|
|
|
|
|
|
|
}
|
2020-10-10 00:59:54 +00:00
|
|
|
|
2020-10-14 01:32:12 +00:00
|
|
|
function logout(): void{
|
|
|
|
store.commit("login", false)
|
|
|
|
router.replace("/");
|
|
|
|
}
|
2020-10-10 02:19:38 +00:00
|
|
|
|
2020-09-25 07:13:39 +00:00
|
|
|
return{
|
|
|
|
list,
|
|
|
|
routeto,
|
2020-10-10 02:19:38 +00:00
|
|
|
selnum,
|
2020-10-14 01:32:12 +00:00
|
|
|
userinfo,
|
|
|
|
logout
|
2020-09-25 07:13:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
</script>
|