Commit 02584cd9 authored by 黄奎's avatar 黄奎

页面修改

parent a06dad31
<style> <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%;} .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> </style>
<template> <template>
<div class="advmanager-box"> <div class="advmanager-box">
...@@ -19,37 +32,45 @@ ...@@ -19,37 +32,45 @@
</li> </li>
<li> <li>
<span> <span>
<input type="button" class="normalBtn" @click="getaddatas" :value="$t('pub.searchBtn')"/> <input type="button" class="normalBtn" @click="getaddatas" :value="$t('pub.searchBtn')" />
</span> </span>
<span> <span>
<el-upload class="upload-demo" :http-request="UploadAttachment" :multiple="true" accept="image/jpeg,image/gif,image/png,image/bmp" <el-upload class="upload-demo" :http-request="UploadAttachment" :multiple="true"
:show-file-list="false" action=""> accept="image/jpeg,image/gif,image/png,image/bmp" :show-file-list="false" action="">
<input type="button" class="normalBtn" :value="$t('system.up_upImg')"/> <input type="button" class="normalBtn" :value="$t('system.up_upImg')" />
</el-upload> </el-upload>
</span> </span>
<span> <span>
<input type="button" class="normalBtn" @click='goUrl("advert",LineID,msg.TCID,"制作广告")' :value="$t('objFill.zhizuogg')"/> <input type="button" class="normalBtn" @click='goUrl("advert",LineID,msg.TCID,"制作广告")'
:value="$t('objFill.zhizuogg')" />
</span> </span>
</li> </li>
</ul> </ul>
</div> </div>
<div class="content GroupAdvert"> <div class="content GroupAdvert" v-loading="pdfLoading" :element-loading-text="loadingText">
<ul> <ul>
<li v-for='(item,index) in dataList' :key="item.id" @click="getPicList(index)"> <!--@click="getPicList(index)"-->
<li v-for='(item,index) in dataList' :key="item.id+index">
<div class="img-box"> <div class="img-box">
<img :src="item.AdvertisingPicUrl" /> <img :src="item.AdvertisingPicUrl" />
<span class="free" v-if="item.AdType==1">{{$t('Operation.Op_advertising')}}</span> <span class="free" v-if="item.AdType==1">{{$t('Operation.Op_advertising')}}</span>
<span class="free" v-if="item.AdType==2">{{$t('objFill.bendi')}}</span> <span class="free" v-if="item.AdType==2">{{$t('objFill.bendi')}}</span>
<div class="zezhao"> <div class="zezhao">
<a v-if="item.AdType==1" :href='`/#/advert?id=${item.AdvertId}&TCID=${item.TCID}`'><i class="el-icon-edit" :title="$t('pub.updateMsg')"></i></a> <!-- <a v-if="item.AdType==1" :href='`/#/advert?id=${item.AdvertId}&TCID=${item.TCID}`'><i class="el-icon-edit"
<a :href='item.AdvertisingPicUrl' :download="$t('salesModule.AdvPic')+'.png'"><i class="el-icon-download" :title="$t('objFill.xz')"></i></a> :title="$t('pub.updateMsg')"></i></a>
<a :href='item.AdvertisingPicUrl' target="_blank" :download="$t('salesModule.AdvPic')+'.png'"><i class="el-icon-download"
:title="$t('objFill.xz')"></i></a> -->
<span @click="clickDownLoad(item,1)"><i class="el-icon-download" title="旅小友二维码"></i></span>
<span @click="clickDownLoad(item,2)"><i class="el-icon-download" title="行程二维码"></i></span>
<i class="el-icon-delete" :title="$t('system.ph_shanchu')" @click.stop="deleteItem(item.ID)"></i> <i class="el-icon-delete" :title="$t('system.ph_shanchu')" @click.stop="deleteItem(item.ID)"></i>
</div> </div>
</div> </div>
</li> </li>
</ul> </ul>
<div v-if='dataList.length==0' style='width:100%;margin-top:50px;text-align:center;color: #ccc;'> <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/> <i class="iconfont icon-kong" style="font-size: 120px;"></i><br />
{{$t('objFill.haimeiyggo')}} {{$t('objFill.haimeiyggo')}}
</div> </div>
</div> </div>
...@@ -61,52 +82,130 @@ ...@@ -61,52 +82,130 @@
</el-carousel-item> </el-carousel-item>
</el-carousel> </el-carousel>
</div> </div>
<a id="pdfDownLoad" style="display:none;"></a>
</div> </div>
</template> </template>
<script> <script>
import vueWaterfallEasy from 'vue-waterfall-easy' import vueWaterfallEasy from 'vue-waterfall-easy'
export default { export default {
data(){ data() {
return{ return {
dataList:[], dataList: [],
pageIndex:0, pageIndex: 0,
pageSize:15, pageSize: 15,
picObj:[], picObj: [],
picIsShow:false, picIsShow: false,
initialIndex:0, initialIndex: 0,
total:0, total: 0,
LineID:0, LineID: 0,
msg:{ msg: {
TCID:0, TCID: 0,
AdType:0 AdType: 0
}, },
SelectDefaultValue:0, SelectDefaultValue: 0,
AdTypeList:[{ AdTypeList: [{
Id:1, Id: 1,
name:this.$t('objFill.guanggaozz') name: this.$t('objFill.guanggaozz')
},{ }, {
Id:2, Id: 2,
name:this.$t('objFill.bendisc') name: this.$t('objFill.bendisc')
}], }],
downLoadMsg: {
Id: 0, //广告Id
Type: 0, //类型(1-旅小友二维码,2-行程文件二维码)
CreateBy: 0, //下载人员
},
download_timer: null,
loadingText: "",
pdfLoading: false,
} }
}, },
components: { components: {
vueWaterfallEasy vueWaterfallEasy
}, },
mounted(){ mounted() {
this.msg.TCID = this.$route.query.TCID; this.msg.TCID = this.$route.query.TCID;
this.LineID = this.$route.query.LineID this.LineID = this.$route.query.LineID
this.user=JSON.parse(window.localStorage.userInfo) this.user = JSON.parse(window.localStorage.userInfo)
this.getaddatas() this.getaddatas()
}, },
methods:{ methods: {
clickDownLoad(item, type) {
this.downLoadMsg.Id = item.ID;
this.downLoadMsg.Type = type;
this.downLoadMsg.CreateBy = this.getLocalStorage().EmployeeId
var that = this;
this.download_timer = setInterval(function () {
that.checkFile()
}, 1000);
},
//检查文件是否生成
checkFile() {
var that = this;
var downLoadFileName = "广告图.jpg";
let urlObj = this.domainManager();
var checkUrl = urlObj.ocrUrl + "/Home/CheckAdFile?Id=" + this.downLoadMsg.Id + "&Type=" + this.downLoadMsg
.Type + "&CreateBy=" + this.downLoadMsg.CreateBy;
this.pdfLoading = true;
this.loadingText = "正在生成广告图...";
this.$http({
headers: {
'Content-Type': 'application/json'
},
method: 'get',
url: checkUrl,
data: {}
}).then(res => {
if (res.data == 1) {
clearInterval(that.download_timer);
that.loadingText = that.$t('objFill.zhengzxzpdf2');
var ocrUrl = "";
ocrUrl = urlObj.ocrUrl + "/Home/DownLoadAdFile?Id=" + that.downLoadMsg.Id + "&Type=" + that.downLoadMsg
.Type + "&CreateBy=" + that.downLoadMsg.CreateBy;
that.$http({
headers: {
'Content-Type': 'application/json'
},
method: 'get',
url: ocrUrl,
data: {},
responseType: 'arraybuffer',
onDownloadProgress: (progressEvent) => {
const progress = Math.round((progressEvent.loaded / progressEvent.total) * 100);
that.loadingText = that.$t('objFill.v101.zhengzxiaz') + (that.orderId > 0 ? that.$t(
'Operation.Op_teamNotice') : that.$t('Airticket.Air_Trip')) + that.$t(
'objFill.v101.hote.wenjian') + progress +
that.$t('objFill.v101.qingwugbhsxyem');
// 在这里处理下载进度, 如更新界面上的进度条
}
}).then(res => {
that.pdfLoading = false;
let blob = new Blob([res.data], {
type: "image/jpeg"
})
let fileUrl = URL.createObjectURL(blob);
let link = document.getElementById('pdfDownLoad');
link.href = fileUrl;
link.setAttribute("download", downLoadFileName);
link.click();
that.loadingText = "";
}).catch(err => {
that.pdfLoading = false
})
}
}).catch(err => {
that.loadingText = "";
that.pdfLoading = false;
clearInterval(that.download_timer);
})
},
//删除广告 //删除广告
deleteItem(ID){ deleteItem(ID) {
var that = this; var that = this;
var Ids = []; var Ids = [];
Ids.push(ID); Ids.push(ID);
that.Confirm(that.$t('tips.shifoushanchu'), function() { that.Confirm(that.$t('tips.shifoushanchu'), function () {
var msg = { var msg = {
Ids: Ids Ids: Ids
}; };
...@@ -123,26 +222,25 @@ export default { ...@@ -123,26 +222,25 @@ export default {
); );
}); });
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.pageIndex++ this.pageIndex++
this.getaddatas() this.getaddatas()
}, },
getaddatas(){ getaddatas() {
this.apipost("travel_post_GetPriceAdvert", this.msg, res => { this.apipost("travel_post_GetPriceAdvert", this.msg, res => {
if(res.data.resultCode==1){ if (res.data.resultCode == 1) {
this.dataList = res.data.data; this.dataList = res.data.data;
}else{ } else {
this.Error(res.data.message); this.Error(res.data.message);
} }
},err => {}) }, err => {})
}, },
//获取轮播路径 //获取轮播路径
getPicList(index){ getPicList(index) {
this.picIsShow=true; this.picIsShow = true;
this.picObj=[]; this.picObj = [];
this.initialIndex = index; this.initialIndex = index;
this.dataList.forEach((x,index)=>{ this.dataList.forEach((x, index) => {
this.picObj.push(x.AdvertisingPicUrl); this.picObj.push(x.AdvertisingPicUrl);
}) })
}, },
...@@ -161,26 +259,32 @@ export default { ...@@ -161,26 +259,32 @@ export default {
obj.ShowPath = imgUrl; obj.ShowPath = imgUrl;
imgArr.push(obj.ShowPath); imgArr.push(obj.ShowPath);
let msg = { let msg = {
TCID:this.msg.TCID, TCID: this.msg.TCID,
AdvertisingPicUrlList:imgArr AdvertisingPicUrlList: imgArr
} }
this.apipost("travel_post_AddPriceLocalAdvert", msg, res => { this.apipost("travel_post_AddPriceLocalAdvert", msg, res => {
if(res.data.resultCode==1){ if (res.data.resultCode == 1) {
this.Success(res.data.message); this.Success(res.data.message);
this.getaddatas(); this.getaddatas();
}else{ } else {
this.Error(res.data.message); this.Error(res.data.message);
} }
},err => {}) }, err => {})
},2); }, 2);
}, },
//跳转 //跳转
goUrl(path,LineID,TCID, name) { goUrl(path, LineID, TCID, name) {
this.$router.push({ this.$router.push({
name: path, name: path,
query: { LineID: LineID, TCID: TCID ,blank:'y',tab:name} query: {
LineID: LineID,
TCID: TCID,
blank: 'y',
tab: name
}
}); });
}, },
} }
} }
</script> </script>
...@@ -3333,7 +3333,8 @@ ...@@ -3333,7 +3333,8 @@
that.Success(res.data.message); that.Success(res.data.message);
that.changePriceMsg.isShowChangePrice = false; that.changePriceMsg.isShowChangePrice = false;
that.changePriceMsg.NewB2BPrice = ""; that.changePriceMsg.NewB2BPrice = "";
that.changePriceMsg.NewB2BPrice = ""; that.changePriceMsg.NewB2CPrice = "";
that.changePriceMsg.ChangeRemark="";
that.changePriceMsg.TCID = 0; that.changePriceMsg.TCID = 0;
that.getControlList(); that.getControlList();
} else { } else {
......
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