From d9e0899264b61165cd666574e8674661af1a1547 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Thu, 12 Nov 2020 09:19:44 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E5=A4=B4=E5=83=8F=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.ts | 10 ++++++++++ src/i18n/en.ts | 2 +- src/i18n/zh.ts | 2 +- src/views/mine/Archives.vue | 14 +++++++++++++- 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index 069904e..fa001ec 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1049,3 +1049,13 @@ export async function getset() { const res = await get('getset'); return res.data; } + +export async function setheadimg(src: string){ + const res = await put(`member/${store.state.userinfo.memberid}`,{img: src}); + console.log(res) +} + +export async function setusername(src: string){ + const res = await put(`member/${store.state.userinfo.memberid}`,{name: src}); + console.log(res) +} diff --git a/src/i18n/en.ts b/src/i18n/en.ts index 3595486..58d37f9 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -300,7 +300,7 @@ export default { shijirenshu: "Actual number of live broadcast", shijishichang: "Actual live broadcast duration", cshipinyaoqiu1: "The video should be no longer than 10 minutes", - cshipinyaoqiu2: "Video size cannot exceed 500MB", + cshipinyaoqiu2: "Video size cannot exceed 500M", shichangtishi:"", renshutishi: '', tixianzhu: "", diff --git a/src/i18n/zh.ts b/src/i18n/zh.ts index 853512c..be579a2 100644 --- a/src/i18n/zh.ts +++ b/src/i18n/zh.ts @@ -300,7 +300,7 @@ export default { shijirenshu: "实际直播人数", shijishichang: "实际直播时长", cshipinyaoqiu1: "视频长度不能超过10分钟", - cshipinyaoqiu2: "视频大小不能超过500mb", + cshipinyaoqiu2: "视频大小不能超过500m", shichangtishi:"", renshutishi: '', tixianzhu:"", diff --git a/src/views/mine/Archives.vue b/src/views/mine/Archives.vue index 8d80e09..a1cdc73 100644 --- a/src/views/mine/Archives.vue +++ b/src/views/mine/Archives.vue @@ -37,6 +37,7 @@ size="small" v-model:value="userinfo.name" :placeholder="lan.$t('shuruxinnicheng')" + @pressEnter="setname" /> @@ -525,6 +526,8 @@ import { interests, putmember, sendsms, + setheadimg, + setusername, } from "@/api/index"; import { message } from "ant-design-vue"; import { useI18n } from "@/utils/i18n"; @@ -971,6 +974,7 @@ export default defineComponent({ // picinfo.fileId=res.fileId // picinfo.url=res.video.url formData.value.img = res.video.url; + setheadimg(res.video.url); } function beforeVideoUpload(file: any){ @@ -981,6 +985,13 @@ export default defineComponent({ } return false; } + + function setname(){ + setusername(formData.value.name).then(()=>{ + showname.value = true; + }) + } + // function selguojia(e: any){ // userinfo.value.countryValue = e; // console.log(e) @@ -1029,7 +1040,8 @@ export default defineComponent({ lan, interestslist, isdisabled, - beforeVideoUpload + beforeVideoUpload, + setname }; }, }); -- 2.47.2 From 1f2cae25fd6afad707c09a3937ae05f5191ae8ce Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Thu, 12 Nov 2020 09:22:18 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E6=8D=A2?= =?UTF-8?q?=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mine/ReleaseWebcast.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/mine/ReleaseWebcast.vue b/src/views/mine/ReleaseWebcast.vue index 439d4b9..8eef676 100644 --- a/src/views/mine/ReleaseWebcast.vue +++ b/src/views/mine/ReleaseWebcast.vue @@ -94,7 +94,7 @@
+
{{ lan.$t("shipinyaoqiu") }}
1.{{ lan.$t("shipinyaoqiu1") }}
@@ -672,7 +672,7 @@ export default defineComponent({ font-size: 10px; font-weight: 500; color: #808080; - width: 134px; + // width: 134px; > p { margin: 0; } -- 2.47.2 From 84d3e45292e7c5cf5e006532754444198e1620ac Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Thu, 12 Nov 2020 09:26:51 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E4=BA=86=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/en.ts | 2 +- src/i18n/zh.ts | 2 +- src/utils/common.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/i18n/en.ts b/src/i18n/en.ts index 58d37f9..bdaf8f7 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -94,7 +94,7 @@ export default { shipinyaoqiu: "Video requirements:", shipinyaoqiu1: "The time required for uploading video is within 30s", shipinyaoqiu2: "Support file size 100m", - shipinyaoqiu3: "File extension: FIV, MP4", + shipinyaoqiu3: "File extension: FLV, MP4, MOV, AVI, WAV", ziwojieshao: "self-introduction", lianxifangshi: "contact information", genghuanshoujihao: "Change mobile phone number", diff --git a/src/i18n/zh.ts b/src/i18n/zh.ts index be579a2..e5d51b1 100644 --- a/src/i18n/zh.ts +++ b/src/i18n/zh.ts @@ -94,7 +94,7 @@ export default { shipinyaoqiu:"视频要求:", shipinyaoqiu1:"上传视频时间要求为30s之内", shipinyaoqiu2:"支持文件大小100M", - shipinyaoqiu3:"文件扩展名:fiv、mp4", + shipinyaoqiu3:"文件扩展名:flv、mp4、mov、avi、wav", fengmianyaoqiu:"封面要求:", fengmianyaoqiu1:"文件扩展名:jpg,png", fengmianyaoqiu2:"文件大小限制:2M", diff --git a/src/utils/common.ts b/src/utils/common.ts index d6ad46d..474eea0 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -77,7 +77,7 @@ export function provenimg(name: string): boolean{ */ export function provenvideo(name: string): boolean{ - const type = ['flv', 'mp4']; + const type = ['flv', 'mp4', 'wmv', 'mov', 'avi']; const ntypearr = name.split('.'); const ntype = ntypearr[ntypearr.length - 1]; for(const i in type){ -- 2.47.2 From 4b83d61df774166cb6ddaac7a91dc144c2060818 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Thu, 12 Nov 2020 09:53:30 +0800 Subject: [PATCH 4/9] =?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/utils/common.ts | 15 +++++++++------ src/views/mine/Archives.vue | 31 +++++++++++++++++++------------ src/views/mine/ReleaseVideo.vue | 25 +++++++++++++++---------- src/views/mine/ReleaseWebcast.vue | 20 ++++++++++++-------- 4 files changed, 55 insertions(+), 36 deletions(-) diff --git a/src/utils/common.ts b/src/utils/common.ts index 474eea0..7276adb 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -59,16 +59,19 @@ export function getValue(key: string): any{ * @param name 图片名字 */ -export function provenimg(name: string): boolean{ +export function provenimg(file: any): boolean | void{ const type = ['png', 'jpg']; - const ntypearr = name.split('.'); + const ntypearr = file.name.split('.'); const ntype = ntypearr[ntypearr.length - 1]; + console.log(ntype) + let istype = false for(const i in type){ if(type[i] == ntype){ - return true; + istype = true } } - return false; + console.log(istype) + return istype; } /** @@ -76,9 +79,9 @@ export function provenimg(name: string): boolean{ * @param name 图片名字 */ -export function provenvideo(name: string): boolean{ +export function provenvideo(file: any): boolean{ const type = ['flv', 'mp4', 'wmv', 'mov', 'avi']; - const ntypearr = name.split('.'); + const ntypearr = file.name.split('.'); const ntype = ntypearr[ntypearr.length - 1]; for(const i in type){ if(type[i] == ntype){ diff --git a/src/views/mine/Archives.vue b/src/views/mine/Archives.vue index a1cdc73..49f432a 100644 --- a/src/views/mine/Archives.vue +++ b/src/views/mine/Archives.vue @@ -9,6 +9,7 @@ class="avatar-uploader" :show-upload-list="false" :customRequest="uploadspic" + :beforeUpload="imgs" @change="handleChange" >