From ffe57d99388c6abc8b556e60afab0795f7c413af Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Wed, 14 Oct 2020 18:55:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/base.ts | 1 + src/api/index.ts | 23 ++++++++++++- src/views/mine/Archives.vue | 61 ++++++++++++++++++++++++--------- src/views/mine/ReleaseVideo.vue | 24 ++++++------- 4 files changed, 80 insertions(+), 29 deletions(-) diff --git a/src/api/base.ts b/src/api/base.ts index c24fb1a..843568c 100644 --- a/src/api/base.ts +++ b/src/api/base.ts @@ -11,6 +11,7 @@ export interface Get { } axios.interceptors.response.use((response)=>{ + console.log(response) if(response.data.code == 1001){ router.push("/") } diff --git a/src/api/index.ts b/src/api/index.ts index 1641b83..72a0186 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -237,7 +237,7 @@ export async function sendsms(phone: string, type: number): Promise{ } /** - * 获取国家数据 + * 获取国家与语言数据 */ interface Countries{ @@ -256,3 +256,24 @@ export async function getarchives(): Promise<[Countries[],Willsay[]]>{ } +/** + * 客户端语言 + */ + +interface Language { + dictionaryid: number; + name: string; + alias: string; + code :string; + position: number; + publish: number; + value: string; + deleted_at: null; + created_at: string; + updated_at: string; +} + +export async function getlanguages(): Promise{ + + return (await get("languages")).data; +} \ No newline at end of file diff --git a/src/views/mine/Archives.vue b/src/views/mine/Archives.vue index 374784f..d328da0 100644 --- a/src/views/mine/Archives.vue +++ b/src/views/mine/Archives.vue @@ -94,9 +94,19 @@
- + +
@@ -171,8 +181,8 @@ ref="select" :getPopupContainer="triggerNode => triggerNode.parentNode" > - - {{ item }} + + {{ item.name }}
@@ -266,7 +276,7 @@ import { uploadflie } from "@/utils/vod" import store from '@/store'; import smile from "@/static/images/smile.png" import smilet from "@/static/images/smilet.png" -import { getarchives } from "@/api/index" +import { getarchives, getlanguages } from "@/api/index" export default defineComponent({ name: "Archives", @@ -291,8 +301,10 @@ export default defineComponent({ const modalNode = () => document.getElementsByClassName('modal-container')[0] const chiveslist = ref([[],[]]); + const languages = ref([]) onMounted(async ()=>{ chiveslist.value = await getarchives() + languages.value = await getlanguages() }) /** @@ -423,17 +435,8 @@ export default defineComponent({ console.log('12'); } - interface AntUpload{ - action: string; - data: unknown; - file: File; - } - async function uploads(file: AntUpload){ - let res = await uploadflie(file.file, (info) => { - console.log(info) - }); - console.log(res) - } + + // uploadflie()3. function setlevel(index: number, level: number){ @@ -441,6 +444,27 @@ export default defineComponent({ } + /** + * 上传视频 + */ + interface AntUpload{ + action: string; + data: unknown; + file: File; + } + const uploadprogress: Ref = ref(0); + async function uploads(file: AntUpload) { + uploadprogress.value=0 + + let res = await uploadflie(file.file, (info: any) => { + console.log(info); + uploadprogress.value = info.percent.toFixed(2) * 100; + }); + userinfo.value.video = res.video.url; + } + + + return { modalNode, formData, @@ -467,7 +491,9 @@ export default defineComponent({ smile, smilet, setlevel, - chiveslist + chiveslist, + languages, + uploadprogress } } }); @@ -749,5 +775,8 @@ export default defineComponent({ user-select: none; } } + ::v-deep(.ant-upload-list) { + display: none; + } } \ No newline at end of file diff --git a/src/views/mine/ReleaseVideo.vue b/src/views/mine/ReleaseVideo.vue index 0189d76..0f2cf0b 100644 --- a/src/views/mine/ReleaseVideo.vue +++ b/src/views/mine/ReleaseVideo.vue @@ -64,18 +64,18 @@
- - {{ item.split('/')[item.split('/').length-1] }} - -
+ v-for="(item, index) in form.video" + :key="index" + class="video-list" + > + + {{ item.split('/')[item.split('/').length-1] }} + +