Authored by whb

在线登记

... ... @@ -807,28 +807,55 @@ define('yohood', function(require, exports) {
function getFormData (callback) {
var $formBox = $('#exhibitor-form'),
name = $formBox.find('input[name="name"]').val(),
var $formBox;
if($('#exhibitor-form').length> 0)
{
$formBox = $('#exhibitor-form');
}
else if($('#media-form').length> 0)
{
$formBox = $('#media-form');
}
else if($('#sponsor-form').length> 0)
{
$formBox = $('#sponsor-form');
}
var name = $formBox.find('input[name="name"]').val(),
is_enter_yohobuy = $formBox.find('input[name="is_enter_yohobuy"]:checked').val(),
brand_reg_type = $formBox.find('input[name="brand_reg_type"]:checked').val(),
profession = $formBox.find('input[name="profession"]').val(),
product_type = $formBox.find('input[name="product_type"]').val(),
company = $formBox.find('input[name="company"]').val(),
country = $formBox.find('input[name="country"]').val(),
sex = $formBox.find('input[name="sex"]').val(),
city = $formBox.find('input[name="city"]').val(),
mobile = $formBox.find('input[name="mobile"]').val(),
contact = $formBox.find('input[name="contact"]').val(),
introduction = $formBox.find('input[name="introduction"]').val(),
telphone = $formBox.find('input[name="telphone"]').val(),
email = $formBox.find('input[name="email"]').val(),
relation = $formBox.find('input[name="relation"]:checked').val(),
place = $formBox.find('input[name="place"]').val(),
is_3c = $formBox.find('input[name="is_3c"]:checked').val(),
website = $formBox.find('input[name="website"]').val(),
zipcode = $formBox.find('input[name="zipcode"]').val(),
files = $formBox.find('input[name="files"]').val(),
code = $formBox.find('input[name="code"]').val(),
type = $formBox.find('input[name="type"]').val();
var resData = {
name: name,
is_enter_yohobuy: is_enter_yohobuy,
brand_reg_type: brand_reg_type,
company: company,
profession:profession,
company:company,
country:country,
sex:sex,
city:city,
mobile:mobile,
contact: contact,
introduction:introduction,
telphone: telphone,
email: email,
relation: relation,
... ... @@ -836,12 +863,31 @@ define('yohood', function(require, exports) {
is_3c: is_3c,
website: website,
files: files,
zipcode:zipcode,
code: code,
type: type
}
callback(resData);
}
function valiateCode(form)
{
$.ajax({
type: 'post',
dataType: 'json',
url: '/onlinereg/validatecode',
data: {
code: $('.pic-code').val()
},
success: function (d) {
if (d.code === 200) {
//form.submit();
}
}
});
}
// 表单验证
if ($('#exhibitor-form').length > 0) {
$('#exhibitor-form').validate({
... ... @@ -896,20 +942,100 @@ define('yohood', function(require, exports) {
}
},
submitHandler: function(form){
$.ajax({
type: 'post',
dataType: 'json',
url: '/onlinereg/validatecode',
data: {
code: $('.pic-code').val()
},
success: function (d) {
if (d.code === 200) {
//form.submit();
valiateCode(form);
getFormData(function (data) {
$.ajax({
type: 'post',
dataType: 'json',
url: '/onlinereg/setseller',
data: {
name: data.name,
profession:data.profession,
company: data.company,
contact: data.contact,
telphone: data.telphone,
email: data.email,
relation: data.relation,
place: data.place,
is_3c: data.is_3c,
website: data.website,
files: data.files,
code: data.code,
type: data.type
},
success: function (d) {
if (d.code === 200) {
$('.dialog-w').fadeIn();
window.location.reload();
}
else {
alert("失败");
}
}
}
});
});
}
});
}
//媒体登记
if ($('#media-form').length > 0)
{
$('#media-form').validate({
focusInvalid: false,
onkeyup: false,
rules: {
name: {
required: true
},
introduction: {
required: true
},
mobile: {
required: true
},
place: {
required: true
},
email:{
email:true
},
code:{
required:true,
minlength:4,
maxlength:4
},
website:{
url:true
}
},
messages: {
name: {
required: '必填'
},
introduction: {
required: '必填'
},
mobile: {
required: '必填'
},
place: {
required: '必填'
},
email:'邮箱格式不正确',
code:{
required:"必须输入验证码",
minlength:"验证码长度4位",
maxlength:"验证码长度4位"
},
website:{
url:"必须是有效链接"
}
},
submitHandler: function(form){
valiateCode(form);
getFormData(function (data) {
$.ajax({
... ... @@ -918,11 +1044,14 @@ define('yohood', function(require, exports) {
url: '/onlinereg/setseller',
data: {
name: data.name,
is_enter_yohobuy: data.is_enter_yohobuy,
brand_reg_type: data.brand_reg_type,
profession:data.profession,
sex:data.sex,
company: data.company,
introduction:data.introduction,
city:data.city,
contact: data.contact,
telphone: data.telphone,
mobile:data.mobile,
email: data.email,
relation: data.relation,
place: data.place,
... ... @@ -930,6 +1059,95 @@ define('yohood', function(require, exports) {
website: data.website,
files: data.files,
code: data.code,
zipcode:data.zipcode,
type: data.type
},
success: function (d) {
if (d.code === 200) {
$('.dialog-w').fadeIn();
window.location.reload();
}
else {
alert("失败");
}
}
});
});
}
});
}
//赞助商
if ($('#sponsor-form').length > 0)
{
$('#sponsor-form').validate({
focusInvalid: false,
onkeyup: false,
rules: {
name: {
required: true
},
product_type: {
required: true
},
telphone: {
required: true
},
email:{
email:true
},
code:{
required:true,
minlength:4,
maxlength:4
},
website:{
url:true
}
},
messages: {
name: {
required: '必填'
},
product_type: {
required: '必填'
},
telphone: {
required: '必填'
},
email:'邮箱格式不正确',
code:{
required:"必须输入验证码",
minlength:"验证码长度4位",
maxlength:"验证码长度4位"
},
website:{
url:"必须是有效链接"
}
},
submitHandler: function(form){
valiateCode(form);
getFormData(function (data) {
$.ajax({
type: 'post',
dataType: 'json',
url: '/onlinereg/setseller',
data: {
name: data.name,
is_enter_yohobuy:data.is_enter_yohobuy,
product_type:data.product_type,
company: data.company,
country:data.country,
contact: data.contact,
telphone: data.telphone,
email: data.email,
place: data.place,
website: data.website,
files: data.files,
code: data.code,
type: data.type
},
success: function (d) {
... ... @@ -947,5 +1165,10 @@ define('yohood', function(require, exports) {
}
});
}
}
});
\ No newline at end of file
... ...
... ... @@ -103,9 +103,9 @@
<div class="form-leading"><span>品牌资料上传:</span></div>
<div class="form-control">
<input type="file" name="upload-file" id="upload-file"/>
<span class="upload-tips">大小不超过10M</span>
<span class="upload-tips">ppt/ptf/zip,大小不超过10M</span>
<div class="has-upload" style="display: none;">
<span>品牌资料.pdf</span>
<span></span>
</div>
</div>
</li>
... ...
... ... @@ -22,7 +22,7 @@
</div>
<div class="pull-right">
<h2 class="content-header">填写报名信息 <span>Switch to English</span></h2>
<form method="post" action="/onlinereg/setseller" id="media-form" enctype="multipart/form-data">
<form method="post" id="media-form" enctype="multipart/form-data">
<ul>
<li>
<div class="form-leading"><span>姓名:</span></div>
... ... @@ -83,7 +83,7 @@
</li>
</ul>
<input type="hidden" value="<?php echo $this->view->type?>" name="type" />
<span class="submit-w-btn">提交</span>
<input type="submit" class="submit-w-btn" value="提交" />
</form>
</div>
</div>
... ...
... ... @@ -17,7 +17,7 @@
</div>
<div class="pull-right">
<h2 class="content-header">填写报名信息 <span>Switch to English</span></h2>
<form action="/onlinereg/setseller" method="post" enctype="multipart/form-data" id="sponsor-form">
<form method="post" enctype="multipart/form-data" id="sponsor-form">
<ul>
<li>
<div class="form-leading"><b>*</b><span>品牌名称:</span></div>
... ... @@ -38,15 +38,15 @@
<div class="form-control"><input type="text" name="product_type"/></div>
</li>
<li>
<div class="form-leading">所属国家:</span></div>
<div class="form-leading">所属国家:</div>
<div class="form-control"><input type="text" name="country"/></div>
</li>
<li>
<div class="form-leading">公司名称:</span></div>
<div class="form-leading">公司名称:</div>
<div class="form-control"><input type="text" name="company"/></div>
</li>
<li>
<div class="form-leading">公司地址:</span></div>
<div class="form-leading">公司地址:</div>
<div class="form-control"><input type="text" name="place"/></div>
</li>
<li>
... ... @@ -68,13 +68,10 @@
<li class="upload-list">
<div class="form-leading"><span>品牌资料上传:</span></div>
<div class="form-control">
<input type="file" name="file"/>
<span class="upload-tips">ppt/ptf,大小不超过10M</span>
<input type="file" name="upload-file" id="upload-file"/>
<span class="upload-tips">ppt/ptf/zip,大小不超过10M</span>
<div class="has-upload">
<span>品牌资料.pdf <b>X</b></span>
</div>
<div class="has-upload">
<span>品牌资料.pdf <b>X</b></span>
<span></span>
</div>
</div>
</li>
... ... @@ -92,6 +89,7 @@
</ul>
<input type="hidden" value="<?php echo $this->view->type?>" name="type" />
<!-- <span class="submit-w-btn">提交</span>-->
<input type="hidden" value="" name="files" id="file-url"/>
<input type="submit" value="提交" class="submit-w-btn">
</form>
</div>
... ...