<%@ page import="com.lightinit.hsdataportal.dictionary.DicRequirmentAuditState" %>
<%@ 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>
    <title>我的服务需求列表</title>
    <jsp:include page="../../common/head.jsp"></jsp:include>
</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 class="qxbm" 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 xx01"   id="app"><a href="<%=basePath%>/open/MyMicroappRequirement/list.action">我的服务需求</a></span>
                <span class="xx"  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><a  class="qxbm" href="<%=basePath%>/open/requirementMicroapp/view.htm/${item.rqrmntId}">${item.rqrmntName}</a></td>
                            <td>${item.rqrmntSummary}</td>
                            <td><fmt:formatDate value="${item.publishAt}" pattern="yyyy-MM-dd"></fmt:formatDate></td>
                            <td class="td3">${item.rqrmntState}</td>
                            <td class="td3">
                                <a class="qxbm" onclick="offLine(${item.rqrmntId})"><c:if test="${item.rqrmntState eq '已关闭'||item.rqrmntState eq '待反馈' }">下架</c:if></a>
                                <a class="qxbm" href="<%=basePath%>/open/MyMicroappRequirement/receiveList.action/${item.rqrmntId}">查看接单</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 offLine(id) {
        $.ajax({
            url:"<%=basePath%>/open/MyMicroappRequirement/offLine.action/"+id,
            type:"post",
            success:function (msg) {
                if(msg.stateCode==200) {
                    alert("下架成功");
                    window.location.href="<%=basePath%>/open/MyMicroappRequirement/list.action";
                }
            }
        })

    }
</script>
</html>