|
|
@ -5,10 +5,6 @@ import { |
|
|
|
getImageUrl2 |
|
|
|
} from "../../utils/api" |
|
|
|
Page({ |
|
|
|
|
|
|
|
/** |
|
|
|
* 页面的初始数据 |
|
|
|
*/ |
|
|
|
data: { |
|
|
|
associationList: [], |
|
|
|
loadMoreVisible: false, |
|
|
@ -17,10 +13,6 @@ Page({ |
|
|
|
pageSize: 10, |
|
|
|
imageUrlList: [], |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面加载 |
|
|
|
*/ |
|
|
|
onLoad: function () { |
|
|
|
// this.getPartyGroupList();
|
|
|
|
getImageUrl2().then(res => { |
|
|
@ -29,48 +21,12 @@ Page({ |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面初次渲染完成 |
|
|
|
*/ |
|
|
|
onReady: function () { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面显示 |
|
|
|
*/ |
|
|
|
onShow: function () { |
|
|
|
this.setData({ |
|
|
|
associationList: [] |
|
|
|
}) |
|
|
|
this.getPartyGroupList() |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面隐藏 |
|
|
|
*/ |
|
|
|
onHide: function () { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面卸载 |
|
|
|
*/ |
|
|
|
onUnload: function () { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 页面相关事件处理函数--监听用户下拉动作 |
|
|
|
*/ |
|
|
|
onPullDownRefresh: function () { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 页面上拉触底事件的处理函数 |
|
|
|
*/ |
|
|
|
onReachBottom: function () { |
|
|
|
this.setData({ |
|
|
|
loadMoreVisible: true |
|
|
@ -87,6 +43,14 @@ Page({ |
|
|
|
getPartyGroupList () { |
|
|
|
getPartyGroupList().then(res => { |
|
|
|
console.log("获取党群列表", res) |
|
|
|
const groupNameList = ["进入玫瑰苑社群", "进入玫瑰湖社群", "进入锦水园社群", "进入锦祥园社群"] |
|
|
|
res.data.forEach((item, index) => { |
|
|
|
if (index <= 3) { |
|
|
|
item.groupName = groupNameList[index] |
|
|
|
} else { |
|
|
|
item.groupName = "进入社群" |
|
|
|
} |
|
|
|
}) |
|
|
|
this.setData({ |
|
|
|
associationList: [...this.data.associationList, ...res.data], |
|
|
|
loadMoreType: res.data.length === this.data.pageSize ? "loading": "none" |
|
|
|