直播学生

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) {
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>
<div class="cont">
<div class="title">
<div>上课学生</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 class="cont">
<div class="title">
<div>上课学生</div>
<div class="more">查看详情</div>
</div>
<div class="cancel">取消直播</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="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 class="info">
<div class="item" v-for="(i, j) in list" :key="j">
<div style="display: flex">
<img :src="i.img" alt="" />
<div class="stuinfo">
<div>{{ i.name }}</div>
<div class="lessonname">{{ i.interest }}</div>
</div>
</div>
<div class="takehour" v-if="i.status == 1 && livestatus == 2">
参加时长
<div>30min</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="cancel"
v-if="i.status == 2 || (livestatus == 0 && i.status == 1)"
@click="quxiao(j)"
>
取消直播
</div>
<div class="refuse" v-if="i.status == 3">已拒绝</div>
</div>
<div class="takehour">
参加时长
<div>30min</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>
<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>
</template>
<style lang="scss" scoped>
.cont {
width: 316px;
height: 563px;
background-color: #fff;
border-radius: 17px;
padding: 0 28px;
position: relative;
overflow: auto;
.title {
padding: 23px 0 11px 0;
font-size: 13px;
color: #111;
line-height: 1;
border-bottom: 1px solid #eee;
display: flex;
justify-content: space-between;
.more {
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;
width: 316px;
height: 563px;
background-color: #fff;
border-radius: 17px;
padding: 0 28px;
position: relative;
overflow: auto;
.title {
padding: 23px 0 11px 0;
font-size: 13px;
color: #111;
line-height: 1;
border-bottom: 1px solid #eee;
display: flex;
justify-content: space-between;
.more {
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;
margin: auto 0;
text-align: center;
}
> div > img {
width: 57px;
height: 57px;
border-radius: 50%;
background-color: #0f0;
}
}
}
.refuse {
color: #d22c2e;
margin: auto 0;
text-align: center;
}
> div>img {
width: 57px;
height: 57px;
border-radius: 50%;
background-color: #0f0;
}
text-align: center;
}
}
.refuse{
color: #D22C2E;
margin:auto 0;
}
.cancel{
margin:auto 0;
width: 57px;
height: 23px;
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;
.cancel {
margin: auto 0;
width: 57px;
height: 23px;
border: 1px solid #09ae99;
line-height: 23px;
text-align: center;
color: #09ae99;
border-radius: 3px;
}
.modify {
background-color: #08ae98;
.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 {
background-color: #08ae98;
}
.del {
background-color: #d12c2e;
}
}
.del {
background-color: #d12c2e;
}
}
}
</style>
<script lang="ts">
import { defineComponent } from "vue";
import { cancellive } from '@/api';
import { defineComponent, ref, watch } from "vue";
export default defineComponent({
setup(){
return{}
}
props: {
info: Array,
livestatus: Number,
},
setup(props) {
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>

View File

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

View File

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