更多>
最新下载
冰兔(Btoo)网店系统
系统简介:冰兔BToo网店系统采用高端技术架构,具备超强负载能力,极速数据处理能力、高效灵活、安全稳定;模板设计制作简单、灵活、多元;系统功能十分全面,商品、会员、订单管理功能异常丰富。秒杀、团购、优惠、现金、卡券、打折等促销模式十分全面;更为人性化的商品订单管理,融合了多种控制和独特地管理机制;两大模块无限级别的会员管理系统结合积分机制、实现有效的推广获得更多的盈利!本次更新说明:1. 增加了新
0
2025-09-23
MediPro乡镇政府门户网站系统 5.1.0 UTF-8简体中文版
MediPro乡镇政府门户网站系统,适合乡镇政府机构创建地方门户网站,用以宣传本地资源,实现政务公开,促进乡镇基层信息化建设。本系统基于PHP+MYSQL开发,预设了乡镇风采、党政机构、政务公开、投资指南、服务导航、文件下载、公众互动、领导信箱等乡镇政府门户网站常用的栏目和测试数据,采用适合乡镇政府门户网站的专用模版,增强了系统的针对性和易用性。除了文章系统、图文系统、下载系统、社区交流、反馈表单
0
2025-09-23
Tun2企业网站管理系统(支持静态生成)2.0.18
Tun2企业网站管理系统是一套针对企业开发的CMS。它是一款具有专业级的功能和傻瓜式管理的网站站管理软件。Tun2追求的是简单与实用。它不同于大型门户CMS,繁杂并令人无从下手。因为它正对的用户是企业网站,所以它将更贴近企业本身【2.0.18更新说明】1、修复linux主机无法群发邮件的bug2、增加自定义栏目静态文件保存名、内容静态文件保存名& K6 V& N4
0
2025-09-23
全诚外卖通外卖预订管理系统单店版
一、外卖通叫餐(预订)系统单店版是什么样的一个系统? 外卖通系列软件是针对非商品性买卖、有别于传统的商城系统的、外卖和预订为概念性的店铺管理系统,我们的口号就是:让所有的门店在网上安个家,以往的版本都是基于多用户性质的平台系统,而外卖通单店版是基于某个店铺的专业外卖预订管理系统,设计了外卖、预订、专题活动、小游戏、资讯、形象、点评、积分、相册等多种功能模块以适应商家办站的各种需求。这套系统可
0
2025-09-23
极品HTML5网络建站公司模板源码(包含源文件)3.0
1、架构轻盈,完全免费与开源采用轻量MVC架构开发,兼顾效率与拓展性。全局高效缓存,打造飞速体验。 2、让简洁与强大并存强大字段自定义功能,完善的后台开关模块,不会编程也能搭建各类网站系统。 3、顶级搜索引擎优化功能纯静态、伪静态,全部支持自由设置规则,内容、栏目自由设置URL格式。 4、会员、留言、投稿、支付购物神马一个不能少不断升级完善的模块与插件,灵活的组装与自定义设置,满足你的多样需求。
0
2025-09-23
24小时阅读排行榜
- 1 喜马拉雅电脑版安装版_喜马拉雅电脑安装版获取与安装
- 2 Python 实战:博客内容管理系统雏形
- 3 家具积灰怎么擦更省力?
- 4 如何理解JavaScript中的对象创建模式?
- 5 PHP动态网页RSS订阅生成_PHP动态网页RSSfeed订阅源创建指南
- 6 如何通过JavaScript实现星级评分组件?
- 7 谷歌地球pro专业版免费下载_谷歌卫星地图2025超清版直接进入
- 8 扫描全能王怎么分类文档_扫描全能王文件夹分类管理指南
- 9 poki跑酷游戏免费体验_poki小游戏休闲跑酷免下载玩
- 10 喜马拉雅山录音导电脑_喜马拉雅录音导出到电脑教程
- 11 使用Python检测Ctrl+R组合键并重启程序
- 12 电脑上搜狗输入法怎么调出来_电脑搜狗输入法呼出与切换
- 13 万兴数据管家功能详解 微信记录恢复与数据管理教程
- 14 phpcms模板中截取字符串方法
- 15 哈啰出行账号注册指南_一步步教你注册哈啰出行APP账号
更多>
最新教程
-
- Node.js 教程
- 2987 2025-08-28
-
- CSS3 教程
- 343548 2025-08-27
-
- Rust 教程
- 3706 2025-08-27
-
- Vue 教程
- 4484 2025-08-22
-
- PostgreSQL 教程
- 4616 2025-08-21
-
- Git 教程
- 3456 2025-08-21
微信小程序列表的上拉刷新和上拉加载
##1.介绍几个组件
###1.1 scroll-view 组件
这里写图片描述
注意:使用竖向滚动时,需要给一个固定高度,通过 WXSS 设置 height。 ###1.2 image组件
这里写图片描述
注意:mode有12种模式,其中3种是缩放模式,9种是裁剪模式。 ###1.3 Icon组件 这里写图片描述
iconType: [ 'success', 'info', 'warn', 'waiting', 'safe_success', 'safe_warn', 'success_circle', 'success_no_circle', 'waiting_circle', 'circle', 'download', 'info_circle', 'cancel', 'search', 'clear' ]
2.列表的上拉加载和下拉刷新的实现
##2.1先来张效果图 这里写图片描述 ##2.2逻辑很简单,直接上代码 ###2.2.1 detail.wxml 布局文件
<loading hidden="{{hidden}}" bindchange="loadingChange">
加载中...
</loading>
<scroll-view scroll-y="true" style="height: 100%;" bindscrolltolower="loadMore" bindscrolltoupper="refesh">
<view wx:if="{{hasRefesh}}" style="display: flex;flex-direction: row;align-items: center;align-self: center;justify-content: center;">
<icon type="waiting" size="45"/><text>刷新中...</text></view>
<view wx:else style="display:none" ><text></text></view>
<view class="lll" wx:for="{{list}}" wx:for-item="item" bindtap="bindViewTap"
data-title="{{item.title}}" >
<image style=" width: 50px;height: 50px;margin: 20rpx;" src="{{item.firstImg}}" ></image>
<view class="eee" >
<view style="margin:5px;font-size:8px"> 标题:{{item.title}}</view>
<view style="margin:5px;color:red;font-size:6px"> 来源:{{item.source}}</view>
</view>
</view>
<view class="tips1">
<view wx:if="{{hasMore}}" style="display: flex;flex-direction: row;align-items: center;align-self: center;justify-content: center;">
<icon type="waiting" size="45"/><text>玩命的加载中...</text></view>
<view wx:else><text>没有更多内容了</text></view>
</view>
</scroll-view>
###2.2.1 detail.js逻辑代码文件
var network_util = require('../../utils/network_util.js');
var json_util = require('../../utils/json_util.js');
Page({
data:{
// text:"这是一个页面"
list:[],
dd:'',
hidden:false,
page: 1,
size: 20,
hasMore:true,
hasRefesh:false
},
onLoad:function(options){
var that = this;
var url = 'http://v.juhe.cn/weixin/query?key=f16af393a63364b729fd81ed9fdd4b7d&pno=1&ps=10';
network_util._get(url,
function(res){
that.setData({
list:res.data.result.list,
hidden: true,
});
},function(res){
console.log(res);
});
},
onReady:function(){
// 页面渲染完成
},
onShow:function(){
// 页面显示
},
onHide:function(){
// 页面隐藏
},
onUnload:function(){
// 页面关闭
},
//点击事件处理
bindViewTap: function(e) {
console.log(e.currentTarget.dataset.title);
},
//加载更多
loadMore: function(e) {
var that = this;
that.setData({
hasRefesh:true,});
if (!this.data.hasMore) return
var url = 'http://v.juhe.cn/weixin/query?key=f16af393a63364b729fd81ed9fdd4b7d&pno='+(++that.data.page)+'&ps=10';
network_util._get(url,
function(res){
that.setData({
list: that.data.list.concat(res.data.result.list),
hidden: true,
hasRefesh:false,
});
},function(res){
console.log(res);
})
},
//刷新处理
refesh: function(e) {
var that = this;
that.setData({
hasRefesh:true,
});
var url = 'http://v.juhe.cn/weixin/query?key=f16af393a63364b729fd81ed9fdd4b7d&pno=1&ps=10';
network_util._get(url,
function(res){
that.setData({
list:res.data.result.list,
hidden: true,
page:1,
hasRefesh:false,
});
},function(res){
console.log(res);
})
},
})
###1.1 scroll-view 组件
这里写图片描述
注意:使用竖向滚动时,需要给一个固定高度,通过 WXSS 设置 height。 ###1.2 image组件
这里写图片描述
注意:mode有12种模式,其中3种是缩放模式,9种是裁剪模式。 ###1.3 Icon组件 这里写图片描述
iconType: [ 'success', 'info', 'warn', 'waiting', 'safe_success', 'safe_warn', 'success_circle', 'success_no_circle', 'waiting_circle', 'circle', 'download', 'info_circle', 'cancel', 'search', 'clear' ]
2.列表的上拉加载和下拉刷新的实现
##2.1先来张效果图 这里写图片描述 ##2.2逻辑很简单,直接上代码 ###2.2.1 detail.wxml 布局文件
<loading hidden="{{hidden}}" bindchange="loadingChange">
加载中...
</loading>
<scroll-view scroll-y="true" style="height: 100%;" bindscrolltolower="loadMore" bindscrolltoupper="refesh">
<view wx:if="{{hasRefesh}}" style="display: flex;flex-direction: row;align-items: center;align-self: center;justify-content: center;">
<icon type="waiting" size="45"/><text>刷新中...</text></view>
<view wx:else style="display:none" ><text></text></view>
<view class="lll" wx:for="{{list}}" wx:for-item="item" bindtap="bindViewTap"
data-title="{{item.title}}" >
<image style=" width: 50px;height: 50px;margin: 20rpx;" src="{{item.firstImg}}" ></image>
<view class="eee" >
<view style="margin:5px;font-size:8px"> 标题:{{item.title}}</view>
<view style="margin:5px;color:red;font-size:6px"> 来源:{{item.source}}</view>
</view>
</view>
<view class="tips1">
<view wx:if="{{hasMore}}" style="display: flex;flex-direction: row;align-items: center;align-self: center;justify-content: center;">
<icon type="waiting" size="45"/><text>玩命的加载中...</text></view>
<view wx:else><text>没有更多内容了</text></view>
</view>
</scroll-view>
###2.2.1 detail.js逻辑代码文件
var network_util = require('../../utils/network_util.js');
var json_util = require('../../utils/json_util.js');
Page({
data:{
// text:"这是一个页面"
list:[],
dd:'',
hidden:false,
page: 1,
size: 20,
hasMore:true,
hasRefesh:false
},
onLoad:function(options){
var that = this;
var url = 'http://v.juhe.cn/weixin/query?key=f16af393a63364b729fd81ed9fdd4b7d&pno=1&ps=10';
network_util._get(url,
function(res){
that.setData({
list:res.data.result.list,
hidden: true,
});
},function(res){
console.log(res);
});
},
onReady:function(){
// 页面渲染完成
},
onShow:function(){
// 页面显示
},
onHide:function(){
// 页面隐藏
},
onUnload:function(){
// 页面关闭
},
//点击事件处理
bindViewTap: function(e) {
console.log(e.currentTarget.dataset.title);
},
//加载更多
loadMore: function(e) {
var that = this;
that.setData({
hasRefesh:true,});
if (!this.data.hasMore) return
var url = 'http://v.juhe.cn/weixin/query?key=f16af393a63364b729fd81ed9fdd4b7d&pno='+(++that.data.page)+'&ps=10';
network_util._get(url,
function(res){
that.setData({
list: that.data.list.concat(res.data.result.list),
hidden: true,
hasRefesh:false,
});
},function(res){
console.log(res);
})
},
//刷新处理
refesh: function(e) {
var that = this;
that.setData({
hasRefesh:true,
});
var url = 'http://v.juhe.cn/weixin/query?key=f16af393a63364b729fd81ed9fdd4b7d&pno=1&ps=10';
network_util._get(url,
function(res){
that.setData({
list:res.data.result.list,
hidden: true,
page:1,
hasRefesh:false,
});
},function(res){
console.log(res);
})
},
})


本站所有资源都是由网友投搞发布,或转载各大下载站,请自行检测软件的完整性!本站所有资源仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您自己承担!如有侵权请联系我们删除下架,联系方式:admin@php.cn