在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
<!-- &&底部加载 -->
<view class='page-add-data flexca'>
<text>{{pageTottomText}}</text>
</view>
/*加载 ---------------- */
.page-add-data{
width: 100%;
height: 40rpx;
color: #666;
font-size: 24rpx;
padding-bottom: 20rpx;
}
JS-------------------------
// 底部加载信息
pageTottomText: '',
pageN:2,
onReachBottom: function () {
let textCity = this.data.textCity;
let sexC = this.data.sexC;
this.setData({
pageTottomText: ''
});
let that = this;
let pageN = this.data.pageN;
let lists = this.data.lists;
// console.log(pageN)
that.setData({
pageTottomText: getApp().globalData.addText,
});
wx.request({
url: app.globalData.hpUrl + 'queryUsers',
data: {
census: textCity,
sex: sexC,
page: pageN
},
success: function (res) {
var arr = [];
// console.log(res.data)
var result = res.data;
//----------------------------------------------
// 判断分页
if (result.length != 0) {
pageN += 1;
that.setData({
pageN: pageN
});
//----------------------------------------------
setTimeout(function () {
lists= lists.concat(result)
// console.log(lists)
that.setData({
lists: lists
});
}, 1000);
//----------------------------------------------
} else {
that.setData({
pageTottomText: getApp().globalData.endText,
});
}
//----------------------------------------------
}
})
},
|
请发表评论