Authored by whb

在线登记

@@ -807,28 +807,55 @@ define('yohood', function(require, exports) { @@ -807,28 +807,55 @@ define('yohood', function(require, exports) {
807 807
808 function getFormData (callback) { 808 function getFormData (callback) {
809 809
810 - var $formBox = $('#exhibitor-form'),  
811 - name = $formBox.find('input[name="name"]').val(), 810 + var $formBox;
  811 + if($('#exhibitor-form').length> 0)
  812 + {
  813 + $formBox = $('#exhibitor-form');
  814 + }
  815 + else if($('#media-form').length> 0)
  816 + {
  817 + $formBox = $('#media-form');
  818 + }
  819 + else if($('#sponsor-form').length> 0)
  820 + {
  821 + $formBox = $('#sponsor-form');
  822 + }
  823 + var name = $formBox.find('input[name="name"]').val(),
812 is_enter_yohobuy = $formBox.find('input[name="is_enter_yohobuy"]:checked').val(), 824 is_enter_yohobuy = $formBox.find('input[name="is_enter_yohobuy"]:checked').val(),
813 brand_reg_type = $formBox.find('input[name="brand_reg_type"]:checked').val(), 825 brand_reg_type = $formBox.find('input[name="brand_reg_type"]:checked').val(),
  826 + profession = $formBox.find('input[name="profession"]').val(),
  827 + product_type = $formBox.find('input[name="product_type"]').val(),
814 company = $formBox.find('input[name="company"]').val(), 828 company = $formBox.find('input[name="company"]').val(),
  829 + country = $formBox.find('input[name="country"]').val(),
  830 + sex = $formBox.find('input[name="sex"]').val(),
  831 + city = $formBox.find('input[name="city"]').val(),
  832 + mobile = $formBox.find('input[name="mobile"]').val(),
815 contact = $formBox.find('input[name="contact"]').val(), 833 contact = $formBox.find('input[name="contact"]').val(),
  834 + introduction = $formBox.find('input[name="introduction"]').val(),
816 telphone = $formBox.find('input[name="telphone"]').val(), 835 telphone = $formBox.find('input[name="telphone"]').val(),
817 email = $formBox.find('input[name="email"]').val(), 836 email = $formBox.find('input[name="email"]').val(),
818 relation = $formBox.find('input[name="relation"]:checked').val(), 837 relation = $formBox.find('input[name="relation"]:checked').val(),
819 place = $formBox.find('input[name="place"]').val(), 838 place = $formBox.find('input[name="place"]').val(),
820 is_3c = $formBox.find('input[name="is_3c"]:checked').val(), 839 is_3c = $formBox.find('input[name="is_3c"]:checked').val(),
821 website = $formBox.find('input[name="website"]').val(), 840 website = $formBox.find('input[name="website"]').val(),
  841 + zipcode = $formBox.find('input[name="zipcode"]').val(),
822 files = $formBox.find('input[name="files"]').val(), 842 files = $formBox.find('input[name="files"]').val(),
823 code = $formBox.find('input[name="code"]').val(), 843 code = $formBox.find('input[name="code"]').val(),
  844 +
824 type = $formBox.find('input[name="type"]').val(); 845 type = $formBox.find('input[name="type"]').val();
825 846
826 var resData = { 847 var resData = {
827 name: name, 848 name: name,
828 is_enter_yohobuy: is_enter_yohobuy, 849 is_enter_yohobuy: is_enter_yohobuy,
829 brand_reg_type: brand_reg_type, 850 brand_reg_type: brand_reg_type,
830 - company: company, 851 + profession:profession,
  852 + company:company,
  853 + country:country,
  854 + sex:sex,
  855 + city:city,
  856 + mobile:mobile,
831 contact: contact, 857 contact: contact,
  858 + introduction:introduction,
832 telphone: telphone, 859 telphone: telphone,
833 email: email, 860 email: email,
834 relation: relation, 861 relation: relation,
@@ -836,12 +863,31 @@ define('yohood', function(require, exports) { @@ -836,12 +863,31 @@ define('yohood', function(require, exports) {
836 is_3c: is_3c, 863 is_3c: is_3c,
837 website: website, 864 website: website,
838 files: files, 865 files: files,
  866 + zipcode:zipcode,
839 code: code, 867 code: code,
840 type: type 868 type: type
841 } 869 }
842 callback(resData); 870 callback(resData);
843 } 871 }
844 872
  873 + function valiateCode(form)
  874 + {
  875 + $.ajax({
  876 + type: 'post',
  877 + dataType: 'json',
  878 + url: '/onlinereg/validatecode',
  879 + data: {
  880 + code: $('.pic-code').val()
  881 + },
  882 + success: function (d) {
  883 +
  884 + if (d.code === 200) {
  885 + //form.submit();
  886 + }
  887 + }
  888 + });
  889 + }
  890 +
845 // 表单验证 891 // 表单验证
846 if ($('#exhibitor-form').length > 0) { 892 if ($('#exhibitor-form').length > 0) {
847 $('#exhibitor-form').validate({ 893 $('#exhibitor-form').validate({
@@ -896,20 +942,100 @@ define('yohood', function(require, exports) { @@ -896,20 +942,100 @@ define('yohood', function(require, exports) {
896 } 942 }
897 }, 943 },
898 submitHandler: function(form){ 944 submitHandler: function(form){
  945 + valiateCode(form);
  946 +
  947 + getFormData(function (data) {
899 $.ajax({ 948 $.ajax({
900 type: 'post', 949 type: 'post',
901 dataType: 'json', 950 dataType: 'json',
902 - url: '/onlinereg/validatecode', 951 + url: '/onlinereg/setseller',
903 data: { 952 data: {
904 - code: $('.pic-code').val() 953 + name: data.name,
  954 + profession:data.profession,
  955 + company: data.company,
  956 + contact: data.contact,
  957 + telphone: data.telphone,
  958 + email: data.email,
  959 + relation: data.relation,
  960 + place: data.place,
  961 + is_3c: data.is_3c,
  962 + website: data.website,
  963 + files: data.files,
  964 + code: data.code,
  965 + type: data.type
905 }, 966 },
906 success: function (d) { 967 success: function (d) {
907 -  
908 if (d.code === 200) { 968 if (d.code === 200) {
909 - //form.submit(); 969 + $('.dialog-w').fadeIn();
  970 + window.location.reload();
910 } 971 }
  972 + else {
  973 + alert("失败");
911 } 974 }
  975 + }
  976 + });
  977 +
912 }); 978 });
  979 + }
  980 + });
  981 + }
  982 +
  983 + //媒体登记
  984 + if ($('#media-form').length > 0)
  985 + {
  986 + $('#media-form').validate({
  987 + focusInvalid: false,
  988 + onkeyup: false,
  989 + rules: {
  990 + name: {
  991 + required: true
  992 + },
  993 + introduction: {
  994 + required: true
  995 + },
  996 + mobile: {
  997 + required: true
  998 + },
  999 + place: {
  1000 + required: true
  1001 + },
  1002 + email:{
  1003 + email:true
  1004 + },
  1005 + code:{
  1006 + required:true,
  1007 + minlength:4,
  1008 + maxlength:4
  1009 + },
  1010 + website:{
  1011 + url:true
  1012 + }
  1013 + },
  1014 + messages: {
  1015 + name: {
  1016 + required: '必填'
  1017 + },
  1018 + introduction: {
  1019 + required: '必填'
  1020 + },
  1021 + mobile: {
  1022 + required: '必填'
  1023 + },
  1024 + place: {
  1025 + required: '必填'
  1026 + },
  1027 + email:'邮箱格式不正确',
  1028 + code:{
  1029 + required:"必须输入验证码",
  1030 + minlength:"验证码长度4位",
  1031 + maxlength:"验证码长度4位"
  1032 + },
  1033 + website:{
  1034 + url:"必须是有效链接"
  1035 + }
  1036 + },
  1037 + submitHandler: function(form){
  1038 + valiateCode(form);
913 1039
914 getFormData(function (data) { 1040 getFormData(function (data) {
915 $.ajax({ 1041 $.ajax({
@@ -918,11 +1044,14 @@ define('yohood', function(require, exports) { @@ -918,11 +1044,14 @@ define('yohood', function(require, exports) {
918 url: '/onlinereg/setseller', 1044 url: '/onlinereg/setseller',
919 data: { 1045 data: {
920 name: data.name, 1046 name: data.name,
921 - is_enter_yohobuy: data.is_enter_yohobuy,  
922 - brand_reg_type: data.brand_reg_type, 1047 + profession:data.profession,
  1048 + sex:data.sex,
923 company: data.company, 1049 company: data.company,
  1050 + introduction:data.introduction,
  1051 + city:data.city,
924 contact: data.contact, 1052 contact: data.contact,
925 telphone: data.telphone, 1053 telphone: data.telphone,
  1054 + mobile:data.mobile,
926 email: data.email, 1055 email: data.email,
927 relation: data.relation, 1056 relation: data.relation,
928 place: data.place, 1057 place: data.place,
@@ -930,6 +1059,7 @@ define('yohood', function(require, exports) { @@ -930,6 +1059,7 @@ define('yohood', function(require, exports) {
930 website: data.website, 1059 website: data.website,
931 files: data.files, 1060 files: data.files,
932 code: data.code, 1061 code: data.code,
  1062 + zipcode:data.zipcode,
933 type: data.type 1063 type: data.type
934 }, 1064 },
935 success: function (d) { 1065 success: function (d) {
@@ -947,5 +1077,98 @@ define('yohood', function(require, exports) { @@ -947,5 +1077,98 @@ define('yohood', function(require, exports) {
947 } 1077 }
948 }); 1078 });
949 } 1079 }
  1080 +
  1081 +
  1082 + //赞助商
  1083 + if ($('#sponsor-form').length > 0)
  1084 + {
  1085 + $('#sponsor-form').validate({
  1086 + focusInvalid: false,
  1087 + onkeyup: false,
  1088 + rules: {
  1089 + name: {
  1090 + required: true
  1091 + },
  1092 + product_type: {
  1093 + required: true
  1094 + },
  1095 + telphone: {
  1096 + required: true
  1097 + },
  1098 + email:{
  1099 + email:true
  1100 + },
  1101 + code:{
  1102 + required:true,
  1103 + minlength:4,
  1104 + maxlength:4
  1105 + },
  1106 + website:{
  1107 + url:true
950 } 1108 }
  1109 + },
  1110 + messages: {
  1111 + name: {
  1112 + required: '必填'
  1113 + },
  1114 + product_type: {
  1115 + required: '必填'
  1116 + },
  1117 + telphone: {
  1118 + required: '必填'
  1119 + },
  1120 + email:'邮箱格式不正确',
  1121 + code:{
  1122 + required:"必须输入验证码",
  1123 + minlength:"验证码长度4位",
  1124 + maxlength:"验证码长度4位"
  1125 + },
  1126 + website:{
  1127 + url:"必须是有效链接"
  1128 + }
  1129 + },
  1130 + submitHandler: function(form){
  1131 + valiateCode(form);
  1132 +
  1133 + getFormData(function (data) {
  1134 + $.ajax({
  1135 + type: 'post',
  1136 + dataType: 'json',
  1137 + url: '/onlinereg/setseller',
  1138 + data: {
  1139 + name: data.name,
  1140 + is_enter_yohobuy:data.is_enter_yohobuy,
  1141 + product_type:data.product_type,
  1142 + company: data.company,
  1143 + country:data.country,
  1144 + contact: data.contact,
  1145 + telphone: data.telphone,
  1146 + email: data.email,
  1147 + place: data.place,
  1148 + website: data.website,
  1149 + files: data.files,
  1150 + code: data.code,
  1151 + type: data.type
  1152 + },
  1153 + success: function (d) {
  1154 + if (d.code === 200) {
  1155 + $('.dialog-w').fadeIn();
  1156 + window.location.reload();
  1157 + }
  1158 + else {
  1159 + alert("失败");
  1160 + }
  1161 + }
  1162 + });
  1163 +
  1164 + });
  1165 + }
  1166 + });
  1167 + }
  1168 +
  1169 +
  1170 +
  1171 + }
  1172 +
  1173 +
951 }); 1174 });
@@ -103,9 +103,9 @@ @@ -103,9 +103,9 @@
103 <div class="form-leading"><span>品牌资料上传:</span></div> 103 <div class="form-leading"><span>品牌资料上传:</span></div>
104 <div class="form-control"> 104 <div class="form-control">
105 <input type="file" name="upload-file" id="upload-file"/> 105 <input type="file" name="upload-file" id="upload-file"/>
106 - <span class="upload-tips">大小不超过10M</span> 106 + <span class="upload-tips">ppt/ptf/zip,大小不超过10M</span>
107 <div class="has-upload" style="display: none;"> 107 <div class="has-upload" style="display: none;">
108 - <span>品牌资料.pdf</span> 108 + <span></span>
109 </div> 109 </div>
110 </div> 110 </div>
111 </li> 111 </li>
@@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
22 </div> 22 </div>
23 <div class="pull-right"> 23 <div class="pull-right">
24 <h2 class="content-header">填写报名信息 <span>Switch to English</span></h2> 24 <h2 class="content-header">填写报名信息 <span>Switch to English</span></h2>
25 - <form method="post" action="/onlinereg/setseller" id="media-form" enctype="multipart/form-data"> 25 + <form method="post" id="media-form" enctype="multipart/form-data">
26 <ul> 26 <ul>
27 <li> 27 <li>
28 <div class="form-leading"><span>姓名:</span></div> 28 <div class="form-leading"><span>姓名:</span></div>
@@ -83,7 +83,7 @@ @@ -83,7 +83,7 @@
83 </li> 83 </li>
84 </ul> 84 </ul>
85 <input type="hidden" value="<?php echo $this->view->type?>" name="type" /> 85 <input type="hidden" value="<?php echo $this->view->type?>" name="type" />
86 - <span class="submit-w-btn">提交</span> 86 + <input type="submit" class="submit-w-btn" value="提交" />
87 </form> 87 </form>
88 </div> 88 </div>
89 </div> 89 </div>
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 </div> 17 </div>
18 <div class="pull-right"> 18 <div class="pull-right">
19 <h2 class="content-header">填写报名信息 <span>Switch to English</span></h2> 19 <h2 class="content-header">填写报名信息 <span>Switch to English</span></h2>
20 - <form action="/onlinereg/setseller" method="post" enctype="multipart/form-data" id="sponsor-form"> 20 + <form method="post" enctype="multipart/form-data" id="sponsor-form">
21 <ul> 21 <ul>
22 <li> 22 <li>
23 <div class="form-leading"><b>*</b><span>品牌名称:</span></div> 23 <div class="form-leading"><b>*</b><span>品牌名称:</span></div>
@@ -38,15 +38,15 @@ @@ -38,15 +38,15 @@
38 <div class="form-control"><input type="text" name="product_type"/></div> 38 <div class="form-control"><input type="text" name="product_type"/></div>
39 </li> 39 </li>
40 <li> 40 <li>
41 - <div class="form-leading">所属国家:</span></div> 41 + <div class="form-leading">所属国家:</div>
42 <div class="form-control"><input type="text" name="country"/></div> 42 <div class="form-control"><input type="text" name="country"/></div>
43 </li> 43 </li>
44 <li> 44 <li>
45 - <div class="form-leading">公司名称:</span></div> 45 + <div class="form-leading">公司名称:</div>
46 <div class="form-control"><input type="text" name="company"/></div> 46 <div class="form-control"><input type="text" name="company"/></div>
47 </li> 47 </li>
48 <li> 48 <li>
49 - <div class="form-leading">公司地址:</span></div> 49 + <div class="form-leading">公司地址:</div>
50 <div class="form-control"><input type="text" name="place"/></div> 50 <div class="form-control"><input type="text" name="place"/></div>
51 </li> 51 </li>
52 <li> 52 <li>
@@ -68,13 +68,10 @@ @@ -68,13 +68,10 @@
68 <li class="upload-list"> 68 <li class="upload-list">
69 <div class="form-leading"><span>品牌资料上传:</span></div> 69 <div class="form-leading"><span>品牌资料上传:</span></div>
70 <div class="form-control"> 70 <div class="form-control">
71 - <input type="file" name="file"/>  
72 - <span class="upload-tips">ppt/ptf,大小不超过10M</span> 71 + <input type="file" name="upload-file" id="upload-file"/>
  72 + <span class="upload-tips">ppt/ptf/zip,大小不超过10M</span>
73 <div class="has-upload"> 73 <div class="has-upload">
74 - <span>品牌资料.pdf <b>X</b></span>  
75 - </div>  
76 - <div class="has-upload">  
77 - <span>品牌资料.pdf <b>X</b></span> 74 + <span></span>
78 </div> 75 </div>
79 </div> 76 </div>
80 </li> 77 </li>
@@ -92,6 +89,7 @@ @@ -92,6 +89,7 @@
92 </ul> 89 </ul>
93 <input type="hidden" value="<?php echo $this->view->type?>" name="type" /> 90 <input type="hidden" value="<?php echo $this->view->type?>" name="type" />
94 <!-- <span class="submit-w-btn">提交</span>--> 91 <!-- <span class="submit-w-btn">提交</span>-->
  92 + <input type="hidden" value="" name="files" id="file-url"/>
95 <input type="submit" value="提交" class="submit-w-btn"> 93 <input type="submit" value="提交" class="submit-w-btn">
96 </form> 94 </form>
97 </div> 95 </div>