123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482 |
- 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){
- initRelation();
- }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 && (typeof(r) == "undefined" || r == null || r == "")){
- $("#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("serviceList","/front/findServiceByEntId",{entId:entId},6,function(r){
- var html = '';
- for(var i=0;i<r.length;i++){
-
- }
- $("#serviceList").html(html);
- });
- });
- }
- /*
- function getCityN(code){
- if(code){
- var n=code.substring(0,2)
- for(var i=0;i<citySim.length;i++){
- if (citySim[i].k==n) {
- return citySim[i].n;
- }
- }
- }
- return "";
- }
- function reloadData(obj,name){
- name=name||obj.attr("name")
- var val=(obj.attr("value")||obj.val());
-
- if (val==0) val=""
- if(name=="city"&&!val){
- var pids=obj.attr("id")
- if(pids=="c_area"){
- var v=obj.prev("select").val()
- if(!v){
- v=obj.prev("select").prev("select").val()
- }
- if(v){
- val=v
- }
-
- }else if(pids=="c_city"){
- var v=obj.prev("select").val()
- if(v){
- val=v
- }
- }
-
- }else if(name=="c_author"){
- if(!obj.prop("checked")){
- val="";
- }
- }
- //调整value 值
- if(val==10){
- val = "10-100"
- }else if(val ==100){
- val = "100-1000"
- }else if(val ==1000){
- val = "1000-10000"
- }
- //搜索表单提交
- $("#searchForm input[name="+name+"]").val(val);
- document.forms['searchForm'].submit();
- }
- function setLocation(entsel,serviceloc){
- //所在地处理
- var le = entsel.length
- var sel1 = "";
- var sel2 = "";
- var sel3 = "";
- if (le == 2) {
- sel1 = entsel.substring(0,2);
- sel2 = 0;
- sel3 = 0;
- }else if (le == 4){
- sel1 = entsel.substring(0,2);
- sel2 = entsel.substring(0,4);
- sel3 = 0;
- }else{
- sel1 = entsel.substring(0,2);
- sel2 = entsel.substring(0,4);
- sel3 = entsel.substring(0,6);
- }
- $.cxSelect.setVal(sel1,sel2,sel3);
- if(serviceloc){
- //添加编辑服务中的省
- $("#servicecity_china .province option").each(function(){
- if(sel1 == $(this).val()){
- $(this).attr("selected","selected");
- }
- });
- //添加编辑服务中的市
- $("#servicecity_china .city option").each(function(){
- if(sel2 == $(this).val()){
- $(this).attr("selected","selected");
- }
- });
- //添加编辑服务中的县
- $("#servicecity_china .area option").each(function(){
- if(sel3 == $(this).val()){
- $(this).attr("selected","selected");
- }
- });
- }
- }
- cityMouse="";
- $(function(){
-
- ////推荐企业
- loadImg(1);
- //行业类别 注册资本 加载
- makeFl();
- //所在地信息加载
- if($chiancity){
- $('#city_china').cxSelect({
- selects: ['province', 'city', 'area'],
- required:0,
- somep:true,
- someps:[41,45]
- });
- setLocation(entsel)
- }
-
-
- //处理点击重新加载
- $("div[id^=c_] li,li[id^=c_],input[id^=c_]").click(function(){
-
- if(this.id=="c_words"){
- reloadData($("#header-searchInputs"))
- }else{
- reloadData($(this))
- }
- })
-
- $("select[id^=c_]").click(function(){
- cityMouse=this.id
- }).change(function(){
- if(this.id==cityMouse){
- reloadData($(this),"city")
- }
- })
- //处理选择样式
- $("div[id^=c_] li").click(function(){
- $("li",$(this).closest("div")).removeClass("text-primary");
- $(this).addClass("text-primary");
- })
- //搜索关键字
- var words=""
-
- if(btempwords){
- words=btempwords
- $("#header-searchInput").val(words);
- }
-
-
- })
- function makeFl(){
- //行业类别
- $(["c_hfl"]).each(function(i,ad){
- var str="<ul>";
- var tmp=eval(ad)
- for(var i=0;i<tmp.length;i++){
- var val = chf1;
- if (val !=""){
- if (val == tmp[i][1]){
- str+="<li name='"+ad+"' value='"+tmp[i][1]+"' class='text-primary'>"+tmp[i][0]+"</li>"
- var j ="J"
- if (val > j || val == "D" || val == "E" || val == "F" || val == "G" ){
- $("#c_hfl").next().find("small").text("收起<")
- $("#c_hfl").removeClass("less")
-
- }
- }else{
- str+="<li name='"+ad+"' value='"+tmp[i][1]+"'>"+tmp[i][0]+"</li>"
- }
- }else{
- str+="<li name='"+ad+"' value='"+tmp[i][1]+"' "+(i==0?"class='text-primary'":"")+">"+tmp[i][0]+"</li>"
- }
-
- }
- str+="</ul>"
- $("#"+ad).html(str)
- })
- //注册资本
- $(["c_zb"]).each(function(i,ad){
- var str="<ul>";
- var tmp=eval(ad)
- for(var i=0;i<tmp.length;i++){
- var val = czb;
- if (val !=""){
- if (val == tmp[i][1]){
- str+="<li name='"+ad+"' value='"+tmp[i][1]+"' class='text-primary'>"+tmp[i][0]+"</li>"
- }else{
- str+="<li name='"+ad+"' value='"+tmp[i][1]+"'>"+tmp[i][0]+"</li>"
- }
- }else{
- str+="<li name='"+ad+"' value='"+tmp[i][1]+"' "+(i==0?"class='text-primary'":"")+">"+tmp[i][0]+"</li>"
- }
-
- }
- str+="</ul>"
- $("#"+ad).html(str)
- })
- }
- function less(obj){
- pred=$(obj).prev()
- obj=$(obj).find("small")
- var text=obj.text()
- if(text=="更多>"){
- obj.text("收起<")
- pred.removeClass("less")
- }else{
- obj.text("更多>")
- pred.addClass("less")
- }
-
- }
- //推荐企业
- function loadImg(n){
- var str=""
- for(var i=0;i<n;i++){
- str+="<img src='/images/right_ad.png'>"
- }
- $("#tjqy").html(str)
- }
- function GetDiffName(i) {
- ret=["法定代表人"]
- //ret=["法定代表人","住所","成立日期"]
- switch (i) {
- case "9600":
- {
- ret[0] = "经营者"
- //ret[1] = "经营场所"
- //ret[2] = "注册日期"
- break;
- }
- case "4500":
- case "6800":
- case "6810":
- case "6820":
- case "7100":
- case "7110":
- case "7120":
- case "7130":
- case "7190":
- case "9200":
- case "6840":
- case "2100":
- case "2110":
- case "2120":
- case "2121":
- case "2122":
- case "2123":
- case "2130":
- case "2140":
- case "2150":
- case "2151":
- case "2152":
- case "2190":
- case "2200":
- case "2210":
- case "2211":
- case "2212":
- case "2213":
- case "2219":
- case "2220":
- case "2221":
- case "2222":
- case "2223":
- case "2229":
- case "4000":
- case "4300":
- case "4310":
- case "4320":
- case "4330":
- case "4340":
- case "4550":
- case "4551":
- case "4552":
- case "4553":
- case "4560":
- case "5800":
- case "5810":
- case "5820":{
- ret[0] = "负责人"
- //ret[1] = "营业场所"
- //ret[2] = "成立日期"
- break;
- }
- }
- return ret
- }
- //公式信息是否显示
- if(!$gs){
- $("#ags").parent().hide();
- $("#gs").hide();
- }
- */
- var perPage=5,currentPage=1
- //点击服务标题展示服务信息
- function clickservicename(id,isshow){
- if(isshow.indexOf("3")>-1){
- window.location.href="/market/detail/"+id+".html"
- }else{
- window.location.href="/market/showservice/"+id+".html"
- }
- }
- //显示二维码图片
- function viewBarCode(bcpath){
- if(bcpath){
- $('#myModal').modal({
- keyboard: true
- })
- $("#viewImgs").html("<img style='width:300px;height:300px;' src='"+bcpath+"'/>")
- }
- }
- function analyList(rowHtml, rowData) {
- var t="";
- if(rowData.i_status==1){
- t=template_content.replace("<a class='text-primary' value='${_id}' data-id='${s_isEdit}' onclick='removeservice(this)'>下架</a>","");
- }else{
- t=template_content.replace("已下架","");
- }
- return t.replace(/\$\{(.*?)\}/g,
- function(a, b, c) {
- var res = rowData[b]||"";
- //去掉后台服务列表中的图片
- var data = res.replace(/<img.*>.*<\/img>/ig,""); //过滤如<img></img>形式的图片元素
- res = data.replace(/<img.*\/>/ig, ""); //过滤如<img />形式的元素
- if (!res&&b=="s_images"){
- res="/images/services/default.png"
- }else{
- res = res.replace(/\n/g,"");
- }
- return res;
- });
- }
- //加载更多
- function loadMore(){
- $.post('/searchEntSer/'+entId ,{currentPage:currentPage+1,perPage:perPage},function(data){
- if(data){
- var res=data["data"]
- if(!res || res === undefined || res.length == 0) {
- $("#loadMore").hide();
- return;
- }else if(data.totalRows<=(perPage*data.currentPage)){
- $("#loadMore").hide();
- }else{
- $("#loadMore").show();
- }
- currentPage=data["currentPage"];
- var str="";
-
- for(var i=0;i<res.length;i++){
- var temp=res[i];
- str+=analyList("",temp)
- }
- $("#service_list table tbody").append(str);
- }
- })
- }
|