195 lines
8.1 KiB
PHTML
Executable File
195 lines
8.1 KiB
PHTML
Executable File
<link rel="stylesheet" type="text/css" href="__PUBLIC__/weben/css/style2.css">
|
||
|
||
<!-- 代理申请表单 s -->
|
||
<div class="apply_content" style="margin-top: 80px;">
|
||
<div class="form_title">Become a Distributor</div>
|
||
<div class="apply_form">
|
||
<div style="margin-bottom: 1.875rem;">
|
||
<p><strong style="color: red; margin-right: 0.3125rem;">*</strong>Company name</p>
|
||
<input class='companyName' type="text" placeholder="Legal business name" name="company" id="company" />
|
||
</div>
|
||
<div style="margin-bottom: 1.875rem;">
|
||
<p>Official website</p>
|
||
<input type="text" placeholder="Please paste the URL" name="url" class="url" id="url" />
|
||
</div>
|
||
<div class="name clearfix" style="margin-bottom: 1.875rem;">
|
||
<p><strong style="color: red; margin-right: 0.3125rem;">*</strong>Your name</p>
|
||
<div style="margin-right: 1.25rem;">
|
||
<input type="text" class="first" placeholder="First name" name="firstname" id="firstname"/>
|
||
</div>
|
||
<div>
|
||
<input type="text" class="last" placeholder="Last name" name="lastname" id="lastname"/>
|
||
</div>
|
||
</div>
|
||
<div style="margin-bottom: 1.875rem;">
|
||
<p><strong style="color: red; margin-right: 0.3125rem;">*</strong>Email</p>
|
||
<input type="email" class="email" name="email" id="email"/>
|
||
</div>
|
||
<div style="margin-bottom: 1.875rem;">
|
||
<p>Phone number</p>
|
||
<input type="text" class="phone" name="phone" id="phone"/>
|
||
</div>
|
||
<div style="margin-bottom: 1.875rem;">
|
||
<p>Products you are interested in?</p>
|
||
<div class="check_boxs">
|
||
<ul>
|
||
<li><input type="checkbox" name="interested" value="Computer Peripheral">Computer Peripheral</li>
|
||
<li><input type="checkbox" name="interested" value="Phone Peripheral">Phone Peripheral</li>
|
||
<li><input type="checkbox" name="interested" value="Electronics">Electronics</li>
|
||
<li><input type="checkbox" name="interested" value="SSD">SSD</li>
|
||
<li><input type="checkbox" name="interested" value="Entertainment Series">Entertainment Series</li>
|
||
<li><input type="checkbox" name="interested" value="Smart Life Series">Smart Life Series</li>
|
||
<li><input type="checkbox" name="interested" value="Outdoor Power Station">Outdoor Power Station</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
<div style="margin-bottom: 1.875rem;">
|
||
<p>Are you willing to keep inventory?</p>
|
||
<div class="radio_box">
|
||
<ul>
|
||
<li><input type="radio" name="inventory" value="YES" checked>YES</li>
|
||
<li><input type="radio" name="inventory" value="NO">NO</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
<div style="margin-bottom: 1.875rem;">
|
||
<p><strong style="color: red; margin-right: 0.3125rem;">*</strong>Distribution region</p>
|
||
<input type="text" class="region" placeholder="Country,or area within a country" name="distribution" id="distribution"/>
|
||
</div>
|
||
<div class="submit_btn">SUBMIT</div>
|
||
</div>
|
||
</div>
|
||
<!-- 代理申请表单 e -->
|
||
|
||
<script>
|
||
|
||
try {
|
||
k_win_ref = window.parent.document.referrer;
|
||
} catch(e) {
|
||
k_win_ref = '';
|
||
};
|
||
// 输入框失去焦点
|
||
$('.companyName').blur(function(){
|
||
if($('.companyName').val() != ''){
|
||
$('.companyName').removeClass('error');
|
||
$('.companyName').next('span').addClass('hide');
|
||
}else{
|
||
$('.companyName').addClass('error');
|
||
$('.companyName').next('span').removeClass('hide');
|
||
}
|
||
})
|
||
$('.first').blur(function(){
|
||
if($('.first').val() != ''){
|
||
$('.first').removeClass('error');
|
||
$('.first').next('span').addClass('hide');
|
||
}else{
|
||
$('.first').addClass('error');
|
||
$('.first').next('span').removeClass('hide');
|
||
}
|
||
})
|
||
$('.last').blur(function(){
|
||
if($('.last').val() != ''){
|
||
$('.last').removeClass('error');
|
||
$('.last').next('span').addClass('hide');
|
||
}else{
|
||
$('.last').addClass('error');
|
||
$('.last').next('span').removeClass('hide');
|
||
}
|
||
})
|
||
$('.email').blur(function(){
|
||
if($('.email').val() != ''){
|
||
$('.email').removeClass('error');
|
||
$('.email').next('span').addClass('hide');
|
||
}else{
|
||
$('.email').addClass('error');
|
||
$('.email').next('span').removeClass('hide');
|
||
}
|
||
})
|
||
$('.region').blur(function(){
|
||
if($('.region').val() != ''){
|
||
$('.region').removeClass('error');
|
||
$('.region').next('span').addClass('hide');
|
||
}else{
|
||
$('.region').addClass('error');
|
||
$('.region').next('span').removeClass('hide');
|
||
}
|
||
})
|
||
// 提交表单
|
||
$('.submit_btn').click(function(){
|
||
var companyName = $('.companyName').val();
|
||
var firstName = $('.first').val();
|
||
var lastName = $('.last').val();
|
||
var email = $('.email').val();
|
||
var region = $('.region').val();
|
||
|
||
var checkItem = new Array();
|
||
|
||
$("input[name='interested']:checked").each(function() {
|
||
checkItem.push($(this).val());// 在数组中追加元素
|
||
});
|
||
var interesteds = checkItem.join(",");
|
||
|
||
var inventory = $("input[name='inventory']:checked").val();
|
||
|
||
|
||
if(companyName == ''){
|
||
$('.companyName').addClass('error');
|
||
$('.companyName').next('span').removeClass('hide');
|
||
}
|
||
if(firstName == ''){
|
||
$('.first').addClass('error');
|
||
$('.first').next('span').removeClass('hide');
|
||
}
|
||
if(lastName == ''){
|
||
$('.last').addClass('error');
|
||
$('.last').next('span').removeClass('hide');
|
||
}
|
||
if(email == ''){
|
||
$('.email').addClass('error');
|
||
$('.email').next('span').removeClass('hide');
|
||
}
|
||
if(region == ''){
|
||
$('.region').addClass('error');
|
||
$('.region').next('span').removeClass('hide');
|
||
}
|
||
|
||
|
||
|
||
//点击创建申请块
|
||
if(companyName && firstName && lastName && email && region) {
|
||
|
||
$.ajax({
|
||
type: "POST",
|
||
url: "/us/agents/create",
|
||
data: {'company':companyName, 'email':email,'country':region,'name':firstName,'last_name':lastName,'phone':$('.phone').val(),'interested':interesteds,'is_inventory':inventory,'uri':$('.url').val(),'refer':k_win_ref},
|
||
dataType: "json",
|
||
success: function(data){
|
||
if(data.code == 200) {
|
||
|
||
location.href = '/us/Group/submission.html';
|
||
}
|
||
else{
|
||
if(data.code == 403 || data.code == 201) {
|
||
alert(data.msg);
|
||
}
|
||
else{
|
||
|
||
$('.email').addClass('error');
|
||
$('.email').next('span').removeClass('hide');
|
||
|
||
}
|
||
}
|
||
|
||
}
|
||
});
|
||
}
|
||
|
||
})
|
||
</script>
|
||
|
||
<style>
|
||
.csunbmit{height: 35px;margin-top: 10px;margin-bottom: 5px;}
|
||
.submitBtn{width: 75px;height: 30px;line-height: 26px;background-color: #339b53;text-align: center;display: block; color: #FFFFFF;font-size: 12px;border-radius: 6px;float: left;}
|
||
.cli{border-bottom: 1px dashed #ccc;text-align: left;font-size: 12px;}
|
||
.ccontent{width: 98%;padding: 10px; background: #f6f9fb;border:1px solid #ccc;margin-bottom: 10px}
|
||
</style> |