提交 fcd2dddc 编写于 作者: bo.dang's avatar bo.dang

新建直播新增图片修改

上级 fcf718bd
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
</el-col> </el-col>
<el-col :span="16"> <el-col :span="16">
<!--<div v-for="(item, index) in formData.rtcIntroduces.filter(obj=> obj.type === 2)" :key="index" style="margin-left:0px;min-width: 380px;display: flex;align-items: center">--> <!--<div v-for="(item, index) in formData.rtcIntroduces.filter(obj=> obj.type === 2)" :key="index" style="margin-left:0px;min-width: 380px;display: flex;align-items: center">-->
<div v-for="(item, index) in formData.rtcIntroducesImages" :key="index" style="margin-left:0px;min-width: 380px;display: flex;align-items: center"> <div v-for="(item, index) in rtcIntroducesImages" :key="index" style="margin-left:0px;min-width: 380px;display: flex;align-items: center">
<el-upload <el-upload
class="bg-uploader" class="bg-uploader"
action="#" action="#"
...@@ -163,8 +163,8 @@ ...@@ -163,8 +163,8 @@
@click="getIndexIntroduce(index)"/> @click="getIndexIntroduce(index)"/>
</el-upload> </el-upload>
<div class="limit-text" style="font-size: 12px;color: #999;margin-left: 10px;margin-top: -10px;"> <div class="limit-text" style="font-size: 12px;color: #999;margin-left: 10px;margin-top: -10px;">
<p>限制大小: 100kb</p> <p>限制大小: 2Mb</p>
<p>尺寸:750*(不限高度</p> <p>尺寸:750*(高度<3000</p>
<p>支持jpeg, png格式</p> <p>支持jpeg, png格式</p>
</div> </div>
<!--<img--> <!--<img-->
...@@ -401,7 +401,6 @@ ...@@ -401,7 +401,6 @@
preImage: '', // 直播预告图url preImage: '', // 直播预告图url
textContent: '', // 直播简介文字版 textContent: '', // 直播简介文字版
imageContent: '',// 直播简介图片版 imageContent: '',// 直播简介图片版
rtcIntroducesImages: [],
// imgUrl2: '', // imgUrl2: '',
// imgUrl2More: {}, // imgUrl2More: {},
// imgUrl3: '', // imgUrl3: '',
...@@ -424,6 +423,7 @@ ...@@ -424,6 +423,7 @@
}] // 嘉宾 }] // 嘉宾
}, },
introTextNum: 0, introTextNum: 0,
rtcIntroducesImages: [],
// imgUrl1: '', // imgUrl1: '',
imgUrl1More: {}, imgUrl1More: {},
guestErrFlag: false, guestErrFlag: false,
...@@ -585,9 +585,9 @@ ...@@ -585,9 +585,9 @@
beforeUploadPic1(file) { beforeUploadPic1(file) {
let fileLimit = { let fileLimit = {
width: 750, width: 750,
height: "", height: 3000,
size: 0.1, size: 2,
sizeText: "100k", sizeText: "2Mb",
key: "imageContent", key: "imageContent",
more: "imgUrl1More", more: "imgUrl1More",
show: "uploadImgMessage1" show: "uploadImgMessage1"
...@@ -684,14 +684,14 @@ ...@@ -684,14 +684,14 @@
vm.$message.info('开始上传'); vm.$message.info('开始上传');
const isJPG = file.type === 'image/jpeg' const isJPG = file.type === 'image/jpeg'
const isPNG = file.type === 'image/png' const isPNG = file.type === 'image/png'
const isLt100kb = file.size / 1024 < 100 const isLt2M = file.size / 1024 / 1024 < fileLimit.size
if (!isJPG && !isPNG) { if (!isJPG && !isPNG) {
vm.$message.error('上传直播简介图片只能是 JPEG或者png 格式!') vm.$message.error('上传直播简介图片只能是 JPEG或者png 格式!')
// vm.isDisabledIns = false; // vm.isDisabledIns = false;
return; return;
} }
if (!isLt100kb) { if (!isLt2M) {
vm.$message.error('上传图片大小不能超过 100kb') vm.$message.error('图片大小不符合规范,请根据规范上传图片')
// vm.isDisabledIns = false; // vm.isDisabledIns = false;
return; return;
} }
...@@ -710,8 +710,8 @@ ...@@ -710,8 +710,8 @@
}else { }else {
doUpload(vm,file, getFilePath(file,null), 'preview4', 'progress1', 1).then(function (path) { doUpload(vm,file, getFilePath(file,null), 'preview4', 'progress1', 1).then(function (path) {
// vm.cleatBroadcast.liveIntroduceModel[vm.introduceIndex].content = path.fullPath; // vm.cleatBroadcast.liveIntroduceModel[vm.introduceIndex].content = path.fullPath;
vm.formData.rtcIntroduces[vm.introduceIndex].content = path.fullPath; vm.rtcIntroducesImages[vm.introduceIndex].content = path.fullPath;
vm.formData.rtcIntroduces[vm.introduceIndex].seqNo = vm.introduceIndex+1; vm.rtcIntroducesImages[vm.introduceIndex].seqNo = vm.introduceIndex+1;
vm.$message.success('上传成功'); vm.$message.success('上传成功');
// vm.isDisabledIns = false; // vm.isDisabledIns = false;
}); });
...@@ -805,13 +805,20 @@ ...@@ -805,13 +805,20 @@
// 公开直播,两个拉流地址都需要 // 公开直播,两个拉流地址都需要
if(this.formData.scope == "2"){ if(this.formData.scope == "2"){
if(this.formData.pullStreamRtmp == "" && this.formData.pullStreamHttp == ""){
this.$message.warning("请输入APP拉流地址和H5拉流地址");
flag = false;
return flag;
}
if(this.formData.pullStreamRtmp == ""){ if(this.formData.pullStreamRtmp == ""){
this.$message.warning("请输入APP拉流地址"); this.$message.warning("请输入APP拉流地址");
flag = false; flag = false;
return flag;
} }
if(this.formData.pullStreamHttp == ""){ if(this.formData.pullStreamHttp == ""){
this.$message.warning("请输入H5拉流地址"); this.$message.warning("请输入H5拉流地址");
flag = false; flag = false;
return flag;
} }
} }
else { else {
...@@ -841,7 +848,7 @@ ...@@ -841,7 +848,7 @@
}, },
// 增加直播简介 // 增加直播简介
addIntroImage(){ addIntroImage(){
let length = this.formData.rtcIntroduces.length; let length = this.rtcIntroducesImages.length;
if(length > 5){ if(length > 5){
...@@ -849,18 +856,18 @@ ...@@ -849,18 +856,18 @@
return; return;
} }
this.showIntroImageFlag = true; this.showIntroImageFlag = true;
const item = { const item = {
seqNo: length + 1, seqNo: length + 1,
content: '', content: "",
type: 2 // 文字 type: 2 // 文字
}; };
this.formData.rtcIntroduces.push(item); this.rtcIntroducesImages.push(item);
}, },
// 删除直播简介 // 删除直播简介
delIntroImage(index, item){ delIntroImage(index, item){
this.formData.rtcIntroduces.splice(index, 1); this.rtcIntroducesImages.splice(index, 1);
}, },
...@@ -1003,7 +1010,7 @@ ...@@ -1003,7 +1010,7 @@
this.formData.infoCollect = String(this.formData.infoCollect); this.formData.infoCollect = String(this.formData.infoCollect);
this.$set(this.formData, 'textContent', ""); this.$set(this.formData, 'textContent', "");
if(this.formData.rtcIntroduces != null){ if(this.formData.rtcIntroduces != null){
this.formData.rtcIntroducesImages = []; this.rtcIntroducesImages = [];
for(let i=0;i<this.formData.rtcIntroduces.length;i++) { for(let i=0;i<this.formData.rtcIntroduces.length;i++) {
if(this.formData.rtcIntroduces[i].type == "1"){ if(this.formData.rtcIntroduces[i].type == "1"){
// this.formData.textContent = this.formData.rtcIntroduces[i].content; // this.formData.textContent = this.formData.rtcIntroduces[i].content;
...@@ -1011,13 +1018,22 @@ ...@@ -1011,13 +1018,22 @@
// break; // break;
} }
else { else {
this.formData.rtcIntroducesImages.push(this.formData.rtcIntroduces[i]); // this.$set(this.formData, "rtcIntroducesImages", )
this.rtcIntroducesImages.push(this.formData.rtcIntroduces[i]);
} }
// else if(this.formData.rtcIntroduces[i].type == "2"){ // else if(this.formData.rtcIntroduces[i].type == "2"){
// // this.formData.imageContent = this.formData.rtcIntroduces[i].content; // // this.formData.imageContent = this.formData.rtcIntroduces[i].content;
// this.$set(this.formData, 'imageContent', this.formData.rtcIntroduces[i].content); // this.$set(this.formData, 'imageContent', this.formData.rtcIntroduces[i].content);
// } // }
} }
// this.rtcIntroducesImages = this.formData.rtcIntroduces.filter(function (item) {
// return item.type == "2";
// });
} }
// (formData.textContent).replace(/\s+/g,"").length // (formData.textContent).replace(/\s+/g,"").length
...@@ -1047,7 +1063,7 @@ ...@@ -1047,7 +1063,7 @@
} }
// 直播简介图片版 // 直播简介图片版
this.formData.rtcIntroduces = this.formData.rtcIntroducesImages; this.formData.rtcIntroduces = this.rtcIntroducesImages;
// 直播简介文字版 // 直播简介文字版
if(this.formData.textContent != null && this.formData.textContent != ""){ if(this.formData.textContent != null && this.formData.textContent != ""){
this.formData.rtcIntroduces.push({type:1,content:this.formData.textContent}); this.formData.rtcIntroduces.push({type:1,content:this.formData.textContent});
......
...@@ -173,17 +173,17 @@ ...@@ -173,17 +173,17 @@
</el-radio-group> </el-radio-group>
</div> </div>
<div v-if="uploadFlag"> <div v-if="uploadFlag" style="line-height: 40px;">
<div v-if="numberShowFlag"> <div v-if="numberShowFlag">
<span>存在"{{videoNumber}}段"直播原视频,请下载合并后上传</span> <span>存在"{{videoNumber}}段"直播原视频,请下载合并后上传</span>
</div> </div>
<div style="margin-left:30px;"> <div style="margin-left:30px;">
<span>①下载原视频</span> <span>①下载原视频</span>
<!--<el-col :span="1">--> <!--<el-col :span="1">-->
<!--<img style="vertical-align: middle" src="../../assets/image/icon_download.png" />-->
<!--</el-col>--> <!--</el-col>-->
<el-button @click="download('model')" style="margin-left: 190px;" size="small" type="text">下载</el-button> <el-button @click="download('model')" size="small" type="text"><img style="vertical-align: middle;margin-left: 150px" src="../../assets/image/icon_download.png" />下载</el-button>
</div> </div>
<div style="margin-left:30px;"> <div style="margin-left:30px;">
...@@ -195,22 +195,22 @@ ...@@ -195,22 +195,22 @@
:limit="1" :limit="1"
:before-upload="beforeVideoUpload"> :before-upload="beforeVideoUpload">
<!--<el-col :span="1">--> <!--<el-col :span="1">-->
<!--<img style="vertical-align: middle" src="../../assets/image/icon_upload.png" />-->
<!--</el-col>--> <!--</el-col>-->
<el-button type="text" size="small" v-if="fileFlag">上传(仅支持mp4)</el-button> <el-button type="text" size="small" v-if="fileFlag"><img style="vertical-align: middle;margin-left: 120px;" src="../../assets/image/icon_upload.png" />上传(仅支持mp4)</el-button>
<!--<video class="video-mg-url" controls preload :src="cleatBroadcast.liveInfo.mgUrl"></video>--> <!--<video class="video-mg-url" controls preload :src="cleatBroadcast.liveInfo.mgUrl"></video>-->
<!-- <img v-if="!cleatBroadcast.liveInfo.mgUrl" class="video-bg-img" src="../../../static/img/small.png"> --> <!-- <img v-if="!cleatBroadcast.liveInfo.mgUrl" class="video-bg-img" src="../../../static/img/small.png"> -->
</el-upload> </el-upload>
<el-progress <el-progress
:text-inside="true" :text-inside="true"
:stroke-width="16" :stroke-width="28"
:percentage="uploadProgress1" :percentage="uploadProgress1"
status="success" status="success"
v-show="uploadProgress1 > 0 && uploadProgress1 < 100"> v-show="uploadProgress1 > 0 && uploadProgress1 < 100">
</el-progress> </el-progress>
<div v-if="deleteFileFlag"> <div v-if="deleteFileFlag">
<span>{{playbackForm.videos[0].videoName}}({{videoToSize(playbackForm.videos[0].videoSize, 1)}}M)</span> <span>{{videoToName(playbackForm.videos[0].videoName, 6)}}({{videoToSize(playbackForm.videos[0].videoSize, 1)}}M)</span>
<el-button @click="delVideo" style="margin-left: 190px;" size="small" type="text">删除</el-button> <el-button @click="delVideo" style="margin-left: 100px;" size="small" type="text">删除</el-button>
</div> </div>
<!--<div v-if="fileFlag">--> <!--<div v-if="fileFlag">-->
<!----> <!---->
...@@ -550,9 +550,25 @@ export default { ...@@ -550,9 +550,25 @@ export default {
return (fileSize / 1024 / 1024).toFixed(number); return (fileSize / 1024 / 1024).toFixed(number);
}, },
videoToName(fileName, number){
if(fileName != ""){
const index = fileName.indexOf(".mp4");
const str = fileName.slice(0, index);
if(str.length > number){
return str.slice(0,number+1) + "..." + ".mp4";
}
else {
return fileName;
}
}
return fileName;
},
// 上传视频 // 上传视频
beforeVideoUpload(file){ beforeVideoUpload(file){
vm.fileFlag = true; vm.fileFlag = false;
vm.deleteFileFlag = true;
// vm.fileName = file.name; // vm.fileName = file.name;
// if(file.size != null){ // if(file.size != null){
// vm.fileSize = vm.videoSize(file.size, 1); // vm.fileSize = vm.videoSize(file.size, 1);
...@@ -583,7 +599,7 @@ export default { ...@@ -583,7 +599,7 @@ export default {
vm.deleteFileFlag = true; vm.deleteFileFlag = true;
vm.$message.success('上传成功') vm.$message.success('上传成功');
}); });
}, },
...@@ -657,7 +673,8 @@ export default { ...@@ -657,7 +673,8 @@ export default {
if(res.code == "000000") { if(res.code == "000000") {
// if(canPlayback == 0){ // if(canPlayback == 0){
this.$message.success("关闭成功"); vm.$message.success("关闭成功");
vm.getLiveList("", "");
} else { } else {
...@@ -665,7 +682,7 @@ export default { ...@@ -665,7 +682,7 @@ export default {
} }
}).catch((error) => { }).catch((error) => {
this.$message.error("请重试"); vm.$message.error("请重试");
}) })
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册