You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
717 B

const adConfig = {
ads: [
{
id: 'ad_slot_1',
name: '广告位1',
type: 'full_card',
imageUrl: '/images/轮播图1.jpg',
link: '',
show: true
},
{
id: 'ad_slot_2',
name: '广告位2',
type: 'half_image',
imageUrl: '/images/轮播图1.jpg',
link: '',
show: true
}
],
getAdById(id) {
return this.ads.find(ad => ad.id === id && ad.show)
},
getFullCardAd() {
return this.ads.find(ad => ad.type === 'full_card' && ad.show)
},
getHalfImageAd() {
return this.ads.find(ad => ad.type === 'half_image' && ad.show)
},
getAllAds() {
return this.ads.filter(ad => ad.show)
}
}
module.exports = adConfig