beelink/src/components/VideoCont.vue

181 lines
4.4 KiB
Vue

<template>
<div class="cont">
<div class="title">{{lan.$t('shipinshuju')}}</div>
<div class="info">
<div class="item">
<img src="@/static/images/livewatch.png" alt="" />
<span> {{lan.$t('shangchuanshijian')}} </span>
<span>{{date}}</span>
</div>
<div class="item">
<img src="@/static/images/watch.png" alt="" />
<span>{{lan.$t('bofangliang')}}</span>
<span> {{watch}}</span>
</div>
<div class="item">
<img src="@/static/images/share.png" alt="" />
<span>{{lan.$t('zhuanfaliang')}}</span>
<span>{{share}}</span>
</div>
<div class="item item1" v-if="status==0">
<span>{{lan.$t('zhuangtai')}}</span>
<span class="status">{{lan.$t('shenheing')}}</span>
</div>
<!-- <div class="item item1" v-if="status==1">
<span>{{lan.$t('zhuangtai')}}</span>
<span class="status1">{{lan.$t('shenheing')}}</span>
</div> -->
<div class="item item1" v-if="status==2">
<span>{{lan.$t('zhuangtai')}}</span>
<span class="status1" style="color: #D12C2E">{{lan.$t('shenheweitongguo')}}</span>
</div>
<div class="item item1" v-if="status==2">
<span style="flex-shrink:0">{{lan.$t('yuanyin')}}</span>
<span> {{lan.$t('yuanyintext')}} </span>
</div>
</div>
<div class="button">
<div class="modify" @click="update(videoid)">{{lan.$t('xiugaishipin')}}</div>
<div class="del" @click="drop(videoid)">{{lan.$t('shanchushipin')}}</div>
<a-modal
title="确认删除"
v-model:visible="visible"
:confirm-loading="confirmLoading"
@ok="handleOk"
>
<p>{{lan.$t('querenshanchu')}}</p>
</a-modal>
</div>
</div>
</template>
<style lang="scss" scoped>
.cont {
width: 316px;
height: 563px;
background-color: #fff;
border-radius: 17px;
padding: 0 28px;
position: relative;
.title {
padding: 23px 0 11px 0;
font-size: 13px;
color: #111;
line-height: 1;
border-bottom: 1px solid #eee;
}
.info {
.item1{
position: relative;
left:-12px
}
.status{
color: #07AD97!important;
// font-weight: bold;
}
.status1{
color: #D12C2D!important;
}
.item {
display: flex;
align-content: center;
margin-top: 23px;
> img {
width: 24px;
height: 24px;
// background-color: #0f0;
}
> span {
font-size: 11px;
color: #666;
margin-left: 10px;
}
}
}
.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;
cursor: pointer;
}
.modify {
background-color: #08ae98;
}
.del {
background-color: #d12c2e;
}
}
}
</style>
<script lang="ts">
import { videodel } from '@/api';
import router from '@/router';
import { useI18n } from '@/utils/i18n';
import { defineComponent, ref } from "vue";
import { useRoute } from 'vue-router';
export default defineComponent({
props:{
date:{
type:String
},
watch:{
type:Number
},
share:{
type:Number
},
status:{
type:Number
},
videoid:{
type:Number
}
},
setup(){
const lan: any = useI18n();
console.log(1)
const visible = ref(false);
const confirmLoading = ref(false);
let id = 0;
function drop(e: number){
console.log(e);
id = e;
visible.value = true;
}
function update(e: number) {
router.push("/mine/video?id="+e)
}
function handleOk() {
confirmLoading.value = true;
videodel(id).then(()=>{
visible.value = false;
confirmLoading.value = false;
router.back()
})
}
return{
drop,
update,
confirmLoading,
visible,
handleOk,
lan
}
}
});
</script>