Commit 1c562811 by 袁晓帅

添加上传视频loading的问题

parent ff9f2436
......@@ -91,7 +91,7 @@
<span style="margin: 0 5px;">--</span>
<el-date-picker v-model="editForm.endTime" type="date" :picker-options="EndOptions" placeholder="结束时间" style="width: 190px;" > </el-date-picker>
</el-form-item>
<el-form-item label="上传封面" required >
<el-form-item label="上传海报" required >
<div style="display: flex;flex-direction: column;">
<el-upload
class="avatar-uploader"
......@@ -264,7 +264,7 @@ export default {
}else if(that.addForm.endTime == ''){
that.showAlert('请选择活动结束时间~')
}else if(that.addForm.imgUrl == ''){
that.showAlert('请上传活动图片~')
that.showAlert('请上传海报~')
}else{
that.$axios.post('/activity/addActivity', that.addForm).then((res) => {
if (res.data.code === '0') {
......@@ -292,7 +292,7 @@ export default {
}else if(that.editForm.endTime == ''){
that.showAlert('请选择活动结束时间~')
}else if(that.editForm.imgUrl == ''){
that.showAlert('请上传活动图片~')
that.showAlert('请上传海报~')
}else{
var parem = Object.assign(that.editForm,{startTime:new Date(that.editForm.startTime),endTime:new Date(that.editForm.endTime),})
that.$axios.post('/activity/editActivityById', parem).then((res) => {
......
......@@ -52,11 +52,13 @@
<el-form-item label="上传视频" required style="margin-bottom: 12px !important;">
<div style="display: flex;flex-direction: column;">
<el-upload
v-loading="loading"
class="avatar-uploader"
action="http://39.97.169.207:9200/baseInfo/uploadPhoto"
:show-file-list="false"
:headers="headers"
:on-success="handlevideoSuccess"
:on-progress="upLoadImg"
v-if="videoShow"
>
<video v-if="addForm.videoUrl" :src="addForm.videoUrl" controls='controls' :autoplay="autoplay" class="avatar"/>
......@@ -101,11 +103,13 @@
<el-form-item label="上传视频" required style="margin-bottom: 12px !important;">
<div style="display: flex;flex-direction: column;">
<el-upload
v-loading="loading"
class="avatar-uploader"
action="http://39.97.169.207:9200/baseInfo/uploadPhoto"
:show-file-list="false"
:headers="headers"
:on-success="handlevideoedit"
:on-progress="upLoadImg"
v-if="videoShow"
>
<video v-if="editForm.videoUrl" :src="editForm.videoUrl" controls='controls' :autoplay="autoplay" class="avatar"/>
......@@ -219,8 +223,12 @@ export default {
this.imgShow = true
})
},
upLoadImg(){
this.loading = true
},
handlevideoSuccess(res, file) {
this.addForm.videoUrl = res.data;
this.loading = false
this.videoShow = false
this.$nextTick(() => {
this.videoShow = true
......@@ -228,6 +236,7 @@ export default {
},
handlevideoedit(res, file) {
this.editForm.videoUrl = res.data;
this.loading = false
this.videoShow = false
this.$nextTick(() => {
this.videoShow = true
......@@ -398,6 +407,11 @@ export default {
}
};
</script>
<style>
.el-loading-spinner{
width: 35% !important;
}
</style>
<style scoped lang="less">
.tableCont {
height: calc(100vh - 20px);
......
......@@ -637,7 +637,11 @@ export default {
margin: 0 15px;
}
.left {
display: flex;
display: -webkit-box; /* 老版本语法: Safari, iOS, Android browser, older WebKit browsers. */
display: -moz-box; /* 老版本语法: Firefox (buggy) */
display: -ms-flexbox; /* 混合版本语法: IE 10 */
display: -webkit-flex; /* 新版本语法: Chrome 21+ */
display: flex; /* 新版本语法: Opera 12.1, Firefox 22+ */
flex-direction: column;
align-items: center;
justify-content: center;
......@@ -787,7 +791,7 @@ export default {
}
.boxDiv3 {
width: 23%;
// height: 150px;
height: 248px;
overflow: hidden;
background: #ffffff;
border: 1px solid #ffffff;
......
......@@ -172,7 +172,7 @@ export default {
},
upload(data) {
if (data === 1) {
window.open(this.fileUrl + 'static/xls/模板.xls')
window.open(this.fileUrl + 'static/xls/出售车位模板.xls')
} else if (data === 3) {
this.$axios({
method: 'post',
......
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 sign in to comment