[添加转账,提现等新功能]
This commit is contained in:
56
pages/recommend/recommend.js
Normal file
56
pages/recommend/recommend.js
Normal file
@@ -0,0 +1,56 @@
|
||||
// 本时生活
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
recomNumber : '', //推荐好友数量
|
||||
recomArr : [], //推荐好友列表
|
||||
page : {}, //下一页
|
||||
lodingStats : false //加载状态
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow () {
|
||||
// 获取列表
|
||||
this.recomInfo();
|
||||
},
|
||||
|
||||
/**
|
||||
* 商品活动订单
|
||||
*/
|
||||
recomInfo(page) {
|
||||
wx.$api.user.childs(page).then(res=>{
|
||||
let listArr = this.data.recomArr,
|
||||
newData = []
|
||||
if(page == 1 || page == undefined) listArr = []
|
||||
|
||||
newData = listArr.concat(res.data.lists.data)
|
||||
this.setData({
|
||||
recomNumber : res.data.all,
|
||||
recomArr : newData,
|
||||
page : res.data.lists.page,
|
||||
lodingStats : false
|
||||
})
|
||||
wx.stopPullDownRefresh()
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 上拉加载
|
||||
*/
|
||||
onReachBottom(){
|
||||
this.setData({
|
||||
lodingStats: true
|
||||
})
|
||||
let pageNumber = this.data.page.current
|
||||
if(this.data.page.has_more){
|
||||
pageNumber++
|
||||
this.recomInfo(pageNumber)
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user