<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <LINK rel="Bookmark" href="/favicon.ico">
    <LINK rel="Shortcut Icon" href="/favicon.ico" />
    <link href="${pageContext.request.contextPath }/common/admin/css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="${pageContext.request.contextPath }/common/admin/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
    <link href="${pageContext.request.contextPath }/common/admin/skin/default/skin.css" rel="stylesheet" type="text/css" id="skin" />
    <link href="${pageContext.request.contextPath }/common/admin/lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
    <link href="${pageContext.request.contextPath }/common/admin/css/style.css" rel="stylesheet" type="text/css" />

    <!--[if IE 6]>
    <script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>牙刷绑定列表</title>
</head>
<body>
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span>
    牙刷绑定管理 <span class="c-gray en">&gt;</span> 牙刷绑定列表 <a
        class="btn btn-success radius r mr-20"
        style="line-height: 1.6em; margin-top: 3px"
        href="javascript:location.replace(location.href);" title="刷新"><i
        class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="pd-20">
    <form action="${pageContext.request.contextPath }/admin/apparatus/listApparatus" method="post" style="text-align: center;margin-bottom: 10px;">

        <input name="apparatusBarcode" id="apparatusBarcode" value="${apparatusBarcode }" placeholder="牙刷编号" style="width: 150px" class="input-text" type="text">
        <input name="userNickname" id="userNickname" value="${userNickname }" placeholder="微信昵称" style="width: 150px" class="input-text" type="text">
        <input name="userTel" id="userTel" value="${userTel }" placeholder="手机号码" style="width: 150px" class="input-text" type="text">

        <button name="" id="submitBtn" class="btn btn-success" type="submit">
            <i class="Hui-iconfont"></i> 搜索
        </button>
    </form>
    <form id="goodsform" >
        <table class="table table-border table-bordered table-bg">
            <thead>
            <tr>
                <th scope="col" colspan="13">牙刷绑定列表</th>
            </tr>
            <tr class="text-c">
                <th width="150">牙刷编号</th>
                <th width="150">openId</th>
                <th width="150">微信昵称</th>
                <th width="100">手机号码</th>
                <th width="70">渠道</th>
                <th width="150">颜色</th>
                <th width="80">创建时间</th>
                <th width="40">操作</th>
            </tr>
            </thead>
            <tbody>
            <c:if test="${! (empty page.dataList) }">
                <c:forEach items="${page.dataList }" var="infolist">
                <tr class="text-c">
                    <td>${infolist.apparatusBarcode }</td>
                    <td>${infolist.userOpenid }</td>
                    <td>${infolist.userNickname}</td>
                    <td>${infolist.userTel }</td>
                   <td>
                        <c:if test="${infolist.apparatusStore == 1 }">
                            天猫
                        </c:if>
                        <c:if test="${infolist.apparatusStore == 2 }">
                            淘宝
                        </c:if>
                        <c:if test="${infolist.apparatusStore == 3 }">
                            京东
                        </c:if>
                       <c:if test="${infolist.apparatusStore == 4 }">
                           微信
                        </c:if>
                       <c:if test="${infolist.apparatusStore == 5 }">
                           其他
                        </c:if>
                       <c:if test="${infolist.apparatusStore == 6 }">
                           一条
                        </c:if>
                       <c:if test="${infolist.apparatusStore == 7 }">
                           小红书
                        </c:if>
                    </td>
                    <td>${infolist.productName }</td>

                    <td><fmt:formatDate value="${infolist.apparatusCreateTime}" pattern="yyyy-MM-dd"/></td>
                    <td>
                        <a href="javascript:void(0)" lang="取消绑定" title="取消绑定" alt="取消绑定" onclick="del_tooth('${infolist.apparatusBarcode }')">
                            取消绑定
                        </a>
                    </td>
                 </c:forEach>
             </c:if>
                <c:if test="${empty page.dataList}">
                    <tr align="center"><td colspan="13" style="text-align: center;">未查询到该类数据!</td></tr>
                </c:if>
            </tbody>
        </table>
        <div align="right" class="mt-10 mb-10 mr-10">
            <%@include file="/common/other/paper/pager.jsp"%>
        </div>
    </form>
</div>



<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/layer/1.9.3/layer.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/H-ui.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/tips.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
    /* $(document).ready(function(){
     $('#beginDate').datepicker();//时间控件
     $('#endDate').datepicker();
     }); */

    /**
     * 发货
     * @param receiveId
     */
    function  del_tooth(code){
        layer.confirm('确定取消绑定吗?', {icon: 3, title:'提示'}, function(index){
            var url = "${pageContext.request.contextPath }" + '/admin/apparatus/del_tooth';
            $.ajax({
                type: "POST",
                url: url,
                traditional : true,
                data: {
                    code : code
                },
                dataType: "json",
                success: function(data){
                    if(data.status){
                        layer.msg(data.message,{icon: 1,time:3000});
                        return false;
                    }else{
                        layer.msg(data.message,{icon: 5,time:3000});
                        return false;
                    }
                }
            });
            layer.close(index);
        });
    }
</script>
</body>
</html>