Commit 2481c45c authored by zhengke's avatar zhengke

增加视频选择

parent 45302d65
......@@ -158,14 +158,20 @@
left: 0;
top: 20px;
}
.DMCActiveclass{
width:98px;
margin:0 25px;
}
.DmcactiveMyClass{
width:32px!important;
}
</style>
<template>
<div class="DMCchooseImg">
<div style="width:98px;margin:0 25px;" v-if="this.IsShowVideo">
<div class="DMCActiveclass" v-if="this.IsShowVideo" :class="{'DmcactiveMyClass':this.isVideoActive}">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="图片" name="first"></el-tab-pane>
<el-tab-pane label="视频" name="second"></el-tab-pane>
<el-tab-pane v-if="isSHowImgCheck" label="图片" name="first"></el-tab-pane>
<el-tab-pane v-if="isSHowVideoCheck" label="视频" name="second"></el-tab-pane>
</el-tabs>
</div>
<div v-if="activeName=='first'">
......@@ -232,7 +238,7 @@
<script>
export default {
props: ["imgType", "isCheckmore", 'queryItem', 'IsShowAdd', 'IsShowVideo'],
props: ["imgType", "isCheckmore", 'queryItem', 'IsShowAdd', 'IsShowVideo','checkType'],
data() {
return {
queryMsg: {
......@@ -260,6 +266,9 @@
videoListArray: [],
//选中视频数组
selectVideoArr: [],
isSHowImgCheck:true,
isSHowVideoCheck:true,
isVideoActive:false,
};
},
methods: {
......@@ -444,6 +453,19 @@
},
created() {},
mounted() {
if(this.checkType==2){
this.isSHowVideoCheck=true
this.isSHowImgCheck=false
this.activeName='second'
this.getVideoList();
this.isVideoActive=true;
}else if(this.checkType==1){
this.isSHowImgCheck=true
this.isSHowVideoCheck=false
this.activeName='first'
this.getList();
this.isVideoActive=true;
}
this.queryMsg.Type = this.imgType;
this.getQueryItem();
this.getList();
......@@ -457,6 +479,24 @@
this.getVideoList();
},
deep: true
},
checkType:{
handler: function (val, oldVal) {
if(val==2){
this.isSHowImgCheck=false
this.isSHowVideoCheck=true
this.activeName='second'
this.getVideoList();
this.isVideoActive=true;
}else if(val==1){
this.isSHowImgCheck=true
this.isSHowVideoCheck=false
this.activeName='first'
this.getList();
this.isVideoActive=true;
}
},
deep: true
}
}
......
......@@ -60,14 +60,20 @@
.TC_tcnum{margin-left:20px;}
.TravelConfig ._VideoStr_box{
position: relative;
padding-right: 80px;
padding-right: 160px;
}
.TravelConfig ._VideoStr_box ._VideoStr_upload{
width: 80px;
position: absolute;
right: 0;
right: 75px;
top: 7px;
}
.TravelConfig ._VideoStr_box .TC_ChoiceBtn{
width: 70px;
position: absolute;
right: 0;
top: 7px;
}
.TC_comDMCchoose .el-dialog__body{
padding:5px 25px 30px;
}
......@@ -144,7 +150,7 @@
</div>
<div class="_VideoStr_box" :class="{'showOther':TeamType==3}">
<el-form-item :label="$t('sm.shipindizhi')">
<el-input v-model="PostConfig.VideoStr" type="textarea" :autosize="{minRows: 1, maxRows: 1 }"
<el-input v-model="PostConfig.VideoStr" class="w700" type="textarea" :autosize="{minRows: 1, maxRows: 1 }"
placeholder="https//:video.mp4" @blur="loadVideo"></el-input>
</el-form-item>
<el-upload
......@@ -156,6 +162,7 @@
:file-list="VideoStrList">
<el-button size="small" type="primary">{{$t('tips.dianjishanhcuan')}}</el-button>
</el-upload>
<el-button size="small" class="TC_ChoiceBtn" @click="checkType=2,addimg=true" type="primary">选择</el-button>
</div>
<div style="text-align: center;" v-if="VideoStr">
<video :src="VideoStr" width="660" height="320" class="avatar" controls="controls">{{$t('pub.unlimitedSel')}}您的浏览器不支持视频播放</video>
......@@ -198,7 +205,7 @@
</div>
<el-dialog custom-class="TC_comDMCchoose" :title="$t('pub.addImg')" center :visible.sync="addimg">
<DMCchooseImg @closeImg="closeDMCchooseImg" ref="DMCchooseImg1" @headCallBack="getDMCimg" v-bind:isCheckmore="1"
v-bind:imgType="3" v-bind:IsShowVideo="true"></DMCchooseImg>
v-bind:imgType="3" v-bind:IsShowVideo="true" v-bind:checkType="checkType"></DMCchooseImg>
</el-dialog>
<el-dialog custom-class="w600" :title="$t('sm.yijiansc')" :visible.sync="outerVisible" center>
<el-upload v-if="PostConfig.IsDirect ==0" ref="ticketUpload" drag class="upload-demo" :action="getImportFileUrl()"
......@@ -236,6 +243,7 @@
GGMapShow: false,
VideoStrList: [],
VideoStr: '',
checkType:1
};
},
components: {
......@@ -333,17 +341,22 @@
addImgOpen(index) {
this.addimg = true;
this.ChooseImgIndex = index;
this.checkType=1;
},
getDMCimg(imgArr) {
var that = this;
imgArr.forEach(imgItem => {
var obj = this.$DMCUtils.DMCImageObj();
obj.ID = 0;
obj.Path = this.$commonUtils.removeDomain(imgItem.Path);
obj.PicID = imgItem.ID;
obj.ShowPath = imgItem.Path + "?x-oss-process=image/resize,l_140";
that.PostConfig.fileList[this.ChooseImgIndex].Url = obj.ShowPath;
});
if(this.checkType==1){
var that = this;
imgArr.forEach(imgItem => {
var obj = this.$DMCUtils.DMCImageObj();
obj.ID = 0;
obj.Path = this.$commonUtils.removeDomain(imgItem.Path);
obj.PicID = imgItem.ID;
obj.ShowPath = imgItem.Path + "?x-oss-process=image/resize,l_140";
that.PostConfig.fileList[this.ChooseImgIndex].Url = obj.ShowPath;
});
}else{
this.PostConfig.VideoStr=imgArr[0].VideoPath;
}
},
//获取系列列表
getLineTeamList(lineId, isDefault) {
......
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