var oper_info=null; var posturl=""; function checkFun(v, k) { if ($(v).val() == "") { alert(k + " is incorrect"); $(v).focus(); return false; } if(v.indexOf("name='email'")!=-1){ if(!ismail($(v).val())){ alert("The "+k+" Incorrect format"); $(v).focus(); return false; } } if(v.indexOf("name='password'")!=-1){ if(($(v).val()).length<6){ alert(k+" At least 6 people"); $(v).focus(); return false; } } if (v.indexOf("name='phone'") != -1) { $(v).val(jQuery.trim($(v).val())); if (!istel($(v).val())) { alert("The "+k+" Incorrect format"); $(v).focus(); return false; } } return $(v).val(); } //鑾峰彇url鍚庣殑鍙傛暟鍊 function getUrlParam(key) { var href = window.location.href; var url = href.split("?"); var search = window.location.search; if (url.length <= 1 || !search) { return ""; } var params = url[1].split("&"); for (var i = 0; i < params.length; i++) { var param = params[i].split("="); if (key == param[0]) { return param[1]; } } return ""; } function istel(tel) {return (new RegExp(/^(13[0-9]|14[5-9]|15[012356789]|166|17[0-8]|18[0-9]|19[8-9])[0-9]{8}$/).test(tel));}//鎵嬫満鍙锋牸寮忔牎楠 function ismail(mail){return(new RegExp(/^(?:[a-zA-Z0-9]+[_\-\+\.]?)*[a-zA-Z0-9]+@(?:([a-zA-Z0-9]+[_\-]?)*[a-zA-Z0-9]+\.)+([a-zA-Z]{2,})+$/).test(mail));}//閭鏍煎紡鏍¢獙 var classify1='',classify2='',classifyAll1='',classifyAll2='',offsets=0,limits=20,search="";//濡傛灉鑷畾涔夛紝璇峰皬浜庢爮鐩缃殑limit鏁伴噺 var list_url = "/system/web/dataList"; if(typeof(class_limit) != "undefined"){limits = parseInt(class_limit);} var total=0;//鎬绘潯鏁 //------------------get鏁版嵁------------------------- function formatTime(time, format) {//鏃堕棿鏍煎紡鍖栧伐鍏 var t = new Date(time); var tf = function (i) { return (i < 10 ? '0' : '') + i }; return format.replace(/yyyy|MM|dd|HH|mm|ss/g, function (a) { switch (a) { case 'yyyy': return tf(t.getFullYear()); break; case 'MM': return tf(t.getMonth() + 1); break; case 'mm': return tf(t.getMinutes()); break; case 'dd': return tf(t.getDate()); break; case 'HH': return tf(t.getHours()); break; case 'ss': return tf(t.getSeconds()); break; } }) } function listPaginator(totalPages,currentPage){ $('.page-list ul').jqPaginator({ totalPages: totalPages//璁剧疆鍒嗛〉鐨勬€婚〉鏁 ,visiblePages: 8//璁剧疆鏈€澶氭樉绀虹殑椤电爜鏁帮紙渚嬪鏈?00涔燂紝褰撳墠绗?椤碉紝鍒欐樉绀? - 7椤碉級 ,currentPage: currentPage//璁剧疆褰撳墠鐨勯〉鐮 ,first: ''//璁剧疆鈥滈椤碘€濈殑Html缁撴瀯 ,prev: '
  • '//璁剧疆鈥滀笂涓€椤碘€濈殑Html缁撴瀯 ,next: '
  • '//璁剧疆鈥滀笅涓€椤碘€濈殑Html缁撴瀯 ,last: '
  • 鍏包span class="crt-page">{{page}}椤袋/li>'//璁剧疆鈥滄湯椤碘€濈殑Html缁撴瀯 ,page: '
  • {{page}}
  • ' //璁剧疆椤电爜鐨凥tml缁撴瀯,鍏朵腑鍙互浣跨敤{{page}}浠h〃褰撳墠椤碉紝{{totalPages}}浠h〃鎬婚〉鏁帮紝{{totalCounts}}浠h〃鎬绘潯鐩暟锛堜緥濡傦細涓婇潰鐨勨€滄瀬绠€椋庢牸鈥濈殑Demo锛屽氨鏄娇鐢ㄤ簡{{鍗犱綅绗}锛屽苟灏唙isiblePages璁句负1瀹炵幇鐨勩€傦級 //娉ㄦ剰锛歠irst銆乸rev銆乶ext銆乴ast銆俻age鍙璁剧疆涓€涓紝鍏朵綑鏈缃殑浼氬彉涓虹┖銆 ,onPageChange: function(n,t) { if(t=="change"){ offsets = (n-1)*limits; listInfo(); } } }); } function listInfo(){ var dataJson = {nav_id:nav_id,classify1:classify1,classify2:classify2,offset:offsets,limit:limits,search:search}; $.ajax({ type: "POST", async: false, url: posturl+list_url, data:JSON.stringify(dataJson), processData : false, // 浣挎暟鎹笉鍋氬鐞 contentType : "application/json", // 涓嶈璁剧疆Content-Type璇锋眰澶 dataType: 'json', error : function(res){ alert("Under development, please stay tuned!"); }, success:function(data){ total = data.total; var pages = Math.ceil(total/limits);//鎬婚〉鏁 var current = (offsets)/limits+1;//褰撳墠椤 dataRowsHtml(data); if(!total){ $('.page-list ul').hide(); }else{ $('.page-list ul').show(); listPaginator(pages,current); } } }); } function dataRowsHtml(data){ $(itemBom).html(""); if(nav_id==22){//妗堜緥 $.each(data.rows,function(index,item){ var common_img = eval("(" + item.common_img + ")"); var case_html='
  • '+ '
    '+ ' '+ '
    '+ '
    '+ ' '+item.common_title+''+ '
    '+ ''+ '

    '+item.common_descrition+'

    '+ '
    浜嗚В鏇村
    '+ '
    '+ '
  • '; $(itemBom).append(case_html); }); $(".case-top span").html(total); }else if(nav_id==5 || nav_id==6 || nav_id==7){//鑽h獕 $.each(data.rows,function(index,item){ var common_img = eval("(" + item.common_img + ")"); var h4 = item.common_nav_classify1==6?"鐗屽尵":""; var case_html = '
  • '+ '
    '+ ' '+ '
    '+ '
    '+ '

    '+h4+'

    '+ '

    '+item.common_title+'

    '+ '

    '+item.common_descrition+'

    '+ ' '+formatTime(item.common_createtime,'yyyy骞碝M鏈坉d鏃?)+''+ '
    '+ '
  • '; $(itemBom).append(case_html); }); }else if(nav_id==29){//瀹㈡埛鍚嶅綍 $.each(data.rows,function(index,item){ var common_img = eval("(" + item.common_img + ")"); var case_html = '
  • '+ '
    '+ ' '+ '
    '+ '
    '+ ' '+item.common_title+''+ '
    '+ '
  • '; $(itemBom).append(case_html); }); }else if(nav_id==27){//绾夸笅娲诲姩 $.each(data.rows,function(index,item){ var common_img = eval("(" + item.common_img + ")"); var h3 = item.common_nav_classify1==46?"娲诲姩鎺ㄨ崘":"娲诲姩鎶ラ亾"; var case_html = '
  • '+ ' '+ '
    '+ ' '+ '
    '+ '
    '+ '

    '+h3+'

    '+ '

    '+item.common_title+'

    '+ '
    '+ '
    '+ ' '+ '
    '+ ' 闃呰鏇村'+ '
    '+ ' '+item.common_standby+''+ '
    '+ '
    '+ '
  • '; $(itemBom).append(case_html); }); }else if(nav_id==26){//鏂伴椈璧勮 $.each(data.rows,function(index,item){ var common_img = eval("(" + item.common_img + ")"); var case_html = '
  • '+ ' '+ '
    '+ ' '+ '
    '+ '
    '+ '

    '+ '

    '+item.common_title+'

    '+ '

    '+item.common_descrition+'

    '+ ' '+formatTime(item.common_createtime,'yyyy骞碝M鏈坉d鏃?)+''+ '

    闃呰鏇村

    '+ '
    '+ '
    '+ '
  • '; $(itemBom).append(case_html); }); }else if(nav_id==28){//鐑偣涓撻 $.each(data.rows,function(index,item){ var common_img = eval("(" + item.common_img + ")"); var standby=item.common_standby=='鍙??"right":""; var case_html = ''; $(itemBom).append(case_html); }); }else if(nav_id==31){//涓嬭浇涓績 $.each(data.rows1,function(index,item){ var common_img = eval("(" + item.common_img + ")"); var img_url = common_img["common_img"].length>1?common_img["common_img"][1]["img_url"]:common_img["common_img"][0]["img_url"]; var case_html = ''; if(item.content.field_file_6){ href = item.content.field_file_6; }else{ href = 'javascript:;'; } case_html='
  • '+ ' '+ '
    '+ '

    '+item.common_title+'

    '+ '

    '+item.common_descrition+'

    '+ '
    '+ ' '+ ' 鐐瑰嚮涓嬭浇'+ '
    '+ '
    '+ '
  • '; $(itemBom).append(case_html); }); $.each(data.rows,function(index,item){ var common_img = eval("(" + item.common_img + ")"); var case_html = ''; if(item.content.field_file_6){ href = item.content.field_file_6; }else{ href = 'javascript:;'; } case_html='
  • '+ '
    '+ ' '+ ' '+item.content.field_text_5+''+ '
    '+ '
    '+ '

    '+ ' '+item.common_title+''+ '

    '+ ' '+ ' '+ ' 鐐瑰嚮涓嬭浇'+ ' '+ '
    '+ '
  • '; $(itemBom).append(case_html); }); }else{//鎼滅储 $.each(data.rows,function(index,item){ var common_descrition = item.common_descrition.replace(search,""+search+""); var common_title = item.common_title.replace(search,""+search+""); var case_html ='
  • '+ ' '+common_title+''+ '

    '+common_descrition+'

    '+ '
  • '; $(itemBom).append(case_html); }) $(".search-content h3").html("鍏辨悳绱↑span>鈥?+search+"鈥滭/span>"+total+"涓粨鏋?); } } //---------------------涓嬭浇涓績---------------------- function downloadPageClassify(){ $(".classify-list .column-list ul").html(""); $(".classify-list .column ul.clearfix").html(""); var classifyMap=classify["n_54"]["child"]["n_"+classify1]["child"]; if(undefined!=classifyMap){ var html2 = '
  • 鍏ㄩ儴

  • '; $.each(classifyMap,function(index,item){ //debugger; html2+='
  • '+item.nav_name+'

  • '; var html3 = ''; if(item.hasOwnProperty("child")){ $.each(item.child,function(index,item3){ console.log(item3); html3+='
  • '+item3.nav_name+'
  • '; }) } $(".classify-list .column-list ul:first").append('
  • '); }) $(".classify-list .column ul.clearfix").append(html2); } } //---------------------淇敼淇℃伅---------------------- function editOper(){ var formDom=".member-info .edit"; if(oper_info){ $(formDom).find("[name='name']").val(oper_info["name"]); $(formDom).find("[name='gender']").val(oper_info["gender"]); $(formDom).find("[name='company']").val(oper_info["company"]); $(formDom).find("[name='position']").val(oper_info["position"]); $(formDom).find("[name='products_interest']").val(oper_info["productsInterest"]); $(formDom).find("[name='demand']").val(oper_info["demand"]); $(formDom).find('#email span').html(oper_info["email"]); $(formDom).find('#tel span').html(oper_info["phone"]); } } $(function() { //---------------------鎼滅储---------------------- $('.search input').bind('keypress', function (event) { if (event.keyCode == "13") { $(".input-search span").click(); } }) $(".input-search").on('click','span',function(){ var keywords = $('.search input').val(); window.location.href="/en/search.html?keywords="+keywords+"&typeid=22"; }) $('.search-content .input-container input').bind('keypress', function (event) { if (event.keyCode == "13") { $(".search-content .input-container img").click(); } }) $(".search-content .input-container").on('click','img',function(){ offsets = 0; var $this=$(this); search = $(".search-content .input-container input").val().trim(); if(search){ listInfo(); } }) //---------------------涓嬭浇涓績---------------------- $(".download-nav .classify").on('click','span',function(){ offsets = 0; var $this=$(this); classify1=$this.data("id"); downloadPageClassify(); listInfo(); }) $(".classify-list .column ul").on('click','li',function(){ offsets = 0; var $this=$(this); classify1=$this.data("id"); //downloadPageClassify(); listInfo(); }) $(".classify-list .column-list ul li ul").on('click','li',function(){ offsets = 0; var $this=$(this); classify1=$this.data("id"); //downloadPageClassify(); listInfo(); }) $('.adow').click(function () { var fileId = $(this).data("fileid"); var dataJson = {header_id:fileId}; if(fileId){ $.ajax({ type: "POST", async: false, url: posturl+'/system/web/download/log', data:JSON.stringify(dataJson), processData : false, // 浣挎暟鎹笉鍋氬鐞 contentType : "application/json", // 涓嶈璁剧疆Content-Type璇锋眰澶 dataType: 'json', /*error : function(res){ alert("Under development, please stay tuned!"); },*/ success:function(data){ var url = data.content_info.field_file_6; if(url){ window.open(posturl+url); }else{ alert("鏆傛棤鏂囦欢锛屼笅杞藉け璐?); } } }); } }); //------------------鐑偣涓撻------------------------- $(".hotClassify").on('click','li',function(){ offsets = 0; var $this=$(this); classify1=$this.data("id"); listInfo(); }) //------------------绾夸笅娲诲姩------------------------- $(".active-wrapper ul.clearfix").on('click','li',function(){ offsets = 0; var $this=$(this); classify1=$this.data("id"); listInfo(); }) //------------------鑽h獕鍙g------------------------- $(".honor-list ul.clearfix").on('click','li',function(){ offsets = 0; var $this=$(this); nav_id=$this.data("id"); listInfo(); }) //------------------妗堜緥------------------------- $(".search-company").on('click','button',function(){ // search = $(".search-company input").val(); // keywords = $(".search-company input").val(); // listInfo(); }) $(".caseClassify").on('click','li span',function(){ /* offsets = 0; var $this=$(this), _id=$this.parent().data("id"), _parentid=$this.parent().parent().parent().data("id"); function classifyAll(bom,not_id){ $(bom+" li").each(function(index,element){ var fenge=""; if(index!=0){fenge=","} if(not_id==34){ classifyAll1+=fenge+$(this).data("id"); } if(not_id==35){ classifyAll2+=fenge+$(this).data("id"); } }) } if(!classifyAll1){ classifyAll('.industry',34); } if(!classifyAll2){ classifyAll('.product',35); } if(_parentid==34){//琛屼笟 if(_id==34){ classify1=classifyAll1; }else{ classify1=_id; } } if(_parentid==35){//浜у搧 if(_id==35){ classify2=classifyAll2; }else{ classify2=_id; } } if(!classify1){ classify1=classifyAll1; } if(!classify2){ classify2=classifyAll2; } listInfo(); */ }) //------------------浜у搧------------------------- $(".outline-box").on('click','li',function(){ $(".outline-box li").removeClass("active"); $(this).addClass("active"); $(".banner-list .show-ban").removeClass("active"); $(".banner-list .show-ban").eq($(".outline-box li").index(this)).addClass("active"); $(".prodiv").removeClass("active"); $(".prodiv").eq($(".outline-box li").index(this)).addClass("active"); // var $this=$(this), // _id=$this.data("id"); // var map = classify["n_1"]["child"]["n_4"]["child"]["n_"+_id]["child"]; // $(".masonry-product").html(""); // if(!map){return false;} // $.each(map,function(index,item){ // var nav_imgs = eval("(" + item.nav_imgs + ")"); // var infohtml = ""; // $.each(item.info,function(index,iteminfo){ // if(iteminfo.common_outside_url){ // infourl=iteminfo.common_outside_url; // }else{ // infourl='/'+iteminfo.common_url+'/'+iteminfo.id+'.html'; // } // infohtml+='
  • '+iteminfo.common_title+'

  • '; // }) // var html='
    '+ // '
    '+ // ''+ // '
    '+ // '

    '+item.nav_name+'

    '+ // '
    '+ // ''+ // '
    '+ // '
    '+ // '
    '+ // ''+ // '
    '; // $(".masonry-product").append(html); // }) // waterFall(); }) //---------------------------------------------- /*鎴戣鏂规*/ $(".case-appointment").on('click','.btn',function(){ var formDom=".case-appointment"; var $this=$(this); if($this.data("type")==2){alert("Please refresh and retry");return false;} var field_text_1=checkFun(formDom+" [name='username']","Full Name");if(!field_text_1){ return false;} var field_text_3=checkFun(formDom+" [name='phone']","Contact Number");if(!field_text_3){ return false;} var field_text_4=checkFun(formDom+" [name='email']","E-mail");if(!field_text_4){ return false;} var field_text_5=checkFun(formDom+" [name='job']","Position Affiliation");if(!field_text_5){ return false;} var field_text_6=checkFun(formDom+" [name='company']","Corporate Name");if(!field_text_6){ return false;} var field_text_7=checkFun(formDom+" [name='product']","Interested Products");if(!field_text_7){ return false;} var field_text_9=checkFun(formDom+" [name='booking']","Requirement Description");if(!field_text_9){ return false;} var field_text_10=checkFun(formDom+" [name='case-choice']","Solution");if(!field_text_10){ return false;} var formData = new FormData(); formData.append("forms_type", 2); formData.append("field_text_1", field_text_1); //Full Name formData.append("field_text_3", field_text_3); //鎵嬫満鍙 formData.append("field_text_4", field_text_4); // formData.append("field_text_5", field_text_5); // formData.append("field_text_6", field_text_6); // formData.append("field_text_7", field_text_7); // formData.append("field_text_9", field_text_9); // formData.append("field_text_10", field_text_10); // $this.data("type",2); $.ajax({ type: "POST", async: false, url: posturl+'/system/forms/add', data: formData, processData : false, // 浣挎暟鎹笉鍋氬鐞 contentType : false, // 涓嶈璁剧疆Content-Type璇锋眰澶 dataType: 'json', error : function(res){ $this.data("type",1); alert("Under development, please stay tuned!"); }, success: function (res) { $this.data("type",1); if (res != '') { if (res.code != 100) { console.log(res.msg); alert(res.msg); }else{ alert("Submitted successfully"); $(formDom+" input:not([type=button],[type=reset])").val(""); $(formDom+" textarea").val(""); $(formDom+" .close").click(); } } else { console.log("Under development, please stay tuned!"); alert("Submission failed, please try again"); } } }); }) /*鎴戣鏂规鍐呭*/ $(".appointment").on('click','#submit-btn',function(){ var formDom=".appointment"; var $this=$(this); if($this.data("type")==2){alert("Please refresh and retry");return false;} var field_text_1=checkFun(formDom+" [name='username']","Full Name");if(!field_text_1){ return false;} var field_text_2=checkFun(formDom+" [name='gender']","Gender");if(!field_text_2){ return false;} var field_text_3=checkFun(formDom+" [name='phone']","Contact Number");if(!field_text_3){ return false;} var field_text_4=checkFun(formDom+" [name='email']","E-mail");if(!field_text_4){ return false;} var field_text_5=checkFun(formDom+" [name='job']","Position Affiliation");if(!field_text_5){ return false;} var field_text_6=checkFun(formDom+" [name='company']","Corporate Name");if(!field_text_6){ return false;} var field_text_7=checkFun(formDom+" [name='product']","Interested Products");if(!field_text_7){ return false;} var field_text_9=checkFun(formDom+" [name='booking']","Requirement Description");if(!field_text_9){ return false;} var field_text_10=$(formDom+" h2").text();if(!field_text_10){ alert("The theme cannot be empty"); return false;} var formData = new FormData(); formData.append("forms_type", 2); formData.append("field_text_1", field_text_1); //Full Name formData.append("field_text_2", field_text_2); formData.append("field_text_3", field_text_3); //鎵嬫満鍙 formData.append("field_text_4", field_text_4); // formData.append("field_text_5", field_text_5); // formData.append("field_text_6", field_text_6); // formData.append("field_text_7", field_text_7); // formData.append("field_text_9", field_text_9); // formData.append("field_text_10", field_text_10); // $this.data("type",2); $.ajax({ type: "POST", async: false, url: posturl+'/system/forms/add', data: formData, processData : false, // 浣挎暟鎹笉鍋氬鐞 contentType : false, // 涓嶈璁剧疆Content-Type璇锋眰澶 dataType: 'json', error : function(res){ $this.data("type",1); alert("Under development, please stay tuned!"); }, success: function (res) { $this.data("type",1); if (res != '') { if (res.code != 100) { console.log(res.msg); alert(res.msg); }else{ alert("Submitted successfully"); $(formDom+" input:not([type=button],[type=reset])").val(""); $(formDom+" textarea").val(""); $(formDom+" .close").click(); } } else { console.log("Under development, please stay tuned!"); alert("Submission failed, please try again"); } } }); }) /*棰勭害婕旂ず.*/ $(".book-appointment").on('click','.btn',function(){ var formDom=".book-appointment"; var $this=$(this); if($this.data("type")==2){alert("Please refresh and retry");return false;} var field_text_1=checkFun(formDom+" [name='username']","Full Name");if(!field_text_1){ return false;} var field_text_3=checkFun(formDom+" [name='phone']","Contact Number");if(!field_text_3){ return false;} var field_text_4=checkFun(formDom+" [name='email']","E-mail");if(!field_text_4){ return false;} var field_text_5=checkFun(formDom+" [name='job']","Position Affiliation");if(!field_text_5){ return false;} var field_text_6=checkFun(formDom+" [name='company']","Corporate Name");if(!field_text_6){ return false;} var field_text_7=checkFun(formDom+" [name='product']","Interested Products");if(!field_text_7){ return false;} var field_text_9=checkFun(formDom+" [name='booking']","Requirement Description");if(!field_text_9){ return false;} var field_text_10=$(formDom+" .title").text();if(!field_text_10){ alert("The theme cannot be empty"); return false;} var formData = new FormData(); formData.append("forms_type", 1); formData.append("field_text_1", field_text_1); //Full Name formData.append("field_text_3", field_text_3); //鎵嬫満鍙 formData.append("field_text_4", field_text_4); // formData.append("field_text_5", field_text_5); // formData.append("field_text_6", field_text_6); // formData.append("field_text_7", field_text_7); // formData.append("field_text_9", field_text_9); // formData.append("field_text_10", field_text_10); // $this.data("type",2); $.ajax({ type: "POST", async: false, url: posturl+'/system/forms/add', data: formData, processData : false, // 浣挎暟鎹笉鍋氬鐞 contentType : false, // 涓嶈璁剧疆Content-Type璇锋眰澶 dataType: 'json', error : function(res){ $this.data("type",1); alert("Under development, please stay tuned!"); }, success: function (res) { $this.data("type",1); if (res != '') { if (res.code != 100) { console.log(res.msg); alert(res.msg); }else{ alert("Submitted successfully"); $(formDom+" input:not([type=button],[type=reset])").val(""); $(formDom+" textarea").val(""); $(formDom+" .close").click(); } } else { console.log("Under development, please stay tuned!"); alert("Submission failed, please try again"); } } }); }) /*鎶ュ悕璧勬枡*/ $(".sign-up").on('click','.button',function(){ var formDom=".sign-up"; var $this=$(this); if($this.data("type")==2){alert("Please refresh and retry");return false;} var field_text_1=checkFun(formDom+" [name='username']","Full Name");if(!field_text_1){ return false;} var field_text_3=checkFun(formDom+" [name='phone']","Contact Number");if(!field_text_3){ return false;} var field_text_4=checkFun(formDom+" [name='email']","E-mail");if(!field_text_4){ return false;} var field_text_5=checkFun(formDom+" [name='job']","Position Affiliation");if(!field_text_5){ return false;} var field_text_6=checkFun(formDom+" [name='company']","Corporate Name");if(!field_text_6){ return false;} var field_text_7=checkFun(formDom+" [name='product']","Interested Products");if(!field_text_7){ return false;} var field_text_9=checkFun(formDom+" [name='require']","Job requirements");if(!field_text_9){ return false;} var field_text_10=$(formDom+" .right h4").text();if(!field_text_10){ alert("The registration theme cannot be empty"); return false;} var formData = new FormData(); formData.append("forms_type", 3); formData.append("field_text_1", field_text_1); //Full Name formData.append("field_text_3", field_text_3); //鎵嬫満鍙 formData.append("field_text_4", field_text_4); // formData.append("field_text_5", field_text_5); // formData.append("field_text_6", field_text_6); // formData.append("field_text_7", field_text_7); // formData.append("field_text_9", field_text_9); // formData.append("field_text_10", field_text_10); // $this.data("type",2); $.ajax({ type: "POST", async: false, url: posturl+'/system/forms/add', data: formData, processData : false, // 浣挎暟鎹笉鍋氬鐞 contentType : false, // 涓嶈璁剧疆Content-Type璇锋眰澶 dataType: 'json', error : function(res){ $this.data("type",1); alert("Under development, please stay tuned!"); }, success: function (res) { $this.data("type",1); if (res != '') { if (res.code != 100) { console.log(res.msg); alert(res.msg); }else{ alert("Submitted successfully"); $(formDom+" input:not([type=button],[type=reset])").val(""); $(formDom+" textarea").val(""); $(formDom+" .close").click(); } } else { console.log("Under development, please stay tuned!"); alert("Submission failed, please try again"); } } }); }) /*璧涙剰涓浗*/ $(".china-time").on('click','#submit-btn',function(){ var formDom=".sign-up"; var $this=$(this); if($this.data("type")==2){alert("Please refresh and retry");return false;} var field_text_1=checkFun(formDom+" [name='username']","Full Name");if(!field_text_1){ return false;} var field_text_2=checkFun(formDom+" [name='company']","Corporate Name");if(!field_text_2){ return false;} var field_text_3=checkFun(formDom+" [name='phone']","Phone Number");if(!field_text_3){ return false;} var field_text_4=checkFun(formDom+" [name='phone_s']","Contact Number");if(!field_text_4){ return false;} var field_text_5=checkFun(formDom+" [name='fax']","Fax Number");if(!field_text_5){ return false;} var field_text_6=checkFun(formDom+" [name='email']","E-mail");if(!field_text_6){ return false;} var field_text_7=checkFun(formDom+" [name='theme']","Consultation Topic");if(!field_text_7){ return false;} var field_text_9=checkFun(formDom+" [name='require']","Requirement Content");if(!field_text_9){ return false;} var field_text_10=$(formDom+" .right h4").text();if(!field_text_10){ alert("Consultation Topic"); return false;} var formData = new FormData(); formData.append("forms_type", 4); formData.append("field_text_1", field_text_1); //Full Name formData.append("field_text_2", field_text_2); formData.append("field_text_3", field_text_3); //鎵嬫満鍙 formData.append("field_text_4", field_text_4); // formData.append("field_text_5", field_text_5); // formData.append("field_text_6", field_text_6); // formData.append("field_text_7", field_text_7); // formData.append("field_text_9", field_text_9); // formData.append("field_text_10", field_text_10); // $this.data("type",2); $.ajax({ type: "POST", async: false, url: posturl+'/system/forms/add', data: formData, processData : false, // 浣挎暟鎹笉鍋氬鐞 contentType : false, // 涓嶈璁剧疆Content-Type璇锋眰澶 dataType: 'json', error : function(res){ $this.data("type",1); alert("Under development, please stay tuned!"); }, success: function (res) { $this.data("type",1); if (res != '') { if (res.code != 100) { console.log(res.msg); alert(res.msg); }else{ alert("Submitted successfully"); $(formDom+" input:not([type=button],[type=reset])").val(""); $(formDom+" textarea").val(""); $(formDom+" .close").click(); } } else { console.log("Under development, please stay tuned!"); alert("Submission failed, please try again"); } } }); }) /*棰勭害婕旂ず.鐑偣涓撻*/ $(".hot-form").on('click','#submit-btn',function(){ var formDom=".hot-form"; var $this=$(this); if($this.data("type")==2){alert("Please refresh and retry");return false;} var field_text_1=checkFun(formDom+" [name='username']","Full Name");if(!field_text_1){ return false;} var field_text_2=checkFun(formDom+" [name='gender']","Gender");if(!field_text_2){ return false;} var field_text_3=checkFun(formDom+" [name='phone']","Contact Number");if(!field_text_3){ return false;} var field_text_4=checkFun(formDom+" [name='email']","E-mail");if(!field_text_4){ return false;} var field_text_5=checkFun(formDom+" [name='job']","Position");if(!field_text_5){ return false;} var field_text_6=checkFun(formDom+" [name='company']","Corporate Name");if(!field_text_6){ return false;} var field_text_10=$(formDom+" h3").text();if(!field_text_10){ alert("The theme cannot be empty"); return false;} var formData = new FormData(); formData.append("forms_type", 1); formData.append("field_text_1", field_text_1); //Full Name formData.append("field_text_2", field_text_2); formData.append("field_text_3", field_text_3); //鎵嬫満鍙 formData.append("field_text_4", field_text_4); // formData.append("field_text_5", field_text_5); // formData.append("field_text_6", field_text_6); // formData.append("field_text_10", field_text_10); // $this.data("type",2); $.ajax({ type: "POST", async: false, url: posturl+'/system/forms/add', data: formData, processData : false, // 浣挎暟鎹笉鍋氬鐞 contentType : false, // 涓嶈璁剧疆Content-Type璇锋眰澶 dataType: 'json', error : function(res){ $this.data("type",1); alert("Under development, please stay tuned!"); }, success: function (res) { $this.data("type",1); if (res != '') { if (res.code != 100) { console.log(res.msg); alert(res.msg); }else{ alert("Submitted successfully"); $(formDom+" input:not([type=button],[type=reset])").val(""); $(formDom+" textarea").val(""); $(formDom+" .close").click(); } } else { console.log("Under development, please stay tuned!"); alert("Submission failed, please try again"); } } }); }) /*棰勭害鎶ュ悕.棰勭害婕旂ず.绾夸笅娲诲姩*/ $(".con-show").on('click','#submit-btn',function(){ var formDom=".con-show"; var $this=$(this); if($this.data("type")==2){alert("Please refresh and retry");return false;} var field_text_1=checkFun(formDom+" [name='username']","Full Name");if(!field_text_1){ return false;} var field_text_2=checkFun(formDom+" [name='gender']","Gender");if(!field_text_2){ return false;} var field_text_3=checkFun(formDom+" [name='phone']","Phone Number");if(!field_text_3){ return false;} var field_text_4=checkFun(formDom+" [name='email']","E-mail");if(!field_text_4){ return false;} var field_text_5=checkFun(formDom+" [name='job']","Position");if(!field_text_5){ return false;} var field_text_6=checkFun(formDom+" [name='company']","Corporate Name");if(!field_text_6){ return false;} var field_text_10=$(formDom+" h3").text();if(!field_text_10){ alert("The registration theme cannot be empty"); return false;} var formData = new FormData(); if($(formDom+" [name='classify']").val()==46){ formData.append("forms_type", 3); }else{ formData.append("forms_type", 1); } formData.append("field_text_1", field_text_1); //Full Name formData.append("field_text_2", field_text_2); formData.append("field_text_3", field_text_3); //鎵嬫満鍙 formData.append("field_text_4", field_text_4); // formData.append("field_text_5", field_text_5); // formData.append("field_text_6", field_text_6); // formData.append("field_text_10", field_text_10); // $this.data("type",2); $.ajax({ type: "POST", async: false, url: posturl+'/system/forms/add', data: formData, processData : false, // 浣挎暟鎹笉鍋氬鐞 contentType : false, // 涓嶈璁剧疆Content-Type璇锋眰澶 dataType: 'json', error : function(res){ $this.data("type",1); alert("Under development, please stay tuned!"); }, success: function (res) { $this.data("type",1); if (res != '') { if (res.code != 100) { console.log(res.msg); alert(res.msg); }else{ alert("Submitted successfully"); $(formDom+" input:not([type=button],[type=reset])").val(""); $(formDom+" textarea").val(""); $(formDom+" .close").click(); } } else { console.log("Under development, please stay tuned!"); alert("Submission failed, please try again"); } } }); }) //---------------------------------------------- //鎵惧洖瀵嗙爜 $(".forget-password").on('click','.button',function(){ var formDom=".forget-password"; var phone=checkFun(formDom+" [name='phone']","鎵嬫満鍙?);if(!phone){ return false;} var pcode=checkFun(formDom+" [name='pcode']","楠岃瘉鐮?);if(!pcode){ return false;} var password=checkFun(formDom+" [name='password']","瀵嗙爜");if(!password){ return false;} var passwords=checkFun(formDom+" [name='passwords']","纭璁剧疆瀵嗙爜");if(!passwords){ return false;} if (password != passwords) { alert("涓ゆ瀵嗙爜涓嶇浉鍚?); $(formDom+" [name='passwords']").focus(); return false; } $.ajax({ type: "POST", async: false, url: posturl+'/system/oper/forget', data: JSON.stringify({mode:"forget",phone:phone,pcode:pcode,password:password}), processData : false, // 浣挎暟鎹笉鍋氬鐞 contentType : "application/json", // 涓嶈璁剧疆Content-Type璇锋眰澶 dataType: 'json', error : function(res){ alert("Under development, please stay tuned!"); }, success: function(res){ if (res != '') { if (res.code != 100) { console.log(res.msg); alert(res.msg); }else{ alert("淇敼鎴愬姛"); $('.sign-up-header .close').click(); } } else { console.log("Under development, please stay tuned!"); alert("Submission failed, please try again"); } } }); }) //楠岃瘉鐮佺櫥闄 $(".shouji").on('click','.button',function(){ var url = $(this).data("url"); var formDom=".shouji"; var account=checkFun(formDom+" [name='tel']","鎵嬫満鍙?);if(!account){ return false;} var passcode=checkFun(formDom+" [name='pcode']","楠岃瘉鐮?);if(!passcode){ return false;} $.ajax({ type: "POST", async: false, url: posturl+'/system/oper/login', data: JSON.stringify({mode:"mobile",account:account,passcode:passcode}), processData : false, // 浣挎暟鎹笉鍋氬鐞 contentType : "application/json", // 涓嶈璁剧疆Content-Type璇锋眰澶 dataType: 'json', error : function(res){ alert("Under development, please stay tuned!"); }, success: function(res){ if (res != '') { if (res.code != 100) { console.log(res.msg); alert(res.msg); }else{ alert("鐧婚檰鎴愬姛"); if(url){ window.location.href=url; }else{ window.location.href="/member/download/";//璺宠浆閾炬帴 } } } else { console.log("Under development, please stay tuned!"); alert("Submission failed, please try again"); } } }); }) //璐﹀彿鐧婚檰 $(".zhanghao").on('click','.button',function(){ var url = $(this).data("url"); var formDom=".zhanghao"; var account=checkFun(formDom+" [name='tel']","璐﹀彿");if(!account){ return false;} var passcode=checkFun(formDom+" [name='password']","瀵嗙爜");if(!passcode){ return false;} $.ajax({ type: "POST", async: false, url: posturl+'/system/oper/login', data: JSON.stringify({mode:"account",account:account,passcode:passcode}), processData : false, // 浣挎暟鎹笉鍋氬鐞 contentType : "application/json", // 涓嶈璁剧疆Content-Type璇锋眰澶 dataType: 'json', error : function(res){ alert("Under development, please stay tuned!"); }, success: function(res){ if (res != '') { if (res.code != 100) { console.log(res.msg); alert(res.msg); }else{ alert("鐧婚檰鎴愬姛"); if(url){ window.location.href=url; }else{ window.location.href="/member/download/";//璺宠浆閾炬帴 } } } else { console.log("Under development, please stay tuned!"); alert("Submission failed, please try again"); } } }); }) //鎻愪氦娉ㄥ唽 $(".register-header").on('click','.button',function(){ var formDom=".register-header"; var $this=$(this); if($this.data("type")==2){alert("Please refresh and retry");return false;} var name=checkFun(formDom+" [name='name']","Full Name");if(!name){ return false;} var gender=checkFun(formDom+" [name='gender']","Gender");if(!gender){ return false;} var company=checkFun(formDom+" [name='company']","Corporate Name");if(!company){ return false;} var position=checkFun(formDom+" [name='position']","Position淇℃伅");if(!position){ return false;} var email=checkFun(formDom+" [name='email']","E-mail");if(!email){ return false;} var products_interest=$(formDom+" [name='products_interest']").val(); var demand=$(formDom+" [name='demand']").val(); var password=checkFun(formDom+" [name='password']","瀵嗙爜");if(!password){ return false;} var passwords=checkFun(formDom+" [name='passwords']","纭瀵嗙爜");if(!passwords){ return false;} console.log(2); if (password != passwords) { alert("涓ゆ瀵嗙爜涓嶇浉鍚?); $(formDom+" [name='passwords']").focus(); return false; } var phone=checkFun(formDom+" [name='phone']","鎵嬫満鍙?);if(!phone){ return false;} var pcode=checkFun(formDom+" [name='pcode']","楠岃瘉鐮?);if(!pcode){ return false;} if(!$(formDom+" [name='agreed']").is(':checked')){alert("鎮ㄦ湭鍚屾剰銆婃敞鍐屽崗璁拰闅愮鏀跨瓥銆?);return false;} $this.data("type",2); console.log(3); $.ajax({ type: "POST", async: false, url: posturl+'/system/oper/regist', data: JSON.stringify({ name:name,gender:gender,company:company,position:position,email:email, products_interest:products_interest,demand:demand,password:password,phone:phone,pcode:pcode }), processData : false, // 浣挎暟鎹笉鍋氬鐞 contentType : "application/json", // 涓嶈璁剧疆Content-Type璇锋眰澶 dataType: 'json', error : function(res){ $this.data("type",1); alert("Under development, please stay tuned!"); }, success: function (res) { $this.data("type",1); if (res != '') { if (res.code != 100) { console.log(res.msg); alert(res.msg); }else{ alert("娉ㄥ唽鎴愬姛,璇风櫥褰?); $(formDom+" input:not([type=button],[type=reset])").val(""); $(formDom+" textarea").val(""); $('.login-account').click(); } } else { console.log("Under development, please stay tuned!"); alert("Submission failed, please try again"); } } }); }) //淇敼淇℃伅 $(".member-info .edit").on('click','.button',function(){ var formDom=".member-info .edit "; var $this=$(this); if($this.data("type")==2){alert("Please refresh and retry");return false;} var name=checkFun(formDom+"[name='name']","Full Name");if(!name){ return false;} var gender=checkFun(formDom+"[name='gender']","Gender");if(!gender){ return false;} var company=checkFun(formDom+"[name='company']","Corporate Name");if(!company){ return false;} var position=checkFun(formDom+"[name='position']","Position淇℃伅");if(!position){ return false;} var products_interest=$(formDom+"[name='products_interest']").val(); var demand=$(formDom+"[name='demand']").val(); $.ajax({ type: "POST", async: false, url: posturl+'/system/oper/update', data: JSON.stringify({ name:name,gender:gender,company:company,position:position,products_interest:products_interest,demand:demand }), processData : false, // 浣挎暟鎹笉鍋氬鐞 contentType : "application/json", // 涓嶈璁剧疆Content-Type璇锋眰澶 dataType: 'json', error : function(res){ alert("Under development, please stay tuned!"); }, success: function(res){ if (res != '') { if (res.code != 100) { console.log(res.msg); alert(res.msg); }else{ alert("淇敼鎴愬姛"); window.location.reload(); } } else { console.log("Under development, please stay tuned!"); alert("Submission failed, please try again"); } } }); }) //淇敼瀵嗙爜 $(".member-info .revise").on('click','.button',function(){ var formDom=".member-info .revise "; var $this=$(this); if($this.data("type")==2){alert("Please refresh and retry");return false;} var passwordOld=checkFun(formDom+"[name='passwordOld']","鏃у瘑鐮?);if(!passwordOld){ return false;} var passwordNew=checkFun(formDom+"[name='passwordNew']","鏂板瘑鐮?);if(!passwordNew){ return false;} var passwordNews=$(formDom+"[name='passwordNews']").val(); if(passwordNew!=passwordNews){ alert("涓ゆ鏂板瘑鐮佽緭鍏ヤ笉涓€鑷?);return false; } $.ajax({ type: "POST", async: false, url: posturl+'/system/oper/updatepwd', data: JSON.stringify({ passwordOld:passwordOld,passwordNew:passwordNew }), processData : false, // 浣挎暟鎹笉鍋氬鐞 contentType : "application/json", // 涓嶈璁剧疆Content-Type璇锋眰澶 dataType: 'json', error : function(res){ alert("Under development, please stay tuned!"); }, success: function(res){ if (res != '') { if (res.code != 100) { console.log(res.msg); alert(res.msg); }else{ alert("淇敼鎴愬姛"); window.location.reload(); } } else { console.log("Under development, please stay tuned!"); alert("Submission failed, please try again"); } } }); }) //------------------------楠岃瘉鐮?--------------------- $(".forget-password .phone").on('click','a',function(){ var formDom=".forget-password"; var phone=checkFun(formDom+" [name='phone']","鎵嬫満鍙?);if(!phone){ return false;} getCode($(this),phone,"forget"); }); $(".shouji .phone").on('click','a',function(){ var formDom=".shouji"; var phone=checkFun(formDom+" [name='tel']","鎵嬫満鍙?);if(!phone){ return false;} getCode($(this),phone,"login"); }); $(".register-header .phone").on('click','a',function(){ var formDom=".register-header"; var phone=checkFun(formDom+" [name='phone']","鎵嬫満鍙?);if(!phone){ return false;} getCode($(this),phone,"register"); }); var countdown = {"register":60,"login":60,"forget":60}; function settime(obj,type) { //鍙戦€侀獙璇佺爜鍊掕鏃 if (countdown[type] == 0) { obj.data("id","1");obj.text("鑾峰彇楠岃瘉鐮?);countdown[type] = 60;return; } else { obj.data("id","2");obj.text(countdown[type]);countdown[type]=countdown[type]-1; } setTimeout(function() {settime(obj,type)},1000); } function getCode(obj,phone,type) {//鑾峰彇鎵嬫満楠岃瘉鐮 if(obj.data("id")=="2"){return false;} settime(obj,type); $.ajax({ type: "POST", async: false, url: posturl+'/system/oper/msgCode', data: JSON.stringify({"account":phone,"attrs":type}), processData : false, // 浣挎暟鎹笉鍋氬鐞 contentType : "application/json", // 涓嶈璁剧疆Content-Type璇锋眰澶 dataType: 'json', error : function(res){ countdown[type]=0; alert("Under development, please stay tuned!"); }, success: function(res){ if (res != '') { if (res.code != 100) { console.log(res.msg); alert(res.msg); countdown[type]=0; }else{ alert("鐭俊宸插彂閫?璇锋煡鏀?); } } else { console.log("Under development, please stay tuned!"); alert("Submission failed, please try again"); countdown[type]=0; } } }); } //---------------------------------------------- function operInfo(){ $.ajax({ type: "POST", async: false, url: posturl+'/system/oper/info', processData : false, // 浣挎暟鎹笉鍋氬鐞 contentType : "application/json", dataType: 'json', success: function(res){ if (res != '') { $(".login").unbind(); $(".login a").attr("href","/member/download/"); $(".sidebar li:first a").attr("href","/member/download/"); oper_info=res; $(".login").find("span:last").html(oper_info["phone"].substring(0,3)+"..."); } } }); } //operInfo(); var pathname=window.location.pathname; if(pathname=="/member/download/" || pathname=="/member/download" || pathname=="/member/info/" || pathname=="/member/info"){ if(!oper_info){ alert("璇风櫥褰曞悗鍐嶈瘯銆?); window.location.href="/"; } } $(".paper").on("click","a",function () { var url = $(this).data("url"); if(oper_info){ window.open(url); }else{ $('.login').click(); } }) $(".sidebar").on("click",".sidebarlogin",function () { if(!oper_info){ $('.login').click(); } }) })