<%@ 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>
    <jsp:include page="../../common/head.jsp"></jsp:include>
    <title>我的关注需求列表</title>
    <link rel="stylesheet" href="<%=basePath%>/resource/css/open/base.css" type="text/css">
</head>

<body>
<jsp:include page="../../common/body_header.jsp"></jsp:include>

<jsp:include page="../../common/user_center_header.jsp"></jsp:include>
<div id="aa" class="clearfix"></div>

<div class="user-mid2">
    <div  class="xinxi0">
        <div class="user-mid0">
            <div class="if">
                <span class="xx0"  id="data"><a href="<%=basePath%>/open/MyOpenDataRequirement/list.action">我的数据需求</a></span>
                <span  class="xx"  id="api"><a href="<%=basePath%>/open/MyApiRequirement/list.action">我的API需求</a></span>
                <span class="xx"   id="app"><a href="<%=basePath%>/open/MyMicroappRequirement/list.action">我的服务需求</a></span>
                <span class="xx xx01"  id="follow"><a href="<%=basePath%>/open/MyOpenFollow/list.action">我的关注需求</a></span>

            </div>
            <div class="clearfix"></div>
            <div  class="xx-main">
                <table >
                    <tr bgcolor="#f2f2f2" class="biaotou1">
                        <td class="td5">需求名称</td>
                        <td class="td3">需求类型</td>
                        <td class="td6">发布人</td>
                        <td class="td3">关注日期</td>
                        <td class="td3">操作</td>
                    </tr>
                    <c:forEach items="${list}" var="item">
                        <tr>
                            <td>${item.rqrmntName}</td>
                            <td>${item.rqrmntType}</td>
                            <td class="td3">${item.publishBy}</td>
                            <td><fmt:formatDate value="${item.createdAt}" pattern="yyyy-MM-dd"></fmt:formatDate></td>
                            <td class="td3"><a class="qxbm" onclick="delfollow(${item.followId})" >取消关注</a></td>
                        </tr>
                    </c:forEach>

                </table>


            </div>

        </div>
    </div>
</div>



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

    function delfollow(id) {
        $.ajax({
            url:"<%=basePath%>/open/MyOpenFollow/delfollow.action/"+id,
            type:"post",
            success:function (msg) {
                if(msg.stateCode==200) {
                    alert("取消关注成功");
                    location.href="<%=basePath%>/open/MyOpenFollow/list.action";
                }
            }
        })

    }
</script>
</html>