beelink/src/components/LiveCount.vue

303 lines
8.1 KiB
Vue
Raw Normal View History

2020-10-10 03:33:21 +00:00
<template>
2020-10-16 02:47:05 +00:00
<div class="cont">
<div class="title">
2020-10-29 09:50:26 +00:00
<div>{{lan.$t('shangkexuesheng')}}</div>
<div class="more" @click="toxq">{{lan.$t('chakanxiangqing')}}</div>
2020-10-10 03:33:21 +00:00
</div>
2020-10-16 02:47:05 +00:00
<div class="info">
<div class="item" v-for="(i, j) in list" :key="j">
<div style="display: flex">
2020-10-21 02:10:40 +00:00
<img :src="i.img" alt="" />
<div class="stuinfo">
2020-10-23 01:00:02 +00:00
<div>{{ i.name }} {{zid}}</div>
2020-10-21 02:10:40 +00:00
<div class="lessonname">{{ i.interest }}</div>
</div>
2020-10-16 02:47:05 +00:00
</div>
<div class="takehour" v-if="i.status == 1 && livestatus == 2">
2020-10-29 09:50:26 +00:00
{{lan.$t('canjiashichang')}}
2020-10-30 01:54:39 +00:00
<div>{{i.length}}min</div>
2020-10-16 02:47:05 +00:00
</div>
<div
2020-10-21 02:10:40 +00:00
class="cancel"
v-if="i.status == 2 || (livestatus == 0 && i.status == 1)"
@click="quxiao(j)"
2020-10-16 02:47:05 +00:00
>
2020-10-29 09:50:26 +00:00
{{lan.$t('quxiaozhibo')}}
2020-10-16 02:47:05 +00:00
</div>
2020-10-10 03:33:21 +00:00
2020-10-29 09:50:26 +00:00
<div class="refuse" v-if="i.status == 3">{{lan.$t('yijujue')}}</div>
2020-10-10 03:33:21 +00:00
</div>
2020-10-21 03:48:28 +00:00
<div class="modal-container">
<a-modal
centered
:footer="null"
:getContainer="modalNode"
dialogClass="modal-dialog"
v-model:visible="updatePhoneVisible"
@cancel="hidePhoneModal"
>
<template v-slot:closeIcon>
<img src="@/static/images/delete.png" class="close" />
</template>
<!-- 换绑手机号第一步 -->
<div class="yuanyin">
2020-10-29 09:50:26 +00:00
{{lan.$t('jujueyuanyintext')}}
2020-10-21 03:48:28 +00:00
</div>
<div class="body">
2020-10-29 09:50:26 +00:00
<div class="jubao">{{lan.$t('juejueyuanyin')}}</div>
2020-10-21 03:48:28 +00:00
<a-textarea
v-model:value="text"
class="text"
/>
</div>
<div class="submit-btn" @click="sum">
2020-10-29 09:50:26 +00:00
{{lan.$t('querenjujue')}}
2020-10-21 03:48:28 +00:00
</div>
</a-modal>
</div>
2020-10-10 03:33:21 +00:00
2020-10-16 02:47:05 +00:00
<!-- <div class="item">
<div style="display:flex">
<img src="" alt="" />
<div class="stuinfo">
<div>andy</div>
<div class="lessonname">英语 A1</div>
</div>
</div>
2020-10-10 03:33:21 +00:00
</div>
2020-10-16 02:47:05 +00:00
<div class="item">
<div style="display:flex">
<img src="" alt="" />
<div class="stuinfo">
<div>andy</div>
<div class="lessonname">英语 A1</div>
</div>
</div>
2020-10-10 03:33:21 +00:00
2020-10-16 02:47:05 +00:00
2020-10-10 03:33:21 +00:00
</div>
2020-10-16 02:47:05 +00:00
<div class="item">
<div style="display:flex">
<img src="" alt="" />
<div class="stuinfo">
<div>andy</div>
<div class="lessonname">英语 A1</div>
</div>
</div>
2020-10-10 03:33:21 +00:00
2020-10-16 02:47:05 +00:00
<div class="takehour">
参加时长
<div>30min</div>
</div>
</div> -->
</div>
2020-10-10 03:33:21 +00:00
</div>
</template>
<style lang="scss" scoped>
.cont {
2020-10-16 02:47:05 +00:00
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;
2020-10-31 06:00:07 +00:00
cursor: pointer;
2020-10-16 02:47:05 +00:00
}
2020-10-10 03:33:21 +00:00
}
2020-10-16 02:47:05 +00:00
.info {
.item {
2020-10-21 02:10:40 +00:00
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%;
2020-10-16 02:47:05 +00:00
}
}
}
.refuse {
color: #d22c2e;
2020-10-10 03:33:21 +00:00
margin: auto 0;
width: 57px;
2020-10-16 02:47:05 +00:00
text-align: center;
2020-10-10 03:33:21 +00:00
}
2020-10-16 02:47:05 +00:00
.cancel {
margin: auto 0;
width: 57px;
height: 23px;
border: 1px solid #09ae99;
line-height: 23px;
text-align: center;
2020-10-31 06:00:07 +00:00
cursor: pointer;
2020-10-16 02:47:05 +00:00
color: #09ae99;
border-radius: 3px;
2020-10-10 03:33:21 +00:00
}
2020-10-16 02:47:05 +00:00
.button {
position: absolute;
width: 260px;
bottom: 28px;
display: flex;
justify-content: space-between;
> div {
2020-10-21 02:10:40 +00:00
width: 114px;
height: 23px;
border-radius: 3px;
font-size: 10px;
color: #fff;
line-height: 23px;
text-align: center;
2020-10-16 02:47:05 +00:00
}
.modify {
2020-10-21 02:10:40 +00:00
background-color: #08ae98;
2020-10-16 02:47:05 +00:00
}
.del {
2020-10-21 02:10:40 +00:00
background-color: #d12c2e;
2020-10-16 02:47:05 +00:00
}
2020-10-10 03:33:21 +00:00
}
2020-10-21 03:48:28 +00:00
::v-deep(.modal-dialog) {
border-radius: 28px;
overflow: hidden;
padding: 0;
width: 569px !important;
.close {
width: 14px;
height: 14px;
}
.yuanyin{
margin-top: 13px;
font-size: 11px;
color: #111;
font-weight: bold;
}
.body{
display: flex;
margin-top: 34px;
.jubao{
font-size: 11px;
color: #808080;
margin-right: 28px;
}
.text{
width: 359px;
height: 85px;
font-size: 11px;
}
}
.submit-btn {
width: 63px;
height: 23px;
background: #08AE98;
border-radius: 3px;
font-size: 10px;
font-weight: 500;
color: #FFFFFF;
text-align: center;
line-height: 23px;
cursor: pointer;
user-select: none;
margin-top: 57px;
}
}
2020-10-10 03:33:21 +00:00
}
</style>
<script lang="ts">
2020-10-21 03:48:28 +00:00
import { cancellive, refusedtolive } from '@/api';
2020-10-23 01:00:02 +00:00
import router from '@/router';
2020-10-29 09:50:26 +00:00
import { useI18n } from '@/utils/i18n';
2020-10-21 03:48:28 +00:00
import { defineComponent, ref, toRaw, watch } from "vue";
2020-10-10 03:33:21 +00:00
2020-10-10 07:31:18 +00:00
export default defineComponent({
2020-10-16 02:47:05 +00:00
props: {
info: Array,
livestatus: Number,
2020-10-23 01:00:02 +00:00
zid:Number
2020-10-16 02:47:05 +00:00
},
setup(props) {
2020-10-29 09:50:26 +00:00
const lan: any = useI18n();
2020-10-21 03:48:28 +00:00
const modalNode = () => document.getElementsByClassName('modal-container')[0]
const updatePhoneVisible = ref(false)
const sid = ref(0)
const list = ref<any>(props.info);
const text = ref("")
2020-10-16 02:47:05 +00:00
watch(()=> props.info,()=>{
// console.log(props.info)
list.value = props.info
})
async function quxiao(index: number){
2020-10-21 03:48:28 +00:00
console.log(index, list.value[index]);
sid.value = index;
updatePhoneVisible.value = true;
// const res = await cancellive(list.value[index].memberid, 3);
// if(res){
// list.value[index].status = 3
// }
}
function hidePhoneModal(): void {
updatePhoneVisible.value = false;
text.value = "";
}
async function sum(){
console.log(sid.value, text.value)
const res = await refusedtolive(list.value[sid.value].signupid, text.value);
2020-10-16 02:47:05 +00:00
if(res){
2020-10-21 03:48:28 +00:00
list.value[sid.value].status = 3;
hidePhoneModal();
2020-10-16 02:47:05 +00:00
}
}
2020-10-23 01:00:02 +00:00
function toxq(){
router.push({path:"/regime/studentlist",query:{liveid:props.zid}})
console.log(props.zid,"aaa")
}
2020-10-16 02:47:05 +00:00
return {
list,
2020-10-21 03:48:28 +00:00
quxiao,
modalNode,
updatePhoneVisible,
hidePhoneModal,
sum,
2020-10-23 01:00:02 +00:00
text,
2020-10-29 09:50:26 +00:00
toxq,
lan
2020-10-16 02:47:05 +00:00
};
},
2020-10-10 07:31:18 +00:00
});
2020-10-10 03:33:21 +00:00
</script>