<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <link rel="stylesheet" href="/static/weixin/css/public.css">
    <link rel="stylesheet" href="/static/weixin/css/wechat_add_new.css">
    <link rel="stylesheet" href="/static/weixin/css/basic.css">
    <script src="/static/weixin/js/flexible.js"></script>
    <title>搜索展位</title>
</head>
<body id="contain">
<div class="contain">
    <div class="bai-head">
        <span>搜索展位</span>
        <a href="/weixin/exhibition/exhibition-detail-view?activityId=${p.activityId}" class="left">
            <img src="/static/weixin/images/head-left.png"/>
        </a>
    </div>
    <div class="administer-head">
        <input id="keyword" type="text" placeholder="请输入展位号进行搜索">
        <span class="head-remove"></span>
        <a id="searchBtn" class="head-serach">搜索</a>
    </div>
    <div class="sd_search_results">
        <ul>
            <%--<li>--%>
                <%--<div class="left">--%>
                    <%--<p>建筑保险展会A01展厅</p>--%>
                    <%--<span>A002</span>--%>
                <%--</div>--%>
                <%--<div class="right">--%>
                    <%--<p>未购买</p>--%>
                <%--</div>--%>
            <%--</li>--%>
            <%--<li>--%>
                <%--<div class="left">--%>
                    <%--<p>建筑保险展会A01展厅</p>--%>
                    <%--<span>A002</span>--%>
                <%--</div>--%>
                <%--<div class="right">--%>
                    <%--<p>未购买</p>--%>
                <%--</div>--%>
            <%--</li>--%>
            <%--<li>--%>
                <%--<div class="left">--%>
                    <%--<p>建筑保险展会A01展厅</p>--%>
                    <%--<span>A002</span>--%>
                <%--</div>--%>
                <%--<div class="right">--%>
                    <%--<p class="buy">已购买</p>--%>
                <%--</div>--%>
            <%--</li>--%>
        </ul>
    </div>
</div>
</body>
<script src="/static/weixin/js/jquery-1.8.3.min.js"></script>
<script src="/static/weixin/common/layer_mobile/layer.js"></script>
<link rel="stylesheet" href="/static/weixin/common/layer_mobile/need/right.css">
<script src="/static/weixin/common/jquery.formHelper.js"></script>
<script type="text/javascript" src="/static/weixin/js/g.js"></script>
<script>
    // 搜索框的变化

    $(".administer-head input").focus(function(){
        $('.administer-head input').css({"transition":"all ease-in .5s","width":"84.85%"});
        $(this).siblings('.head-serach').css({"right":'3.2%'});
        re_length = $(this).val().length;
        if(re_length >=1 ){
            $(".administer-head").find('.head-remove').css({"opacity":'1'});
        }
    }).blur(function(){
        sd_width = Math.ceil($('.administer-head .head-serach').width())+10;
        $('.administer-head input').css({"transition":"all ease-in .5s","width":"100%"});
        $(this).siblings('.head-serach').css({"right":-sd_width+'px'});
        $(".administer-head").find('.head-remove').css({"opacity":'0'});
    });
    $(".administer-head").find('input').on('input propertychange',function(){
        re_length = $(this).val().length;
        if(re_length >=1 ){
            $(".administer-head").find('.head-remove').css({"opacity":'1'});
        }else{
            $(".administer-head").find('.head-remove').css({"opacity":'0'});
        }
    });

    $(".administer-head .head-remove").click(function () {
        $(this).siblings('input').val('').focus();
    });

    $("#searchBtn").click(function(){
        refresh();
    })

    function refresh(){
        var keyword = $("#keyword").val();
        g_ajax("/weixin/exhibition/get-activity-exhibitions",{activity_id:"${p.activityId}",keyword:keyword},function(json){
//            console.log(json);
            var str ="";
            for(var i in json.data){
                var mark = "未购买";
                if(json.data[i].blb_order_id != undefined){
                    mark = "已购买";
                }
                str += '<li>'
                    + '	<div class="left">'
                    + '		<p>'+json.data[i].exhibition_hall_name+'</p>'
                    + '		<span>'+json.data[i].exhibition_pos_name+'</span>'
                    + '	</div>'
                    + '	<div class="right">'
                    + '		<p>'+mark+'</p>'
                    + '	</div>'
                    + '</li>';
            }
            $(".sd_search_results ul").html(str);
        });
    }(refresh());


</script>
</html>