team.html 6.7 KB
<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>团队定制</title>
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <link rel="stylesheet" type="text/css" href="__TMPL__/static/assets/css/weui.min.css" />

    <link rel="stylesheet" type="text/css" href="__TMPL__/static/assets/css/weui.min.css" />
    <link rel="stylesheet" type="text/css" href="__TMPL__/static/assets/css/swiper-3.4.2.min.css" />
    <link rel="stylesheet" type="text/css" href="http://at.alicdn.com/t/font_773803_6y9erxzbkn2.css" />
    <script src="__TMPL__/static/assets/js/citypicker.js"  type="text/javascript"></script>
    <script type="text/javascript" src="__TMPL__/static/js/base.js"></script>
    <link rel="stylesheet" href="__TMPL__/static/css/common.css" />
    <link rel="stylesheet" href="__TMPL__/static/css/teamorder.css" />
    <style>
        .weui-picker__group {
            font-size: 0.3rem;
        }

    </style>
</head>

<body>
<div class="pic">
    <img src="__TMPL__/static/images/banner.png" alt="" />
</div>
<ul class="team">
    <li class="teamname">
        <span class="tname">团队名称</span>
        <input type="" name="" id="" placeholder="请填写团队名称"  class="name"/>
    </li>
    <li class="people">
        <span class="tpeople">团队人数</span>
        <input type="" name="" id="" placeholder="请填写团队人数"  class="number"/>
    </li>
    <li class="data street_out">
        <span class="tpeople peoples">出行日期&nbsp;</span>
        <sapn class="time">
            <input type="" name="" id="" readonly placeholder="年/月/日"  class="start"/>&nbsp;<span class="zhi"></span>
            &nbsp;&nbsp;<input type="" name="" readonly id="" onclick="next_time()" placeholder="年/月/日"  class="end"/>
        </sapn>
    </li>
    <li class="people ">
        <span class="tpeople ">出发地点</span>
        <input type="" name="" id='citypicker' onclick="citypicker($(this))" placeholder="出发城市"  class="street"/>
        <!--<input type="" name="" id="city-picker" placeholder="区"  class="street"/>-->
    </li>
    <li class="contact">
        <span class="tcontact streets details">具体街道&nbsp;&nbsp;&nbsp;</span>
        <input type="" name="" id="" placeholder="请输入具体街道" class="contact2 streets_detail "/>
    </li>
    <li class="contact">
        <span class="tcontact">联系人&nbsp;&nbsp;&nbsp;</span>
        <input type="" name="" id="" placeholder="请填写联系人姓名" class="contact2"/>
    </li>
    <li class="contact">
        <span class="tcontact">手机号码</span>
        <input type="" name="" id="" placeholder="请填写手机号码" class="phone"/>
    </li>
    <li class="contact">
        <span class="tcontact">微信号码</span>
        <input type="" name="" id="" placeholder="请填写微信号码" class="weixin"/>
    </li>
</ul>
<div class="require">
    需求描述
</div>
<div class="describe">
    <textarea name="" rows="" cols=""  class="des"></textarea>
    <span class="limit">限200字以内</span>
</div>
<div class="submit">
    <button class="ok">提交</button>
</div>
<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>
</body>
</html>
<script type="text/javascript" src="__TMPL__/static/assets/js/jquery-2.1.0.js"></script>
<script type="text/javascript" src="__TMPL__/static/assets/js/common.js"></script>
<script type='text/javascript' src='__TMPL__/static/assets/js/Augly_Verification.js'></script>
<script type="text/javascript" src="__TMPL__/static/assets/js/myweui.js"></script>
<script type="text/javascript" src="__TMPL__/static/assets/js/weui.js"></script>
<script type="text/javascript" src="__TMPL__/static/assets/font/iconfont.js"></script>
<script>
    $('.ok').click(function(){
        if( $('.name').val()=='' ){
            toast('请输入您的团队名称');
        }else if($('.number').val()==''){
            toast('请输入团队人数');
        }else if($('.start').val()==''||$('.end').val()==''){
            toast('请选择出行日期');
        }else if($('.street').val()==''){
            toast('城市 区 街道');
        }
        else if($('.contact2').val()==''){
            toast('请输入联系人姓名');
        }
        else if($('.phone').val()==''){
            toast('请输入手机号');
        }

        else if(!AuglyTest_phone.test($('.phone').val())){
            toast('手机号码格式不正确');
        }

        else if($('.weixin').val()==''){
            toast('请输入微信号码');
        }
        else if($('.des').val()==''){
            toast('请输入填写需求描述');
        }
        else{
            $.ajax({
                url:"{:url('team/Team/teamCustomization')}",
                data:{
                    team_name:$('.name').val(),
                    team_num:$('.number').val(),
                    start_time:$('.start').val(),
                    end_time:$('.end').val(),
                    address:$('.street').val()+$('.details').val(),
                    contact:$('.contact2').val(),
                    tel:$('.phone').val(),
                    wechat:$('.weixin').val(),
                    desc:$('.des').val()
                },
                type:"POST",
                dataType:"JSON",

                success: function () {
                    toast('保存成功');
                }
            })
        }

    })
    var start_mon, start_day, end_mon, end_day;

    $('.start').click(function(event) {
        var _this = this;
        weui.datePicker({
            start: new Date(),
            end: 2030,
            defaultValue: [new Date().getFullYear(), new Date().getMonth() + 1, new Date().getDate()],
            onConfirm: function(result) {

                start_year = result[0].value;
                start_mon = result[1].value;
                start_day = result[2].value;

                $('.start').val(start_year+'/'+start_mon+'/'+start_day);

                //setTimeout(function(){
                //	next_time();
                //},300)
            }
        });
    });
    function next_time(){
        weui.datePicker({
            start: new Date(),
            end: 2030,
            defaultValue: [new Date().getFullYear(), new Date().getMonth() + 1, new Date().getDate()],
            onConfirm: function(result) {
                start_year = result[0].value;
                start_mon = result[1].value;
                start_day = result[2].value;
                $('.end').val(start_year+'/'+start_mon+'/'+start_day);

            }
        });
    };
</script>