From edcee2f5928c2faf4c13156704845f09b4f5cda3 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Mon, 16 Nov 2020 11:20:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AA=E4=B8=8A=E4=BC=A0=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8D=E8=AE=A9=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/en.ts | 1 + src/i18n/zh.ts | 1 + src/views/mine/Archives.vue | 8 +++++++- src/views/mine/ReleaseVideo.vue | 7 +++++++ src/views/mine/ReleaseWebcast.vue | 7 +++++++ 5 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/i18n/en.ts b/src/i18n/en.ts index bdaf8f7..dabf9ae 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -301,6 +301,7 @@ export default { shijishichang: "Actual live broadcast duration", cshipinyaoqiu1: "The video should be no longer than 10 minutes", cshipinyaoqiu2: "Video size cannot exceed 500M", + shangchuanwancheng: "Please wait for the file to be uploaded", shichangtishi:"", renshutishi: '', tixianzhu: "", diff --git a/src/i18n/zh.ts b/src/i18n/zh.ts index e5d51b1..c8a8520 100644 --- a/src/i18n/zh.ts +++ b/src/i18n/zh.ts @@ -301,6 +301,7 @@ export default { shijishichang: "实际直播时长", cshipinyaoqiu1: "视频长度不能超过10分钟", cshipinyaoqiu2: "视频大小不能超过500m", + shangchuanwancheng: "请等待文件上传完成", shichangtishi:"", renshutishi: '', tixianzhu:"", diff --git a/src/views/mine/Archives.vue b/src/views/mine/Archives.vue index 030067f..a86f9cb 100644 --- a/src/views/mine/Archives.vue +++ b/src/views/mine/Archives.vue @@ -542,6 +542,7 @@ export default defineComponent({ NavBottom, }, setup() { + let issum = true; const lan: any = useI18n(); interface SpeakItem { lang: string; @@ -812,6 +813,10 @@ export default defineComponent({ // for(let i in toRaw(formData.value).willsay){ // console.log(toRaw(formData.value).willsay[i]) // } + if(!issum){ + message.error(lan.$t("shangchuanwancheng")) + return; + } const uesrinfo = toRaw(formData.value); // for (let m = 0; m < toRaw(chiveslist.value).length; m++) { // for (const i in uesrinfo.willsayValue) { @@ -926,13 +931,14 @@ export default defineComponent({ async function uploads(file: AntUpload) { uploadprogress.value = 0; - + issum = false; const res = await uploadflie(file.file, (info: any) => { console.log(info); uploadprogress.value = info.percent.toFixed(2) * 100; }); userinfo.value.video = res.video.url; userinfo.value.videoid = res.fileId; + issum = true; } if (formData.value.video != "") { diff --git a/src/views/mine/ReleaseVideo.vue b/src/views/mine/ReleaseVideo.vue index 4d44cc4..4df8159 100644 --- a/src/views/mine/ReleaseVideo.vue +++ b/src/views/mine/ReleaseVideo.vue @@ -147,6 +147,7 @@ export default defineComponent({ NavBottom, }, setup() { + let issum= true; const lan: any = useI18n(); interface FileItem { video: Array; @@ -254,6 +255,7 @@ export default defineComponent({ const uploadprogress: Ref = ref(0); const ifallowvideo = ref(false); async function uploads(file: AntUpload) { + issum = false; console.log(file); videofile.value = file.file; videos.value[0].addEventListener("durationchange", () => { @@ -268,6 +270,7 @@ export default defineComponent({ form.value.fileid = res.fileId; form.value.fileurl = res.video.url; + issum = true; } function beforeVideoUpload(info?: any) { @@ -285,6 +288,10 @@ export default defineComponent({ */ const routes = useRoute(); const onSubmit = async (e: FromSend) => { + if(!issum){ + message.error(lan.$t("shangchuanwancheng")) + return; + } e.preventDefault(); console.log(toRaw(form.value), 111); console.log(toRaw(form.value).video[0].length); diff --git a/src/views/mine/ReleaseWebcast.vue b/src/views/mine/ReleaseWebcast.vue index 2d85636..51d457b 100644 --- a/src/views/mine/ReleaseWebcast.vue +++ b/src/views/mine/ReleaseWebcast.vue @@ -252,6 +252,7 @@ export default defineComponent({ RankList, }, setup() { + let issum = true; const lan: any = useI18n(); // 表单数据 const form = ref({ @@ -361,6 +362,10 @@ export default defineComponent({ }); } const onSubmit = (e: FromSend) => { + if(!issum){ + message.error(lan.$t("shangchuanwancheng")) + return; + } e.preventDefault(); validate() .then(() => { @@ -475,6 +480,7 @@ export default defineComponent({ } } async function uploads(file: AntUpload) { + issum = false; console.log(file); videofile.value = file.file; videos.value[0].addEventListener("durationchange", () => { @@ -489,6 +495,7 @@ export default defineComponent({ form.value.fileid = res.fileId; form.value.fileurl = res.video.url; + issum = true; } const ifallowpic = ref(false); async function uploadspic(file: AntUpload) {