|
@ -24,13 +24,12 @@ Page({ |
|
|
/** |
|
|
/** |
|
|
* 生命周期函数--监听页面加载 |
|
|
* 生命周期函数--监听页面加载 |
|
|
*/ |
|
|
*/ |
|
|
onLoad: function (options) { |
|
|
onLoad: async function (options) { |
|
|
// this.modulelist()
|
|
|
// this.modulelist()
|
|
|
// wx.setNavigationBarTitle({
|
|
|
// wx.setNavigationBarTitle({
|
|
|
// title: options.title
|
|
|
// title: options.title
|
|
|
// })
|
|
|
// })
|
|
|
this.getModuleList() |
|
|
this.getModuleList() |
|
|
this.getNoticelist() |
|
|
|
|
|
}, |
|
|
}, |
|
|
// modulelist() {
|
|
|
// modulelist() {
|
|
|
// let that = this;
|
|
|
// let that = this;
|
|
@ -53,8 +52,10 @@ Page({ |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
modulelist: this.data.modulelist.concat(res.data), |
|
|
modulelist: this.data.modulelist.concat(res.data), |
|
|
loadMoreType: res.data.length === this.data.pageSize ? 'loading' : 'none', |
|
|
loadMoreType: res.data.length === this.data.pageSize ? 'loading' : 'none', |
|
|
loadMoreVisible: res.data.length === this.data.pageSize ? false : true |
|
|
loadMoreVisible: res.data.length === this.data.pageSize ? false : true, |
|
|
|
|
|
typeId:res.data[0].id |
|
|
}) |
|
|
}) |
|
|
|
|
|
this.getNoticelist() |
|
|
if (this.data.modulelist.length == 0) {//没有值
|
|
|
if (this.data.modulelist.length == 0) {//没有值
|
|
|
this.setData({ |
|
|
this.setData({ |
|
|
nodata: true, |
|
|
nodata: true, |
|
@ -80,16 +81,15 @@ Page({ |
|
|
pageSize: this.data.pageSize, |
|
|
pageSize: this.data.pageSize, |
|
|
typeId: this.data.typeId, |
|
|
typeId: this.data.typeId, |
|
|
} |
|
|
} |
|
|
|
|
|
console.log(params); |
|
|
contentList(params).then(res => { |
|
|
contentList(params).then(res => { |
|
|
let list = [ ...res.data ] |
|
|
let list = [ ...res.data ] |
|
|
console.log(list) |
|
|
|
|
|
that.setData({ |
|
|
that.setData({ |
|
|
noticelist: that.data.noticelist.concat(list), |
|
|
noticelist: that.data.noticelist.concat(list), |
|
|
loadMoreType: res.data.length === that.data.pageSize ? 'loading' : 'none', |
|
|
loadMoreType: res.data.length === that.data.pageSize ? 'loading' : 'none', |
|
|
loadMoreVisible: res.data.length === that.data.pageSize ? false : true, |
|
|
loadMoreVisible: res.data.length === that.data.pageSize ? false : true, |
|
|
preloadVisible: false |
|
|
preloadVisible: false |
|
|
}) |
|
|
}) |
|
|
console.log(this.data.noticelist); |
|
|
|
|
|
if (that.data.noticelist.length == 0) { |
|
|
if (that.data.noticelist.length == 0) { |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
nodata: true, |
|
|
nodata: true, |
|
|