当前位置:网站首页>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)
})
}
})
},
})
边栏推荐
- First acquaintance with string+ simple usage (II)
- Demonstration description of integrated base scheme
- [live broadcast review] the first 8 live broadcasts of battle code Pioneer have come to a perfect end. Please look forward to the next one!
- LxC limits the number of CPUs
- SQL Yiwen get window function
- 微信小程序 - 实现获取手机验证码倒计时 60 秒(手机号+验证码登录功能)
- Go language naming specification
- Feature Engineering: summary of common feature transformation methods
- Recyclerview add header
- Realizing deep learning framework from zero -- Introduction to neural network
猜你喜欢
2022-07-01:某公司年会上,大家要玩一食发奖金游戏,一共有n个员工, 每个员工都有建设积分和捣乱积分, 他们需要排成一队,在队伍最前面的一定是老板,老板也有建设积分和捣乱积分, 排好队后,所有
The first practical project of software tester: web side (video tutorial + document + use case library)
Realizing deep learning framework from zero -- Introduction to neural network
Typescript practice for SAP ui5
《动手学深度学习》(二)-- 多层感知机
SQL Yiwen get window function
手撕——排序
【直播回顾】战码先锋首期8节直播完美落幕,下期敬请期待!
[ibdfe] matlab simulation of frequency domain equalization based on ibdfe
Opencv learning example code 3.2.4 LUT
随机推荐
【人员密度检测】基于形态学处理和GRNN网络的人员密度检测matlab仿真
"No war on the Western Front" we just began to love life, but we had to shoot at everything
How should the team choose the feature branch development mode or trunk development mode?
How to solve the code error when storing array data into the database
[personnel density detection] matlab simulation of personnel density detection based on morphological processing and GRNN network
cookie、session、tooken
Go language naming specification
如何解决在editor模式下 无法删除物体的问题
整理了一份ECS夏日省钱秘籍,这次@老用户快来领走
The confusion I encountered when learning stm32
Fluent icon demo
L'avènement de l'ère 5G, une brève discussion sur la vie passée et présente des communications mobiles
Uni app - realize the countdown of 60 seconds to obtain the mobile verification code (mobile number + verification code login function)
【小技巧】使用matlab GUI以对话框模式读取文件
go 分支与循环
Welcome the winter vacation multi school league game 2 partial solution (B, C, D, F, G, H)
What is 5g industrial wireless gateway? What functions can 5g industrial wireless gateway achieve?
The 6th Blue Bridge Cup single chip microcomputer provincial competition
Homework in Chapter 3 of slam course of dark blue vision -- derivative application of T6 common functions
Blue Bridge Cup SCM digital tube skills