<%@ 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.activityName}</div>
                <div class="lyfont2">
                    ${model.activityIntro}
                </div>
            </div>
            <div class="bb">
                <button type="button" onclick="enroll(${model.id})"  class="button3">活动报名</button>
                <%--<button class="button2">关注</button>--%>
            </div>
        </div>
        <div class="clearfix"></div>
        <div class="lyxq">
            <div class="mid04" style="width:1160px;">
                <div class="xuanxiang">
                    <span class="jieshao">活动详情</span>

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

                <div class="jieshao0">
                    ${model.activityDetail}
                </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="baoFrom">
            <input type="hidden" name="activityId" id="activityId"/>
            <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="baoming()">确定</span>
            </div>
        </form>
    </div>
</div>
</body>
<script>
    function baoming() {
        $('.tishi5').text('');//清空验证
        var data =  $("#baoFrom").serialize();
        $.post("<%=basePath%>/open/innovationActivity/enroll.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 enroll(id) {
        $("#aa").show();
        $("#aa1").show();
        $("#activityId").val(id);
    }
    function guanbi() {
        $("#aa").hide();
        $("#aa1").hide();
    }
</script>
</html>