Commit 18421cf2 authored by 黄奎's avatar 黄奎

广告图修改

parent 6df32693
<style>
@import "../../../assets/css/advert/advmanager";
@import "../../../assets/css/advert/advmanager";
.GroupAdvert .zezhao{left:0!important;top:0!important;bottom:0!important;width:100%;height:100%;z-index:999;}
.GroupAdvert img{width:100%;height:100%;}
</style>
<template>
<div class="advmanager-box">
<div class="query-box">
<ul>
<li>
<span>
<em>广告类型</em>
<el-select class='w150' v-model="msg.AdType" filterable :placeholder="$t('pub.pleaseSel')">
<el-option :label="$t('pub.unlimitedSel')" :value='SelectDefaultValue'></el-option>
<el-option v-for="item in AdTypeList" :label='item.name' :value='item.Id' :key='item.Id'>
</el-option>
</el-select>
</span>
</li>
<li>
<span>
<input type="button" class="normalBtn" @click="getaddatas" value="查询"/>
</span>
<span>
<el-upload class="upload-demo" :http-request="UploadImage" :multiple="true" accept="image/jpeg,image/gif,image/png,image/bmp"
:show-file-list="false" action="">
<input type="button" class="normalBtn" value="上传图片"/>
</el-upload>
</span>
<span>
<input type="button" class="normalBtn" @click='goUrl("advert",LineID,msg.TCID,"制作广告")' value="制作广告"/>
</span>
</li>
</ul>
</div>
<div class="content GroupAdvert">
<ul>
<li v-for='(item,index) in dataList' :key="item.id" @click="getPicList(index)">
<div class="img-box">
<img :src="item.AdvertisingPicUrl" />
<span class="free" v-if="item.AdType==1">广告</span>
<span class="free" v-if="item.AdType==2">本地</span>
<div class="zezhao">
<a v-if="item.AdType==1" :href='`/#/advert?id=${item.AdvertId}&TCID=${item.TCID}`'><i class="el-icon-edit" title="修改"></i></a>
<a :href='item.AdvertisingPicUrl' download="广告图.png"><i class="el-icon-download" title="下载"></i></a>
<i class="el-icon-delete" title="删除" @click.stop="deleteItem(item.ID)"></i>
</div>
</div>
</li>
</ul>
<div v-if='dataList.length==0' style='width:100%;margin-top:50px;text-align:center;color: #ccc;'>
<i class="iconfont icon-kong" style="font-size: 120px;"></i><br/>
还没有广告哦
<div class="advmanager-box">
<div class="query-box">
<ul>
<li>
<span>
<em>广告类型</em>
<el-select class='w150' v-model="msg.AdType" filterable :placeholder="$t('pub.pleaseSel')">
<el-option :label="$t('pub.unlimitedSel')" :value='SelectDefaultValue'></el-option>
<el-option v-for="item in AdTypeList" :label='item.name' :value='item.Id' :key='item.Id'>
</el-option>
</el-select>
</span>
</li>
<li>
<span>
<input type="button" class="normalBtn" @click="getaddatas" value="查询" />
</span>
<span>
<el-upload class="upload-demo" :http-request="UploadImage" :multiple="true" accept="image/jpeg,image/gif,image/png,image/bmp"
:show-file-list="false" action="">
<input type="button" class="normalBtn" value="上传图片" />
</el-upload>
</span>
<span>
<input type="button" class="normalBtn" @click='goUrl("advert",LineID,msg.TCID,"制作广告")' value="制作广告" />
</span>
</li>
</ul>
</div>
<div class="content GroupAdvert">
<ul>
<li v-for='(item,index) in dataList' :key="item.id" @click="getPicList(index)">
<div class="img-box">
<img :src="item.AdvertisingPicUrl" />
<span class="free" v-if="item.AdType==1">广告</span>
<span class="free" v-if="item.AdType==2">本地</span>
<div class="zezhao">
<a v-if="item.AdType==1" :href='`/#/advert?id=${item.AdvertId}&TCID=${item.TCID}`'><i class="el-icon-edit"
title="修改"></i></a>
<a :href='item.AdvertisingPicUrl' download="广告图.png"><i class="el-icon-download" title="下载"></i></a>
<i class="el-icon-delete" title="删除" @click.stop="deleteItem(item.ID)"></i>
</div>
</div>
<div v-if='picIsShow' class="viewBigPicLayer" @click="picIsShow=false">
<i class="el-icon-circle-close-outline clolseViewBigPicLayer" @click="picIsShow=false"></i>
<el-carousel height="600px" :initial-index='initialIndex' :interval="5000" trigger="click">
<el-carousel-item v-for="(item,index) in picObj" :key="index">
<div class="inlineDiv ownScrollbarStyle"><img :src="item" /></div>
</el-carousel-item>
</el-carousel>
</div>
</div>
</li>
</ul>
<div v-if='dataList.length==0' style='width:100%;margin-top:50px;text-align:center;color: #ccc;'>
<i class="iconfont icon-kong" style="font-size: 120px;"></i><br />
还没有广告哦
</div>
</div>
<div v-if='picIsShow' class="viewBigPicLayer" @click="picIsShow=false">
<i class="el-icon-circle-close-outline clolseViewBigPicLayer" @click="picIsShow=false"></i>
<el-carousel height="600px" :initial-index='initialIndex' :interval="5000" trigger="click">
<el-carousel-item v-for="(item,index) in picObj" :key="index">
<div class="inlineDiv ownScrollbarStyle"><img :src="item" /></div>
</el-carousel-item>
</el-carousel>
</div>
</div>
</template>
<script>
import vueWaterfallEasy from 'vue-waterfall-easy'
export default {
data(){
return{
dataList:[],
pageIndex:0,
pageSize:15,
picObj:[],
picIsShow:false,
initialIndex:0,
total:0,
LineID:0,
msg:{
TCID:0,
AdType:0
},
SelectDefaultValue:0,
AdTypeList:[{
Id:1,
name:'广告制作'
},{
Id:2,
name:'本地上传'
}],
}
import vueWaterfallEasy from 'vue-waterfall-easy'
export default {
data() {
return {
dataList: [],
pageIndex: 0,
pageSize: 15,
picObj: [],
picIsShow: false,
initialIndex: 0,
total: 0,
LineID: 0,
msg: {
TCID: 0,
AdType: 0
},
SelectDefaultValue: 0,
AdTypeList: [{
Id: 1,
name: '广告制作'
}, {
Id: 2,
name: '本地上传'
}],
}
},
components: {
vueWaterfallEasy
vueWaterfallEasy
},
mounted(){
this.msg.TCID = this.$route.query.TCID;
this.LineID = this.$route.query.LineID
this.user=JSON.parse(window.localStorage.userInfo)
this.getaddatas()
mounted() {
this.msg.TCID = this.$route.query.TCID;
this.LineID = this.$route.query.LineID
this.user = JSON.parse(window.localStorage.userInfo)
this.getaddatas()
},
methods:{
//删除广告
deleteItem(ID){
var that = this;
var Ids = [];
Ids.push(ID);
that.Confirm("是否删除?", function() {
var msg = {
Ids: Ids
};
that.apipost(
"travel_post_DeletePriceAdvert",
msg,
res => {
if (res.data.resultCode == 1) {
that.Success(res.data.message);
that.getaddatas();
}
},
null
);
});
},
handleCurrentChange(val) {
this.pageIndex++
this.getaddatas()
},
getaddatas(){
this.apipost("travel_post_GetPriceAdvert", this.msg, res => {
if(res.data.resultCode==1){
this.dataList = res.data.data;
console.log(this.dataList,'dataListtttt');
}else{
this.Error(res.data.message);
}
},err => {})
},
//获取轮播路径
getPicList(index){
this.picIsShow=true;
this.picObj=[];
this.initialIndex = index;
this.dataList.forEach((x,index)=>{
this.picObj.push(x.AdvertisingPicUrl);
})
},
//上传广告图片
UploadImage(file) {
let newArr = [];
newArr.push(file.file);
let fileName = file.file.name;
var path = "/Upload/DMC/Price/";
var imgArr = [];
this.UploadSelfFile(path, newArr, x => {
var obj = this.$DMCUtils.DMCImageObj();
var str = x.name;
var imgUrl = this.domainManager().ViittoFileUrl + x.data.FilePath;
obj.Path = x.data.FilePath;
obj.ShowPath = imgUrl;
imgArr.push(obj.Path);
let msg = {
TCID:this.msg.TCID,
AdvertisingPicUrlList:imgArr
}
methods: {
//删除广告
deleteItem(ID) {
var that = this;
var Ids = [];
Ids.push(ID);
that.Confirm("是否删除?", function () {
var msg = {
Ids: Ids
};
that.apipost(
"travel_post_DeletePriceAdvert",
msg,
res => {
if (res.data.resultCode == 1) {
that.Success(res.data.message);
that.getaddatas();
}
},
null
);
});
},
this.apipost("travel_post_AddPriceLocalAdvert", msg, res => {
if(res.data.resultCode==1){
this.Success(res.data.message);
this.getaddatas();
}else{
this.Error(res.data.message);
}
},err => {})
handleCurrentChange(val) {
this.pageIndex++
this.getaddatas()
},
getaddatas() {
this.apipost("travel_post_GetPriceAdvert", this.msg, res => {
if (res.data.resultCode == 1) {
this.dataList = res.data.data;
} else {
this.Error(res.data.message);
}
}, err => {})
},
//获取轮播路径
getPicList(index) {
this.picIsShow = true;
this.picObj = [];
this.initialIndex = index;
this.dataList.forEach((x, index) => {
this.picObj.push(x.AdvertisingPicUrl);
})
},
//上传广告图片
UploadImage(file) {
let newArr = [];
newArr.push(file.file);
let fileName = file.file.name;
var path = "/Upload/DMC/Price/";
var imgArr = [];
this.UploadSelfFile(path, newArr, x => {
var obj = this.$DMCUtils.DMCImageObj();
var str = x.name;
var imgUrl = this.domainManager().ViittoFileUrl + x.data.FilePath;
obj.Path = x.data.FilePath;
obj.ShowPath = imgUrl;
imgArr.push(obj.Path);
let msg = {
TCID: this.msg.TCID,
AdvertisingPicUrlList: imgArr
}
});
},
//跳转
goUrl(path,LineID,TCID, name) {
this.$router.push({
name: path,
query: { LineID: LineID, TCID: TCID ,blank:'y',tab:name}
});
},
this.apipost("travel_post_AddPriceLocalAdvert", msg, res => {
if (res.data.resultCode == 1) {
this.Success(res.data.message);
this.getaddatas();
} else {
this.Error(res.data.message);
}
}, err => {})
});
},
//跳转
goUrl(path, LineID, TCID, name) {
this.$router.push({
name: path,
query: {
LineID: LineID,
TCID: TCID,
blank: 'y',
tab: name
}
});
},
}
}
</script>
\ No newline at end of file
}
</script>
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