一部分接口
This commit is contained in:
parent
9c0e6ffd39
commit
6102fda7de
@ -334,3 +334,41 @@ export async function getlanguages(): Promise<Language[]>{
|
||||
export async function putmember(data: unknown): Promise<Liveaddrule>{
|
||||
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}
|
||||
}
|
@ -3,12 +3,11 @@
|
||||
<div class="info">
|
||||
<div class="liveplay">
|
||||
<liveplay></liveplay>
|
||||
|
||||
</div>
|
||||
|
||||
<LiveCount></LiveCount>
|
||||
</div>
|
||||
<VideoReview class="review"></VideoReview>
|
||||
<VideoReview class="review" v-if="liveinfo.livestatus == 2"></VideoReview>
|
||||
</div>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
@ -23,7 +22,6 @@
|
||||
background: white;
|
||||
border-radius: 18px;
|
||||
margin-right: 29px;
|
||||
|
||||
}
|
||||
}
|
||||
.review {
|
||||
@ -32,11 +30,12 @@
|
||||
}
|
||||
</style>
|
||||
<script lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
import liveplay from "@/components/LivePlay.vue"
|
||||
import { defineComponent, ref } from "vue";
|
||||
import liveplay from "@/components/LivePlay.vue";
|
||||
import LiveCount from "@/components/LiveCount.vue";
|
||||
import VideoReview from "@/components/VideoReview.vue";
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useRoute } from "vue-router";
|
||||
import { getliveinfo } from "@/api";
|
||||
export default defineComponent({
|
||||
components: {
|
||||
LiveCount,
|
||||
@ -45,6 +44,17 @@ export default defineComponent({
|
||||
},
|
||||
setup() {
|
||||
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>
|
Loading…
Reference in New Issue
Block a user