Browse Source

封面,其他图片新增进度条

dev
liuzewei 3 years ago
parent
commit
2a26995887
1 changed files with 67 additions and 4 deletions
  1. 71
      src/views/sce/sceInfo/index.vue

71
src/views/sce/sceInfo/index.vue

@ -152,11 +152,14 @@
:on-change="uploadImg"
:on-success="handleAvatar"
:before-upload="beforeAvatarUpload"
element-loading-text="正在上传..."
v-loading="loadingCover"
>
<img v-if="ruleForm.cover" :src="ruleForm.cover" class="avatar" />
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
<el-progress :percentage="jinduCoverNum" v-if="jinduShowCover" status="success"></el-progress>
<el-form-item label="其它图片" style="width:100%">
<div
v-for="(item, l) in dataImg"
@ -188,6 +191,8 @@
list-type="picture-card"
:show-file-list="false"
:http-request="changeImgs"
element-loading-text="正在上传..."
v-loading="loadingOtherImg"
>
<i class="el-icon-plus"></i>
</el-upload>
@ -221,6 +226,7 @@
</div>
</el-upload> -->
</el-form-item>
<el-progress :percentage="jinduOtherImgNum" v-if="jinduShowOtherImg" status="success"></el-progress>
<h3 class="form-title">剧本简介</h3>
<el-form-item label="简介" prop="introduction" style="width:100%">
<!-- <el-input
@ -971,9 +977,13 @@ export default {
audioTitle:'',//
videoTitle:'',//
jindu:0,
jinduCoverNum:0,//
jinduOtherImgNum:0,//
jinduImgNum:0,
jinduAudioNum:0,
jinduVideoNum:0,
jinduShowCover:false,//
jinduShowOtherImg:false,//
jinduShowImg:false,
jinduShowAudio:false,
jinduShowVideo:false,
@ -982,6 +992,8 @@ export default {
videoTime:null,
liuChengLeixingType:'',
loadingOtherImg:false,//
loadingCover:false,//
loadingAudio: false,
loadingImg:false,
baseUrl,
@ -1665,6 +1677,9 @@ export default {
},
//
async uploadImg(file, fileList) {
this.loadingCover=true;//
this.jinduCoverNum=0;//0
this.jinduShowCover=true;//
try {
let formData = new FormData();
let type = file.raw.type;
@ -1673,16 +1688,50 @@ export default {
let res = await uploadFile(formData);
// this.ruleForm.cover = res.data.wjUrl;
this.$set(this.ruleForm, "cover", res.data.wjUrl);
this.loadingCover=false;
clearInterval(this.videoTime); //
this.videoTime = null; //
this.successVideo('cover')
} catch (err) {}
let videoJindu1 = setTimeout(() => {
this.jinduVideoNum = 30;
}, 500);
let videoJindu2 = setTimeout(() => {
videoJindu1
this.jinduVideoNum = 69;
}, 1000);
this.videoTime = setTimeout(() => {
videoJindu2
this.jinduVideoNum = 94;
}, 1500);
},
//
changeImgs({ file }) {
this.loadingOtherImg = true; //
this.jinduOtherImgNum = 0;//0
this.jinduShowOtherImg = true; //
let formData = new FormData();
formData.append("file", file);
formData.append("type", "product");
uploadFile(formData).then(res => {
this.dataImg.push(res.data.wjUrl);
this.loadingOtherImg = false; //
clearInterval(this.videoTime); //
this.videoTime = null; //
this.successVideo('otherImg'); //
});
let videoJindu1 = setTimeout(() => {
this.jinduVideoNum = 30;
}, 500);
let videoJindu2 = setTimeout(() => {
videoJindu1
this.jinduVideoNum = 80;
}, 1000);
this.videoTime = setTimeout(() => {
videoJindu2
this.jinduVideoNum = 90;
}, 1500);
},
beforeAvatarUpload(file) {
const isJPG = file.type;
@ -1946,7 +1995,7 @@ export default {
});
this.imgType = true;
this.loadingImg = false;
this.jinduImgNum = 100;
// this.jinduImgNum = 100;
this.jinduShowImg = false;
clearInterval(this.videoTime);
this.videoTime = null;
@ -1984,8 +2033,8 @@ export default {
});
this.loadingAudio = false;
this.musicType = true;
this.jinduAudioNum = 100;
this.jinduShowAudio = false;
// this.jinduAudioNum = 100;
// this.jinduShowAudio = false;
clearInterval(this.videoTime);
this.videoTime = null;
this.successVideo('audio');
@ -2045,6 +2094,18 @@ export default {
successVideo(type){
console.log('上传成功');
switch (type) {
case 'cover': //
this.jinduCoverNum = 100;
setTimeout(() => {
this.jinduShowCover = false;
}, 1200);
break;
case 'otherImg': //
this.jinduOtherImgNum = 100;
setTimeout(() => {
this.jinduShowOtherImg = false;
}, 1200);
break;
case 'img':
this.jinduImgNum = 100;
setTimeout(() => {
@ -2194,7 +2255,9 @@ export default {
}
this.list = item;
this.typeUrl = type;
// this.processId = "";
if(this.dialog.title == "新增剧本"){
this.processId = "";
}
this.process.Visible = true;
},
subMitLc() {

Loading…
Cancel
Save