zsml.html 6.7 KB
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <!--<title>新闻报道</title>-->
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">


    <link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_1043230_2is4wniwevg.css">
    <link rel="stylesheet" type="text/css" href="css/zsml.css">
    <link rel="stylesheet" type="text/css" href="css/dropload.css">
    <script src="js/base.js"></script>
    <script src="js/jquery.min.js"></script>
    <style>
        .icon-zuo{
            color: #959595;
            font-size: 0.38rem;
        }
        .icon-iconfont-edu12{
            color: #959595;
            font-size: 0.5rem;
        }
        .icon-fangdajing{
            color: #ffffff;
        }
        .items_box{
            margin-bottom: 1rem;
        }
    </style>
</head>
<body>
<div class="container">
    <!--头部信息-->
    <div class="head">
        <!--左图标-->
        <div class="iconfont icon-zuo">

        </div>
        <!--新闻报道-->
        <div class="head_new">
            展商名录
        </div>
        <!--右菜单-->
        <div class="iconfont icon-iconfont-edu12">

        </div>

    </div>
    <!--图片-->
    <div class="top">
        <img src="images/11.png">
    </div>
    <!--查询按钮-->
    <div class="traffic_search">
        <input type="text" placeholder="展商查询">
        <div class="traffic_search_bottom">
            <div class="iconfont icon-fangdajing"></div>
        </div>
    </div>

    <!--展商列表-->
    <div class="items_box">
        <div class="items">
            <div class="item">
                <!--头部图片-->
                <div class="item_top">
                    <img src="images/12.png">
                </div>
                <!--下划线-->
                <div class="item_underline"></div>
                <!--底部公司-->
                <div class="item_bottom">
                    北京惟鑫航达科技有限公司
                </div>
            </div>

        </div>
    </div>




    <!--底部菜单-->
    <div class="bottom_menu">
        <div class="bottom_menu_index">
            <!--上图标-->
            <div class="iconfont icon-zhuye2"></div>
            <!--下文字-->
            <div class="bottom_menu_index_text">
                首页
            </div>
        </div>
        <div class="bottom_menu_index">
            <!--上图标-->
            <div class="iconfont icon-dianhua-copy"></div>
            <!--下文字-->
            <div class="bottom_menu_index_text">
                电话咨询
            </div>
        </div>
        <div class="bottom_menu_index">
            <!--上图标-->
            <div class="iconfont icon-user-address"></div>
            <!--下文字-->
            <div class="bottom_menu_index_text">
                网上展厅
            </div>
        </div>
        <div class="bottom_menu_index">
            <!--上图标-->
            <div class="iconfont icon-gerenzhongxin"></div>
            <!--下文字-->
            <div class="bottom_menu_index_text">
                个人中心
            </div>
        </div>
    </div>

</div>

</body>
<script src="js/dropload.min.js"></script>

<script>

   

    //下拉加载功能
    $(document).ready(function () {


        // 页数
        var page = 2;
        // 每次循环展示10个
        var size = 1;
        $('.items_box').dropload({
            scrollArea : window,
            domUp : {
                domClass   : 'dropload-up',
                domRefresh : '<div class="dropload-refresh">↓下拉刷新</div>',
                domUpdate  : '<div class="dropload-update">↑释放更新</div>',
                domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中...</div>'
            },
            domDown : {
                domClass   : 'dropload-down',
                domRefresh : '<div class="dropload-refresh">↑上拉加载更多</div>',
                domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中...</div>',
                domNoData  : '<div class="dropload-noData">暂无数据</div>'
            },
            loadDownFn : function(me){
                page++;
                // 拼接HTML
                var result = '';
                var s = "";
                var show="";
                var list_compressor="";
                var list_answer="";
                $.ajax({
                    type: 'GET',
                    url: 'http://ons.me/tools/dropload/json.php?page='+page+'&size='+size,
                    dataType: 'json',
                    success: function(data){
                        console.log(data);
                        var arrLen = data.length;
                        if(arrLen > 0){
                            for(var i=0; i<arrLen; i++){
                                result +='<div class="item">\n' +
                                    '            <!--头部图片-->\n' +
                                    '            <div class="item_top">\n' +
                                    '                <img src="images/12.png">\n' +
                                    '            </div>\n' +
                                    '            <!--下划线-->\n' +
                                    '            <div class="item_underline"></div>\n' +
                                    '            <!--底部公司-->\n' +
                                    '            <div class="item_bottom">\n' +
                                    '                北京惟鑫航达科技有限公司\n' +
                                    '            </div>\n' +
                                    '        </div>'




                            }

                            // 如果没有数据
                        }else{
                            // 锁定
                            me.lock();
                            // 无数据
                            me.noData();
                        }
                        // 为了测试,延迟1秒加载
                        setTimeout(function(){
                            // 插入数据到页面,放到最后面
                            $('.items').append(result);
                            // 每次数据插入,必须重置
                            me.resetload();
                        },500);
                    },
                    error: function(xhr, type){
                        alert('Ajax error!');
                        // 即使加载出错,也得重置
                        me.resetload();
                    }
                });
            },
            threshold : 50
        });

    })

</script>

</html>