Merge pull request 'zj' (#41) from zj into master

Reviewed-on: http://git.luyuan.tk/luyuan/beelink/pulls/41
This commit is contained in:
asd 2020-10-14 15:32:31 +08:00
commit c46671ef8e
7 changed files with 622 additions and 377 deletions

View File

@ -1,6 +1,6 @@
import router from '@/router'; import router from '@/router';
import store from '@/store'; import store from '@/store';
import { LiveList, LoginData, UserInfo } 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 { get, post, setToken } from './base'
@ -19,7 +19,7 @@ export async function loginpass(phone: string, password: string){
message.error(res.msg) message.error(res.msg)
}else{ }else{
console.log(res.data) console.log(res.data)
if(!saveValue("token", res.data?.api_token) && !saveValue("memberid", res.data?.memberid) ){ if(!saveValue("token", res.data.api_token) && !saveValue("memberid", res.data.memberid) ){
message.error("存储错误, 请允许网页使用本地存储!") message.error("存储错误, 请允许网页使用本地存储!")
}else{ }else{
setToken(); setToken();
@ -35,30 +35,30 @@ export async function loginpass(phone: string, password: string){
*/ */
export async function userinfo(){ export async function userinfo(){
const user = await get<UserInfo>('personalInfo'); const user = await get<UserInfo>('personalInfo');
// console.log(user.data?.img) // console.log(user.data.img)
if(user.code == 1001){ if(user.code == 1001){
// router.push("/") // router.push("/")
return '未登录'; return '未登录';
} }
return { return {
head: user.data?.img, head: user.data.img,
username: user.data?.name, username: user.data.name,
language: user.data?.language, language: user.data.language,
currency: user.data?.currency, currency: user.data.currency,
zoneStr: user.data?.zoneStr, zoneStr: user.data.zoneStr,
memberid: user.data?.memberid, memberid: user.data.memberid,
country: user.data?.country, country: user.data.country,
live: user.data?.live, live: user.data.live,
mtongue: user.data?.mtongue, mtongue: user.data.mtongue,
tlanguage: user.data?.tlanguage, tlanguage: user.data.tlanguage,
willsay: user.data?.willsay, willsay: user.data.willsay,
interest: user.data?.interest, interest: user.data.interest,
mobile: user.data?.mobile, mobile: user.data.mobile,
email: user.data?.email, email: user.data.email,
birthday: user.data?.birthday, birthday: user.data.birthday,
video: user.data?.video, video: user.data.video,
desc: user.data?.desc, desc: user.data.desc,
money: user.data?.money money: user.data.money
} }
} }
@ -123,9 +123,10 @@ interface VideoList{
statusname: string; statusname: string;
} }
export async function getvideolist() { export async function getvideolist(): Promise<VideoList[]> {
const res = await get<Array<VideoList>>('video') const res = await get<Array<VideoList>>('video')
console.log(res) console.log(res)
return res.data
} }
/** /**
@ -134,7 +135,7 @@ export async function getvideolist() {
export async function getlivelist(data?:any) { export async function getlivelist(data?:any):Promise<LiveList[]> {
const res = await get<Array<LiveList>>('live',data); const res = await get<Array<LiveList>>('live',data);
// console.log(res); // console.log(res);
return res.data return res.data
@ -154,9 +155,9 @@ export async function getstatisticlist() {
const res = await get<StatisticList>('statistics'); const res = await get<StatisticList>('statistics');
// console.log(res) // console.log(res)
return { return {
liveInfo: res.data?.liveInfo, liveInfo: res.data.liveInfo,
videoInfo:res.data?.videoInfo, videoInfo:res.data.videoInfo,
studentInfo:res.data?.studentInfo studentInfo:res.data.studentInfo
} }
} }
@ -170,6 +171,47 @@ interface Liveaddrule{
export async function liveadd(data:any) { export async function liveadd(data:any) {
const res = await post<Liveaddrule>('live',data); const res = await post<Liveaddrule>('live',data);
console.log(res) console.log(res)
}
/**
*
*/
export async function videoadd(data:any) {
const res=await post<Liveaddrule>('video',data)
}
/**
*
*/
interface VideoDetail{
videoid: number;
memberid: number;
title: string;
img: string;
fileid: string;
fileurl: string;
fileduration: string;
status: number;
desc: string;
deleted_at: null;
created_at: string;
updated_at: string;
}
export async function videodetail(data?:any) {
const res=await get<VideoDetail>('video/'+data)
return res.data
}
/**
*
*/
export async function videodel(data:any) {
const res = await post<Liveaddrule>('live',data);
console.log(res)
}
} }

View File

@ -1,34 +1,35 @@
<template> <template>
<div class="videoitem" @click="navto()"> <div class="videoitem" @click="navto(videoid)">
<img src="" alt="" class="cover">
<img :src="img" alt="" class="cover">
<img src="@/static/images/play.png" alt="" class="play"> <img src="@/static/images/play.png" alt="" class="play">
<div class="title"> <div class="title">
sadghaskghdfjkaghjkfha {{title}} {{videoid}}
<span class="lv">7.3</span> <span class="lv">{{score}}</span>
</div> </div>
<div class="info"> <div class="info">
<div class="datetime"> <div class="datetime">
<span>2020-09-11</span> <span>{{date.split(" ")[0]}}</span>
<span class="time">09:30</span> <span class="time">{{date.split(" ")[1]}}</span>
</div> </div>
<div class="feature"> <div class="feature">
<div> <div>
<img src="@/static/images/watch.png" alt=""> <img src="@/static/images/watch.png" alt="">
<span>123</span> <span>{{watch}}</span>
</div> </div>
<div> <div>
<img src="@/static/images/share.png" alt=""> <img src="@/static/images/share.png" alt="">
<span>3</span> <span>{{share}}</span>
</div> </div>
</div> </div>
</div> </div>
<div class="state audit" v-if="type==1"> <div class="state audit" v-if="status==0">
审核中 审核中
</div> </div>
<div class="state audit fail" v-if="type==2"> <div class="state audit fail" v-if="status==2">
未通过 未通过
</div> </div>
<div class="state audit" v-if="type==3"> <div class="state audit" v-if="status==1">
已发布 已发布
</div> </div>
</div> </div>
@ -133,18 +134,45 @@ import { defineComponent } from 'vue';
export default defineComponent({ export default defineComponent({
props:{ props:{
videoid:{
type:Number
},
type: { type: {
type: Number, type: Number,
default:1 default:1
},
img:{
type:String
},
title:{
type:String
},
score:{
type:String
},
date:{
type:String
},
takehour:{
type:String
},
watch:{
type:Number
},
share:{
type:Number
},
status:{
type:Number
} }
}, },
setup() { setup() {
function navto(){ function navto(e: number){
router.push("/regime/videoinfo") router.push("/regime/videoinfo?id="+e)
} }
return { return {
navto navto,
} }
} }
}) })

View File

@ -8,8 +8,8 @@ import * as axios from 'axios';
declare module 'axios' { declare module 'axios' {
export interface CustomSuccessData<T> { export interface CustomSuccessData<T> {
code: number; code: number;
msg?: string; msg: string;
data?: T; data: T;
[keys: string]: any; [keys: string]: any;
} }
} }

View File

@ -3,43 +3,97 @@
<a-form :label-col="labelCol" :wrapper-col="wrapperCol"> <a-form :label-col="labelCol" :wrapper-col="wrapperCol">
<div class="title">上传视频</div> <div class="title">上传视频</div>
<a-form-item label="视频标题"> <a-form-item label="视频标题">
<a-input size="small" v-model:value="form.title" placeholder="请输入您的视频标题" /> <a-input
size="small"
v-model:value="form.title"
placeholder="请输入您的视频标题"
/>
</a-form-item> </a-form-item>
<a-form-item label="视频封面" class="video-cover"> <a-form-item label="视频封面" class="video-cover">
<a-upload <a-upload list-type="picture" :customRequest="uploadspic">
list-type="picture" <div class="upload-image" v-if="!viewCover && form.img.length == 0">
@change="coverChange" <PlusOutlined
> style="fontsize: 22px"
<div class="upload-image" v-if="!viewCover"> v-if="uploadpicprogress == 0"
<PlusOutlined style="fontSize: 22px;" /> />
<a-progress
type="circle"
:percent="uploadpicprogress"
:width="80"
v-else
/>
</div> </div>
<div class="preview-image" v-else> <div class="upload-image" v-else>
<img style="width: 100%" :src="previewImage" /> <img style="width: 100%; height: 100%" :src="form.img" />
</div> </div>
</a-upload> </a-upload>
</a-form-item> </a-form-item>
<a-form-item label="选择视频" class="video-introduction"> <a-form-item label="选择视频" class="video-introduction">
<div class="upload-container"> <div class="upload-container">
<a-upload :beforeUpload="beforeVideoUpload"> <a-upload list-type="picture" :customRequest="uploads" :beforeUpload="beforeVideoUpload">
<div class="upload-image"> <div class="upload-image">
<PlaySquareOutlined style="fontSize: 22px;" /> <PlaySquareOutlined
style="fontsize: 22px"
v-if="uploadprogress == 0"
/>
<a-progress
type="circle"
:percent="uploadprogress"
:width="80"
v-else
/>
<video style="display: none" :src="videofile"></video>
</div>
<div
class="upload-image upload"
style="position: relative"
v-show="false"
>
<video
:src="form.fileurl"
:ref="
(el) => {
videos[0] = el;
}
"
class="upload"
></video>
<!-- <a-progress type="circle" :percent="100" :width="80" style="position:absolute;right:35%"/> -->
</div> </div>
</a-upload> </a-upload>
<!-- 文件列表 --> <!-- 文件列表 -->
<div v-for="(item, index) in form.video" :key="index" class="video-list"> <div v-if="form.video[0].length">
<div
v-for="(item, index) in form.video"
:key="index"
class="video-list"
>
<img src="@/static/images/link.png" class="link" /> <img src="@/static/images/link.png" class="link" />
<span class="one-line-hide">{{ item.name }}</span> <span class="one-line-hide">{{ item.split('/')[item.split('/').length-1] }}</span>
<img src="@/static/images/delete.png" @click="removeFile(index)" class="del" /> <img
src="@/static/images/delete.png"
@click="removeFile(0)"
class="del"
/>
</div>
</div> </div>
</div> </div>
<div class="demand"> <div class="demand">
<p class="one-line-hide">视频要求</p> <p class="one-line-hide">视频要求</p>
<p class="one-line-hide">1.文件扩展名fivmp4文件扩展名fivmp4</p> <p class="one-line-hide">
1.文件扩展名fivmp4文件扩展名fivmp4
</p>
</div> </div>
</a-form-item> </a-form-item>
<a-form-item label="视频简介" class="brief"> <a-form-item label="视频简介" class="brief">
<a-textarea v-model:value="form.brief" :autoSize="true" class="brief-textarea" :maxlength="200" placeholder="请输入您的视频简介" /> <a-textarea
<span class="words-number">{{ form.brief.length }}/200</span> v-model:value="form.desc"
:autoSize="true"
class="brief-textarea"
:maxlength="200"
placeholder="请输入您的视频简介"
/>
<span class="words-number">{{ form.desc.length }}/200</span>
</a-form-item> </a-form-item>
<a-form-item :wrapper-col="{ span: 4, offset: 0 }"> <a-form-item :wrapper-col="{ span: 4, offset: 0 }">
<a-button @click="onSubmit">上传视频</a-button> <a-button @click="onSubmit">上传视频</a-button>
@ -49,46 +103,67 @@
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, reactive, Ref, ref } from 'vue'; import { defineComponent, 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 { videoadd } from "@/api";
export default defineComponent({ export default defineComponent({
name: 'ReleaseWebcast', name: "ReleaseWebcast",
components: { components: {
PlaySquareOutlined, PlaySquareOutlined,
PlusOutlined, PlusOutlined,
NavBottom, NavBottom,
}, },
setup() { setup() {
interface FileItem{ interface FileItem {
uid: string; video:Array<string>,
name: string;
} }
const fileList: Array<FileItem> = []; const fileList: Array<FileItem> = [];
// //
const form = reactive({ const form = reactive({
title: '', title: "",
cover: '', img: "",
brief: '', fileid: "",
video: fileList, fileurl: "",
fileduration: "",
desc: "",
video:[""],
}); });
// //
const viewCover: Ref<boolean> = ref(false), const viewCover: Ref<boolean> = ref(false),
previewImage: Ref<string> = ref(''); previewImage: Ref<string> = ref("");
/** /**
* 封面改变触发事件 * 封面改变触发事件
*/ */
function coverChange(info: ImgInfo): void { function coverChange(info: ImgInfo): void {
// console.log(info); // console.log(info);
// //
previewCover(info.file).then(url => previewImage.value = url); previewCover(info.file).then((url) => (previewImage.value = url));
viewCover.value = true; viewCover.value = true;
// form.cover = fileList; // form.cover = fileList;
} }
/**
* 上传封面之前的钩子
* @param file 上传的文件
*/
const beforeCoverUpload = (file: File): boolean => {
console.log(file);
return false;
};
/**
* 删除封面
*/
function cancelCover(file: number): void {
console.log(file);
}
/** /**
* 删除视频列表 * 删除视频列表
* @param index 删除文件的索引 * @param index 删除文件的索引
@ -98,38 +173,58 @@ export default defineComponent({
newFileList.splice(index, 1); newFileList.splice(index, 1);
form.video = newFileList; form.video = newFileList;
} }
/**
* 上传封面之前的钩子
* @param file 上传的文件
*/
const beforeCoverUpload = (file: File): boolean => {
console.log(file);
return false;
}
/**
* 删除封面
*/
function cancelCover(file: number): void {
console.log(file);
}
/** /**
* 上传文件之前的钩子 * 上传图片
* @param file 上传的文件
*/ */
const beforeVideoUpload = (file: VideoInfo): boolean => { const uploadpicprogress: Ref<number> = ref(0);
const videofile = ref<File>();
const videos = ref<Array<any>>([]);
interface AntUpload {
action: string;
data: unknown;
file: File;
}
async function uploadspic(file: AntUpload) {
let res = await uploadflie(file.file, (info: any) => {
console.log(info);
uploadpicprogress.value = info.percent.toFixed(2) * 100;
});
console.log(res);
form.img = res.video.url;
}
/**
* 上传视频
*/
const uploadprogress: Ref<number> = ref(0);
async function uploads(file: AntUpload) {
uploadprogress.value=0
form.video=[""]
console.log(file); console.log(file);
if(file.type != '') { videofile.value = file.file;
// handleRemove(file); videos.value[0].addEventListener("durationchange", () => {
} console.log(videos.value[0].duration);
form.video = [...fileList, file]; form.fileduration = videos.value[0].duration;
return false; });
let res = await uploadflie(file.file, (info: any) => {
console.log(info);
uploadprogress.value = info.percent.toFixed(2) * 100;
});
console.log(res);
form.fileid = res.fileId;
form.fileurl = res.video.url;
form.video[0]=res.video.url
} }
/** /**
* 表单提交 * 表单提交
*/ */
const onSubmit = (e: FromSend) => { const onSubmit = async (e: FromSend) => {
e.preventDefault(); e.preventDefault();
console.log(toRaw(form), 111);
videoadd(toRaw(form));
}; };
return { return {
@ -138,18 +233,28 @@ export default defineComponent({
form, form,
viewCover, viewCover,
previewImage, previewImage,
removeFile,
previewCover, previewCover,
coverChange, coverChange,
cancelCover, cancelCover,
beforeCoverUpload, beforeCoverUpload,
beforeVideoUpload,
onSubmit, onSubmit,
} uploadpicprogress,
} uploadspic,
}) uploadprogress,
uploads,
videofile,
videos,
removeFile
};
},
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.upload {
width: 171px;
height: 96px;
display:none
}
.upload-video { .upload-video {
width: 100%; width: 100%;
min-width: 700px; min-width: 700px;
@ -173,14 +278,14 @@ export default defineComponent({
font-weight: 500; font-weight: 500;
color: #808080; color: #808080;
&::after { &::after {
content: ''; content: "";
} }
} }
} }
.upload-image { .upload-image {
width: 171px; width: 171px;
height: 96px; height: 96px;
border: 1px solid #DCDFE0; border: 1px solid #dcdfe0;
border-radius: 3px; border-radius: 3px;
display: flex; display: flex;
align-items: center; align-items: center;
@ -191,17 +296,17 @@ export default defineComponent({
width: 171px; width: 171px;
padding: 6px 11px; padding: 6px 11px;
border-radius: 3px; border-radius: 3px;
border: 1px solid #DCDFE0; border: 1px solid #dcdfe0;
font-size: 11px; font-size: 11px;
color: #3F3F3F; color: #3f3f3f;
&::-webkit-input-placeholder{ &::-webkit-input-placeholder {
font-size: 12px; font-size: 12px;
color: #808080; color: #808080;
} }
} }
.ant-select { .ant-select {
font-size: 12px; font-size: 12px;
color: #3F3F3F; color: #3f3f3f;
} }
.ant-select-dropdown { .ant-select-dropdown {
font-size: 12px; font-size: 12px;
@ -213,11 +318,11 @@ export default defineComponent({
padding: 0; padding: 0;
width: 63px; width: 63px;
height: 23px; height: 23px;
background: #08AE98; background: #08ae98;
border-radius: 3px; border-radius: 3px;
font-size: 10px; font-size: 10px;
font-weight: 500; font-weight: 500;
color: #FFFFFF; color: #ffffff;
} }
} }
.video-cover { .video-cover {
@ -258,7 +363,7 @@ export default defineComponent({
> span { > span {
font-size: 9px; font-size: 9px;
font-weight: 500; font-weight: 500;
color: #07AD97; color: #07ad97;
max-width: 150px; max-width: 150px;
} }
.del { .del {
@ -292,7 +397,7 @@ export default defineComponent({
bottom: -11px; bottom: -11px;
font-size: 11px; font-size: 11px;
font-weight: 500; font-weight: 500;
color: #7F7F7F; color: #7f7f7f;
user-select: none; user-select: none;
} }
} }

View File

@ -146,9 +146,9 @@ export default defineComponent({
setup() { setup() {
const page = ref(1); const page = ref(1);
const tabindex = ref(1); const tabindex = ref(1);
const livelist=ref<Array<LiveList>>() const livelist=ref<LiveList[]>()
onMounted(async ()=>{ onMounted(async ()=>{
livelist.value= await getlivelist() livelist.value = await getlivelist();
}) })
function tabchange(e: number): void { function tabchange(e: number): void {
tabindex.value=e tabindex.value=e

View File

@ -2,51 +2,85 @@
<div class="video"> <div class="video">
<div class="nav"> <div class="nav">
<div class="tabs"> <div class="tabs">
<div :class="tabindex == 1 ? 'on' : ''" @click="tabchange(1)">全部视频</div> <div :class="tabindex == 4 ? 'on' : ''" @click="tabchange(4)">
<div :class="tabindex == 2 ? 'on' : ''" @click="tabchange(2)">审核中</div> 全部视频
<div :class="tabindex == 3 ? 'on' : ''" @click="tabchange(3)">未通过</div> </div>
<div :class="tabindex == 4 ? 'on' : ''" @click="tabchange(4)">已发布</div> <div :class="tabindex == 0 ? 'on' : ''" @click="tabchange(0)">
审核中
</div>
<div :class="tabindex == 1 ? 'on' : ''" @click="tabchange(1)">
未通过
</div>
<div :class="tabindex == 2 ? 'on' : ''" @click="tabchange(2)">
已发布
</div>
</div> </div>
<div class="sel"> <div class="sel">
<img src="@/static/images/sousuo.png" alt="" class="icon" /> <img src="@/static/images/sousuo.png" alt="" class="icon" />
<input type="text" /> <input type="text" />
</div> </div>
</div> </div>
<div class="list" v-if="tabindex==1"> <div class="list" v-if="tabindex == 4">
<VideoItem></VideoItem> <VideoItem
<VideoItem></VideoItem> v-for="(i, j) in videolist"
<VideoItem></VideoItem> :key="j"
<VideoItem></VideoItem> :videoid="i.videoid"
<VideoItem></VideoItem> :img="i.img"
<VideoItem></VideoItem> :title="i.title"
<VideoItem></VideoItem> :score="i.score"
<VideoItem></VideoItem> :date="i.created_at"
<VideoItem></VideoItem> :takehour="i.fileduration"
<VideoItem></VideoItem> :livenum="i.statusname"
:status="i.status"
:watch="i.watch"
:share="i.share"
></VideoItem>
</div> </div>
<div class="list" v-if="tabindex==2"> <div class="list" v-if="tabindex == 0">
<VideoItem ></VideoItem> <VideoItem
<VideoItem></VideoItem> v-for="(i, j) in videolist"
<VideoItem></VideoItem> :key="j"
<VideoItem></VideoItem> :img="i.img"
<VideoItem></VideoItem> :title="i.title"
<VideoItem></VideoItem> :score="i.score"
:date="i.created_at"
:takehour="i.fileduration"
:livenum="i.statusname"
:status="i.status"
:watch="i.watch"
:share="i.share"
></VideoItem>
</div> </div>
<div class="list" v-if="tabindex==3"> <div class="list" v-if="tabindex == 1">
<VideoItem :type="2"></VideoItem> <VideoItem
<VideoItem :type="2"></VideoItem> v-for="(i, j) in videolist"
<VideoItem :type="2"></VideoItem> :key="j"
<VideoItem :type="2"></VideoItem> :img="i.img"
:title="i.title"
:score="i.score"
:date="i.created_at"
:takehour="i.fileduration"
:livenum="i.statusname"
:status="i.status"
:watch="i.watch"
:share="i.share"
></VideoItem>
</div> </div>
<div class="list" v-if="tabindex==4"> <div class="list" v-if="tabindex == 2">
<VideoItem :type="3"></VideoItem> <VideoItem
<VideoItem :type="3"></VideoItem> v-for="(i, j) in videolist"
<VideoItem :type="3"></VideoItem> :key="j"
<VideoItem :type="3"></VideoItem> :img="i.img"
<VideoItem :type="3"></VideoItem> :title="i.title"
<VideoItem :type="3"></VideoItem> :score="i.score"
:date="i.created_at"
:takehour="i.fileduration"
:livenum="i.statusname"
:status="i.status"
:watch="i.watch"
:share="i.share"
></VideoItem>
</div> </div>
<div class="pages"> <div class="pages">
<a-pagination v-model:current="page" :total="500" :showLessItems="true" /> <a-pagination v-model:current="page" :total="500" :showLessItems="true" />
@ -154,24 +188,53 @@
} }
</style> </style>
<script lang="ts"> <script lang="ts">
import { defineComponent, ref } from "vue"; import { defineComponent, onMounted, reactive, ref, UnwrapRef } from "vue";
import VideoItem from "@/components/VideoItem.vue"; import VideoItem from "@/components/VideoItem.vue";
import { getvideolist } from '@/api'; import { getvideolist } from "@/api";
import { useRoute } from 'vue-router';
export default defineComponent({ export default defineComponent({
components: { components: {
VideoItem, VideoItem,
}, },
setup() { setup() {
const page = ref(6); const page = ref(6);
const tabindex = ref(1); const tabindex = ref(4);
getvideolist() interface VideoList {
videoid: number;
memberid: number;
title: string;
img: string;
fileid: string;
fileurl: string;
fileduration: string;
status: number;
desc: string;
deleted_at: null;
created_at: string;
updated_at: string;
statusname: string;
}
const videolist = ref<Array<VideoList>>();
// const newvideolist = ref<Array<VideoList>>();
onMounted(async () => {
const res = await getvideolist();
videolist.value = res;
});
function tabchange(e: number): void { function tabchange(e: number): void {
tabindex.value=e tabindex.value = e;
// console.log(videolist)
} }
return { return {
page, page,
tabindex, tabindex,
tabchange tabchange,
videolist
}; };
}, },
}); });

View File

@ -25,6 +25,9 @@ import { defineComponent } 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 { useRoute } from 'vue-router';
export default defineComponent({ export default defineComponent({
components:{ components:{
VideoPlay, VideoPlay,
@ -32,7 +35,11 @@ export default defineComponent({
VideoReview VideoReview
}, },
setup(){ setup(){
console.log(1) // console.log(1)
console.log(useRoute().query)
const result= videodetail(useRoute().query.id)
console.log(result,46546)
} }
}) })
</script> </script>