Commit d2cc104d authored by 罗超's avatar 罗超

1

parent 11d2bd25
This diff is collapsed.
This diff is collapsed.
<style>
@import "../../assets/css/advert/advmanager.css";
</style>
<template>
<div class="advmanager-box">
<div class="content" style="top:50px;">
<vueWaterfallEasy v-if='addatas.length!=0' ref="waterfall" :imgsArr="addatas" @scrollReachBottom="handleCurrentChange" :maxCols='7' :imgWidth='208' :enablePullDownEvent='true'>
<template slot-scope="props">
<span class="free"><i class="el-icon-share"></i> 0</span>
<div class="zezhao">
<a :href='`/#/activity/makeAd?id=${props.value.ID}`'><i class="el-icon-edit" title="修改"></i></a>
<a :href='props.value.advertisingPicUrlStr' download="广告图.png"><i class="el-icon-download" title="下载"></i></a>
<i class="el-icon-delete" title="删除" @click="deleteItem(props.value)"></i>
</div>
</template>
</vueWaterfallEasy>
<div v-if='addatas.length==0' style='width:100%;margin-top:50px;text-align:center;color: #ccc;'>
<i class="iconfont icon-kong" style="font-size: 120px;"></i><br/>
还没有广告哦,<a href='/#/activity/makeAd' style="color:rgb(0, 129, 255)">立即制作</a>
</div>
</div>
</div>
</template>
<script>
import vueWaterfallEasy from 'vue-waterfall-easy'
import {getMyAd,delMyAd} from '../../api/AD/index'
export default {
data(){
return{
lines:[],
teams:[],
modelTeams:[],
countrys:[],
addatas:[],
pageIndex:0,
pageSize:15,
total:0,
msg:{
lineId:'0',
teamId:'0',
countryId:'0',
type:'0'
},
user:{},
model:{},
isAdd:false,
uploadType:0,
}
},
components: {
vueWaterfallEasy
},
mounted(){
this.getaddatas(0)
},
methods:{
deleteItem(x){
delMyAd({ID:x.ID}).then(res=>{
if(res.Code==1){
this.$message.success('删除成功')
this.getaddatas(0)
}else{
this.$message.error(res.Message)
}
})
},
handleCurrentChange(val) {
this.pageIndex++
this.getaddatas(1)
},
getaddatas(type){
if(type==0){
this.pageIndex=0
}
let msg={
pageIndex:this.pageIndex,
pageSize:this.pageSize
}
getMyAd(msg).then(res=>{
if(res.Code===1){
res.Data.PageData.forEach(x=>{
x.src=`${x.advertisingPicUrlStr}?x-oss-process=image/resize,w_200`
})
if(res.Data.PageData.length==0){
this.$refs.waterfall.waterfallOver()
}
if(type==0){
this.addatas=res.Data.PageData
}else{
this.addatas=this.addatas.concat(resDdata.PageData)
}
this.total=res.Data.pageCount
}
console.log(98,res)
})
},
}
}
</script>
\ No newline at end of file
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