<%@ page language="java" pageEncoding="UTF-8"
         contentType="text/html; charset=UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
    String basePath = request.getContextPath();
    String resourcePath = basePath + "/resource";
%>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>创业孵化</title>
    <jsp:include page="../common/head.jsp"></jsp:include>
</head>
<body>
<jsp:include page="../common/body_header.jsp"></jsp:include>
<div class="line0"></div>
<div class="mid-xiangqing1">
    <div class="ly0">
        <div class="ly">
            <div class="lyimg">
                <img style="width: 370px;height: 220px;border-radius: 6px"  src="${imageContextPath}${model.thumbnail}" alt="">
            </div>
            <div class="lyfont">
                <div class="lyfont1">${model.roadshowName}</div>
                <div class="lyfont2">
                    ${model.roadshowIntro}
                </div>
            </div>
            <div class="bb">
                <button type="button" onclick="lxwm(${model.id})" class="button3">项目洽谈</button>
                <%--<button type="button" class="button2">关注</button>--%>
            </div>
        </div>
        <div class="clearfix"></div>
        <div class="lyxq">
            <%--<div class="mid04">--%>
                <%--<div class="xuanxiang">--%>
                    <%--<span class="jieshao">路演材料</span>--%>

                    <%--<span class="kongbai1"></span>--%>
                <%--</div>--%>

                <%--<div class="jieshao0" id="scroll">--%>
                    <%--<p class="subl">上一张<p/>--%>
                    <%--<p class="subr">下一张<p/>--%>

                <%--</div>--%>


            <%--</div>--%>

                <div class="mid04" style="width:1160px;">
                    <div class="xuanxiang">
                        <span class="jieshao">路演材料</span>

                        <span class="kongbai1" style="width:1008px;"></span>
                    </div>

                    <div class="jieshao0 clearfix" id="scroll">

                        <div class="jieshao0-l">
                            <img id="subl" src="<%=resourcePath%>/images/icon_zuo.png" alt="">
                        </div>

                        <div class="jieshao0-m">
                            <ul>
                            <li style="display:block;"><img style="width: 370px;height: 220px;border-radius: 6px"  src="${imageContextPath}${model.material1}" alt=""></li>
                            <%--　上面的ｌｉ要设定为显示，因为是第一张图片．--%>
                            <li style="display: none"><img style="width: 370px;height: 220px;border-radius: 6px"  src="${imageContextPath}${model.material2}" alt=""></li>
                            <li style="display: none"><img style="width: 370px;height: 220px;border-radius: 6px"  src="${imageContextPath}${model.material3}" alt=""></li>
                            <li style="display: none"><img style="width: 370px;height: 220px;border-radius: 6px"  src="${imageContextPath}${model.material4}" alt=""></li>
                            </ul>
                        </div>
                        <div class="jieshao0-l">
                            <img id="subr" src="<%=resourcePath%>/images/icon_you.png" alt="">
                        </div>
                    </div>

                </div>


        </div>
    </div>
</div>
<div class="clearfix"></div>
<jsp:include page="../common/body_footer.jsp"></jsp:include>

<!-------------------------------------------------弹框-------------------->
<div class="fade" id="aa" style="display: none"></div>
<div class="window" id="aa1" style="display: none">
    <div class="top00">
        <span class="p">报名</span>
        <img src="<%=resourcePath%>/images/icon_guanbi.png" alt="" onclick="guanbi()" class="guanbi">
    </div>
    <div class="form6">
        <form id="lxwmFrom">
            <input type="hidden" name="roadshowId" id="roadshowId"/>

            <div class="application-font-0">
                <span class="application-font-2"><span class="xinghao">*</span>需求：</span>
                <textarea type="text" class="area4" id="requirement" name="requirement" ></textarea>
                <div class="tishi5"></div>
            </div>
            <div class="application-font-0">
                <span class="application-font-2"><span class="xinghao">*</span>意向：</span>
                <textarea type="text" class="area4"id="purpose" name="purpose" ></textarea>
                <div class="tishi5"></div>
            </div>
            <div class="application-font-0">
                <span class="application-font-2"><span class="xinghao">*</span>联系人：</span>
                <input type="text" class="area4" id="contact" name="contact" placeholder="请输入联系人">
                <div class="tishi5"></div>
            </div>
            <div class="application-font-0">
                <span class="application-font-2"><span class="xinghao">*</span>联系电话：</span>
                <input type="text" class="area4"id="phone" name="phone" placeholder="请输入联系电话">
                <div class="tishi5"></div>
            </div>
            <div class="clearfix"></div>
            <div class="queding0">
                <span class="quxiao" onclick="toLxwm()">确定</span>
            </div>
        </form>
    </div>
</div>
</body>

<script>
    function lxwm(id) {
        $("#aa").show();
        $("#aa1").show();
        $("#roadshowId").val(id);
    }


    function guanbi() {
        $("#aa").hide();
        $("#aa1").hide();
    }
    
    function toLxwm() {
        $('.tishi5').text('');//清空验证
        var data =  $("#lxwmFrom").serialize();
        $.post("<%=basePath%>/open/roadShow/toLxwm.action",data,function (msg) {
            if(msg.stateCode==200) {
                alert("报名成功");
                $("#aa").hide();
                $("#aa1").hide();
            }else{
                for(var item in msg.data){
                    $("[name='"+item+"']").next().text("! "+msg.data[item]);
                    $("[name='"+item+"']").next().show();
                }
            }
        })
    }
    $(function(){
        var i=0;
        var len=$("#scroll ul li").length-1;
        $("#subl").click(function(){
            if(i==len){
                i=-1;
            }
            i++;
            $("#scroll ul li").eq(i).fadeIn().siblings().hide();
        });
//到这里分开！上面的是上一张点击的效果代码，下面的是下一张点击的效果代码．
        $("#subr").click(function(){//获取类名的点击事件．
            if(i==0){
                i=len+1;
            }
            i--;
            $("#scroll ul li").eq(i).fadeIn().siblings().hide();
        });
    });


</script>
</html>