|
@ -18,7 +18,7 @@ Page({ |
|
|
indicatorDots: false, //指示点
|
|
|
indicatorDots: false, //指示点
|
|
|
autoplay: true, //true,//自动播放
|
|
|
autoplay: true, //true,//自动播放
|
|
|
circular: true, //衔接滑动
|
|
|
circular: true, //衔接滑动
|
|
|
interval: 3000, //自动播放间隔时长(ms)
|
|
|
interval: 5000, //自动播放间隔时长(ms)
|
|
|
duration: 500, //幻灯片切换时长(ms)
|
|
|
duration: 500, //幻灯片切换时长(ms)
|
|
|
currentSwiper: 0, |
|
|
currentSwiper: 0, |
|
|
}, |
|
|
}, |
|
@ -34,14 +34,24 @@ Page({ |
|
|
wx.setNavigationBarTitle({ |
|
|
wx.setNavigationBarTitle({ |
|
|
title: '锦水印象' |
|
|
title: '锦水印象' |
|
|
}) |
|
|
}) |
|
|
|
|
|
}else if(options.modulecode == 'notice_zcwsc'){ |
|
|
|
|
|
this.getBannerList('4') |
|
|
|
|
|
wx.setNavigationBarTitle({ |
|
|
|
|
|
title: '众创卫生城' |
|
|
|
|
|
}) |
|
|
|
|
|
}else if(options.modulecode == 'notice_aq'){ |
|
|
|
|
|
this.getBannerList('5') |
|
|
|
|
|
wx.setNavigationBarTitle({ |
|
|
|
|
|
title: '安全360' |
|
|
|
|
|
}) |
|
|
}else{ |
|
|
}else{ |
|
|
|
|
|
this.getBannerList('2') |
|
|
wx.setNavigationBarTitle({ |
|
|
wx.setNavigationBarTitle({ |
|
|
title: '锦水警事' |
|
|
title: '锦水警事' |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.noticelist() |
|
|
this.noticelist() |
|
|
this.getBannerList() |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -105,9 +115,9 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getBannerList: function() { |
|
|
getBannerList: function(bannerNum) { |
|
|
let that = this |
|
|
let that = this |
|
|
api.bannerList('2').then(function(res) { |
|
|
api.bannerList(bannerNum).then(function(res) { |
|
|
// console.log('res==', res.data)
|
|
|
// console.log('res==', res.data)
|
|
|
that.setData({ |
|
|
that.setData({ |
|
|
swiperBannerList: res.data |
|
|
swiperBannerList: res.data |
|
@ -115,10 +125,34 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
swiperChange: function(e) { |
|
|
swiperChange: function(e) { |
|
|
|
|
|
wx.createVideoContext('video'+this.data.currentSwiper).pause() |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
currentSwiper: e.detail.current |
|
|
currentSwiper: e.detail.current, |
|
|
|
|
|
autoplay: true |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
bindplay() { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
autoplay: false |
|
|
|
|
|
}) |
|
|
|
|
|
wx.getNetworkType({ |
|
|
|
|
|
success (res) { |
|
|
|
|
|
const networkType = res.networkType |
|
|
|
|
|
if (res.networkType != 'wifi') { |
|
|
|
|
|
wx.showToast({ |
|
|
|
|
|
title: '当前为非WI-FI环境,请注意流量消耗', |
|
|
|
|
|
icon: 'none', |
|
|
|
|
|
duration: 3000 |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
bindended() { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
autoplay: true |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
// swiperChange2: function(e) {
|
|
|
// swiperChange2: function(e) {
|
|
|
// this.setData({
|
|
|
// this.setData({
|
|
|
// 'options2.currentSwiper': e.detail.current,
|
|
|
// 'options2.currentSwiper': e.detail.current,
|
|
|