Browse Source

banner视频样式修改

feature/syp_points
songyunpeng 5 years ago
parent
commit
8a60d32faf
  1. 13
      src/views/modules/news/banner-add-or-update.vue

13
src/views/modules/news/banner-add-or-update.vue

@ -104,7 +104,7 @@
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label="banner视频" <el-form-item label="banner视频"
v-loading="loading" v-loading="videoLoading"
prop="videoUrl"> prop="videoUrl">
<el-upload class="avatar-uploader" <el-upload class="avatar-uploader"
:action="this.uploadUrl" :action="this.uploadUrl"
@ -113,7 +113,7 @@
:on-error="handelError" :on-error="handelError"
:before-upload="beforeVideoUpload"> :before-upload="beforeVideoUpload">
<video class="video" v-if="dataForm.videoUrl" <video class="video" v-if="dataForm.videoUrl"
:src="dataForm.videoUrl" controls="controls"></video> :src="dataForm.videoUrl" controls="controls" height="178px" width="378px"></video>
<i v-else <i v-else
class="el-icon-plus avatar-uploader-icon"></i> class="el-icon-plus avatar-uploader-icon"></i>
</el-upload> </el-upload>
@ -157,7 +157,8 @@ export default {
options: [], options: [],
uploadUrl: '', uploadUrl: '',
positionList: [], positionList: [],
loading: false loading: false,
videoLoading: false
} }
}, },
computed: { computed: {
@ -256,20 +257,20 @@ export default {
}, },
handleVideoSuccess (res, file) { handleVideoSuccess (res, file) {
this.dataForm.videoUrl = res.data.url this.dataForm.videoUrl = res.data.url
this.loading = false this.videoLoading = false
}, },
beforeAvatarUpload (file) { beforeAvatarUpload (file) {
this.loading = true this.loading = true
}, },
beforeVideoUpload (file) { beforeVideoUpload (file) {
console.log(file)
if (file.size > 52428800) { if (file.size > 52428800) {
return this.$message.error('文件大小不能超过50M') return this.$message.error('文件大小不能超过50M')
} }
this.loading = true this.videoLoading = true
}, },
handelError () { handelError () {
this.loading = false this.loading = false
this.videoLoading = false
}, },
getListFromDict (dictType) { getListFromDict (dictType) {
this.$http.get(`/sys/dict/listSimple/` + dictType).then(({ data: res }) => { this.$http.get(`/sys/dict/listSimple/` + dictType).then(({ data: res }) => {

Loading…
Cancel
Save