Commit c7c84f31 authored by youjie's avatar youjie

直客首页

parent fa1fe682
......@@ -461,28 +461,42 @@
//获取数据
setSubPlugData() {
this.currentEditItem.plugData = JSON.parse(JSON.stringify(this.currentEditItemData));
if(!this.currentEditItem.plugData.Logo) return this.Error(this.$t('objFill.v101.qingwspzxxi')+'-Web LOGO')
if(!this.currentEditItem.plugData.MLogo) return this.Error(this.$t('objFill.v101.qingwspzxxi')+'-Mobile LOGO')
if(this.currentEditItem.plugData.MenuList.length>0){
for(let j=0;j<this.currentEditItem.plugData.MenuList.length;j++){
let y = this.currentEditItem.plugData.MenuList[j]
if(!y.MenuName||!y.MenuSubName||!y.FileUrl||!y.LinkUrl||y.SubMenuList.length==0) {
return this.Error(this.$t('objFill.v101.qingwspzxxi')+'-'+(j+1))
if(this.currentEditItem.Id&&(this.currentEditItem.Id=="index_nav"||
this.currentEditItem.Id=="index_slider1"||
this.currentEditItem.Id=="index_roll1"||
this.currentEditItem.Id=="index_roll2")){
if(this.currentEditItem.Id=="index_nav"&&!this.currentEditItem.plugData.Logo) return this.Error(this.$t('objFill.v101.qingwspzxxi')+'-Web LOGO')
if(!this.currentEditItem.plugData.MLogo) return this.Error(this.$t('objFill.v101.qingwspzxxi')+'-Mobile LOGO')
if(this.currentEditItem.plugData.MenuList&&this.currentEditItem.plugData.MenuList.length>0){
for(let j=0;j<this.currentEditItem.plugData.MenuList.length;j++){
let y = this.currentEditItem.plugData.MenuList[j]
if(!y.MenuName||!y.MenuSubName||!y.FileUrl||!y.LinkUrl||y.SubMenuList.length==0) {
return this.Error(this.$t('objFill.v101.qingwspzxxi')+'-'+(j+1))
}
for(let g=0;g<y.SubMenuList.length;g++){
let z = y.SubMenuList[g]
if(!z.MenuName||!z.MenuSubName||!z.LinkUrl) {
return this.Error(this.$t('objFill.v101.qingwspzxxi')+'-'+(j+1)+'-'+(g+1))
}
}
}
for(let g=0;g<y.SubMenuList.length;g++){
let z = y.SubMenuList[g]
if(!z.MenuName||!z.MenuSubName||!z.LinkUrl) {
return this.Error(this.$t('objFill.v101.qingwspzxxi')+'-'+(j+1)+'-'+(g+1))
}
if(this.currentEditItem.plugData.NavList&&this.currentEditItem.plugData.NavList.length>0){
for(let j=0;j<this.currentEditItem.plugData.NavList.length;j++){
let y = this.currentEditItem.plugData.NavList[j]
if(!y.SubName||!y.SubEnName||!y.FileUrl||!y.LinkUrl) {
return this.Error(this.$t('objFill.v101.qingwspzxxi')+'-'+(j+1))
}
}
}
}
if(this.currentEditItem.plugData.BottomList.length>0){
for(let i=0;i<this.currentEditItem.plugData.BottomList.length;i++){
let x = this.currentEditItem.plugData.BottomList[i]
if(!x.LinkTitle||!x.LinkUrl) return this.Error('Foot Menu'+ this.$t('objFill.v101.qingwspzxxi')+'-'+(i+1))
if(this.currentEditItem.plugData.BottomList.length>0){
for(let i=0;i<this.currentEditItem.plugData.BottomList.length;i++){
let x = this.currentEditItem.plugData.BottomList[i]
if(!x.LinkTitle||!x.LinkUrl) return this.Error('Foot Menu'+ this.$t('objFill.v101.qingwspzxxi')+'-'+(i+1))
}
}
}
this.isShowDialog = false;
},
......
......@@ -155,13 +155,12 @@
<td rowspan="2">
<el-form-item :label="$t('objFill.v101.fengmian')+(index+1)" style="margin-bottom: 0;">
<div class="webSliderDiv" @click="menuIndex=index">
<el-upload :http-request="UploadAttachment"
:before-upload="item.FileType==2?beforeUploadVideo:''"
<el-upload :http-request="(file)=>UploadAttachment(file,item.FileType)"
:before-upload="(file)=>beforeUploadVideo(file,item.FileType)"
:multiple="false" :accept="getAccept(item.FileType)"
:show-file-list="false" action="">
<img v-if="item.FileType==1&&item.FileUrl" :src="item.FileUrl" class="web_imgUrl" alt="" />
<video v-if="item.FileType==2&&item.FileUrl" :src="item.FileUrl" class="web_imgUrl"
alt=""></video>
<video v-if="item.FileType==2&&item.FileUrl" :src="item.FileUrl" class="web_imgUrl"></video>
<div class="addIconDiv">
<i class="web_addImg iconfont icon-img_haha"></i>
<i class="web_delImg iconfont icon-img_delete_small" style="margin-left:10px;"
......@@ -224,7 +223,9 @@
<td rowspan="2">
<el-form-item :label="$t('objFill.v101.fengmian')+(index+1)+`-`+(subIndex+1)" style="margin-bottom: 0;">
<div class="webSliderDiv" @click="menuIndex=index,subMenuIndex=subIndex">
<el-upload :http-request="UploadAttachment2" :multiple="true" :accept="getAccept(sub.FileType)"
<el-upload
:before-upload="(file)=>beforeUploadVideo(file,sub.FileType)"
:http-request="(file)=>UploadAttachment2(file,sub.FileType)" :multiple="true" :accept="getAccept(sub.FileType)"
:show-file-list="false" action="">
<img v-if="sub.FileType==1&&sub.FileUrl" :src="sub.FileUrl" class="web_imgUrl" alt="" />
<video v-if="sub.FileType==2&&sub.FileUrl" :src="sub.FileUrl" class="web_imgUrl" alt=""></video>
......@@ -424,7 +425,8 @@
}
});
},
beforeUploadVideo: function (file) { // 视频验证
beforeUploadVideo: function (file,FileType) { // 视频验证
if(FileType==1) return true
const isLt10M = file.size / 1024 / 1024 < 10;
if (['video/mp4', 'video/ogg', 'video/flv', 'video/avi', 'video/wmv', 'video/rmvb'].indexOf(file.type) === -
1) {
......@@ -437,49 +439,54 @@
}
},
//上传图片
UploadAttachment(file,type) {
UploadAttachment(file,FileType) {
let newArr = [];
newArr.push(file.file);
var path = "/Upload/WebSite/";
this.$message.info(this.$t('tips.shangchuanzhong'))
console.log(this.plugData.MenuList[this.menuIndex].FileUrl,'-----11111')
this.UploadSelfFileT(path, newArr, x => {
var str = x.data.FilePath;
var imgUrl = this.domainManager().ViittoFileUrl + str;
this.plugData.MenuList[this.menuIndex].FileUrl = imgUrl;
this.$message.success(this.$t('tips.scchenggong'));
},2);
// if(this.plugData.MenuList[this.menuIndex].FileType==1){
// console.log(this.plugData.MenuList[this.menuIndex].FileUrl,'-----11111')
// this.UploadSelfFileT(path, newArr, x => {
// var str = x.data.FilePath;
// var imgUrl = this.domainManager().ViittoFileUrl + str;
// this.plugData.MenuList[this.menuIndex].FileUrl = imgUrl;
// this.$message.success(this.$t('tips.scchenggong'));
// },2);
// }else{
// console.log(this.plugData.MenuList[this.menuIndex].FileUrl,'-----22222')
// this.UploadFileToAli2024(path, newArr, x => {
// var str = x.data.FilePath;
// var imgUrl = this.domainManager().ViittoFileUrl + str;
// this.plugData.MenuList[this.menuIndex].FileUrl = imgUrl;
// this.$message.success(this.$t('tips.scchenggong'));
// },2);
// }
// this.UploadSelfFileT(path, newArr, x => {
// var str = x.data.FilePath;
// var imgUrl = this.domainManager().ViittoFileUrl + str;
// this.plugData.MenuList[this.menuIndex].FileUrl = imgUrl;
// this.$message.success(this.$t('tips.scchenggong'));
// },2);
if(FileType==1){
this.UploadSelfFileT(path, newArr, x => {
var str = x.data.FilePath;
var imgUrl = this.domainManager().ViittoFileUrl + str;
this.plugData.MenuList[this.menuIndex].FileUrl = imgUrl;
this.$message.success(this.$t('tips.scchenggong'));
},2);
}else{
this.UploadFileToAli2024(path, newArr, x => {
var str = x.data.FilePath;
var imgUrl = this.domainManager().OSSUrl + str;
this.plugData.MenuList[this.menuIndex].FileUrl = imgUrl;
this.$message.success(this.$t('tips.scchenggong'));
},2);
}
},
UploadAttachment2(file) {
UploadAttachment2(file,FileType) {
let newArr = [];
newArr.push(file.file);
var path = "/Upload/WebSite/";
this.$message.info(this.$t('tips.shangchuanzhong'))
this.UploadSelfFileT(path, newArr, x => {
var str = x.data.FilePath;
var imgUrl = this.domainManager().ViittoFileUrl + str;
this.plugData.MenuList[this.menuIndex].SubMenuList[this.subMenuIndex].FileUrl = imgUrl;
this.$message.success(this.$t('tips.scchenggong'));
},2);
if(FileType==1){
this.UploadSelfFileT(path, newArr, x => {
var str = x.data.FilePath;
var imgUrl = this.domainManager().ViittoFileUrl + str;
this.plugData.MenuList[this.menuIndex].SubMenuList[this.subMenuIndex].FileUrl = imgUrl;
this.$message.success(this.$t('tips.scchenggong'));
},2);
}else{
this.UploadFileToAli2024(path, newArr, x => {
var str = x.data.FilePath;
var imgUrl = this.domainManager().OSSUrl + str;
this.plugData.MenuList[this.menuIndex].SubMenuList[this.subMenuIndex].FileUrl = imgUrl
this.$message.success(this.$t('tips.scchenggong'));
},2);
}
},
UploadAttachmentLogo(file) {
let newArr = [];
......
......@@ -151,18 +151,12 @@
<td class="w350" rowspan="3">
<el-form-item :label="$t('objFill.v101.fengmian')+(index+1)" style="margin-bottom: 0;">
<div class="webSliderDiv" @click="clickIndex=index">
<el-upload v-if="item.FileType==1" :http-request="UploadAttachment" :multiple="true"
<el-upload
:before-upload="(file)=>beforeUploadVideo(file,item.FileType)"
:http-request="(file)=>UploadAttachment(file,item.FileType)" :multiple="true"
accept="image/jpeg,image/gif,image/png,image/bmp" :show-file-list="false" action="">
<img v-if="item.FileUrl" :src="item.FileUrl" class="web_imgUrl" alt="" />
<div class="addIconDiv">
<i class="web_addImg iconfont icon-img_haha"></i>
<i class="web_delImg iconfont icon-img_delete_small" style="margin-left:10px;"
@click.stop="item.FileUrl=''"></i>
</div>
</el-upload>
<el-upload v-if="item.FileType==2" :http-request="UploadAttachment" :multiple="true"
accept="video/mp4,video/webm" :show-file-list="false" action="">
<video v-if="item.FileUrl" :src="item.FileUrl" class="web_imgUrl" alt=""></video>
<img v-if="item.FileType==1&&item.FileUrl" :src="item.FileUrl" class="web_imgUrl" alt="" />
<video v-if="item.FileType==2&&item.FileUrl" :src="item.FileUrl" class="web_imgUrl"></video>
<div class="addIconDiv">
<i class="web_addImg iconfont icon-img_haha"></i>
<i class="web_delImg iconfont icon-img_delete_small" style="margin-left:10px;"
......@@ -276,18 +270,40 @@
that.plugData.NavList.splice(index, 1)
});
},
beforeUploadVideo: function (file,FileType) { // 视频验证
if(FileType==1) return true
const isLt10M = file.size / 1024 / 1024 < 10;
if (['video/mp4', 'video/ogg', 'video/flv', 'video/avi', 'video/wmv', 'video/rmvb'].indexOf(file.type) === -
1) {
this.$message.error(this.$t('objFill.qingsczqdspgs'));
return false;
}
if (!isLt10M) {
this.$message.error(this.$t('objFill.shngcspbncgs'));
return false;
}
},
//上传图片
UploadAttachment(file) {
UploadAttachment(file,FileType) {
let newArr = [];
newArr.push(file.file);
var path = "/Upload/WebSite/";
this.$message.info(this.$t('tips.shangchuanzhong'))
this.UploadSelfFileT(path, newArr, x => {
var str = x.data.FilePath;
var imgUrl = this.domainManager().ViittoFileUrl + str;
this.plugData.NavList[this.clickIndex].FileUrl = imgUrl;
this.$message.success(this.$t('tips.scchenggong'));
},2);
if(FileType==1){
this.UploadSelfFileT(path, newArr, x => {
var str = x.data.FilePath;
var imgUrl = this.domainManager().ViittoFileUrl + str;
this.plugData.NavList[this.clickIndex].FileUrl = imgUrl;
this.$message.success(this.$t('tips.scchenggong'));
},2);
}else{
this.UploadFileToAli2024(path, newArr, x => {
var str = x.data.FilePath;
var imgUrl = this.domainManager().OSSUrl + str;
this.plugData.NavList[this.clickIndex].FileUrl = imgUrl;
this.$message.success(this.$t('tips.scchenggong'));
},2);
}
},
//显示菜单弹窗
ShowMenuDialog(item) {
......
......@@ -152,18 +152,12 @@
<td class="w350" rowspan="3">
<el-form-item :label="$t('objFill.v101.fengmian')+(index+1)" style="margin-bottom: 0;">
<div class="webSliderDiv" @click="clickIndex=index">
<el-upload v-if="item.FileType==1" :http-request="UploadAttachment" :multiple="true"
<el-upload
:before-upload="(file)=>beforeUploadVideo(file,item.FileType)"
:http-request="(file)=>UploadAttachment(file,item.FileType)" :multiple="true"
accept="image/jpeg,image/gif,image/png,image/bmp" :show-file-list="false" action="">
<img v-if="item.FileUrl" :src="item.FileUrl" class="web_imgUrl" alt="" />
<div class="addIconDiv">
<i class="web_addImg iconfont icon-img_haha"></i>
<i class="web_delImg iconfont icon-img_delete_small" style="margin-left:10px;"
@click.stop="item.FileUrl=''"></i>
</div>
</el-upload>
<el-upload v-if="item.FileType==2" :http-request="UploadAttachment" :multiple="true"
accept="video/mp4,video/webm" :show-file-list="false" action="">
<video v-if="item.FileUrl" :src="item.FileUrl" class="web_imgUrl" alt=""></video>
<img v-if="item.FileType==1&&item.FileUrl" :src="item.FileUrl" class="web_imgUrl" alt="" />
<video v-if="item.FileType==2&&item.FileUrl" :src="item.FileUrl" class="web_imgUrl" alt=""></video>
<div class="addIconDiv">
<i class="web_addImg iconfont icon-img_haha"></i>
<i class="web_delImg iconfont icon-img_delete_small" style="margin-left:10px;"
......@@ -279,18 +273,40 @@
that.plugData.NavList.splice(index, 1)
});
},
beforeUploadVideo: function (file,FileType) { // 视频验证
if(FileType==1) return true
const isLt10M = file.size / 1024 / 1024 < 10;
if (['video/mp4', 'video/ogg', 'video/flv', 'video/avi', 'video/wmv', 'video/rmvb'].indexOf(file.type) === -
1) {
this.$message.error(this.$t('objFill.qingsczqdspgs'));
return false;
}
if (!isLt10M) {
this.$message.error(this.$t('objFill.shngcspbncgs'));
return false;
}
},
//上传图片
UploadAttachment(file) {
UploadAttachment(file,FileType) {
let newArr = [];
newArr.push(file.file);
var path = "/Upload/WebSite/";
this.$message.info(this.$t('tips.shangchuanzhong'))
this.UploadSelfFileT(path, newArr, x => {
var str = x.data.FilePath;
var imgUrl = this.domainManager().ViittoFileUrl + str;
this.plugData.NavList[this.clickIndex].FileUrl = imgUrl;
this.$message.success(this.$t('tips.scchenggong'));
},2);
if(FileType==1){
this.UploadSelfFileT(path, newArr, x => {
var str = x.data.FilePath;
var imgUrl = this.domainManager().ViittoFileUrl + str;
this.plugData.NavList[this.clickIndex].FileUrl = imgUrl;
this.$message.success(this.$t('tips.scchenggong'));
},2);
}else{
this.UploadFileToAli2024(path, newArr, x => {
var str = x.data.FilePath;
var imgUrl = this.domainManager().OSSUrl + str;
this.plugData.NavList[this.clickIndex].FileUrl = imgUrl;
this.$message.success(this.$t('tips.scchenggong'));
},2);
}
},
//显示菜单弹窗
ShowMenuDialog(item) {
......
......@@ -151,24 +151,19 @@
<td class="w350" rowspan="3">
<el-form-item :label="$t('objFill.v101.fengmian')+(index+1)" style="margin-bottom: 0;">
<div class="webSliderDiv" @click="clickIndex=index">
<el-upload v-if="item.FileType==1" :http-request="UploadAttachment" :multiple="true"
<el-upload
:before-upload="(file)=>beforeUploadVideo(file,item.FileType)"
:http-request="(file)=>UploadAttachment(file,item.FileType)" :multiple="true"
accept="image/jpeg,image/gif,image/png,image/bmp" :show-file-list="false" action="">
<img v-if="item.FileUrl" :src="item.FileUrl" class="web_imgUrl" alt="" />
<div class="addIconDiv">
<i class="web_addImg iconfont icon-img_haha"></i>
<i class="web_delImg iconfont icon-img_delete_small" style="margin-left:10px;"
@click.stop="item.FileUrl=''"></i>
</div>
</el-upload>
<el-upload v-if="item.FileType==2" :http-request="UploadAttachment" :multiple="true"
accept="video/mp4,video/webm" :show-file-list="false" action="">
<video v-if="item.FileUrl" :src="item.FileUrl" class="web_imgUrl" alt=""></video>
<img v-if="item.FileType==1&&item.FileUrl" :src="item.FileUrl" class="web_imgUrl" alt="" />
<video v-if="item.FileType==2&&item.FileUrl" :src="item.FileUrl" class="web_imgUrl"></video>
<div class="addIconDiv">
<i class="web_addImg iconfont icon-img_haha"></i>
<i class="web_delImg iconfont icon-img_delete_small" style="margin-left:10px;"
@click.stop="item.FileUrl=''"></i>
</div>
</el-upload>
</div>
<div v-if="plugData.Type==1">{{$t('objFill.v101.tupiqscsqin')}}</div>
<div v-else>{{$t('objFill.v101.tupiqscersw')}}</div>
......@@ -276,16 +271,40 @@
that.plugData.NavList.splice(index, 1)
});
},
beforeUploadVideo: function (file,FileType) { // 视频验证
if(FileType==1) return true
const isLt10M = file.size / 1024 / 1024 < 10;
if (['video/mp4', 'video/ogg', 'video/flv', 'video/avi', 'video/wmv', 'video/rmvb'].indexOf(file.type) === -
1) {
this.$message.error(this.$t('objFill.qingsczqdspgs'));
return false;
}
if (!isLt10M) {
this.$message.error(this.$t('objFill.shngcspbncgs'));
return false;
}
},
//上传图片
UploadAttachment(file) {
UploadAttachment(file,FileType) {
console.log()
let newArr = [];
newArr.push(file.file);
var path = "/Upload/WebSite/";
this.UploadSelfFileT(path, newArr, x => {
var str = x.data.FilePath;
var imgUrl = this.domainManager().ViittoFileUrl + str;
this.plugData.NavList[this.clickIndex].FileUrl = imgUrl;
},2);
if(FileType==1){
this.UploadSelfFileT(path, newArr, x => {
var str = x.data.FilePath;
var imgUrl = this.domainManager().ViittoFileUrl + str;
this.plugData.NavList[this.clickIndex].FileUrl = imgUrl;
},2);
}else{
this.UploadFileToAli2024(path, newArr, x => {
var str = x.data.FilePath;
var imgUrl = this.domainManager().OSSUrl + str;
this.plugData.NavList[this.clickIndex].FileUrl = imgUrl;
this.$message.success(this.$t('tips.scchenggong'));
},2);
}
},
UploadAttachmentMLogo(file) {
let newArr = [];
......
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