<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="../assets/css/swiper-3.4.2.min.css">
    <script src="../assets/js/base.js" type="text/javascript"></script>
    <link rel="stylesheet" href="//at.alicdn.com/t/font_939574_unwnof3vehp.css">
    <link rel="stylesheet" href="https://at.alicdn.com/t/font_773803_41eb3jmg59k.css">
    <link rel="stylesheet" href="../assets/css/style.css">
    <style>
        .pop_up{
            display: none;
            position: fixed;
            top:0;
            left:0;
            width:100%;
            height: 100%;
            background-color: rgba(0,0,0,0.5);
            z-index:1000;
        }
        .pop_mold{
            background: #fff;
            position: absolute;
            bottom:-1000px;
            left:0;
            width:100%;
        }
        .pop_title{
            padding:0 0.32rem;
            height: 1rem;
            display: flex;
           justify-content: space-between;
            align-items: center;
            color:#252729;
            font-size: 0.3rem;
        }
        .pop_item{
            height: 0.8rem;
            display: flex;
            justify-content: center;
            align-items: center;
            color:#252729;
            font-size: 0.3rem;
        }
        .pop_item .iconfont{
            margin: 0 0.2rem 0 0;
        }
        .queding_txt{
            color:#3988E5;
        }
        .pop_active{
            color:#3988E5;
        }
    </style>
    <title>个人中心</title>
</head>
<body>
<div class="container">
    <div class="topmain my_top" style="background-image: url('../assets/imgs/aicon_02@2x.png')">
        <div class="headerimg">
            <img src="../assets/imgs/aicon_03@2x.png" alt="">
        </div>
    </div>
    <div class="input_box">
        <div class="input_in">
            <div class="input_tab">负责人姓名:</div>
            <div class="input_cell">
                <input type="text" value="孙晓晓" class="name">
            </div>
        </div>
        <div class="input_in">
            <div class="input_tab">负责人手机号:</div>
            <div class="input_cell">
                <input type="number" value="15732136232"  class="tel">
            </div>
        </div>
    </div>
    <div class="my_btn">修改资料</div>
</div>
<div class="pop_up">
    <div class="pop_mold">
        <div class="pop_title">
            <div class="no_queding_txt">不需要</div>
            <div>单人间(一人一房)</div>
            <div class="queding_txt">需要</div>
        </div>
        <div class="pop_item_box">
            <div class="pop_item pop_active" data-id="1" data-val="需要">
                <i class="iconfont icon-xuanzhong4"></i>
                需要
            </div>
            <div class="pop_item" data-id="2" data-val="需要">
                <i class="iconfont icon-xuanzhong4"></i>
                需要
            </div>
            <div class="pop_item" data-id="3" data-val="需要">
                <i class="iconfont icon-xuanzhong4"></i>
                需要
            </div>
        </div>

    </div>
</div>
<!--toast-->
<div id="toast" style="display: none;">
    <div class="weui-mask_transparent"></div>
    <div class="weui-toast">
        <i class="weui-icon-success-no-circle weui-icon_toast"></i>
        <p class="weui-toast__content">已完成</p>
    </div>
</div>
<script type="text/javascript" src="../assets/js/jquery-2.1.0.js"></script>
<script type="text/javascript" src="../assets/js/common.js"></script>
<script type="text/javascript" src="../assets/js/Augly_Verification.js"></script>
<script type="text/javascript" src="../assets/js/swiper-3.4.2.jquery.min.js"></script>
<script>
    $('.my_btn').click(function () {
        if($('.name').val()==''){
            toast('请填写姓名')
        }else if($('.tel').val()==''){
            toast('请填写电话号码')
        }else if(! AuglyTest_phone.test($('.tel').val())){
            toast('请电话号码不正确')
        }else{
            toast('验证通过');
        }
    })
    //测试部分
    $('.input_box').click(function () {
        //ajax渲染数据

        $('.pop_up').show();
        $(".pop_mold").animate({bottom:0+'px'});
    })
    $('.pop_up').click(function () {
        $(".pop_mold").animate({bottom:-1000+'px'});
        setTimeout(function(){
            $('.pop_up').hide();
            },500);
    })
    $('.pop_mold').click(function (e) {
        e.stopPropagation();
    })
    $(".pop_item_box").on('click','.pop_item',function(){
        if(false){//单选(需要这个)
            $(this).addClass('pop_active').siblings().removeClass('pop_active');
        }else{//多选(多选要这个)
            if($(this).hasClass('pop_active')){
                $(this).removeClass('pop_active')
            }else {
                $(this).addClass('pop_active');
            }
        }
    })
    //点击不需要
    $('.no_queding_txt').click(function () {
        $(".pop_mold").animate({bottom:-1000+'px'});
        setTimeout(function(){
            $('.pop_up').hide();
        },500);
    })
    //点击需要
    $('.queding_txt').click(function () {
        var idarr=[];
        var valstr='';
        $(".pop_item_box .pop_item").each(function (i,e) {
            console.log(i);
            console.log(e);
            if($(this).hasClass('pop_active')){
                var id=$(this).attr('data-id');
                var val=$(this).attr('data-val');
                idarr.push(id);
                valstr += val + ' ';
                console.log(id+val);
            }
            console.log('idarr:',idarr);
            console.log('valstr',valstr);
        })
    })
</script>
</body>
</html>