当前位置:网站首页>Wechat applet pull-down loading more waterfall flow loading
Wechat applet pull-down loading more waterfall flow loading
2022-07-02 04:04:00 【Minced pork, pumpkin and scallop】
// pages/list/list.js
Page({
/**
* Initial data of the page
*/
data: {
page:1, // Page number
data:[], // data
last_page:"" // The last page ( Total number of pages )
},
/**
* Life cycle function -- Monitor page loading
*/
onLoad: function (options) {
let that = this
// Send a request
wx.request({
url: 'http://www.www.com/index.php/list',
data:{
pagesize:10
},
success(e){
// Render the page
that.setData({
data:e.data.data.data,
last_page:e.data.data.last_page
})
}
})
},
// Click jump details
click(e){
let id = e.currentTarget.dataset.id;
wx.redirectTo({
url: '/pages/msg/msg?id='+id,
})
},
/**
* Handling function of page pull bottom event
*/
onReachBottom: function () {
let that = this;
// Get the next page
let page = that.data.page+1
// Determine whether the next page is larger than the total number of pages
if(page>this.data.last_page){
wx.showToast({
title: ' Whether the ',
icon: 'error',
})
}
// Send a request
wx.request({
url: 'http://www.www.com/index.php/list',
data:{
pagesize:10,
page:page
},
success(e){
// Render the page
that.setData({
page:that.data.page+1,
data:that.data.data.concat(e.data.data.data)
})
}
})
},
})边栏推荐
- [personnel density detection] matlab simulation of personnel density detection based on morphological processing and GRNN network
- 【直播回顾】战码先锋首期8节直播完美落幕,下期敬请期待!
- Nacos 配置中心整体设计原理分析(持久化,集群,信息同步)
- The original author is out! Faker. JS has been controlled by the community..
- Jetpack's livedata extension mediatorlivedata
- C语言:逻辑运算和判断选择结构例题
- Www2022 | know your way back: self training method of graph neural network under distribution and migration
- The 8th Blue Bridge Cup single chip microcomputer provincial competition
- PR zero foundation introductory guide note 2
- 《西线无战事》我们才刚开始热爱生活,却不得不对一切开炮
猜你喜欢

Www2022 | know your way back: self training method of graph neural network under distribution and migration

The 7th Blue Bridge Cup single chip microcomputer provincial competition

What is 5g industrial wireless gateway? What functions can 5g industrial wireless gateway achieve?

The 9th Blue Bridge Cup single chip microcomputer provincial competition

The 11th Blue Bridge Cup single chip microcomputer provincial competition

树莓派GPIO引脚控制红绿灯与轰鸣器

Sword finger offer II 006 Sort the sum of two numbers in the array

跳出舒适区,5年点工转型自动化测试工程师,我只用了3个月时间
![[Li Kou brush questions] 15 Sum of three numbers (double pointer); 17. Letter combination of phone number (recursive backtracking)](/img/5e/81e613370c808c63665c14298f9a39.png)
[Li Kou brush questions] 15 Sum of three numbers (double pointer); 17. Letter combination of phone number (recursive backtracking)

《西线无战事》我们才刚开始热爱生活,却不得不对一切开炮
随机推荐
树莓派GPIO引脚控制红绿灯与轰鸣器
【力扣刷题】15.三数之和(双指针);17.电话号码的字母组合(递归回溯)
How should the team choose the feature branch development mode or trunk development mode?
[wireless image transmission] FPGA based simple wireless image transmission system Verilog development, matlab assisted verification
0 foundation how to learn automated testing? Follow these seven steps step by step and you will succeed
Www 2022 | rethinking the knowledge map completion of graph convolution network
向数据库中存入数组数据,代码出错怎么解决
Blue Bridge Cup single chip microcomputer sixth temperature recorder
文档声明与字符编码
Go function
Wechat applet - realize the countdown of 60 seconds to obtain the mobile verification code (mobile number + verification code login function)
Today's plan: February 15, 2022
First acquaintance with string+ simple usage (II)
微信小程序 - 实现获取手机验证码倒计时 60 秒(手机号+验证码登录功能)
Uni app - realize the countdown of 60 seconds to obtain the mobile verification code (mobile number + verification code login function)
Fluent icon demo
Delete the code you wrote? Sentenced to 10 months!
Recently, the weather has been extremely hot, so collect the weather data of Beijing, Shanghai, Guangzhou and Shenzhen last year, and make a visual map
Homework in Chapter 3 of slam course of dark blue vision -- derivative application of T6 common functions
Which product of anti-cancer insurance is better?