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

广告图修改

parent 6df32693
......@@ -19,16 +19,16 @@
</li>
<li>
<span>
<input type="button" class="normalBtn" @click="getaddatas" value="查询"/>
<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="上传图片"/>
<input type="button" class="normalBtn" value="上传图片" />
</el-upload>
</span>
<span>
<input type="button" class="normalBtn" @click='goUrl("advert",LineID,msg.TCID,"制作广告")' value="制作广告"/>
<input type="button" class="normalBtn" @click='goUrl("advert",LineID,msg.TCID,"制作广告")' value="制作广告" />
</span>
</li>
</ul>
......@@ -41,7 +41,8 @@
<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 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>
......@@ -49,7 +50,7 @@
</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/>
<i class="iconfont icon-kong" style="font-size: 120px;"></i><br />
还没有广告哦
</div>
</div>
......@@ -65,48 +66,48 @@
</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
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:'本地上传'
SelectDefaultValue: 0,
AdTypeList: [{
Id: 1,
name: '广告制作'
}, {
Id: 2,
name: '本地上传'
}],
}
},
components: {
vueWaterfallEasy
},
mounted(){
mounted() {
this.msg.TCID = this.$route.query.TCID;
this.LineID = this.$route.query.LineID
this.user=JSON.parse(window.localStorage.userInfo)
this.user = JSON.parse(window.localStorage.userInfo)
this.getaddatas()
},
methods:{
methods: {
//删除广告
deleteItem(ID){
deleteItem(ID) {
var that = this;
var Ids = [];
Ids.push(ID);
that.Confirm("是否删除?", function() {
that.Confirm("是否删除?", function () {
var msg = {
Ids: Ids
};
......@@ -128,22 +129,21 @@ export default {
this.pageIndex++
this.getaddatas()
},
getaddatas(){
getaddatas() {
this.apipost("travel_post_GetPriceAdvert", this.msg, res => {
if(res.data.resultCode==1){
if (res.data.resultCode == 1) {
this.dataList = res.data.data;
console.log(this.dataList,'dataListtttt');
}else{
} else {
this.Error(res.data.message);
}
},err => {})
}, err => {})
},
//获取轮播路径
getPicList(index){
this.picIsShow=true;
this.picObj=[];
getPicList(index) {
this.picIsShow = true;
this.picObj = [];
this.initialIndex = index;
this.dataList.forEach((x,index)=>{
this.dataList.forEach((x, index) => {
this.picObj.push(x.AdvertisingPicUrl);
})
},
......@@ -162,28 +162,34 @@ export default {
obj.ShowPath = imgUrl;
imgArr.push(obj.Path);
let msg = {
TCID:this.msg.TCID,
AdvertisingPicUrlList:imgArr
TCID: this.msg.TCID,
AdvertisingPicUrlList: imgArr
}
this.apipost("travel_post_AddPriceLocalAdvert", msg, res => {
if(res.data.resultCode==1){
if (res.data.resultCode == 1) {
this.Success(res.data.message);
this.getaddatas();
}else{
} else {
this.Error(res.data.message);
}
},err => {})
}, err => {})
});
},
//跳转
goUrl(path,LineID,TCID, name) {
goUrl(path, LineID, TCID, name) {
this.$router.push({
name: path,
query: { LineID: LineID, TCID: TCID ,blank:'y',tab:name}
query: {
LineID: LineID,
TCID: TCID,
blank: 'y',
tab: name
}
});
},
}
}
}
</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