productTrials.html 4.7 KB
<!DOCTYPE html>
<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">
    <title>学点云</title>
    <link rel="stylesheet" type="text/css" href="css/reset.min.css">
    <link rel="stylesheet" href="css/trials.css">

</head>
<body>
<div class="product_trial_formbox">
    <div class="product_trial_formbox_head"><img src="images/apply-try.png" alt="免费申请试用"></div>
    <div class="product_trial_formbox_content">
        <p>留下您的联系方式,我们会有专人客服在一个工作日内和您联系。</p>
        <form action="" id="detailForm" class="detailForm" method="post">


            <label>*&nbsp;姓名:</label>
            <input name="user_name" type="text" autofocus="autofocus" value="" placeholder="输入您的姓名" title="请输入您的姓名">
            <br>
            <label>*&nbsp;手机:</label>
            <input name="phone_number" type="text" value="" placeholder="输入您的手机号码" title="输入您的手机号码">
            <br>
            <label>*&nbsp;邮箱:</label>
            <input name="email" type="text" value="" placeholder="输入您的邮箱地址" title="输入您的邮箱地址">
            <br>
            <label>公司:</label>
            <input name="company" type="text" value="" placeholder="输入您的公司名称">
            <br>
            <label>电话:</label>
            <input name="telphone" type="text" value="" placeholder="输入您的固定电话">
            <br>
            <label> &nbsp;

                <a class="submit_trail" href="javascript:void(0)">立即申请</a></label>
        </form>
    </div>
</div>
<script type="text/javascript" src="js/rem.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.poshytip.min.js"></script>
<script type="text/javascript" src="js/validate.js"></script>
<script>
    $(document).ready(function(){

        $('.submit_trail').click(function(){
            var obj = $(this);
            var user_name=$("input[name=user_name]").val();
            var phone_number=$("input[name=phone_number]").val();
            var email=$("input[name=email]").val();
            var company=$("input[name=company]").val();
            var telphone=$("input[name=telphone]").val();
//            var clientip = returnCitySN["cip"];
            if(validate.isempty(user_name)){
                $("input[name=user_name]").poshytip({
                    className: 'tip-yellowsimple',
                    showOn: 'focus',
                    alignTo: 'target',
                    alignX: 'right',
                    alignY: 'center',
                    offsetX: 5,
                    showTimeout: 100
                });
                $("input[name=user_name]").focus();
                return false;
            }
            if(!validate.iscellphone(phone_number)){
                $("input[name=phone_number]").poshytip({
                    className: 'tip-yellowsimple',
                    showOn: 'focus',
                    alignTo: 'target',
                    alignX: 'right',
                    alignY: 'center',
                    offsetX: 5,
                    showTimeout: 100
                });
                $("input[name=phone_number]").focus();
                return false;
            }
            if(!validate.isemail(email)){
                $("input[name=email]").poshytip({
                    className: 'tip-yellowsimple',
                    showOn: 'focus',
                    alignTo: 'target',
                    alignX: 'right',
                    alignY: 'center',
                    offsetX: 5,
                    showTimeout: 100
                });
                $("input[name=email]").focus();
                return false;
            }


            jQuery.support.cors = true;

            $.ajax({
                url: "http://api.xuedianyun.com/sanmang/index.php/api/sendmail/sendmail",
                type:'POST',
                data:{email:email,user_name:user_name,phone_number:phone_number,company:company,telphone:telphone},
                dataType: 'JSON',
                success: function(res){
                    if(res.errcode == 0){
                        $('.info').show();
                        //alert("I am an alert box!!")
                    }else{
                        alert(res.msg);

                    }
                },complete:function(){
                    $(':input').val('');
                    $('.info').slideToggle(2000);
                    obj.empty().text("立即申请");
                    alert(res.msg);
                }

            });

        })

    });
</script>

</body>
</html>