123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- var entType = "企业";
- var relation = null;
- var serviceList = null;
- with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];
- //解析服务列表
- $(function(){
- //联系地址
- if(address){
- loadJS("/js/jquery.cxselect.js",function(){
- $('#city_china').cxSelect({
- selects: ['province', 'city', 'area'],
- required:0
- });
- $.cxSelect.setVal(province,city,area);
- var pt=province?($("#provincesel option[value="+province+"]").text()):"";
- var ct=city?($("#citysel option[value="+city+"]").text()):"";
- var at=area?($("#areasel option[value="+area+"]").text()):"";
- //设置地图上显示的位置
- $("#location").attr("value",as1);
- $("#cityname").attr("value",pt.trim()+ct.trim()+at.trim());
- //获取地图的经纬度
- loadJS("http://api.map.baidu.com/getscript?v=2&ak=AFd8b176f363f23e6a23d516f4cfb742&services=&t=20150522093217",function(){
- loadJS("/js/geocoder.js",function(){
- doOptions();
- });
- });
- $("#city_china").text(pt+ct+at+as1);
- });
- }
- //隐藏地图
- $("#fade").click(closeMap);
- //分享
- $(".entinfo-share").click(function(){
- $(".bdsharebuttonbox").show();
- });
- //切换
- $(".ent-tab>li").click(function(){
- $(".ent-tab>li").removeClass("ent-active");
- $(this).addClass("ent-active");
- $(".ent-tab-content>div").addClass("hide");
- $(".ent-tab-content>div:eq("+$(this).index()+")").removeClass("hide");
- if($(this).index() == 1){
- b_afterLogin();
- }else if($(this).index() == 5 && serviceList == null){
- //加载服务列表
- serviceList = new ServiceList();
- }
- });
- new ServiceList();
- });
- //显示地图
- function showMap(){
- document.getElementById('mapshowdiv').style.display = 'block';
- document.getElementById('closeshowmap').style.display = 'block';
- document.getElementById('fade').style.display = 'block';
- $("html,body").addClass("overflow-hidden");
- }
- //关闭地图
- function closeMap(){
- document.getElementById('mapshowdiv').style.display = 'none';
- document.getElementById('closeshowmap').style.display = 'none';
- document.getElementById('fade').style.display = 'none';
- $("html,body").removeClass("overflow-hidden");
- }
- function b_afterLogin(flag){
- if($(".ent-tab>li:eq(1)").hasClass("ent-active") && relation == null){
- initRelation();
- }
- }
- //加载关系网
- function initRelation(){
- if(isLogined){
- $.post("/member/getRelation",{regNo:regNo,entName:entName},function(r){
- if(r.flag == false){
- $("#entrelation-nologin").addClass("hide");
- $("#entrelation-limit,#entrelation-noauthe").removeClass("hide");
- $("#entrelation-infovis").hide();
- }else if(r.flag == true && (r == null || typeof(r) == "undefined" || typeof(r.links) == "undefined" || r.links.length == 0 || typeof(r.nodes) == "undefined" || r.nodes.length <= 1)){
- relation = "";
- $("#entrelation-infovis").hide();
- $("#entrelation-findnull").removeClass("hide");
- }else{
- loadJS("/js/d3.v3.min.js",function(){
- loadJS("/js/geometry.js",function(){
- loadJS("/js/relation.js",function(){
- $("#entrelation-limit").addClass("hide");
- $(".entrelation").height(500);
- relation = new Relation(legcerNo,regNo,r.relation);
- relation.init();
- });
- });
- });
- }
- });
- }else{
- $("#entrelation-limit,#entrelation-nologin").removeClass("hide");
- }
- }
- //服务列表
- function ServiceList(){
- loadJS("/js/paging.js",function(){
- paging = new Paging("serviceListPaging","/front/findServiceByEntId",{entId:entId},6,function(r){
- if(r.length == 0){
- $("#serviceList").next(".ent-findnull").removeClass("hide");
- }
- var html = '';
- for(var i=0;i<r.length;i++){
- html += '<tr>'
- +'<td rowspan="2" width="120"><img src="'+(r[i].s_images==""?"null":r[i].s_images)+'" onerror="this.src=\'/images/services/default.png\'"></td>'
- +'<td class="b-com-name"><a href="/market/detail/'+r[i]._id+'.html">'+r[i].s_name+'</a></td>'
- +'<td width="100" class="text-center">报价:<font class="text-primary">'+(r[i].s_pricemy==0?"面议":r[i].f_price+"元")+'</font></td>'
- +'<td width="100" class="text-center">评价:<font class="text-primary">'+r[i].i_comments+'</font></td>'
- +'<tr>'
- +'<td>'+r[i].s_introduction+'</td>'
- +'</tr>';
- }
- $("#serviceList").html(html);
- });
- });
- }
|