一部分接口

This commit is contained in:
luyuan 2020-10-15 19:06:30 +08:00
parent 9c0e6ffd39
commit 6102fda7de
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3
2 changed files with 70 additions and 22 deletions

View File

@ -333,4 +333,42 @@ export async function getlanguages(): Promise<Language[]>{
export async function putmember(data: unknown): Promise<Liveaddrule>{ export async function putmember(data: unknown): Promise<Liveaddrule>{
return (await put<Liveaddrule>(`member/${store.state.userinfo.memberid}`, data) ) return (await put<Liveaddrule>(`member/${store.state.userinfo.memberid}`, data) )
}
/**
*
*
*/
interface LiveInfo {
liveid: number;
title: string;
img: string;
fileid: string;
fileurl: string;
fileduration: string;
vodid: string;
vodurl: string;
vodduration: string;
dateline: string;
livetime: number;
livenumber: number;
status: number;
desc: string;
deleted_at: null;
created_at: string;
updated_at: string;
}
interface StudentList {
memberid: number;
name: string;
img: string;
}
export async function getliveinfo(id: number){
const liveinfo = (await get<LiveInfo>(`live/${id}`)).data;
const studentlist = (await get<StudentList[]>("studentLive",{id})).data;
return {...liveinfo,studentlist}
} }

View File

@ -1,42 +1,41 @@
<template> <template>
<div class="livedetail"> <div class="livedetail">
<div class="info"> <div class="info">
<div class="liveplay"> <div class="liveplay">
<liveplay></liveplay> <liveplay></liveplay>
</div>
</div>
<LiveCount></LiveCount> <LiveCount></LiveCount>
</div> </div>
<VideoReview class="review"></VideoReview> <VideoReview class="review" v-if="liveinfo.livestatus == 2"></VideoReview>
</div> </div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.livedetail { .livedetail {
width: 1320px; width: 1320px;
height: 563px; height: 563px;
.info { .info {
width: 1321px; width: 1321px;
display: flex; display: flex;
justify-content:center; justify-content: center;
.liveplay { .liveplay {
background: white; background: white;
border-radius: 18px; border-radius: 18px;
margin-right: 29px; margin-right: 29px;
}
}
.review {
margin-top: 28px;
} }
}
.review {
margin-top: 28px;
}
} }
</style> </style>
<script lang="ts"> <script lang="ts">
import { defineComponent } from "vue"; import { defineComponent, ref } from "vue";
import liveplay from "@/components/LivePlay.vue" import liveplay from "@/components/LivePlay.vue";
import LiveCount from "@/components/LiveCount.vue"; import LiveCount from "@/components/LiveCount.vue";
import VideoReview from "@/components/VideoReview.vue"; import VideoReview from "@/components/VideoReview.vue";
import { useRoute } from 'vue-router'; import { useRoute } from "vue-router";
import { getliveinfo } from "@/api";
export default defineComponent({ export default defineComponent({
components: { components: {
LiveCount, LiveCount,
@ -45,6 +44,17 @@ export default defineComponent({
}, },
setup() { setup() {
console.log(useRoute().query.id); console.log(useRoute().query.id);
const id = useRoute().query.id;
let liveinfo = ref<any>({})
if (typeof id == "string") {
getliveinfo(parseInt(id)).then((res) => {
liveinfo.value = res;
console.log(res)
});
}
return {
liveinfo
}
}, },
}); });
</script> </script>