123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <!DOCTYPE html>
- <html>
- <head lang="en">
- <include file="./Application/M/View/Common/head_include.html"/>
- <title>在线留言-联系我们-厦门欣富地智能科技</title>
- <link rel="stylesheet" type="text/css" href="/Public/static/home/m/css/join.css"/><style>
- *{
- box-sizing: border-box;
- }
- .message h3{
- text-align: left;
- margin-top: 1.04rem;
- }
- </style>
- </head>
- <body>
- <include file="./Application/M/View/Common/head.html"/>
- <div class="content">
- <div class="col"><img src="https://img.x-motion.cn/home/m/image/join/message.jpg" /></div>
- <div class="message">
- <h3>请填写以下信息,我们将安排专业的客服与您联系</h3>
- <form action="javascript:void(0);" method="post">
- <p><label for="name">*<span>姓  名:</span></label><input type="text" name="name" id="name" value="" placeholder="请输入您的姓名" /><span class="error"></span></p>
- <p><label for="tel">*<span>电  话:</span></label><input type="text" name="tel" id="tel" value="" placeholder="请输入您的真实电话号码" /><span class="error"></span></p>
- <p><label for="address">*<span>地  址:</span></label><input type="text" name="address" id="address" value="" placeholder="请输入您所在的地址" /><span class="error"></span></p>
- <p class="content1"><label for="message">*<span>留  言:</span></label><textarea id="message" name="message" rows="" cols="" placeholder="您有什么想告诉我们的?"></textarea><span class="error"></span></p>
- <input type="submit" id="submit" value="确定" />
- </form>
- </div>
- <include file="./Application/M/View/Common/footer.html"/>
- </div>
- <include file="./Application/M/View/Common/footer_include.html"/>
- <script type="text/javascript">
- $(document).ready(function() {
- $('form input,form textarea').on('input', function(){
- $(this).siblings('span.error').html('');
- });
- $('#submit').on('click', function(){
- $("#submit").attr('disabled', true);
- var check_key = {
- name:'',
- tel:'',
- address:'',
- message:''
- };
- var data = {
- name: $('#name').val(),
- tel: $('#tel').val(),
- address: $('#address').val(),
- message: $('#message').val()
- };
- var status = true;
- if(!isPoneAvailable(data["tel"])){
- error = $('#tel').siblings('.error');
- $(error).html('号码错误');
- status = false;
- }
- for (var Key in check_key){
- if(data[Key] == ''){
- error = $('#' + Key).siblings('.error');
- $(error).html('请填写');
- status = false;
- }
- }
- if(status == false){
- $("#submit").removeAttr('disabled');
- return false;
- }
- $.ajax({
- type: "post",
- url: "{:U(CONTROLLER_NAME . '/' . ACTION_NAME)}",
- data: {data: data},
- success: function (data) {
- if (data.status == '1') {
- layer.msg('提交成功!');
- setTimeout( function(){
- window.location.href = location.href;
- }, 2 * 1000 );
- } else if (data.status == '0') {
- parent.layer.msg(data.info, {icon: 5});
- }
- $("#submit").removeAttr('disabled');
- }
- });
- });
- $('.message_input input').on('focus', function(){
- $(this).siblings('.error').html('');
- });
- $('.message_input textarea').on('focus', function(){
- $(this).siblings('.error').html('');
- });
- });
- function isPoneAvailable(phone) {
- var myreg = /^[1][3,4,5,7,8][0-9]{9}$/;
- if (!myreg.test(phone)) {
- return false;
- } else {
- return true;
- }
- }
- </script>
- </body>
- </html>
|