From 9dbaebfff233fe80695473a29364d9932b5760c7 Mon Sep 17 00:00:00 2001 From: asd <374367073@qq.com> Date: Wed, 14 Oct 2020 15:30:29 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.ts | 93 +++-- src/components/VideoItem.vue | 56 ++- src/types/index.d.ts | 4 +- src/views/mine/ReleaseVideo.vue | 683 ++++++++++++++++++-------------- src/views/regime/Live.vue | 4 +- src/views/regime/Video.vue | 147 +++++-- src/views/regime/VideoInfo.vue | 9 +- 7 files changed, 620 insertions(+), 376 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index f6c0134..7661695 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,6 +1,6 @@ import router from '@/router'; import store from '@/store'; -import { LiveList, LoginData, UserInfo } from '@/types'; +import { LiveList, LoginData, UserInfo, VideoInfo } from '@/types'; import { saveValue } from '@/utils/common'; import { message } from 'ant-design-vue'; import { get, post, setToken } from './base' @@ -19,7 +19,7 @@ export async function loginpass(phone: string, password: string){ message.error(res.msg) }else{ 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("存储错误, 请允许网页使用本地存储!") }else{ setToken(); @@ -35,30 +35,30 @@ export async function loginpass(phone: string, password: string){ */ export async function userinfo(){ const user = await get('personalInfo'); - // console.log(user.data?.img) + // console.log(user.data.img) if(user.code == 1001){ // router.push("/") return '未登录'; } return { - head: user.data?.img, - username: user.data?.name, - language: user.data?.language, - currency: user.data?.currency, - zoneStr: user.data?.zoneStr, - memberid: user.data?.memberid, - country: user.data?.country, - live: user.data?.live, - mtongue: user.data?.mtongue, - tlanguage: user.data?.tlanguage, - willsay: user.data?.willsay, - interest: user.data?.interest, - mobile: user.data?.mobile, - email: user.data?.email, - birthday: user.data?.birthday, - video: user.data?.video, - desc: user.data?.desc, - money: user.data?.money + head: user.data.img, + username: user.data.name, + language: user.data.language, + currency: user.data.currency, + zoneStr: user.data.zoneStr, + memberid: user.data.memberid, + country: user.data.country, + live: user.data.live, + mtongue: user.data.mtongue, + tlanguage: user.data.tlanguage, + willsay: user.data.willsay, + interest: user.data.interest, + mobile: user.data.mobile, + email: user.data.email, + birthday: user.data.birthday, + video: user.data.video, + desc: user.data.desc, + money: user.data.money } } @@ -123,9 +123,10 @@ interface VideoList{ statusname: string; } -export async function getvideolist() { +export async function getvideolist(): Promise { const res = await get>('video') 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 { const res = await get>('live',data); // console.log(res); return res.data @@ -154,9 +155,9 @@ export async function getstatisticlist() { const res = await get('statistics'); // console.log(res) return { - liveInfo: res.data?.liveInfo, - videoInfo:res.data?.videoInfo, - studentInfo:res.data?.studentInfo + liveInfo: res.data.liveInfo, + videoInfo:res.data.videoInfo, + studentInfo:res.data.studentInfo } } @@ -170,4 +171,44 @@ interface Liveaddrule{ export async function liveadd(data:any) { const res = await post('live',data); console.log(res) + } + +/** + * 发布视频 + */ +export async function videoadd(data:any) { + const res=await post('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('video/'+data) + return res.data + +} + +/** + * 删除视频 + */ +export async function videodel(data:any) { + const res = await post('live',data); + console.log(res) } \ No newline at end of file diff --git a/src/components/VideoItem.vue b/src/components/VideoItem.vue index 9ff5c2b..bd430de 100644 --- a/src/components/VideoItem.vue +++ b/src/components/VideoItem.vue @@ -1,34 +1,35 @@