直播学生

This commit is contained in:
luyuan 2020-10-16 10:47:05 +08:00
parent eef4917466
commit 758f85facf
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3
4 changed files with 187 additions and 142 deletions

View File

@ -475,3 +475,20 @@ export async function getliveinfo(id: number){
export async function getdatelist(start: string, end: string) { export async function getdatelist(start: string, end: string) {
return (await get("teacherCalendar")).data return (await get("teacherCalendar")).data
} }
/**
*
*/
export async function cancellive(id: number, status: number){
const res = await post("cancelLive",{id, status})
if(res.code == 0){
message.success(res.msg);
return true;
}else{
message.error(res.msg);
return false;
}
}

View File

@ -1,163 +1,191 @@
<template> <template>
<div class="cont"> <div class="cont">
<div class="title"> <div class="title">
<div>上课学生</div> <div>上课学生</div>
<div class="more">查看详情</div> <div class="more">查看详情</div>
</div>
<div class="info">
<div class="item">
<div style="display:flex">
<img src="" alt="" />
<div class="stuinfo">
<div>andy</div>
<div class="lessonname">英语 A1</div>
</div>
</div> </div>
<div class="info">
<div class="cancel">取消直播</div> <div class="item" v-for="(i, j) in list" :key="j">
</div> <div style="display: flex">
<img :src="i.img" alt="" />
<div class="item"> <div class="stuinfo">
<div style="display:flex"> <div>{{ i.name }}</div>
<img src="" alt="" /> <div class="lessonname">{{ i.interest }}</div>
<div class="stuinfo"> </div>
<div>andy</div> </div>
<div class="lessonname">英语 A1</div> <div class="takehour" v-if="i.status == 1 && livestatus == 2">
</div>
</div>
<div class="refuse">已拒绝</div>
</div>
<div class="item">
<div style="display:flex">
<img src="" alt="" />
<div class="stuinfo">
<div>andy</div>
<div class="lessonname">英语 A1</div>
</div>
</div>
<div class="takehour">
参加时长 参加时长
<div>30min</div> <div>30min</div>
</div> </div>
</div> <div
<div class="item"> class="cancel"
<div style="display:flex"> v-if="i.status == 2 || (livestatus == 0 && i.status == 1)"
<img src="" alt="" /> @click="quxiao(j)"
<div class="stuinfo"> >
<div>andy</div> 取消直播
<div class="lessonname">英语 A1</div> </div>
</div>
<div class="refuse" v-if="i.status == 3">已拒绝</div>
</div> </div>
<div class="takehour"> <!-- <div class="item">
参加时长 <div style="display:flex">
<div>30min</div> <img src="" alt="" />
<div class="stuinfo">
<div>andy</div>
<div class="lessonname">英语 A1</div>
</div>
</div>
</div> </div>
</div>
<div class="item">
<div style="display:flex">
<img src="" alt="" />
<div class="stuinfo">
<div>andy</div>
<div class="lessonname">英语 A1</div>
</div>
</div>
</div>
<div class="item">
<div style="display:flex">
<img src="" alt="" />
<div class="stuinfo">
<div>andy</div>
<div class="lessonname">英语 A1</div>
</div>
</div>
<div class="takehour">
参加时长
<div>30min</div>
</div>
</div> -->
</div>
</div> </div>
</div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.cont { .cont {
width: 316px; width: 316px;
height: 563px; height: 563px;
background-color: #fff; background-color: #fff;
border-radius: 17px; border-radius: 17px;
padding: 0 28px; padding: 0 28px;
position: relative; position: relative;
overflow: auto; overflow: auto;
.title { .title {
padding: 23px 0 11px 0; padding: 23px 0 11px 0;
font-size: 13px; font-size: 13px;
color: #111; color: #111;
line-height: 1; line-height: 1;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.more { .more {
color: #999999; color: #999999;
font-size: 11px;
}
}
.info {
.item {
display: flex;
align-content: center;
justify-content: space-between;
margin-top: 23px;
font-size: 10px;
.stuinfo {
margin: auto 0;
margin-left: 11px;
color: #111111;
.lessonname {
color: #666666;
}
}
.takehour {
color: #08ae98;
font-size: 11px; font-size: 11px;
}
}
.info {
.item {
display: flex;
align-content: center;
justify-content: space-between;
margin-top: 23px;
font-size: 10px;
.stuinfo {
margin: auto 0;
margin-left: 11px;
color: #111111;
.lessonname {
color: #666666;
}
}
.takehour {
color: #08ae98;
font-size: 11px;
margin: auto 0;
text-align: center;
}
> div > img {
width: 57px;
height: 57px;
border-radius: 50%;
background-color: #0f0;
}
}
}
.refuse {
color: #d22c2e;
margin: auto 0; margin: auto 0;
text-align: center;
}
> div>img {
width: 57px; width: 57px;
height: 57px; text-align: center;
border-radius: 50%;
background-color: #0f0;
}
} }
} .cancel {
.refuse{ margin: auto 0;
color: #D22C2E; width: 57px;
margin:auto 0; height: 23px;
} border: 1px solid #09ae99;
.cancel{ line-height: 23px;
margin:auto 0; text-align: center;
width: 57px; color: #09ae99;
height: 23px; border-radius: 3px;
border: 1px solid #09AE99;
line-height: 23px;
text-align: center;
color: #09AE99;
border-radius: 3px;
}
.button {
position: absolute;
width: 260px;
bottom: 28px;
display: flex;
justify-content: space-between;
> div {
width: 114px;
height: 23px;
border-radius: 3px;
font-size: 10px;
color: #fff;
line-height: 23px;
text-align: center;
} }
.modify { .button {
background-color: #08ae98; position: absolute;
width: 260px;
bottom: 28px;
display: flex;
justify-content: space-between;
> div {
width: 114px;
height: 23px;
border-radius: 3px;
font-size: 10px;
color: #fff;
line-height: 23px;
text-align: center;
}
.modify {
background-color: #08ae98;
}
.del {
background-color: #d12c2e;
}
} }
.del {
background-color: #d12c2e;
}
}
} }
</style> </style>
<script lang="ts"> <script lang="ts">
import { defineComponent } from "vue"; import { cancellive } from '@/api';
import { defineComponent, ref, watch } from "vue";
export default defineComponent({ export default defineComponent({
setup(){ props: {
info: Array,
livestatus: Number,
},
setup(props) {
return{} let list = ref<any>(props.info);
} watch(()=> props.info,()=>{
// console.log(props.info)
list.value = props.info
})
async function quxiao(index: number){
console.log(index, list.value[index])
const res = await cancellive(list.value[index].memberid, 3);
if(res){
list.value[index].status = 3
}
}
return {
list,
quxiao
};
},
}); });
</script> </script>

View File

@ -13,7 +13,7 @@
</div> </div>
<div> <div>
<img src="@/static/images/livetimetake.png" alt="" class="icon"> <img src="@/static/images/livetimetake.png" alt="" class="icon">
<span>{{info.vodduration}}min</span> <span>{{info.livetime}}min</span>
</div> </div>
<div> <div>
<img src="@/static/images/shoucang.png" alt="" class="icon"> <img src="@/static/images/shoucang.png" alt="" class="icon">

View File

@ -5,7 +5,7 @@
<liveplay :info="liveinfo"></liveplay> <liveplay :info="liveinfo"></liveplay>
</div> </div>
<LiveCount></LiveCount> <LiveCount :info="liveinfo.studentlist" :livestatus="liveinfo.livestatus" :zid="liveinfo.liveid"></LiveCount>
</div> </div>
<VideoReview class="review" v-if="liveinfo.livestatus == 2"></VideoReview> <VideoReview class="review" v-if="liveinfo.livestatus == 2"></VideoReview>
</div> </div>