index.html 3.2 KB
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="__TMPL__/public/assets/assets/css/weui.min.css">
    <link rel="stylesheet" href="__TMPL__/public/assets/assets/css/swiper-3.4.2.min.css">
    <link rel="stylesheet" href="//at.alicdn.com/t/font_970727_8ia65mkkncu.css">
    <link rel="stylesheet" href="__TMPL__/public/assets/assets/css/style.css">
    <script type="text/javascript" src="__TMPL__/public/assets/assets/js/fontsize.js"></script>
    <script type="text/javascript" src="__TMPL__/public/assets/assets/js/jquery-2.1.0.js"></script>
    <title>我的保单</title>
</head>
<body>
<a class="agree_top" href="javascript:history.back(-1);">
    <div class="iconfont icon-xiangzuo"></div>
    <div>返回</div>
</a>
<div class="search_input">
    <input type="text" id="keyword" placeholder="请输入姓名或者保单号">
    <div class=" iconfont icon-sousuo">

    </div>
</div>
<div class="search_titlebox">
    <div>代理人:{$user.agent_name}</div>
    <div class="search_subtitle">当前保单数:{$no_collocation_count}张</div>
</div>
<div class="dom">
    <foreach name="$data" item="vo">
        <a class="search_item" href="{:url('index/agent/more',array('application'=>$vo['application']))}">
            <div class="search_itemcell">
                <div>保险人:{$vo.application}</div>
            </div>
        </a>
    </foreach>
</div>
<empty name="$data">
    <div class="search_nodata">暂无您的客户,您可推荐公众号橙象保单托管</div>
</empty>
<div class="search_nodata" style="display: none">暂无您的客户,您可推荐公众号橙象保单托管</div>
</body>
<script>
    $(function(){
        $('.icon-sousuo').click(function(){
            var keyword = $('#keyword').val();
            $.ajax({
                url:"{:url('agent/search')}",
                type:"POST",
                data:{'keyword':keyword},
                success:function(data){
                    var data = eval("(" + data + ")");
                    console.log(data);
                    if(data.code == 20000){
                        var result = data.data;
                        if(result != null){
                            var mydata = '';
                            for(var i=0;i<result.length;i++){
                                mydata +='<a class="search_item" href="{:url('index/agent/more','','')}/application/'+result[i].application+'"><div class="search_itemcell"><div>保险人:'+result[i].application+'</div></div></a>';
                            }
                            $('.dom').html(mydata);
                        }else{
                            $('.dom').html('');
                            $('.search_nodata').html('暂无信息');
                            $('.search_nodata').show();
                        }
                    }else{
                        toast('与服务器断开连接');
                    }
                }
            })
        })
    })
</script>
</html>