Commit 9d815ae5 authored by Your Name's avatar Your Name

缩略图不显示

parent 8a16c63b
...@@ -67,7 +67,7 @@ export default { ...@@ -67,7 +67,7 @@ export default {
) )
.then(res => { .then(res => {
let resData = res.data; let resData = res.data;
console.log(res) // console.log(res)
loading.close(); loading.close();
// this.loading = false // this.loading = false
if (resData.resultCode == "200") { if (resData.resultCode == "200") {
......
...@@ -72,7 +72,7 @@ export default { ...@@ -72,7 +72,7 @@ export default {
) )
.then(res => { .then(res => {
let resData = res.data; let resData = res.data;
console.log(res) // console.log(res)
loading.close(); loading.close();
// this.loading = false // this.loading = false
if (resData.resultCode == "200") { if (resData.resultCode == "200") {
...@@ -98,7 +98,7 @@ export default { ...@@ -98,7 +98,7 @@ export default {
}, },
uploadFile(file) { uploadFile(file) {
console.log(file) // console.log(file)
this.filedata.append('file', file.file) this.filedata.append('file', file.file)
}, },
beforeAvatarUpload(file) { beforeAvatarUpload(file) {
......
...@@ -27,7 +27,7 @@ export default { ...@@ -27,7 +27,7 @@ export default {
props:{ props:{
fileList:{ fileList:{
type:Array, type:Array,
default:[] default:() => []
}, },
}, },
data() { data() {
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
}, },
watch: { watch: {
fileList(newName, oldName) { fileList(newName, oldName) {
console.log(newName) // console.log(newName)
this.files = newName this.files = newName
// ... // ...
} }
...@@ -58,16 +58,16 @@ export default { ...@@ -58,16 +58,16 @@ export default {
const children = this.files; const children = this.files;
const index = children.findIndex(d => d.name === data.name); const index = children.findIndex(d => d.name === data.name);
children.splice(index, 1); children.splice(index, 1);
console.log(this.files,'111') // console.log(this.files,'111')
this.$emit("videoList", this.files.map(item=>item.id)); this.$emit("videoList", this.files.map(item=>item.id));
}, },
getFiles: function(event) { getFiles: function(event) {
console.log(event); // console.log(event);
var files = event.target.files; var files = event.target.files;
for (var i = 0; i < files.length; i++) { for (var i = 0; i < files.length; i++) {
this.files.push(files[i]); this.files.push(files[i]);
} }
console.log(this.files, "--"); // console.log(this.files, "--");
}, },
upload: function() { upload: function() {
const loading = this.$loading({ const loading = this.$loading({
...@@ -76,12 +76,12 @@ export default { ...@@ -76,12 +76,12 @@ export default {
spinner: 'el-icon-loading', spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}); });
console.log(this.files); // console.log(this.files);
var formData = new FormData(); var formData = new FormData();
for (var i = 0; i < this.files.length; i++) { for (var i = 0; i < this.files.length; i++) {
formData.append("file", this.files[i]); formData.append("file", this.files[i]);
} }
console.log(formData); // console.log(formData);
let _this = this; let _this = this;
_this _this
.$https( .$https(
...@@ -95,7 +95,7 @@ export default { ...@@ -95,7 +95,7 @@ export default {
.then(res => { .then(res => {
loading.close(); loading.close();
let resData = res.data; let resData = res.data;
console.log(res); // console.log(res);
if (resData.resultCode == "200") { if (resData.resultCode == "200") {
_this.$message.success("上传成功!"); _this.$message.success("上传成功!");
const data = resData.data.fileList; const data = resData.data.fileList;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
:on-remove="handleRemove" :on-remove="handleRemove"
:on-success="handleAvatarSuccess" :on-success="handleAvatarSuccess"
:headers="headers" :headers="headers"
:file-list="fileList" :file-list="fileShowList"
:limit="1" :limit="1"
:multiple ="false" :multiple ="false"
> >
...@@ -24,19 +24,24 @@ ...@@ -24,19 +24,24 @@
<script> <script>
export default { export default {
// props:{ props:{
// fileList:{ fileList:{
// type: Array, type: Array,
// default: () => [], default: () => [],
// }, },
// }, },
data() { data() {
return { return {
fileList: [], fileShowList: [],
dialogImageUrl: "", dialogImageUrl: "",
dialogVisible: false, dialogVisible: false,
imageUrl:"", imageUrl:"",
}; };
},
watch: {
fileList(val) {
this.fileShowList = val;
}
}, },
computed: { computed: {
headers() { headers() {
...@@ -45,7 +50,7 @@ export default { ...@@ -45,7 +50,7 @@ export default {
}; };
}, },
uploadDisabled:function() { uploadDisabled:function() {
return (this.fileList.length>0)||this.imageUrl return (this.fileShowList.length>0)||this.imageUrl
}, },
}, },
methods: { methods: {
...@@ -61,7 +66,7 @@ export default { ...@@ -61,7 +66,7 @@ export default {
handleRemove(file, fileList) { handleRemove(file, fileList) {
this.$emit("imgUrl", ""); this.$emit("imgUrl", "");
this.imageUrl="" this.imageUrl=""
this.fileList=[] this.fileShowList=[]
}, },
handlePictureCardPreview(file) { handlePictureCardPreview(file) {
this.dialogImageUrl = file.url; this.dialogImageUrl = file.url;
...@@ -72,7 +77,7 @@ export default { ...@@ -72,7 +77,7 @@ export default {
name: "", name: "",
url: cover, url: cover,
}; };
this.fileList = [file] this.fileShowList = [file]
}, },
}, },
}; };
......
...@@ -67,7 +67,7 @@ export default { ...@@ -67,7 +67,7 @@ export default {
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
console.log(file, fileList); // console.log(file, fileList);
this.$emit("qrcodeUrl", ""); this.$emit("qrcodeUrl", "");
this.imageUrl="" this.imageUrl=""
this.fileList=[] this.fileList=[]
......
...@@ -172,6 +172,7 @@ export default { ...@@ -172,6 +172,7 @@ export default {
videoContentCatIdList: "", videoContentCatIdList: "",
videoContentCatId: "", videoContentCatId: "",
thumbnail:"", thumbnail:"",
imageList: [],
videoFileIdList:[] videoFileIdList:[]
}, },
videoContentCat: [], videoContentCat: [],
...@@ -223,7 +224,7 @@ export default { ...@@ -223,7 +224,7 @@ export default {
}, },
// 缩略图地址 // 缩略图地址
imgUrl(url){ imgUrl(url){
console.log(url,'图片服务器地址') // console.log(url,'图片服务器地址')
this.ruleForm.thumbnail = url this.ruleForm.thumbnail = url
}, },
// 视频列表地址 // 视频列表地址
...@@ -238,8 +239,8 @@ export default { ...@@ -238,8 +239,8 @@ export default {
} }
}, },
getVideoContentCat(data){ getVideoContentCat(data){
console.log(data) // console.log(data)
console.log(this.ruleForm.videoContentCatId) // console.log(this.ruleForm.videoContentCatId)
}, },
// 获取信息 // 获取信息
getInfo(id) { getInfo(id) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment