You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
3.3 KiB
76 lines
3.3 KiB
{layout name="public/layout" /}
|
|
<div id="feedback">
|
|
<div class="wraper">
|
|
<div class="title">
|
|
<p>如需帮助请您留言并留联系方式,</p>
|
|
<p>我们的工作人员会尽快与您联系。</p>
|
|
</div>
|
|
<form class=" " id="postForm" method="post" action="{:url('feedback')}">
|
|
{:token('__feed__')}
|
|
<div class="form-group">
|
|
<div class=" control-label"><strong>手机</strong> <span>(必填)</span></div>
|
|
<input type="text" name="tel" id="tel" class="form-control" placeholder="请输入内容">
|
|
</div>
|
|
<div class="form-group">
|
|
<div class=" control-label"><strong>邮箱</strong> <span>(必填)</span></div>
|
|
<input type="text" name="email" id="email" class="form-control" placeholder="请输入内容">
|
|
</div>
|
|
<div class="form-group">
|
|
<div class=" control-label"><strong>留言</strong> <span>(必填)</span></div>
|
|
<textarea name="information" id="information" class="form-control" rows="8" placeholder="请输入内容"></textarea>
|
|
</div>
|
|
<br/>
|
|
<div class="row text-center">
|
|
<div class="col-xs-6 col-xs-offset-3">
|
|
<button type="submit" class="btn btn-danger" style="width:80%">提 交</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<script src="{$yf_theme_path}public/js/jquery-2.1.4.js"></script>
|
|
<script src="{$yf_theme_path}public/js/jquery.form.js"></script>
|
|
<script src="{$yf_theme_path}public/js/jquery.validate.min.js"></script>
|
|
<script src="{$yf_theme_path}public/js/layer/layer.js"></script>
|
|
<script src="{$yf_theme_path}public/js/base.js"></script>
|
|
<script>
|
|
// 手机号码验证
|
|
jQuery.validator.addMethod("isMobile", function(value, element) {
|
|
var length = value.length;
|
|
return this.optional(element) || (length == 11 && /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/.test(value));
|
|
}, "请正确填写您的手机号码。");
|
|
var rules={
|
|
"tel":{
|
|
"required":true,
|
|
"isMobile":true
|
|
},
|
|
"email":{
|
|
"required":true,
|
|
"email":true,
|
|
},
|
|
"information":"required"
|
|
};
|
|
var messages={
|
|
"tel":{
|
|
"required":"请输入手机",
|
|
"isMobile":"请输入正确手机"
|
|
},
|
|
"email":{
|
|
"required":"请输入邮箱",
|
|
"email":"请输入正确邮箱",
|
|
},
|
|
"information":"请输入内容"
|
|
};
|
|
tool.commonForm("#postForm",rules,messages,tool.tipError,'',function(data){
|
|
console.log(data.data);
|
|
tool.msg(data.msg);
|
|
if(data.code==0){
|
|
$("input[name='__feed__']").val(data.data.token);
|
|
}else{
|
|
setTimeout(function(){
|
|
window.location.reload();
|
|
},3000);
|
|
}
|
|
|
|
});
|
|
</script>
|
|
</div>
|