直播路由

This commit is contained in:
2020-10-10 14:34:23 +08:00
parent 96e9284abb
commit 3755425b0e
7 changed files with 48 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
<template>
<div class="videoitem">
<div class="videoitem" @click="navto()">
<img src="" alt="" class="cover">
<img src="@/static/images/play.png" alt="" class="play">
<div class="title">
@@ -133,14 +133,34 @@
}
</style>
<script lang="ts">
import router from '@/router';
import { defineComponent } from 'vue';
export default defineComponent({
props:{
props:{
type: {
type: Number,
default:1
}
},
setup(props){
function navto(){
let url = '';
switch (props.type) {
case 1:
url = '/regime/livedetail';
break;
case 2:
url = '/regime/livedetail';
break;
case 3:
url = '/regeime/liveing';
}
router.push(url)
}
return {
navto
}
}
})
</script>

View File

@@ -14,7 +14,7 @@
<img :src="i.icon" alt="" class="icon">
<div class="title">{{i.name}}</div>
</div>
<img src="" alt="" class="right">
<img alt="" src="../static/images/jiantou.png" class="right">
</div>
</div>
<div style="overflow: hidden;">
@@ -22,7 +22,7 @@
</div>
<div class="item loginout">
<div class="route">
<img src="" alt="" class="icon">
<img src="../static/images/tuichu.png" alt="" class="icon">
<div class="title">
帐号退出
</div>
@@ -89,7 +89,6 @@
.right{
width: 5px;
height: 10px;
background-color: #0f0;
}
}
.loginout{
@@ -119,6 +118,7 @@
import router from '@/router';
import store from '@/store';
import { computed, defineComponent, ref } from 'vue';
import { useRoute } from 'vue-router';
export default defineComponent({
setup(){
@@ -131,37 +131,37 @@ export default defineComponent({
// 左侧的列表数组
const list: Array<MenuItem> = [
{
icon: "../static/images/wode1.ping",
icon: require("../static/images/wode1.png"),
sleicon:"",
name: "我的档案",
route: "/mine/archives"
},
{
icon: "../static/images/xiayig.ping",
icon: require("../static/images/xiayig.png"),
sleicon:"",
name: "发布直播",
route: "/mine/webcast"
},
{
icon: "../static/images/shipin.png",
icon: require("../static/images/shipin.png"),
sleicon:"shipin.png",
name: "上传视频",
route: "/mine/video"
},
{
icon: "/static/images/yinhangka.png",
icon: require("../static/images/yinhangka.png"),
sleicon:"",
name: "我的钱包",
route: "/mine/wallet"
},
{
icon: "../static/images/tongji.png",
icon: require("../static/images/tongji.png"),
sleicon:"",
name: "列表统计",
route: "/mine/liststatistic"
},
{
icon: "../static/images/bangzhu@2x.png",
icon: require("../static/images/bangzhu.png"),
sleicon:"",
name: "关于Beelink",
route: "/mine/aboutus"
@@ -171,7 +171,12 @@ export default defineComponent({
const selnum = ref(0);
const userinfo = computed(() => store.state.userinfo)
console.log(userinfo.value)
// 设置当前路由
for(const i in list){
if(list[i].route == useRoute().path){
selnum.value = parseInt(i);
}
}
/**
* 跳转路由与赋值对应的下标
* @param index 选中的下标 方便赋值与跳转

View File

@@ -134,7 +134,7 @@ export default defineComponent({
const nav: Array<Nav> = [
{
name: "直播管理",
route: ""
route: "/regime/live"
},
{
name: "视频管理",
@@ -142,7 +142,7 @@ export default defineComponent({
},
{
name: "订阅者管理",
route: ""
route: "/regime/subscriber"
},
{
name: "个人中心",