Appcan listview上拉加载下拉刷新源码

// window.uexOnload = function(type)相当于 appcan.ready(function() { });

 window.uexOnload = function(type) {

            pinglunlist();
            initBounce(mes,mes);
            }
            function mes(){
            }
        
            function initBounce(funcTop, funcBottom){
                uexWindow.setBounce("1");
                if (!funcTop && !funcBottom) {
                    uexWindow.showBounceView("0", "rgba(255,255,255,0)", "0");
                    uexWindow.showBounceView("1", "rgba(255,255,255,0)", "1");
                    return;

            }


            var top = 0;
            var btm = 1;
            uexWindow.onBounceStateChange = function(type, state){
                if (type == top && state == 2) { //顶部弹动
                    funcTop();
                    uexWindow.resetBounceView(0);
                    shuzi=1;//页数
                    listData = [];
                    pinglunlist();
                    
                }
                if (type == btm && state == 2) { //底部弹动
                    funcBottom();
                    uexWindow.resetBounceView(1);
                    if(shuzi>TotalPage){
                         uexWindow.alert("提示","数据已加载完!","确定");
                    }else{
                        shuzi++;//页数+1
                        //数据请求再显示出来
                        pinglunlist();
                    }
                }
                
            }
            if (funcTop) {
                uexWindow.setBounceParams('0', "{'pullToReloadText':'下拉刷新','releaseToReloadText':'释放刷新','loadingText':'正在刷新,请稍候'}");
                uexWindow.showBounceView(top, "rgba(255,255,255,0)", 1);
                uexWindow.notifyBounceEvent(top, 1);
            }
            if (funcBottom) {
                uexWindow.setBounceParams('1', "{'pullToReloadText':'加载更多','releaseToReloadText':'加载更多','loadingText':'加载中,请稍候'}");
                uexWindow.showBounceView(btm, "rgba(255,255,255,0)", 1); //设置弹动位置及效果([1:显示内容;0:不显示])
                uexWindow.notifyBounceEvent(btm, 1); //注册接收弹动事件([0:不接收onBounceStateChange方法回调;1:接收])
            }
        }

       



技术交流可以加入QQ群:
AppCan开发者技术交流群:299282825。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值