/** * Created by Administrator on 2017/6/7 0007. */ $('#reset').click(function () { $("#tel").val(''); $("#name").val(''); $("#email").val(''); $("#contents").val(''); $("#verifyCode").val(''); }); $("#btn_reg").click(function () { var $realname = $.trim($("#realname").val()); var $gender = $.trim($("#gender").val()); var $birthday = $.trim($("#birthday").val()); var $email = $.trim($("#email").val()); var $mobile = $.trim($("#mobile").val()); var $verifyCode = $.trim($("#verifyCode").val()); if($realname==''){ alert("Please fill in your name"); return false; } if($gender==''){ alert("Please select your gender"); return false; } if($birthday==''){ alert("Please select your date of birth"); return false; } if($email==''){ alert("Please fill in your usual email address"); return false; } if($mobile==''){ alert("Please fill in your mobile number"); return false; } if($verifyCode ==''){ alert("verification code must be filled"); return false; } $.ajax({ data:{realname:$realname,gender:$gender,birthday:$birthday,email:$email,mobile:$mobile,verify:$verifyCode,type:'reg'}, dataType:'json', type:'post', url:msg_post_url, success:function (data) { if(data.code == 200){ alert(data.message); location.href='/login.html'; // location.reload(); }else{ alert(data.message+', you try again?'); imageurl = vercode_post_url+"?"+Math.random(); $(".verifyimg").attr('src',imageurl); $("#verifyCode").attr("value",""); } } }); }); $("#btn_login").click(function () { var $email = $.trim($("#email").val()); var $mobile = $.trim($("#mobile").val()); var $verifyCode = $.trim($("#verifyCode").val()); if($email==''){ alert("Please fill in your registered email address"); return false; } if($mobile==''){ alert("Please fill in your mobile number"); return false; } if($verifyCode ==''){ alert("verification code must be filled"); return false; } $.ajax({ data:{email:$email,mobile:$mobile,verify:$verifyCode,type:'login'}, dataType:'json', type:'post', url:msg_post_url, success:function (data) { if(data.code == 200){ alert(data.message); location.href='/'; // location.reload(); }else{ alert(data.message+', you try again?'); imageurl = vercode_post_url+"?"+Math.random(); $(".verifyimg").attr('src',imageurl); $("#verifyCode").attr("value",""); } } }); }); $("#btn_msg").click(function () { var $title_sel = $.trim($("#title_sel").val()); var $title_other = $.trim($("#title_other").val()); var $contents = $.trim($("#contents").val()); if($title_other!=''){ $title = $title_other; }else{ $title = $title_sel; } if($title==''){ alert("Please select or fill in the question type!"); return false; } if($contents==''){ alert("Please describe the problem details!"); return false; } $.ajax({ data:{title:$title,contents:$contents,type:'1'}, dataType:'json', type:'post', url:msg_post_url, success:function (data) { if(data.code == 200){ alert(data.message); location.reload(); }else{ alert(data.message); } } }); }); $("#btn_store").click(function () { var $pname = $.trim($("#pname").val()); var $sname = $.trim($("#sname").val()); var $name = $.trim($("#name").val()); var $gender = $.trim($("#gender").val()); var $age = $.trim($("#age").val()); var $gao = $.trim($("#gao").val()); var $zhong = $.trim($("#zhong").val()); var $career = $.trim($("#career").val()); var $email = $.trim($("#email").val()); var $tel = $.trim($("#tel").val()); var $city = $.trim($("#city").val()); var $yao = $.trim($("#yao").val()); var $tui = $.trim($("#tui").val()); var $longa = $.trim($("#longa").val()); var $longb = $.trim($("#longb").val()); var $health_sel = $.trim($("#health_sel").val()); var $health_oth = $.trim($("#health_oth").val()); var $yycj_sel = $.trim($("#yycj_sel").val()); var $yycj_oth = $.trim($("#yycj_oth").val()); if($pname==''){ alert("Please select the product you want to experience!"); return false; } if($sname==''){ alert("Please choose the experience store you want to experience!"); return false; } if($name==''){ alert("Please fill in the name!"); return false; } if($gender==''){ alert("Please choose gender!"); return false; } if($age==''){ alert("Please fill in the age!"); return false; } if($gao==''){ alert("Please fill in the height!"); return false; } if($zhong==''){ alert("Please fill in the weight!"); return false; } if($career==''){ alert("Please fill in the occupation!"); return false; } if($email==''){ alert("Please fill in the email address!"); return false; } if($tel==''){ alert("Please fill in your phone number!"); return false; } if($city==''){ alert("Please fill in the work city!"); return false; } if($yao==''){ alert("Please fill in the waistline!"); return false; } if($tui==''){ alert("Please fill in the thigh circumference!"); return false; } if($longa==''){ alert("Please fill in the thigh length!"); return false; } if($longb==''){ alert("Please fill in the calf length!"); return false; } if($health_oth!=''){ $health = $health_oth; }else{ $health = $health_sel; } if($health==''){ alert("Please choose or fill in the physical condition!"); return false; } if($yycj_oth!=''){ $yycj = $yycj_oth; }else{ $yycj = $yycj_sel; } if($yycj==''){ alert("Please select or fill in the application scenario!"); return false; } $.ajax({ data:{pname:$pname,sname:$sname,name:$name,gender:$gender,age:$age,gao:$gao,zhong:$zhong,career:$career,email:$email,tel:$tel,city:$city,yao:$yao,tui:$tui,longa:$longa,longb:$longb,health:$health,yycj:$yycj}, dataType:'json', type:'post', url:msg_post_url, success:function (data) { if(data.code == 200){ alert(data.message); location.reload(); }else{ alert(data.message); } } }); }); $("#btn_diy").click(function () { var $pname = $.trim($("#pname").val()); var $yao = $.trim($("#yao").val()); var $tui = $.trim($("#tui").val()); var $longa = $.trim($("#longa").val()); var $longb = $.trim($("#longb").val()); var $fuzhong_sel = $.trim($("#fuzhong_sel").val()); var $fuzhong_oth = $.trim($("#fuzhong_oth").val()); var $sudu_sel = $.trim($("#sudu_sel").val()); var $sudu_oth = $.trim($("#sudu_oth").val()); var $name = $.trim($("#name").val()); var $gender = $.trim($("#gender").val()); var $age = $.trim($("#age").val()); var $gao = $.trim($("#gao").val()); var $zhong = $.trim($("#zhong").val()); var $career = $.trim($("#career").val()); var $email = $.trim($("#email").val()); var $tel = $.trim($("#tel").val()); var $city = $.trim($("#city").val()); var $health_sel = $.trim($("#health_sel").val()); var $health_oth = $.trim($("#health_oth").val()); var $yycj_sel = $.trim($("#yycj_sel").val()); var $yycj_oth = $.trim($("#yycj_oth").val()); if($pname==''){ alert("Please choose a custom product!"); return false; } if($yao==''){ alert("Please fill in the waistline!"); return false; } if($tui==''){ alert("Please fill in the thigh circumference!"); return false; } if($longa==''){ alert("Please fill in the thigh length!"); return false; } if($longb==''){ alert("Please fill in the calf length!"); return false; } if($fuzhong_oth!=''){ $fuzhong = $fuzhong_oth; }else{ $fuzhong = $fuzhong_sel; } if($fuzhong==''){ alert("Please choose or fill in the weight!"); return false; } if($sudu_oth!=''){ $sudu = $sudu_oth; }else{ $sudu = $sudu_sel; } if($sudu==''){ alert("Please choose or fill in the walking speed!"); return false; } if($name==''){ alert("Please fill in the name!"); return false; } if($gender==''){ alert("Please choose gender!"); return false; } if($age==''){ alert("Please fill in the age!"); return false; } if($gao==''){ alert("Please fill in the height!"); return false; } if($zhong==''){ alert("Please fill in the weight!"); return false; } if($career==''){ alert("Please fill in the occupation!"); return false; } if($email==''){ alert("Please fill in the email address!"); return false; } if($tel==''){ alert("Please fill in your phone number!"); return false; } if($city==''){ alert("Please fill in the work city!"); return false; } if($health_oth!=''){ $health = $health_oth; }else{ $health = $health_sel; } if($health==''){ alert("Please choose or fill in the physical condition!"); return false; } if($yycj_oth!=''){ $yycj = $yycj_oth; }else{ $yycj = $yycj_sel; } if($yycj==''){ alert("Please select or fill in the application scenario!"); return false; } $.ajax({ data:{pname:$pname,yao:$yao,tui:$tui,longa:$longa,longb:$longb,fuzhong:$fuzhong,sudu:$sudu,name:$name,gender:$gender,age:$age,gao:$gao,zhong:$zhong,career:$career,email:$email,tel:$tel,city:$city,health:$health,yycj:$yycj}, dataType:'json', type:'post', url:msg_post_url, success:function (data) { if(data.code == 200){ alert(data.message); location.reload(); }else{ alert(data.message); } } }); }); function verify(){ imageurl = vercode_post_url+"?"+Math.random(); $(".verifyimg").attr('src',imageurl); }