修复了个人中心和直播视频item高度

This commit is contained in:
luyuan 2020-11-10 14:56:42 +08:00
parent e515b8266d
commit b0a6592373
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3
7 changed files with 57 additions and 7 deletions

View File

@ -36,7 +36,7 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.videoitem{ .videoitem{
width: 226px; width: 226px;
height: 198px; // height: 198px;
background-color: #fff; background-color: #fff;
border-radius: 17px; border-radius: 17px;
overflow: hidden; overflow: hidden;

View File

@ -37,7 +37,7 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.videoitem{ .videoitem{
width: 226px; width: 226px;
height: 198px; // height: 198px;
background-color: #fff; background-color: #fff;
border-radius: 17px; border-radius: 17px;
overflow: hidden; overflow: hidden;

View File

@ -83,7 +83,7 @@ export default {
xiugai: "modify", xiugai: "modify",
shuruxinnicheng: "Please enter a new nickname", shuruxinnicheng: "Please enter a new nickname",
jibenxinxi: "Basic information", jibenxinxi: "Basic information",
laiziguojia: "From the country", laiziguojia: "From a country or region",
juzhudi: "Place of residence", juzhudi: "Place of residence",
shurujuzhudi: "Enter residence", shurujuzhudi: "Enter residence",
wohaihuishuo: "I would also say", wohaihuishuo: "I would also say",

View File

@ -83,7 +83,7 @@ export default {
xiugai:"修改", xiugai:"修改",
shuruxinnicheng:"请输入新的昵称", shuruxinnicheng:"请输入新的昵称",
jibenxinxi:"基本信息", jibenxinxi:"基本信息",
laiziguojia:"来自国家", laiziguojia:"来自国家或地区",
juzhudi:"居住地", juzhudi:"居住地",
shurujuzhudi:"输入居住地", shurujuzhudi:"输入居住地",
wohaihuishuo:"我还会说", wohaihuishuo:"我还会说",

View File

@ -53,3 +53,37 @@ export function getValue(key: string): any{
} }
return value; return value;
} }
/**
*
* @param name
*/
export function provenimg(name: string): boolean{
const type = ['png', 'jpg'];
const ntypearr = name.split('.');
const ntype = ntypearr[ntypearr.length - 1];
for(const i in type){
if(type[i] == ntype){
return true;
}
}
return false;
}
/**
*
* @param name
*/
export function provenvideo(name: string): boolean{
const type = ['flv', 'mp4'];
const ntypearr = name.split('.');
const ntype = ntypearr[ntypearr.length - 1];
for(const i in type){
if(type[i] == ntype){
return true;
}
}
return false;
}

View File

@ -523,6 +523,7 @@ import {
} from "@/api/index"; } from "@/api/index";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import { useI18n } from "@/utils/i18n"; import { useI18n } from "@/utils/i18n";
import { provenvideo } from '@/utils/common';
export default defineComponent({ export default defineComponent({
name: "Archives", name: "Archives",
@ -909,6 +910,7 @@ export default defineComponent({
} }
const uploadprogress: Ref<number> = ref(0); const uploadprogress: Ref<number> = ref(0);
async function uploads(file: AntUpload) { async function uploads(file: AntUpload) {
uploadprogress.value = 0; uploadprogress.value = 0;
const res = await uploadflie(file.file, (info: any) => { const res = await uploadflie(file.file, (info: any) => {
@ -960,6 +962,15 @@ export default defineComponent({
// picinfo.url=res.video.url // picinfo.url=res.video.url
formData.value.img = res.video.url; formData.value.img = res.video.url;
} }
function beforeVideoUpload(file: any){
console.log(file)
const type = provenvideo(file.name);
if(!type){
message.error("文件类型错误,请重新选择")
}
return false;
}
// function selguojia(e: any){ // function selguojia(e: any){
// userinfo.value.countryValue = e; // userinfo.value.countryValue = e;
// console.log(e) // console.log(e)
@ -1007,7 +1018,8 @@ export default defineComponent({
uploadspic, uploadspic,
lan, lan,
interestslist, interestslist,
isdisabled isdisabled,
beforeVideoUpload
}; };
}, },
}); });
@ -1068,7 +1080,7 @@ export default defineComponent({
align-items: center; align-items: center;
margin-bottom: 28px; margin-bottom: 28px;
.label { .label {
width: 60px; width: 90px;
font-size: 11px; font-size: 11px;
font-weight: 500; font-weight: 500;
color: #808080; color: #808080;

View File

@ -131,7 +131,7 @@
import { defineComponent, onMounted, reactive, Ref, ref, toRaw } from "vue"; import { defineComponent, onMounted, reactive, Ref, ref, toRaw } from "vue";
import { PlaySquareOutlined, PlusOutlined } from "@ant-design/icons-vue"; import { PlaySquareOutlined, PlusOutlined } from "@ant-design/icons-vue";
import NavBottom from "@/components/NavBottom.vue"; import NavBottom from "@/components/NavBottom.vue";
import { previewCover } from "@/utils/common"; import { previewCover, provenimg } from "@/utils/common";
import { FromSend, ImgInfo, VideoInfo } from "@/types"; import { FromSend, ImgInfo, VideoInfo } from "@/types";
import { uploadflie } from "@/utils/vod"; import { uploadflie } from "@/utils/vod";
import { setvideo, videoadd, videodetail } from "@/api"; import { setvideo, videoadd, videodetail } from "@/api";
@ -191,6 +191,10 @@ export default defineComponent({
*/ */
const beforeCoverUpload = (file: File): boolean => { const beforeCoverUpload = (file: File): boolean => {
console.log(file); console.log(file);
const type = provenimg(file.name);
if(!type){
message.error("请重新选择")
}
return false; return false;
}; };