|
|
@ -11,13 +11,22 @@ Page({ |
|
|
|
deptList: [], |
|
|
|
nodata: false, |
|
|
|
loadMoreType: 'none', |
|
|
|
loadMoreVisible: false |
|
|
|
loadMoreVisible: false, |
|
|
|
swiperBannerList: [], |
|
|
|
indicatorDots: false, //指示点
|
|
|
|
autoplay: true, //true,//自动播放
|
|
|
|
circular: true, //衔接滑动
|
|
|
|
interval: 5000, //自动播放间隔时长(ms)
|
|
|
|
duration: 500, //幻灯片切换时长(ms)
|
|
|
|
currentSwiper: 0, |
|
|
|
showTitle: true, //视频标题
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面加载 |
|
|
|
*/ |
|
|
|
onLoad: function (options) { |
|
|
|
this.getBannerList('7') |
|
|
|
this.getFullDictInfo() |
|
|
|
}, |
|
|
|
|
|
|
@ -48,28 +57,76 @@ Page({ |
|
|
|
|
|
|
|
getFullDictInfo () { |
|
|
|
const dictType = 'notice_yjfu_lbzx' |
|
|
|
api.getFullDictInfo(dictType).then(res => { |
|
|
|
console.log(res) |
|
|
|
api.modulelist(dictType).then(res => { |
|
|
|
this.setData({ |
|
|
|
deptList: [...this.data.deptList,...res.data], |
|
|
|
loadMoreType: res.data.length === this.data.pageSize ? 'loading' : 'none', |
|
|
|
loadMoreVisible: res.data.length === this.data.pageSize ? false : true |
|
|
|
deptList: res.data, |
|
|
|
}) |
|
|
|
if (this.data.deptList.length == 0) { |
|
|
|
this.setData({ |
|
|
|
nodata: true, |
|
|
|
loadMoreType: 'none', |
|
|
|
loadMoreVisible: false, |
|
|
|
}) |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
this.setData({ |
|
|
|
deptList: [], |
|
|
|
nodata: true, |
|
|
|
loadMoreType: 'none', |
|
|
|
loadMoreVisible: false, |
|
|
|
}) |
|
|
|
// api.getFullDictInfo(dictType).then(res => {
|
|
|
|
// console.log(res)
|
|
|
|
// this.setData({
|
|
|
|
// deptList: [...this.data.deptList,...res.data],
|
|
|
|
// loadMoreType: res.data.length === this.data.pageSize ? 'loading' : 'none',
|
|
|
|
// loadMoreVisible: res.data.length === this.data.pageSize ? false : true
|
|
|
|
// })
|
|
|
|
// if (this.data.deptList.length == 0) {
|
|
|
|
// this.setData({
|
|
|
|
// nodata: true,
|
|
|
|
// loadMoreType: 'none',
|
|
|
|
// loadMoreVisible: false,
|
|
|
|
// })
|
|
|
|
// }
|
|
|
|
// }).catch(err => {
|
|
|
|
// this.setData({
|
|
|
|
// deptList: [],
|
|
|
|
// nodata: true,
|
|
|
|
// loadMoreType: 'none',
|
|
|
|
// loadMoreVisible: false,
|
|
|
|
// })
|
|
|
|
// console.log(err)
|
|
|
|
// })
|
|
|
|
}, |
|
|
|
getBannerList: function(bannerNum) { |
|
|
|
let that = this |
|
|
|
api.bannerList(bannerNum).then(function(res) { |
|
|
|
// console.log('res==', res.data)
|
|
|
|
that.setData({ |
|
|
|
swiperBannerList: res.data |
|
|
|
}) |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
}, |
|
|
|
swiperChange: function(e) { |
|
|
|
wx.createVideoContext('video'+this.data.currentSwiper).pause() |
|
|
|
this.setData({ |
|
|
|
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 |
|
|
|
}) |
|
|
|
}, |
|
|
|
bindcontrolstoggle(e) { |
|
|
|
this.setData({ |
|
|
|
showTitle: e.detail.show |
|
|
|
}) |
|
|
|
}, |
|
|
|
/** |
|
|
@ -78,7 +135,7 @@ Page({ |
|
|
|
navigateToDict (e) { |
|
|
|
console.log(e.currentTarget.dataset.dict) |
|
|
|
wx.navigateTo({ |
|
|
|
url: `../laobingzaixianDict/laobingzaixianDict?dictName=${e.currentTarget.dataset.dict.dictName}&dictType=${e.currentTarget.dataset.dict.dictType}&dictValue=${e.currentTarget.dataset.dict.dictValue}` |
|
|
|
url: `../laobingzaixianDict/laobingzaixianDict?dictName=${e.currentTarget.dataset.dict.name}&dictType=notice_yjfu_lbzx&dictValue=${e.currentTarget.dataset.dict.moduleCode}` |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |