diff --git a/src/api/base.ts b/src/api/base.ts index 56d4e01..b259a4f 100644 --- a/src/api/base.ts +++ b/src/api/base.ts @@ -11,7 +11,7 @@ export interface Get { } axios.interceptors.response.use((response)=>{ - console.log(response) + // console.log(response) if(response.data.code == 1001){ router.push("/") } diff --git a/src/api/index.ts b/src/api/index.ts index fd571eb..72d5d0c 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, VideoInfo } from '@/types'; +import { LiveList, LivelistInfo, LoginData, UserInfo, VideoInfo } from '@/types'; import { saveValue } from '@/utils/common'; import { message } from 'ant-design-vue'; import { del, get, post, put, setToken } from './base' @@ -136,10 +136,10 @@ export async function getvideolist(): Promise { -export async function getlivelist(data?:any):Promise { +export async function getlivelist(data?:any):Promise { const res = await get>('live',data); - // console.log(res); - return res.data + console.log(res); + return res; } /** @@ -177,10 +177,19 @@ export async function liveadd(data:any) { /** * 发布视频 */ -export async function videoadd(data:any) { +export async function videoadd( form: any,data: any) { const res=await post('video',data) if(res.code==0){ message.success("发布成功") + form.value = { + title: "", + img: "", + fileid: "", + fileurl: "", + fileduration: "", + desc: "", + video:[""], + } } } @@ -416,4 +425,70 @@ export async function getlanguages(): Promise{ export async function putmember(data: unknown): Promise{ return (await put(`member/${store.state.userinfo.memberid}`, data) ) +} + + +/** + * 直播详情 + * + */ + +interface LiveInfo { + liveid: number; + title: string; + img: string; + fileid: string; + fileurl: string; + fileduration: string; + vodid: string; + vodurl: string; + vodduration: string; + dateline: string; + livetime: number; + livenumber: number; + status: number; + desc: string; + deleted_at: null; + created_at: string; + updated_at: string; +} + +interface StudentList { + memberid: number; + name: string; + img: string; +} + +export async function getliveinfo(id: number){ + const liveinfo = (await get(`live/${id}`)).data; + const studentlist = (await get("studentLive",{id})).data; + return {...liveinfo,studentlist} +} + + +/** + * 直播日历 + */ + + + +export async function getdatelist(start: string, end: string) { + return (await get("teacherCalendar")).data +} + + + +/** + * 取消直播 + */ + +export async function cancellive(id: number, status: number){ + const res = await post("cancelLive",{id, status}) + if(res.code == 0){ + message.success(res.msg); + return true; + }else{ + message.error(res.msg); + return false; + } } \ No newline at end of file diff --git a/src/components/LiveCount.vue b/src/components/LiveCount.vue index 2f7c36f..b0e441b 100644 --- a/src/components/LiveCount.vue +++ b/src/components/LiveCount.vue @@ -1,163 +1,191 @@ \ No newline at end of file diff --git a/src/components/LiveItem.vue b/src/components/LiveItem.vue index ac3f468..24548d3 100644 --- a/src/components/LiveItem.vue +++ b/src/components/LiveItem.vue @@ -28,7 +28,7 @@
进入直播
-
+
查看回放
@@ -47,7 +47,6 @@ .cover{ width: 100%; height: 127px; - background-color: #0f0; } .play{ position: absolute; diff --git a/src/components/LivePlay.vue b/src/components/LivePlay.vue index 83a1c08..712a9bc 100644 --- a/src/components/LivePlay.vue +++ b/src/components/LivePlay.vue @@ -1,6 +1,6 @@ -
+
日历
@@ -219,10 +219,15 @@ export default defineComponent({ return store.state.userinfo; }) - function navto(index: number){ - router.push({ - path: nav[index].route - }) + function navto(index: number | string){ + if(typeof index == "number"){ + router.push({ + path: nav[index].route + }) + }else{ + router.push(index) + } + } return { nav, diff --git a/src/types/index.d.ts b/src/types/index.d.ts index 0f48506..805d22e 100644 --- a/src/types/index.d.ts +++ b/src/types/index.d.ts @@ -10,6 +10,7 @@ declare module 'axios' { code: number; msg: string; data: T; + total: number; [keys: string]: any; } } @@ -87,4 +88,11 @@ export interface LiveList { statusname: string; starttime: string; begin: number; +} + +export interface LivelistInfo { + data: LiveList[]; + code: number; + msg: string; + total: number; } \ No newline at end of file diff --git a/src/utils/date.ts b/src/utils/date.ts index 06c18c9..2478765 100644 --- a/src/utils/date.ts +++ b/src/utils/date.ts @@ -11,6 +11,8 @@ interface GetDate{ yue: number; day: number; zhou: number; + start: string; + end: string; } export function getdate(yue?: number): GetDate{ @@ -27,7 +29,8 @@ export function getdate(yue?: number): GetDate{ now = now.date(0); const month = now.date(); // 当前月有几天 const year = now.year() - + const start = year + "-" + yue + '-01'; + const end = year + "-" + yue + '-' + month; console.log(day,week,month) let i = 0; let w = 0; @@ -55,7 +58,7 @@ export function getdate(yue?: number): GetDate{ } console.log(date) - return {date, year, yue, day, zhou}; + return {date, year, yue, day, zhou, start, end}; } diff --git a/src/views/login/Sign.vue b/src/views/login/Sign.vue index 63df4cb..11f9036 100644 --- a/src/views/login/Sign.vue +++ b/src/views/login/Sign.vue @@ -84,8 +84,8 @@ - - + + 中国+0086 diff --git a/src/views/mine/Archives.vue b/src/views/mine/Archives.vue index 13884ee..9edd877 100644 --- a/src/views/mine/Archives.vue +++ b/src/views/mine/Archives.vue @@ -32,7 +32,7 @@
-
授课语言
+
教授
{ e.preventDefault(); console.log(toRaw(form.value), 111); - // videoadd(toRaw(form)); + videoadd(form, toRaw(form.value)); }; return { diff --git a/src/views/mine/ReleaseWebcast.vue b/src/views/mine/ReleaseWebcast.vue index c657ee0..e638dc0 100644 --- a/src/views/mine/ReleaseWebcast.vue +++ b/src/views/mine/ReleaseWebcast.vue @@ -41,7 +41,7 @@ :width="80" v-else /> - +
-
- +
+
-
- - - - - - +
+
-
- - - - +
+
- +
@@ -45,100 +79,100 @@ display: flex; flex-direction: column; align-items: center; - .nav { - display: flex; - align-items: center; - border-bottom: 1px solid #eee; - justify-content: space-between; - width: 100%; - .tabs { - display: flex; - align-items: center; - font-size: 13px; - font-weight: bold; - color: #111; - padding: 11px 0; - > div { - margin-right: 58px; - cursor: pointer; - text-align: center; - width: 54px; - } - .on { - color: #08ae98; - position: relative; - &::before { - content: ""; - display: block; - position: absolute; - bottom: -12px; - width: 57px; - height: 1px; - background-color: #08ae98; + .nav { + display: flex; + align-items: center; + border-bottom: 1px solid #eee; + justify-content: space-between; + width: 100%; + .tabs { + display: flex; + align-items: center; + font-size: 13px; + font-weight: bold; + color: #111; + padding: 11px 0; + > div { + margin-right: 58px; + cursor: pointer; + text-align: center; + width: 54px; + } + .on { + color: #08ae98; + position: relative; + &::before { + content: ""; + display: block; + position: absolute; + bottom: -12px; + width: 57px; + height: 1px; + background-color: #08ae98; + } + } + } + .sel { + width: 171px; + height: 26px; + border: 1px solid #999; + display: flex; + align-items: center; + padding: 8px; + border-radius: 4px; + > img { + width: 11px; + height: 11px; + } + > input { + width: 119px; + font-size: 9px; + line-height: 1; + margin-left: 6px; + border: none; + outline: none; + } } - } } - .sel { - width: 171px; - height: 26px; - border: 1px solid #999; - display: flex; - align-items: center; - padding: 8px; - border-radius: 4px; - > img { - width: 11px; - height: 11px; - } - > input { - width: 119px; - font-size: 9px; - line-height: 1; - margin-left: 6px; - border: none; - outline: none; - } + .list { + display: flex; + flex-wrap: wrap; + width: 100%; + > div { + margin-top: 28px; + margin-left: 23px; + &:nth-child(1), + &:nth-child(6) { + margin-left: 0; + } + } } - } - .list { - display: flex; - flex-wrap: wrap; - width: 100%; - > div { - margin-top: 28px; - margin-left: 23px; - &:nth-child(1), - &:nth-child(6) { - margin-left: 0; - } + .pages { + position: absolute; + bottom: 114px; + display: flex; + justify-content: center; + ::v-deep(.ant-pagination-next) > .ant-pagination-item-link, + ::v-deep(.ant-pagination-prev) > .ant-pagination-item-link, + ::v-deep(.ant-pagination-item), + ::v-deep(.ant-pagination-jump-next-custom-icon), + ::v-deep(.ant-pagination-jump-prev-custom-icon) { + border: 1px solid #08ae98; + } + ::v-deep(.ant-pagination-item-active) a { + color: #fff; + } + ::v-deep(.ant-pagination-item-active) { + background-color: #08ae98; + } } - } - .pages { - position: absolute; - bottom: 114px; - display: flex; - justify-content: center; - ::v-deep(.ant-pagination-next) > .ant-pagination-item-link, - ::v-deep(.ant-pagination-prev) > .ant-pagination-item-link, - ::v-deep(.ant-pagination-item), - ::v-deep(.ant-pagination-jump-next-custom-icon), - ::v-deep(.ant-pagination-jump-prev-custom-icon) { - border: 1px solid #08ae98; - } - ::v-deep(.ant-pagination-item-active) a { - color: #fff; - } - ::v-deep(.ant-pagination-item-active) { - background-color: #08ae98; - } - } } \ No newline at end of file diff --git a/src/views/regime/Liveing.vue b/src/views/regime/Liveing.vue index 7a6125f..c49cd1a 100644 --- a/src/views/regime/Liveing.vue +++ b/src/views/regime/Liveing.vue @@ -1,162 +1,161 @@ \ No newline at end of file diff --git a/src/views/regime/date.vue b/src/views/regime/date.vue index 2a54c8c..846c744 100644 --- a/src/views/regime/date.vue +++ b/src/views/regime/date.vue @@ -188,6 +188,7 @@