锶源昆仑会员+体验官

This commit is contained in:
2023-07-22 19:04:56 +08:00
commit 5a6b3517e6
439 changed files with 20654 additions and 0 deletions

75
pages/news/list/index.js Normal file
View File

@@ -0,0 +1,75 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
type : '',
noticeArr: [] //列表
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
type: options.type
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// 获取消息通知列表
this.noticeInfo();
},
/**
* 消息通知列表
*/
noticeInfo (page){
wx.$api.user.noticeList(this.data.type, {
page: page,
}).then(res => {
let listArr = this.data.noticeArr,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data.data)
this.setData({
noticeArr : newData,
page : res.data.page,
lodingStats : false
})
wx.stopPullDownRefresh()
}).catch(err => { })
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
// 获取消息通知列表
this.noticeInfo();
},
/**
* 上拉加载
*/
onReachBottom(){
this.setData({
lodingStats: true
})
let pageNumber = this.data.page.current
if(this.data.page.has_more){
pageNumber++
// 获取消息通知列表
this.noticeInfo(pageNumber);
}
}
})