filesbox/web/dist/design/designstatic/newJS/company/basicInfo.js

2 lines
5.1 KiB
JavaScript
Raw Normal View History

2024-07-26 06:10:54 +00:00
(function(){var s={init:function(){var i=this;i.getEnterpriseSchool()},getEnterpriseSchool:function(){var i=this;$.ajax({type:"get",dataType:"json",url:"/api/school/getEnterpriseSchool",success:function(t){var e=t.data;i.renderLogo(e.logo);var a=e.detail?JSON.parse(e.detail):{};i.renderBasicInfo(e,a);for(var n=e.enterprisePhoto?JSON.parse(e.enterprisePhoto):{},c=0,o=n.length;c<o;c++){var r=n[c];i.renderPohoto(r)}i.binddDragPhoto()}})},renderLogo:function(i){i&&($(".bch-l-logo").show(),$(".bch-l-logo img").attr("src",(window.cdnPath||"")+i),$(".bch-l-logo img").addClass("smallimg"))},renderBasicInfo:function(i,t){var e=$(".bch-company-name");e.find(".fullName").text(i.name),t.abbreviation||e.find(".divider").hide(),e.find(".alias").text(t.abbreviation);var a=$(".bch-company-property");a.find(".industry").text("\u6240\u5C5E\u884C\u4E1A\uFF1A"+t.industry),t.industry||a.find(".industry").hide(),a.find(".staffSize").text("\u4EBA\u5458\u89C4\u6A21\uFF1A"+t.scale),t.scale||a.find(".staffSize").hide(),a.find(".turnover").text("\u5E74\u8425\u4E1A\u989D\uFF1A"+t.annualTurnover),t.annualTurnover||a.find(".turnover").hide(),a.find(".Slogan").text("Slogan\uFF1A"+t.slogan),t.slogan||a.find(".Slogan").hide();for(var n=t.schoolTags?t.schoolTags.split(","):[],c=$(".bch-company-label"),o="",r=0,h=n.length;r<h;r++)o+='<span class="label-tag">'+n[r]+"</span>";c.html(o);var l=$(".bch-company-contact");l.find(".contactPerson").text("\u8054\u7CFB\u4EBA\uFF1A"+t.realName),t.realName||l.find(".contactPerson").hide(),l.find(".email").text("\u90AE\u7BB1\uFF1A"+t.email),t.email||l.find(".email").hide(),l.find(".contactNumber").text("\u8054\u7CFB\u7535\u8BDD\uFF1A"+t.contactNumber),t.contactNumber||l.find(".contactNumber").hide(),l.find(".address").text("\u8054\u7CFB\u5730\u5740\uFF1A"+t.address),t.address||l.find(".address").hide();var d=$(".bc-introduce");d.find(".introduction").html(t.introduction),d.find(".introduceDetail").html(i.enterpriseIntroduce),$(".bc-progress").show();var m=$(".bc-progress-box");m.html(i.businessIntroduce)},renderPohoto:function(i){var t=i.photoType,e=i.list;switch(t){case"1":$(".bc-Photo").show();for(var a="",n=0,c=e.length;n<c;n++){var o=e[n];a+='<div class="li"><img src="'+(window.cdnPath||"")+o.sourcePath+'" class="smallimg"/></div>'}$(".photo-content-box").css("width",240*e.length),$(".photo-content-box").html(a);break;case"2":$(".bc-honor").show();for(var r="",n=0,c=e.length;n<c;n++){var o=e[n];r+='<div class="li"><img src="'+(window.cdnPath||"")+o.sourcePath+'" class="smallimg"/></div>'}$(".bc-honor-box").html(r);break;case"3":$(".bc-partner").show();for(var h='<div class="ul">',n=0,c=e.length;n<c;n++){n!=0&&n%14==0&&(h+='</div><div class="ul">');var o=e[n];h+='<div class="li"><img src="'+(window.cdnPath||"")+o.sourcePath+'"/><span>'+o.title+"</span></div>"}h+="</div>",$(".bc-partner-box").html(h);break}},binddDragPhoto:function(){var i=$(".photo-content-box"),t=i.width(),e=t-$(".bc-photo-box").width();t<$(".bc-photo-box").width()||$(document).width()<750?$(".rightShadow").hide():i.on("mousedown",function(n){n.preventDefault();var c=parseInt(i.attr("translateX")||0),o=n.pageX;$(document).on("mousemove",function(r){$(r.target).hasClass("smallimg")&&$(r.target).addClass("closeSmallimg");var h=c+r.pageX-o;h>0&&(h=0),h<-e&&(h=-e),i.attr("translateX",h),i.css({transform:"translateX("+h+"px)"})}),$(document).on("mouseup",function(r){var h=r.pageX;console.log("mouseup"),$(document).unbind("mousemove mouseup")})});var a=new zoom("mask","bigimg","smallimg");a.init()}};s.init()})();function zoom(s,i,t){this.bigimg=i,this.smallimg=t,this.mask=s}zoom.prototype={init:function(){var s=this;this.smallimgClick(),this.maskClick(),this.mouseWheel()},smallimgClick:function(){var s=this;$("."+s.smallimg).click(function(){if($(this).hasClass("closeSmallimg"))return $(this).removeClass("closeSmallimg"),!1;$("."+s.bigimg).css($(document).width()<750?{width:"80vw",height:"auto"}:{height:"80vh",width:"auto"}),$("."+s.mask).fadeIn(),$("."+s.bigimg).attr("src",$(this).attr("src")).fadeIn()})},maskClick:function(){var s=this;$("."+s.mask).c