zj #45
@ -3,7 +3,7 @@ import store from '@/store';
|
|||||||
import { LiveList, LoginData, UserInfo, VideoInfo } from '@/types';
|
import { LiveList, LoginData, UserInfo, VideoInfo } from '@/types';
|
||||||
import { saveValue } from '@/utils/common';
|
import { saveValue } from '@/utils/common';
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
import { get, post, setToken } from './base'
|
import { del, get, post, setToken } from './base'
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -178,6 +178,9 @@ export async function liveadd(data:any) {
|
|||||||
*/
|
*/
|
||||||
export async function videoadd(data:any) {
|
export async function videoadd(data:any) {
|
||||||
const res=await post<Liveaddrule>('video',data)
|
const res=await post<Liveaddrule>('video',data)
|
||||||
|
if(res.code==0){
|
||||||
|
message.success("发布成功")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -201,25 +204,38 @@ interface VideoDetail{
|
|||||||
watch:number
|
watch:number
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function videodetail(data?:any) {
|
export async function videodetail(data?:any,ifupdate?:number) {
|
||||||
const res=await get<VideoDetail>('video/'+data)
|
const res=await get<VideoDetail>('video/'+data)
|
||||||
console.log(res,"lllk")
|
if(ifupdate){
|
||||||
return {
|
console.log(111)
|
||||||
videoid: res.data.videoid,
|
return{
|
||||||
memberid: res.data.memberid,
|
title: res.data.title,
|
||||||
title: res.data.title,
|
img: res.data.img,
|
||||||
img: res.data.img,
|
fileid: res.data.fileid,
|
||||||
fileid: res.data.fileid,
|
fileurl: res.data.fileurl,
|
||||||
fileurl: res.data.fileurl,
|
fileduration: res.data.fileduration,
|
||||||
fileduration: res.data.fileduration,
|
desc:res.data.desc,
|
||||||
status: res.data.status,
|
video:[res.data.fileurl],
|
||||||
desc: res.data.desc,
|
}
|
||||||
deleted_at: res.data.deleted_at,
|
}else{
|
||||||
created_at: res.data.created_at,
|
return {
|
||||||
updated_at: res.data.updated_at,
|
videoid: res.data.videoid,
|
||||||
watch:res.data.watch,
|
memberid: res.data.memberid,
|
||||||
share:res.data.share
|
title: res.data.title,
|
||||||
|
img: res.data.img,
|
||||||
|
fileid: res.data.fileid,
|
||||||
|
fileurl: res.data.fileurl,
|
||||||
|
fileduration: res.data.fileduration,
|
||||||
|
status: res.data.status,
|
||||||
|
desc: res.data.desc,
|
||||||
|
deleted_at: res.data.deleted_at,
|
||||||
|
created_at: res.data.created_at,
|
||||||
|
updated_at: res.data.updated_at,
|
||||||
|
watch:res.data.watch,
|
||||||
|
share:res.data.share
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,7 +245,11 @@ export async function videodetail(data?:any) {
|
|||||||
* 删除视频
|
* 删除视频
|
||||||
*/
|
*/
|
||||||
export async function videodel(data:any) {
|
export async function videodel(data:any) {
|
||||||
const res = await post<Liveaddrule>('live',data);
|
const res = await del<Liveaddrule>('video/'+data);
|
||||||
|
if(res.code==0){
|
||||||
|
message.success("删除成功")
|
||||||
|
}
|
||||||
|
|
||||||
console.log(res)
|
console.log(res)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,22 +5,36 @@
|
|||||||
<div class="item">
|
<div class="item">
|
||||||
<img src="@/static/images/livewatch.png" alt="" />
|
<img src="@/static/images/livewatch.png" alt="" />
|
||||||
<span> 上传时间: </span>
|
<span> 上传时间: </span>
|
||||||
{{date}}
|
<span>{{date}}</span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<img src="@/static/images/watch.png" alt="" />
|
<img src="@/static/images/watch.png" alt="" />
|
||||||
<span>播放量</span>
|
<span>播放量</span>
|
||||||
{{watch}}
|
<span> {{watch}}</span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<img src="@/static/images/share.png" alt="" />
|
<img src="@/static/images/share.png" alt="" />
|
||||||
<span>转发量</span>
|
<span>转发量</span>
|
||||||
{{share}}
|
<span>{{share}}</span>
|
||||||
|
</div>
|
||||||
|
<div class="item item1" v-if="status==0">
|
||||||
|
<span>状态</span>
|
||||||
|
<span class="status">正在审核中,情耐心等待</span>
|
||||||
|
</div>
|
||||||
|
<div class="item item1" v-if="status==2">
|
||||||
|
<span>状态</span>
|
||||||
|
<span class="status1">审核未通过</span>
|
||||||
|
</div>
|
||||||
|
<div class="item item1" v-if="status==1">
|
||||||
|
<span style="flex-shrink:0">原因</span>
|
||||||
|
<span class="status">您的视频中含有大量敏感词汇,请修改后再次上传,感谢您对Beelink的技术支持 </span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="button">
|
<div class="button">
|
||||||
<div class="modify">修改该视频</div>
|
<div class="modify" @click="update(videoid)">修改该视频</div>
|
||||||
<div class="del">删除该视频</div>
|
<div class="del" @click="drop(videoid)">删除该视频</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -40,6 +54,17 @@
|
|||||||
border-bottom: 1px solid #eee;
|
border-bottom: 1px solid #eee;
|
||||||
}
|
}
|
||||||
.info {
|
.info {
|
||||||
|
.item1{
|
||||||
|
position: relative;
|
||||||
|
left:-12px
|
||||||
|
}
|
||||||
|
.status{
|
||||||
|
color: #07AD97!important;
|
||||||
|
// font-weight: bold;
|
||||||
|
}
|
||||||
|
.status1{
|
||||||
|
color: #D12C2D!important;
|
||||||
|
}
|
||||||
.item {
|
.item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-content: center;
|
align-content: center;
|
||||||
@ -47,7 +72,7 @@
|
|||||||
> img {
|
> img {
|
||||||
width: 24px;
|
width: 24px;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
background-color: #0f0;
|
// background-color: #0f0;
|
||||||
}
|
}
|
||||||
> span {
|
> span {
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
@ -81,7 +106,10 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { videodel } from '@/api';
|
||||||
|
import router from '@/router';
|
||||||
import { defineComponent } from "vue";
|
import { defineComponent } from "vue";
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props:{
|
props:{
|
||||||
@ -93,6 +121,26 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
share:{
|
share:{
|
||||||
type:Number
|
type:Number
|
||||||
|
},
|
||||||
|
status:{
|
||||||
|
type:Number
|
||||||
|
},
|
||||||
|
videoid:{
|
||||||
|
type:Number
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setup(){
|
||||||
|
console.log(1)
|
||||||
|
function drop(e: number){
|
||||||
|
console.log(e)
|
||||||
|
videodel(e)
|
||||||
|
}
|
||||||
|
function update(e: number) {
|
||||||
|
router.push("/mine/video?id="+e)
|
||||||
|
}
|
||||||
|
return{
|
||||||
|
drop,
|
||||||
|
update
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -103,13 +103,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, reactive, Ref, ref, toRaw } from "vue";
|
import { defineComponent, onMounted, reactive, Ref, ref, toRaw } from "vue";
|
||||||
import { PlaySquareOutlined, PlusOutlined } from "@ant-design/icons-vue";
|
import { PlaySquareOutlined, PlusOutlined } from "@ant-design/icons-vue";
|
||||||
import NavBottom from "@/components/NavBottom.vue";
|
import NavBottom from "@/components/NavBottom.vue";
|
||||||
import { previewCover } from "@/utils/common";
|
import { previewCover } from "@/utils/common";
|
||||||
import { FromSend, ImgInfo, VideoInfo } from "@/types";
|
import { FromSend, ImgInfo, VideoInfo } from "@/types";
|
||||||
import { uploadflie } from "@/utils/vod";
|
import { uploadflie } from "@/utils/vod";
|
||||||
import { videoadd } from "@/api";
|
import { videoadd, videodetail } from "@/api";
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "ReleaseWebcast",
|
name: "ReleaseWebcast",
|
||||||
@ -125,7 +126,7 @@ export default defineComponent({
|
|||||||
const fileList: Array<FileItem> = [];
|
const fileList: Array<FileItem> = [];
|
||||||
|
|
||||||
// 表单数据
|
// 表单数据
|
||||||
const form = reactive({
|
const form = ref<any>({
|
||||||
title: "",
|
title: "",
|
||||||
img: "",
|
img: "",
|
||||||
fileid: "",
|
fileid: "",
|
||||||
@ -134,6 +135,14 @@ export default defineComponent({
|
|||||||
desc: "",
|
desc: "",
|
||||||
video:[""],
|
video:[""],
|
||||||
});
|
});
|
||||||
|
onMounted(async () => {
|
||||||
|
if(useRoute().query.id){
|
||||||
|
console.log(useRoute().query.id)
|
||||||
|
form.value = await videodetail(useRoute().query.id,1)
|
||||||
|
console.log(form.value,"fornm")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// 是否显示封面预览 封面的路径
|
// 是否显示封面预览 封面的路径
|
||||||
const viewCover: Ref<boolean> = ref(false),
|
const viewCover: Ref<boolean> = ref(false),
|
||||||
previewImage: Ref<string> = ref("");
|
previewImage: Ref<string> = ref("");
|
||||||
@ -169,9 +178,9 @@ export default defineComponent({
|
|||||||
* @param index 删除文件的索引
|
* @param index 删除文件的索引
|
||||||
*/
|
*/
|
||||||
function removeFile(index: number): void {
|
function removeFile(index: number): void {
|
||||||
const newFileList = form.video.slice();
|
const newFileList = form.value.video.slice();
|
||||||
newFileList.splice(index, 1);
|
newFileList.splice(index, 1);
|
||||||
form.video = newFileList;
|
form.value.video = newFileList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -191,7 +200,7 @@ export default defineComponent({
|
|||||||
uploadpicprogress.value = info.percent.toFixed(2) * 100;
|
uploadpicprogress.value = info.percent.toFixed(2) * 100;
|
||||||
});
|
});
|
||||||
console.log(res);
|
console.log(res);
|
||||||
form.img = res.video.url;
|
form.value.img = res.video.url;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -200,12 +209,12 @@ export default defineComponent({
|
|||||||
const uploadprogress: Ref<number> = ref(0);
|
const uploadprogress: Ref<number> = ref(0);
|
||||||
async function uploads(file: AntUpload) {
|
async function uploads(file: AntUpload) {
|
||||||
uploadprogress.value=0
|
uploadprogress.value=0
|
||||||
form.video=[""]
|
form.value.video=[""]
|
||||||
console.log(file);
|
console.log(file);
|
||||||
videofile.value = file.file;
|
videofile.value = file.file;
|
||||||
videos.value[0].addEventListener("durationchange", () => {
|
videos.value[0].addEventListener("durationchange", () => {
|
||||||
console.log(videos.value[0].duration);
|
console.log(videos.value[0].duration);
|
||||||
form.fileduration = videos.value[0].duration;
|
form.value.fileduration = videos.value[0].duration;
|
||||||
});
|
});
|
||||||
let res = await uploadflie(file.file, (info: any) => {
|
let res = await uploadflie(file.file, (info: any) => {
|
||||||
console.log(info);
|
console.log(info);
|
||||||
@ -213,9 +222,9 @@ export default defineComponent({
|
|||||||
});
|
});
|
||||||
console.log(res);
|
console.log(res);
|
||||||
|
|
||||||
form.fileid = res.fileId;
|
form.value.fileid = res.fileId;
|
||||||
form.fileurl = res.video.url;
|
form.value.fileurl = res.video.url;
|
||||||
form.video[0]=res.video.url
|
form.value.video[0]=res.video.url
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -223,8 +232,8 @@ export default defineComponent({
|
|||||||
*/
|
*/
|
||||||
const onSubmit = async (e: FromSend) => {
|
const onSubmit = async (e: FromSend) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
console.log(toRaw(form), 111);
|
console.log(toRaw(form.value), 111);
|
||||||
videoadd(toRaw(form));
|
// videoadd(toRaw(form));
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<div class="videoinfo">
|
<div class="videoinfo">
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<VideoPlay :url="result.fileurl"></VideoPlay>
|
<VideoPlay :url="result.fileurl"></VideoPlay>
|
||||||
<VideoCont :date="result.created_at" :watch="result.watch" :share="result.share"></VideoCont>
|
<VideoCont :videoid="result.videoid" :date="result.created_at" :watch="result.watch" :share="result.share" :status="result.status"></VideoCont>
|
||||||
</div>
|
</div>
|
||||||
<VideoReview class="review" ></VideoReview>
|
<VideoReview class="review" ></VideoReview>
|
||||||
</div>
|
</div>
|
||||||
@ -24,8 +24,7 @@
|
|||||||
import { defineComponent, onMounted, ref } from 'vue';
|
import { defineComponent, onMounted, ref } from 'vue';
|
||||||
import VideoPlay from "@/components/VideoPlay.vue"
|
import VideoPlay from "@/components/VideoPlay.vue"
|
||||||
import VideoCont from "@/components/VideoCont.vue"
|
import VideoCont from "@/components/VideoCont.vue"
|
||||||
import VideoReview from "@/components/VideoReview.vue"
|
import VideoReview from "@/components/VideoReview.vue";
|
||||||
import router from '@/router';
|
|
||||||
import { videodetail } from '@/api';
|
import { videodetail } from '@/api';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
@ -39,7 +38,7 @@ export default defineComponent({
|
|||||||
console.log(useRoute().query)
|
console.log(useRoute().query)
|
||||||
const result=ref({})
|
const result=ref({})
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
result.value= await videodetail(useRoute().query.id)
|
result.value= await videodetail(useRoute().query.id)
|
||||||
})
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user