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.
42 lines
761 B
42 lines
761 B
Component({
|
|
data: {
|
|
currentIndex: 0,
|
|
autoplay:false,
|
|
bannerInterval:0
|
|
},
|
|
properties: {
|
|
bannerList: {
|
|
type: Array,
|
|
value: []
|
|
}
|
|
},
|
|
lifetimes: {
|
|
|
|
},
|
|
pageLifetimes: {
|
|
show:function(){
|
|
console.log("show")
|
|
this.setData({
|
|
autoplay:true,
|
|
bannerInterval:3000
|
|
})
|
|
},
|
|
hide:function(){
|
|
this.setData({
|
|
autoplay:false,
|
|
bannerInterval:0
|
|
})
|
|
}
|
|
},
|
|
methods: {
|
|
swiperChange (e) {
|
|
this.setData({
|
|
currentIndex: e.detail.current
|
|
})
|
|
},
|
|
navigatetoBannerDetail (e) {
|
|
const { id, url, newsflag } = e.currentTarget.dataset
|
|
this.triggerEvent('navigatetoBannerDetail', {id, url, newsFlag: newsflag} )
|
|
}
|
|
}
|
|
})
|