上拉加载,是目前手机网站加载数据的一种常用方式,本文主要讲解anglarjs集成,上拉加载功能。
简介
上拉加载,是目前手机网站加载数据的一种常用方式,本文主要讲解anglarjs集成,上拉加载功能。通常与下拉刷新配置使用,下拉刷新请查阅。
实现
页面
<p> <b></b> <input> <b><img></b> </p> <p> </p><p> </p>
= 10 ">
loading......
我也是有底线的
controller中上拉加载功能使用
app.controller('wdListCtrl', ['$scope','catInfoService', function ($scope,catInfoService) {
//下拉加载service
$scope.catinfo = new catInfoService();
封装上拉加载CatInfoService.js
/** 2017-10-26
*作者:卜凡起
*功能:
*/
define(['jquery','app'], function ($,app) {
app.service('catInfoService', ['$location','$http', function($location,$http) {
var CatInfo = function () {
this.items =null;
this.busy = false;
this.after = '';
this.page = 1;
this.pagenum =10;
this.title = '';
this.varieties ='';
};
CatInfo.prototype.nextPage = function () {
if (this.busy) return;
this.busy = true;
var url = baseurl+"接口地址?page=" + this.page + "&pagenum="+ this.pagenum + "&title="+this.title+ "&varieties="+this.varieties+"&callback=JSON_CALLBACK";
$http.jsonp(url).success(function(data) {
var items =data.data;
console.log(items);
if( this.items == null){
this.items=items;
}else{
for (var i =0;i <p>效果</p><p style="text-align: center"><img src="https://img.php.cn/upload/article/000/000/008/daa54c709e0eb640f891e9caf169b2a2-0.jpg?x-oss-process=image/resize,p_40" alt=""></p><p>上面是我整理给大家的,希望今后会对大家有帮助。</p><p>相关文章:</p><p class="art_xg"><a href="http://www.php.cn/js-tutorial-401367.html" target="_blank">react项目开发</a></p><p class="art_xg"><a href="http://www.php.cn/js-tutorial-401370.html" target="_blank">在Vue-Router2.X中实现多种路由实现</a></p><p class="art_xg"><a href="http://www.php.cn/js-tutorial-401373.html" target="_blank">详细解读react受控组件与非受控组件</a></p>











