This commit is contained in:
DL
2024-03-26 19:27:30 +08:00
3 changed files with 49 additions and 1 deletions

View File

@@ -506,6 +506,7 @@ export default {
pid: this.tableData.pid ? this.tableData.pid : 0,
};
formData.append('multipart', param.file);
console.log(param);
this.uploadPic(formData, data);
},
uploadPic(formData, data) {
@@ -515,9 +516,11 @@ export default {
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)',
});
console.log(formData, data);
fileImageApi(formData, data)
.then((res) => {
loading.close();
console.log(res,'1');
this.$message.success('上传成功');
this.tableData.page = 1;
this.getFileList();

View File

@@ -31,6 +31,7 @@ export default {
this.visible = false;
},
getImage(img) {
console.log(img)
this.callback(img);
this.visible = false;
},

View File

@@ -28,6 +28,7 @@
<div class="upLoadPicBox" @click="modalPicTap('2', 'video')">
<div v-if="user.video" class="pictrue">
<div style="width: 170px; height: 108px">
<<<<<<< HEAD
<video
ref="video"
id="video"
@@ -39,10 +40,25 @@
@input="inputvideoUrl"
style="width: 100%; height: 100%"
></video>
=======
<video
ref="video"
id="video"
:src="user.video"
:autoplay="videolist.autoplay"
:controls="videolist.controls"
:controlslist="videolist.controlslist"
:webkit-playsinline="webkitplaysinline"
@loadedmetadata="getVideoAspectRatio"
@input="inputvideoUrl"
style="width: 100%; height: 100%"
></video>
>>>>>>> 75aff14368f874b7d896e4ec7fae9d07f2a33e4e
</div>
</div>
<div v-else-if="formValidate.video" class="pictrue">
<div style="width: 170px; height: 108px"></div>
<<<<<<< HEAD
<video
ref="video"
id="video"
@@ -54,6 +70,19 @@
@input="inputvideoUrl"
style="width: 100%; height: 100%"
></video>
=======
<video
ref="video"
id="video"
:src="formValidate.video"
:autoplay="videolist.autoplay"
:controls="videolist.controls"
:controlslist="videolist.controlslist"
:webkit-playsinline="webkitplaysinline"
@input="inputvideoUrl"
style="width: 100%; height: 100%"
></video>
>>>>>>> 75aff14368f874b7d896e4ec7fae9d07f2a33e4e
</div>
<div v-else class="upLoad">
<i class="el-icon-camera cameraIconfont" />
@@ -163,6 +192,8 @@ export default {
},
webkitplaysinline: 'true',
// 以上是点击查看有关
//视频比例
aspectRatio: 0,
};
},
mounted() {
@@ -186,6 +217,17 @@ export default {
},
},
methods: {
getVideoAspectRatio(e) {
console.log(e);
const video = this.$refs.video;
if (video) {
// console.log(video.videoWidth,video.videoHeight);
this.user.wide = video.videoWidth;
this.user.high = video.videoHeight;
this.aspectRatio = video.videoWidth / video.videoHeight;
// console.log(this.aspectRatio);
}
},
//监听上传视频
inputvideoUrl(url) {
// console.log(url);
@@ -223,7 +265,7 @@ export default {
_this.formValidate.image = img[0].sattDir;
this.$set(_this.user, 'image', _this.formValidate.image);
} else {
console.log(img[0].sattDir);
console.log(img[0]);
_this.formValidate.video = img[0].sattDir;
this.$set(_this.user, 'video', _this.formValidate.video);
}
@@ -253,6 +295,8 @@ export default {
id: this.user.id,
type: this.user.type,
video: this.user.video,
wide: this.user.wide,
high: this.user.high,
};
this.user.id
? updateNoteAPI(data)