<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <link rel="stylesheet" href="${ctxwxsta}/css/public.css">
    <link rel="stylesheet" href="${ctxwxsta}/css/basic.css">
    <script src="${ctxwxsta}/js/flexible.js"></script>
    <script src="/static/weixin/common/layer_mobile/layer.js"></script>
    <link rel="stylesheet" href="/static/weixin/common/layer_mobile/need/right.css">
    <title>已分配产品</title>
</head>
<body id="contain">
<div class="contain">
    <div class="bai-head">
        <span>已分配产品</span>
        <a href="javascript:;"    onclick="fanhui()" class="left">
            <img src="${ctxwxsta}/images/head-left.png"/>
        </a>
        <a href="javascript:;" class="trash">
            <img src="${ctxwxsta}/images/trash.png"  onclick="delProduct()"/>
        </a>
    </div>
    <input  type="hidden" name="companyId" value="${companyId}" id="companyId">
    <div id="wrapper">
        <div class="administer wrapper-product" id="scroller">
            <ul class="optional-product" id="assigned-list">

            </ul>
            <div id="pullUp">
                <span class="pullUpLabel">上拉加载更多...</span>
            </div>
            <p id="ert"></p>
        </div>
    </div>
</div>
<c:if test="${ empty newType }">
    <div class="inferiors-jia assigned-jia">
        <img src="${ctxwxsta}/images/jia.png" style="z-index: 9999 !important;"  onclick="addProduct()"/>
    </div>
</c:if>


<c:if test="${not empty  newType}">
<div class="pro-steps assigned-steps">
    <div class="steps">
        <button class="xia" type="button" onclick="next()">下一步</button>
        <button onclick="back()" type="button">上一步</button>
    </div>
</div>
</c:if>
<!--设置比例弹窗-->
<div class="proportion-wind">
    <div class="proporion-cont">
        <h2 class="proportion-head">
            请填写下级可获得的分配收入比率
        </h2>
        <input class="sdf" type="text" id="fee" maxlength="6" onkeyup="value=value.replace(/[^(\d|\.)]/g,'')"/>
        <input class="sdfoid" type="hidden" name="oid"  value=""/>
        <p id="feerate">该产品收入比率不得超过15%</p>
        <input  type="hidden" id="feerateoid"  value=""/>

    </div>
    <div class="proporion-sel">
        <span class="sure">确定</span>
        <span class="no-qu">取消</span>
    </div>
</div>
<!--设置弹窗-->
<p id="erty_dan"></p>
<div class="tooltip-box">
    <p>当前信息未保存是否取消，已分配产品</p>
    <div class="tooltip-button">
        <button class="sure"  onclick="fanhui()">确定</button>
        <button class="no-qu">取消</button>
    </div>
</div>
<div class="tooltip-grm" >
    <p id="error_msg">操作成功</p>
    <div class="tooltip-button">
        <button class="sure">确定</button>
    </div>
</div>
<!--黑色蒙版弹窗-->
<div class="block-mask-more"></div>

<script src="${ctxwxsta}/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="${ctxwxsta}/js/iscroll.js"></script>
<script type="text/javascript" src="${ctxwxsta}/js/basicTwo.js"></script>
<script type="text/javascript" src="${ctxwxsta}/js/assigned.js"></script>
<script>
    var baseUrl = '${pageContext.request.contextPath }';

    $(function () {
        var tool_height = parseInt($('.tooltip-box').height()/2);
        $('.tooltip-box').css({"margin-top":-tool_height+'px'});

        $('#erty').click(function () {
            $('.tooltip-box').css({"display":"block"});
            $('.block-mask-more').css({"display":"block"});
        });

        $('#erty_dan').click(function () {
            $('.tooltip-grm').show();
            $('.block-mask-more').css({"display":"block"});
        });
        $('.tooltip-grm .sure').click(function () {
            $('.tooltip-grm').hide();
            $('.block-mask-more').hide();
        });

        $('.tooltip-box button').click(function () {
            $('.tooltip-box').hide();
            $('.block-mask-more').hide();
        });

    })
    $(document).ready(function(){
        getData(0);
    });

    function addProduct() {
        var  companyId= $("#companyId").val();
        var  newType='${newType}';
        if(newType){
            window.location.href=baseUrl+"/weixin/product/changeList/"+companyId+"?newType=1";
        }else{
            window.location.href=baseUrl+"/weixin/product/changeList/"+companyId;
        }
    }
    function delProduct() {
        var  companyId= $("#companyId").val();
        var  newType='${newType}';
        if(newType){
            window.location.href=baseUrl+"/weixin/product/delChangeList/"+companyId+"?newType=1";
        }else{
            window.location.href=baseUrl+"/weixin/product/delChangeList/"+companyId;
        }
    }
    function  fanhui(){
        var  companyId= $("#companyId").val();
        window.location.href="/weixin/partner/detatil/"+companyId;
    }
    function  back(){
        var  companyId= $("#companyId").val();
        window.location.href=baseUrl+"/weixin/product/changeList/"+companyId+"?newType=1";

    }
    function  next() {
        var  companyId= $("#companyId").val();
        window.location.href="/weixin/partner/area/"+companyId+"?newType=1";
    }
</script>
</body>
</html>