PHP速学视频免费教程(入门到精通)
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
图片:2.jpg
图片:3.jpg
<br><strong>2.列表的上拉加载和下拉刷新的实现</strong><br>2.1先来张效果图<br><span class="J_attach_img_wrap single_img"><div class="img_info J_img_info"><p>图片:4.gif</p></div> <img class="J_post_img" src="http://www.javascriptcn.com/attachment/1704/thread/21_1_7118d91a9a3ba7a.gif?x-oss-process=image/resize,p_40" title="点击查看原图"></span><br><br>2.2逻辑很简单,直接上代码<br>2.2.1 detail.wxml 布局文件<br><pre class="brush:js;toolbar:false;" style="max-width:90%"><loading> 加载中... </loading> <scroll-view> <view> <icon></icon><text>刷新中...</text></view> <view><text></text></view> <view> <image></image> <view> <view> 标题:pw_item.title</view> <view> 来源:pw_item.source</view> </view></view><view> <view> <icon></icon><text>玩命的加载中...</text></view> <view><text>没有更多内容了</text></view> </view> </scroll-view>
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); })},})
图片:5.jpg
已抢7336个
抢已抢95474个
抢已抢14937个
抢已抢52725个
抢已抢195929个
抢已抢87512个
抢