guidance.js 54.5 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382
/**
 * Created by chenbiao on 2017/7/4.
 */
//下拉框
var clear_flag = false;
var guideLevel=['零','一','二','三','四','五','六','七'];

;(function ($) {
    var ser_object2;
    var ser_object2_img;
    var radius_v;
    jQuery.fn.extend({
        "M_select": function (options) {
            var ojc_arr = this;
            var ojc;
            // select下拉框
            for (i = 0; i < ojc_arr.length; i++) {
                var ser_object = $(ojc_arr[i]);
                $(ser_object).parent().addClass("select-con");
                $(ser_object).parent().css("z-index", "1");
                $(ser_object).wrap("<section class='sel-hide'></section>");
                $(ser_object).parent().parent().append('<section class="sel-box"><div class="sel-title-box"><span class="sel-title"></span><span class="sel-sign"></span></div><section class="sel-float-box"></section></section>');
                var w = $(ser_object).parent().parent().width();
                $(ser_object).parent().parent().find(".sel-float-box").css("width", w);
                var ojc = $(ser_object).children();
                for (a = 0; a < ojc.length; a++) {
                    var t = $(ojc[a]).text();
                    var v = $(ojc[a]).attr("value");
                    $(ser_object).parent().parent().find(".sel-float-box").append('<div class="sel-float-div sel-Hcolor" value=' + v + '>' + t + '</div>');
                }
                ;

                for (a = 0; a < ojc.length; a++) {

                    var sel_disabled = $(ojc[a]).attr("disabled");

                    if (sel_disabled == "disabled" || sel_disabled == "true") {
                        var div_ojc = $(ser_object).parent().parent().find('.sel-float-box').children();
                        $(div_ojc[a]).removeClass("sel-float-div");
                        $(div_ojc[a]).addClass("sel-float-div-disabled");

                    }
                }
                ;

                var sel_textFirst = $(ser_object).parent().parent().find(".sel-float-box").children().eq(0).text();


                // 默认参数
                var defaultOption = {

                    ico: 1,
                    Img: "",
                    Img2: "",
                    Title: "",
                    inputName: "sel_v",
                    selected: "0",
                    radius: "0",
                    Succee: function () {
                    }

                };
                // 合并自定义参数和默认参数,出现相同属性名时自定义参数会覆盖默认参数
                options = $.extend({}, defaultOption, options);

                // 判断Test是否为空
                if (options.Title) {
                    sel_textFirst = options.Title;

                }
                ;
                $(ser_object).parent().parent().find(".sel-title").text(sel_textFirst);

                // 判断使用哪种ico样式
                var Img, Img2;
                if (!(options.Img) && !(options.Img2)) {

                    if (options.ico == 1) {
                        Img = "./js/M_select/down1.png";
                        Img2 = "./js/M_select/up1.png";
                    }
                    if (options.ico == 2) {
                        Img = "./js/M_select/down2.png";
                        Img2 = "./js/M_select/up2.png";
                    }
                    if (options.ico == 3) {
                        Img = "./js/M_select/down3.png";
                        Img2 = "./js/M_select/up3.png";
                    }
                    if (options.ico == 4) {
                        Img = "./js/M_select/down4.png";
                        Img2 = "./js/M_select/up4.png";
                    }
                    if (options.ico == 5) {
                        Img = "./js/M_select/down5.png";
                        Img2 = "./js/M_select/up5.png";
                    }
                } else if (!(options.Img) && (options.Img2 != null)) {
                    Img = options.Img2;
                    Img2 = options.Img2;
                } else if (!(options.Img2) && (options.Img != null)) {
                    Img = options.Img;
                    Img2 = options.Img;
                } else if ((options.Img != null) && (options.Img2 != null)) {
                    Img = options.Img;
                    Img2 = options.Img2;
                }

                // 可传参css
//              $(ser_object).parent().parent().find(".sel-sign").css("background","url("+Img+")");
//              $(ser_object).parent().parent().find(".sel-sign").css("background-size","100% 100%");
                $(ser_object).parent().parent().find(".sel-box").append('<input type="hidden" name="' + options.inputName + '" value="' + options.selected + '" class="inputHidden">');
                //$(ser_object).parent().parent().find(".sel-box").css("border-radius",options.radius);
                //$(ser_object).parent().parent().find(".sel-float-box").css("border-radius","0 0 "+options.radius +" "+options.radius+" ");

                // 获取图片的高
                var ico_h = $(ser_object).parent().parent().find(".sel-title-box").height();
                // 设置图片的宽高
//              $(ser_object).parent().parent().find(".sel-sign").css({'width':+ico_h+'px','height':+ico_h+'px'});
                $(ser_object).parent().parent().find(".sel-title-box").css("padding-right", "10px");

                // 获取有多少个选项
                var selLength = $(ser_object).parent().parent().find(".sel-float-box").children().length;
                var selListHeight = $(ser_object).parent().parent().find(".sel-float-box").children().height();
                // 获取选项的高度

                var selHeight = selListHeight * 10;
                // 隐藏下拉框
                $(".sel-float-box").hide();
                if (selLength > 10) {
                    $(ser_object).parent().parent().find(".sel-float-box").css("height", selHeight);
                    $(ser_object).parent().parent().find(".sel-float-box").css("overflow-y", "scroll");
                }

                // 根据selected 的值选中(即input value)
                var input_val = $(ser_object).parent().parent().find(".inputHidden").attr("value");
                var div_objoct = $(ser_object).parent().parent().find(".sel-float-div");
                for (a = 0; a < div_objoct.length; a++) {

                    var div_val = $(div_objoct[a]).attr("value");
                    if (div_val == input_val) {
                        var div_text = $(div_objoct[a]).text();
                        $(ser_object).parent().parent().find(".sel-title").text(div_text);
                    }
                    ;
                }
                ;


                // 点击事件
                $(ser_object).parent().parent().find(".sel-title-box").on("click", function () {
                    // 切换图片
//                  $(ser_object2).parent().parent().find(".sel-sign").css("background","url("+ser_object2_img+")");
//                  $(ser_object2).parent().parent().find(".sel-sign").css("background-size","100% 100%");
                    //$(ser_object2).parent().css("border-radius",radius_v);
                    $('.sel-box').removeClass("on");
                    ser_object2 = this;
                    ser_object2_img = Img;
                    // 圆角值
                    radius_v = options.radius;

                    var floatAttr = $(this).parent().find(".sel-float-box").css("display");
                    if (floatAttr == "block") {
                        $(".sel-float-box").hide();
                        $(this).parent().find(".sel-float-box").hide();

                        $(this).parent().removeClass("on");
                        $(this).parent().find(".sel-float-box").removeClass("on");

                        //$(this).parent().css("border-radius",options.radius);
                        // 切换图片
//                      $(this).parent().parent().find(".sel-sign").css("background","url("+Img+")");
//                      $(this).parent().parent().find(".sel-sign").css("background-size","100% 100%");
                    } else if (floatAttr == "none") {
                        // 切换图片
//                      $(this).parent().parent().find(".sel-sign").css("background","url("+Img2+")");
//                      $(this).parent().parent().find(".sel-sign").css("background-size","100% 100%");
                        $(".sel-float-box").hide();
                        $(this).parent().find(".sel-float-box").show();

                        $(this).parent().addClass("on");
                        $(this).parent().find(".sel-float-box").addClass("on");

                        //$(this).parent().css("border-radius",options.radius+" "+options.radius+"  0 0");
                    }

                });

                // 选项点击事件
                $(ser_object).parent().parent().find(".sel-float-div").on("click", function () {
                    var sel_text = $(this).text();
                    var sel_value = $(this).attr("value");
                    // 切换图片
//                  $(this).parent().parent().find(".sel-sign").css("background","url("+Img+")");
//                  $(this).parent().parent().find(".sel-sign").css("background-size","100% 100%");

                    $(this).parent().hide();
                    $(this).parent().parent().find(".sel-title").text(sel_text);
                    //$(this).parent().parent().css("border-radius",options.radius);

                    $(this).parent().parent().find(".sel-title").attr("value", sel_value);
                    var selected_value = $(this).parent().parent().find(".sel-title").attr("value");
                    $(this).parent().parent().find(".inputHidden").attr("value", selected_value);
                    var v;
                    var ojc_option = $(this).parent().parent().parent().find("option");
                    for (a = 0; a < ojc_option.length; a++) {

                        v = $(ojc_option[a]).attr("value");

                        if (v == selected_value) {
                            $(ojc_option).attr("selected", false);
                            $(ojc_option[a]).attr("selected", true);

                        }
                    }
                    ;
                    // 判断函数是否为空
                    if (options.Succee != null) {
                        options.Succee(selected_value);
                    }


                });
            }// for循环语句结束

        },

    });
    // 点击其他位置下拉消失

    $(document).on('click', function (e) {
        var parent = $(e.target).parents('.select-con').length;
        if (!parent) {
            // // 切换图片
//          $(ser_object2).parent().parent().find(".sel-sign").css("background","url("+ser_object2_img+")");
//          $(ser_object2).parent().parent().find(".sel-sign").css("background-size","100% 100%");
            //$(ser_object2).parent().css("border-radius",radius_v);
            // console.log(ser_object2);
            $('.sel-float-box').hide();
            $('.sel-box').removeClass("on");
        }
        ;

    });

})(jQuery);
//分页
(function ($) {
    $.fn.extendPagination = function (options) {
        var defaults = {
            //pageId:'',
            totalCount: '',
            showPage: '3',
            limit: '5',
            callback: function () {
                return false;
            }
        };
        $.extend(defaults, options || {});
        if (defaults.totalCount == '') {
            //alert('鎬绘暟涓嶈兘涓虹┖!');
            $(this).empty();
            return false;
        } else if (Number(defaults.totalCount) <= 0) {
            //alert('鎬绘暟瑕佸ぇ浜�0!');
            $(this).empty();
            return false;
        }
        if (defaults.showPage == '') {
            defaults.showPage = '10';
        } else if (Number(defaults.showPage) <= 0) defaults.showPage = '10';
        if (defaults.limit == '') {
            defaults.limit = '5';
        } else if (Number(defaults.limit) <= 0) defaults.limit = '5';
        var totalCount = Number(defaults.totalCount), showPage = Number(defaults.showPage),
            limit = Number(defaults.limit), totalPage = Math.ceil(totalCount / limit);
        if (totalPage > 0) {
            var html = [];
            html.push(' <ul class="pagination">');
            html.push(' <li class="previous"><a href="#"><</a></li>');
            html.push('<li class="disabled hidden"><a href="#">...</a></li>');
            if (totalPage <= showPage) {
                for (var i = 1; i <= totalPage; i++) {
                    if (i == 1) html.push(' <li class="active"><a href="#">' + i + '</a></li>');
                    else html.push(' <li><a href="#">' + i + '</a></li>');
                }
            } else {
                for (var j = 1; j <= showPage; j++) {
                    if (j == 1) html.push(' <li class="active"><a href="#">' + j + '</a></li>');
                    else html.push(' <li><a href="#">' + j + '</a></li>');
                }
            }
            html.push('<li class="disabled hidden"><a href="#">...</a></li>');
            html.push('<li class="next"><a href="#">></a></li></ul>');
            $(this).html(html.join(''));
            if (totalPage > showPage) $(this).find('ul.pagination li.next').prev().removeClass('hidden');

            var pageObj = $(this).find('ul.pagination'), preObj = pageObj.find('li.previous'),
                currentObj = pageObj.find('li').not('.previous,.disabled,.next'),
                nextObj = pageObj.find('li.next');

            function loopPageElement(minPage, maxPage) {
                var tempObj = preObj.next();
                for (var i = minPage; i <= maxPage; i++) {
                    if (minPage == 1 && (preObj.next().attr('class').indexOf('hidden')) < 0)
                        preObj.next().addClass('hidden');
                    else if (minPage > 1 && (preObj.next().attr('class').indexOf('hidden')) > 0)
                        preObj.next().removeClass('hidden');
                    if (maxPage == totalPage && (nextObj.prev().attr('class').indexOf('hidden')) < 0)
                        nextObj.prev().addClass('hidden');
                    else if (maxPage < totalPage && (nextObj.prev().attr('class').indexOf('hidden')) > 0)
                        nextObj.prev().removeClass('hidden');
                    var obj = tempObj.next().find('a');
                    if (!isNaN(obj.html())) obj.html(i);
                    tempObj = tempObj.next();
                }
            }

            function callBack(curr) {
                defaults.callback(curr, defaults.limit, totalCount);
            }

            currentObj.click(function (event) {
                event.preventDefault();
                var currPage = Number($(this).find('a').html()), activeObj = pageObj.find('li[class="active"]'),
                    activePage = Number(activeObj.find('a').html());
                if (currPage == activePage) return false;
                if (totalPage > showPage && currPage > 1) {
                    var maxPage = currPage, minPage = 1;
                    if (($(this).prev().attr('class'))
                        && ($(this).prev().attr('class').indexOf('disabled')) >= 0) {
                        minPage = currPage - 1;
                        maxPage = minPage + showPage - 1;
                        loopPageElement(minPage, maxPage);
                    } else if (($(this).next().attr('class'))
                        && ($(this).next().attr('class').indexOf('disabled')) >= 0) {
                        if (totalPage - currPage >= 1) maxPage = currPage + 1;
                        else  maxPage = totalPage;
                        if (maxPage - showPage > 0) minPage = (maxPage - showPage) + 1;
                        loopPageElement(minPage, maxPage)
                    }
                }
                activeObj.removeClass('active');
                $.each(currentObj, function (index, thiz) {
                    if ($(thiz).find('a').html() == currPage) {
                        $(thiz).addClass('active');
                        callBack(currPage);
                    }
                });
            });
            preObj.click(function (event) {
                event.preventDefault();
                var activeObj = pageObj.find('li[class="active"]'), activePage = Number(activeObj.find('a').html());
                if (activePage <= 1) return false;
                if (totalPage > showPage) {
                    var maxPage = activePage, minPage = 1;
                    if ((activeObj.prev().prev().attr('class'))
                        && (activeObj.prev().prev().attr('class').indexOf('disabled')) >= 0) {
                        minPage = activePage - 1;
                        if (minPage > 1) minPage = minPage - 1;
                        maxPage = minPage + showPage - 1;
                        loopPageElement(minPage, maxPage);
                    }
                }
                $.each(currentObj, function (index, thiz) {
                    if ($(thiz).find('a').html() == (activePage - 1)) {
                        activeObj.removeClass('active');
                        $(thiz).addClass('active');
                        callBack(activePage - 1);
                    }
                });
            });
            nextObj.click(function (event) {
                event.preventDefault();
                var activeObj = pageObj.find('li[class="active"]'), activePage = Number(activeObj.find('a').html());
                if (activePage >= totalPage) return false;
                if (totalPage > showPage) {
                    var maxPage = activePage, minPage = 1;
                    if ((activeObj.next().next().attr('class'))
                        && (activeObj.next().next().attr('class').indexOf('disabled')) >= 0) {
                        maxPage = activePage + 2;
                        if (maxPage > totalPage) maxPage = totalPage;
                        minPage = maxPage - showPage + 1;
                        loopPageElement(minPage, maxPage);
                    }
                }
                $.each(currentObj, function (index, thiz) {
                    if ($(thiz).find('a').html() == (activePage + 1)) {
                        activeObj.removeClass('active');
                        $(thiz).addClass('active');
                        callBack(activePage + 1);
                    }
                });
            });
        }
    };
})(jQuery);
$(function () {
    var checktext;
    var checkText;
    var fun = {
        init: function () {
            areapartition:{
                // var data = ['1','2','3','4']

                // $('#select01').empty();
                // $.each(data,function(i,item){
                //     $('#select01').append('<option value="'+item+'">'+item+'</option>')
                // });
                var req= {
                sysCode:sysComm.sysCode,
                cityId:sysComm.cityId
            	};
		        var queryNextLowerLeverById= {
		            method: "post",
		            url: dataUrl.util.queryNextLowerLeverById(),
		            data: JSON.stringify(req),
		            contentType: 'application/json; charset=utf-8',
		            dataType:'json',
		            success: function(res){
		                if(res.code == '8888'){


		                    var result = res.data;
		                    // console.log(result);
		                    
		                   	$('#select01').empty();
							$.each(result,function(i,item){
								for(var key in item){
									// console.log(key)
									$('#select01').append('<option value="'+key+'">'+item[key]+'</option>')
								}
							});
		                   	$("#select01").M_select({

		                    "Title": "行政区划",
		                    "inputName": "selected1_value",
		                    // 默认选中的值(参数值写需要选中的select的value值)
		                    "selected": "923",
		                    Succee: function () {
		                        // console.log($("input[name='selected1_value']").attr('value'));
		                        // var checktext;
		                         checkText = $(".sel-title").eq(0).text();
		                        if (checkText == "全部") {
		                            checktext = "赤峰市"
		                        } else if (checkText == "其他") {
		                            // map.clearOverlays();
		                            checktext = "赤峰市";
		                        } else {
		                            checktext = "赤峰市" + checkText;
		                        }
		                        getBoundary(checktext);

		                        serfun();
		                    }
		                });

                            getBoundary("赤峰市红山区");
                            serfun();
		                }
		        	}
		        };
		        sysAjax(queryNextLowerLeverById);
                
                
                
                

                
            }
            ;

            leadlevel:{

                // $('#select02').empty();
                // $.each(data,function(i,item){
                //     $('#select02').append('<option value="'+item+'">'+item+'</option>')
                // });

                $("#select02").M_select({

                    "Title": "诱导级别",
                    "inputName": "selected2_value",
                    // 默认选中的值(参数值写需要选中的select的value值)
                    "selected": "",
                    Succee: function () {
                        // console.log($("input[name='selected2_value']").attr('value'));
                        $('.BMapLabel').empty();
                        serfun();
                    }
                });
                //alert($("input[name='selected_value']").attr('value'))
            }

        },
    }
    fun.init();
    //动态计算高度
    function list_wrap_height() {
        var topHeight = $("#list_wrap").offset().top;
        var clientHeight = $(window).height();
        var list_wrap_height = clientHeight - topHeight - 100 + 'px'
        $("#list_wrap").css('height', list_wrap_height);
        $('#list_wrap').perfectScrollbar();

    };
    window.onresize = function () {
        if ($('#list_con > li').length > 2) {

            list_wrap_height();
        }
    };
    //创建搜索html
    function createHtml(data) {

        //存在行政区划才会有诱导出现

        // $('#guide_con').show();

        $('#list_wrap').show();
        //计算 $('#list_wrap')自适应高度
        if ($('#list_con >li').length >= 1) {

            list_wrap_height();
        } else {
            $('#list_wrap').css('height', 'auto');
        }

        console.log('请求数据ajax');
    }
    //搜索
    //调接口后删除str
    //list_wrap_height();
    //调接口后删除end
    function serfun() {

        $('#callBackPager').show();
        $("#list_wrap").find('#list_con').empty();
        var ser_text = $.trim($('#ser_text').val());
        var area_text = $("input[name='selected1_value']").attr('value');
        var level_text = $("input[name='selected2_value']").attr('value');
        if (ser_text || area_text || level_text) {

            var areaCodes = [];
            var levels = [];
            var queryStr;
            if (ser_text) {
                queryStr = ser_text;
            }
            if (area_text) {
                areaCodes = area_text.split(',');
            }
            if (level_text) {
                levels = level_text.split(',');
            }
            var cond = {
                queryStr: queryStr,
                areaCodes: areaCodes,
                dataState:1,
                levels: levels
            };
            //console.log(JSON.stringify(cond))
            //如果选择了诱导级别,则诱导统计不在展示
            if (undefined == levels || null == levels || levels.length == 0 || levels[0] == '04') {
                levels=[];
                $("#guide_con").show();
            } else {
                $("#guide_con").hide();
            }

            if(!(undefined == ser_text || null == ser_text || ser_text == '' )){
                $("#guide_con").hide();
            }
            $.ajax({
                type: "post",
                url: dataUrl.util.statisticsGuideScreenLevelByAreaCodes(),
                data: JSON.stringify(cond),
                contentType: 'application/json; charset=utf-8',
                dataType: "json",
                success: function (data) {
                    // console.log("level and num" + JSON.stringify(data))
                    if (data.code == '8888') {
                        $(".guide_number").each(function (index, value) {
                            $(this).text(0);
                        });
                        $.each(data.data, function (index, domEle) {
                            $('#guide_number_' + domEle.level).text(domEle.num);
                        });
                    }
                    createHtml();
                }
            });

            var cond1 = {
                queryStr: queryStr,
                areaCodes: areaCodes,
                dataState:1,
                levels: levels,
                pageNum: 1,
                pageSize: 10
            };
            var cond2 = {
                queryStr: queryStr,
                areaCodes: areaCodes,
                dataState:1,
                levels: levels
            };
            $.ajax({
                type: "post",
                url: dataUrl.util.listGuideScreenByAreaCodes(),
                data: JSON.stringify(cond1),
                contentType: 'application/json; charset=utf-8',
                dataType: "json",
                success: function (data) {
                    // console.log(data)
                    if (data.code == '8888') {
                        $('#guide_total').text('');
                        if (null == data.data || null == data.data.pageTotals) {
                            if(clear_flag){
                                markerClusterer.clearMarkers();         //此步骤需要
                            }
                            $('#guide_total').text('');
                            //展示未查询到检索数据提示
                            $('#nodataInfo').show();
                            $('#callBackPager').css({'border-top': '0'})
                        } else {
                            //隐藏未查询到检索数据提示
                            $('#nodataInfo').hide();
                        	getGuideMapInfo(cond2);
                            $('#guide_total').append('诱导屏幕总计:<span class="guide_total_number" id="guide_total_number">'+data.data.pageTotals+'</span>');
                            $.each(data.data.dataList, function (index, domEle) {
                                //console.log(JSON.stringify(domEle))
                                var str = '<li>';
                                str += '<span class="coordinate_x" style="display: none">' + domEle.lonId + '</span>';
                                str += '<span class="coordinate_y" style="display: none">' + domEle.latId + '</span>';
                                str += '<span class="coordinate_guideNo" style="display: none">' + domEle.guideNo + '</span>';
                                str += '<ul class="fl list_item_ul">';
                                str += '<li>';
                                str += '<span class="space_span">' + (index + 1) + '.' + '</span>';
                                str += domEle.guideName == null ? "未知" : domEle.guideName;
                                str += '</li>';
                                str += '<li>';
                                str += '<span class="space_span"></span>停车场数:';
                                str += domEle.parkingNum == null ? "未知" : domEle.parkingNum
                                str += '</li>';
                                str += '<li>';
                                str += '<span class="space_span"></span>空闲车位总数:';
                                str += domEle.freeBerthNum == null ? "未知" : domEle.freeBerthNum
                                str += '</li>';
                                str += '<li>';
                                str += '<span class="space_span"></span>诱导级别:';
                                str += domEle.level == null ? "未知" : guideLevel[domEle.level]+'级'
                                str += '</li>';
                                str += '</ul>';
                                str += '<div class="fl list_item_img">';
                                str += '<img src="' + domEle.picturePath + '">';
                                str += '</div>';
                                str += '</li>';

                                //console.log(str)
                                $("#list_wrap").find('#list_con').append(str);
                            });
                            $('#callBackPager').css({'border-top': '1px solid #1c83f6'})
                        }

                    }
                    $('#callBackPager').extendPagination({
                        totalCount: data.data.pageTotals,
                        limit: 10,
                        callback: function (curr, limit, totalCount) {
                            //console.log("curr" + curr + " limit" + limit + "  totalCount" + totalCount)
                            var ser_text = $.trim($('#ser_text').val());
                            var area_text = $("input[name='selected1_value']").attr('value');
                            var level_text = $("input[name='selected2_value']").attr('value');

                            var areaCodes = [];
                            var levels = [];
                            var queryStr;
                            if (ser_text) {
                                queryStr = ser_text;
                            }
                            if (area_text) {
                                areaCodes = area_text.split(',');
                            }
                            if (level_text) {
                                levels = level_text.split(',');
                            }
                            //如果选择了诱导级别,则诱导统计不在展示
                            if (undefined == levels || null == levels || levels.length == 0 || levels[0] == '04') {
                                levels=[];
                                $("#guide_con").show();
                            } else {
                                $("#guide_con").hide();
                            }

                            if(!(undefined == ser_text || null == ser_text || ser_text == '' )){
                                $("#guide_con").hide();
                            }
                            var cond = {
                                queryStr: queryStr,
                                areaCodes: areaCodes,
                                dataState:1,
                                levels: levels,
                                "baseRequest": {
                                    "pageNum": curr,
                                    "pageSize": limit
                                }
                                /*pageNum: curr,
                                 pageSize: limit*/
                            };
                            //alert(JSON.stringify(cond));
                            $.ajax({
                                type: "post",
                                url: dataUrl.util.listGuideScreenByAreaCodes(),
                                data: JSON.stringify(cond),
                                contentType: 'application/json; charset=utf-8',
                                dataType: "json",
                                success: function (data) {
                                    //console.log(data)
                                    if (data.code == '8888') {
                                        /*$.each(data.data, function (index, domEle) {
                                         $('#guide_number_' + domEle.level).text(domEle.num);
                                         });*/
                                        /*guideData=[];
                                        guidanceMapInfo(data.data.dataList);*/
                                        $("#list_wrap").find('#list_con').html('');
                                        $.each(data.data.dataList, function (index, domEle) {
                                            //console.log(JSON.stringify(domEle))
                                            var str = '<li>';
                                            str += '<span class="coordinate_x" style="display: none">' + domEle.lonId + '</span>';
                                            str += '<span class="coordinate_y" style="display: none">' + domEle.latId + '</span>';
                                            str += '<span class="coordinate_guideNo" style="display: none">' + domEle.guideNo + '</span>';
                                            str += '<ul class="fl list_item_ul">';
                                            str += '<li>';
                                            str += '<span class="space_span">' + (index + 1) + '.' + '</span>';
                                            str += domEle.guideName == null ? "未知" : domEle.guideName;
                                            str += '</li>';
                                            str += '<li>';
                                            str += '<span class="space_span"></span>停车场数:';
                                            str += domEle.parkingNum == null ? "未知" : domEle.parkingNum
                                            str += '</li>';
                                            str += '<li>';
                                            str += '<span class="space_span"></span>空闲车位总数:';
                                            str += domEle.freeBerthNum == null ? "未知" : domEle.freeBerthNum
                                            str += '</li>';
                                            str += '<li>';
                                            str += '<span class="space_span"></span>诱导级别:';
                                            str += domEle.level == null ? "未知" : guideLevel[domEle.level]+'级'
                                            str += '</li>';
                                            str += '</ul>';
                                            str += '<div class="fl list_item_img">';
                                            str += '<img src="' + domEle.picturePath + '">';
                                            str += '</div>';
                                            str += '</li>';

                                            //console.log(str)
                                            $("#list_wrap").find('#list_con').append(str);
                                        });
                                    }

                                }
                            });
                        }
                    });

                    createHtml();
                }
            });
        }
        else{
        	$('#guide_total').text('');
        	$('#callBackPager').hide();
        	$('#list_wrap').css('height','auto');
        }
    }
    //点击确定区域划线显示与否条件函数
    $(document).on('click','#ser_btn',function () {
        checkText = $(".sel-title").eq(0).text();
        var selValue=$(".sel-title").eq(1).text();
        var serText=$(".ser_text").val();

        if (checkText == "全部") {
            checktext = "赤峰市"
        } else if (checkText == "其他") {
            // map.clearOverlays();
            checktext = "赤峰市";
        } else {
            checktext = "赤峰市" + checkText;
        }
        if(serText!=""&&serText!=null&&serText!=undefined||selValue!='诱导级别'){
            map.clearOverlays();
            serfun();

        }else{
            getBoundary(checktext);
            serfun();
        }
    })


});


//地图调用 sta

var map; //Map实例
// var my = {title: "万达广场"};
//数据
var guideData = [];
//地图数据加载

map = new BMap.Map('allmap', {enableMapClick: false});
//第1步:设置地图中心点,当前城市
var point = new BMap.Point(sysComm.point_lng,sysComm.point_lat);
//第2步:初始化地图,设置中心点坐标和地图级别。
map.centerAndZoom(point, 13);
map.setCurrentCity(sysComm.cityName);  // 设置地图显示的城市 此项是必须设置的
//第3步:启用滚轮放大缩小
map.enableScrollWheelZoom(true);
//第4步:向地图中添加缩放控件
var ctrlNav = new window.BMap.NavigationControl({
    // 靠右上角位置
    anchor: BMAP_ANCHOR_TOP_RIGHT,
    // LARGE类型
    type: BMAP_NAVIGATION_CONTROL_ZOOM,
    //偏离值
    offset: new BMap.Size(25, 80)
});
map.addControl(ctrlNav);
//第5步:设置地图风格
map.setMapStyle({
    styleJson: [
        {
            "featureType": "background",
            "elementType": "geometry",
            "stylers": {
                "color": "#0a0906"
            }
        },
        {
            "featureType": "building",
            "elementType": "geometry",
            "stylers": {
                "color": "#444444"
            }
        },
        {
            "featureType": "local",
            "elementType": "geometry",
            "stylers": {
                "color": "#ff9900",
                "weight": "0.1"
            }
        },
        {
            "featureType": "road",
            "elementType": "all",
            "stylers": {
                "color": "#9b780e",
                "weight": "0.1",
                "saturation": -21,
                "visibility": "on"
            }
        },
        {
            "featureType": "green",
            "elementType": "geometry",
            "stylers": {
                "color": "#344222",
                "saturation": -20
            }
        },
        {
            "featureType": "water",
            "elementType": "geometry",
            "stylers": {
                "color": "#163e5a"
            }
        },
        {
            "featureType": "subway",
            "elementType": "all",
            "stylers": {
                "color": "#ff9900",
                "saturation": -39
            }
        },
        {
            "featureType": "railway",
            "elementType": "geometry",
            "stylers": {
                "color": "#ff9900"
            }
        },
        {
            "featureType": "all",
            "elementType": "labels.text.stroke",
            "stylers": {
                "color": "#313131"
            }
        },
        {
            "featureType": "all",
            "elementType": "labels.text.fill",
            "stylers": {
                "color": "#8b8787"
            }
        },
        {
            "featureType": "manmade",
            "elementType": "geometry",
            "stylers": {
                "color": "#1b1b1b"
            }
        },
        {
            "featureType": "highway",
            "elementType": "geometry",
            "stylers": {
                "lightness": -75,
                "saturation": -91
            }
        },
        {
            "featureType": "subway",
            "elementType": "geometry",
            "stylers": {
                "lightness": -65
            }
        },
        {
            "featureType": "railway",
            "elementType": "geometry",
            "stylers": {
                "color": "#000000",
                "weight": "1",
                "lightness": -40,
                "saturation": 1
            }
        }
    ]
});

//第6步:检测浏览器兼容
function checkhHtml5() {
    if (typeof(Worker) === "undefined") {
        if (navigator.userAgent.indexOf("MSIE 9.0") <= 0) {
            alert("定制个性地图示例:IE9以下不兼容,推荐使用百度浏览器、chrome、firefox、safari、IE10");
        }

    }
}
checkhHtml5();
function drawMarker() {
    //清除以前的点位
    //map.clearOverlays();
    //第7步:绘制点
    var marker = [];
    var newpoiX = null;//坐标
    var newpoiY = null;
    var guideNo = null;//编号
    var popLevel = null;//诱导级别
    var popRule = null;//空闲车位

    for (var i = 0; i < guideData.length; i++) {
        newpoiX = guideData[i].pointX;
        newpoiY = guideData[i].pointY;
        guideNo = guideData[i].guideNo;
        popLevel = guideData[i].level;
        popRule = guideData[i].rule;
        //console.log(popLevel);
        var point = new BMap.Point(newpoiX, newpoiY);
        // addMarker(point)
        var newRule = popRule;

        if (newRule == 0) {
            var myIcon = new BMap.Icon("../img/guidance_1.png",
                new BMap.Size(28, 24), {
                    offset: new BMap.Size(0, 24),
                    textColor: '#fff'
                });
            marker[i] = new BMap.Marker(point, {icon: myIcon});
            map.addOverlay(marker[i]);
        } else if (newRule <= 0.3 && newRule > 0) {
            var myIcon2 = new BMap.Icon("../img/guidance_2.png",
                new BMap.Size(28, 24), {
                    offset: new BMap.Size(0, 24),
                    textColor: '#fff'
                });
            marker[i] = new BMap.Marker(point, {icon: myIcon2});
            map.addOverlay(marker[i]);

        } else if (newRule > 0.3) {
            var myIcon3 = new BMap.Icon("../img/guidance_3.png",
                new BMap.Size(28, 24), {
                    offset: new BMap.Size(0, 24),
                    textColor: '#fff'
                });
            marker[i] = new BMap.Marker(point, {icon: myIcon3});
            map.addOverlay(marker[i]);

        }



        marker[i].popLevel = guideData[i].level;
        marker[i].guideNo = guideData[i].guideNo;
        marker[i].newpoiX = guideData[i].pointX;
        marker[i].newpoiY = guideData[i].pointY;
        marker[i].rule = guideData[i].rule;

        marker[i].addEventListener("click", function (n) {

            var newpoiY = n.target.newpoiY;
            var guideNo = n.target.guideNo;
            var newpoiX = n.target.newpoiX;
            var popLevel = Number(n.target.popLevel);
            var rule=n.target.rule;
            if (rule == 0) {
                var myIcon = new BMap.Icon("../img/guidance_1.png",
                    new BMap.Size(32, 27), {
                        offset: new BMap.Size(0, 27),
                        textColor: '#fff'
                    });
                marker[i] = new BMap.Marker(point, {icon: myIcon});
                // map.addOverlay(marker[i]);
            } else if (rule <= 0.3 && rule > 0) {
                var myIcon2 = new BMap.Icon("../img/guidance_2.png",
                    new BMap.Size(32, 27), {
                        offset: new BMap.Size(0, 27),
                        textColor: '#fff'
                    });
                marker[i] = new BMap.Marker(point, {icon: myIcon2});
                // map.addOverlay(marker[i]);

            } else if (rule > 0.3) {
                var myIcon3 = new BMap.Icon("../img/guidance_3.png",
                    new BMap.Size(32, 27), {
                        offset: new BMap.Size(0, 27),
                        textColor: '#fff'
                    });
                marker[i] = new BMap.Marker(point, {icon: myIcon3});
                // map.addOverlay(marker[i]);

            }

            addInfoWindow(guideNo, popLevel, newpoiX, newpoiY)

        });

    };
    removeCluster(marker);

}
function  removeCluster(marker) {
    if(clear_flag){
        markerClusterer.clearMarkers();         //此步骤需要
    }
     markerClusterer = new BMapLib.MarkerClusterer(map,
        {
            markers:marker,
            styles : [{
                url:'../img/poly_icon.png',
                size: new BMap.Size(68, 67)
            }],
        });
    markerClusterer.setMaxZoom(13);
    clear_flag = true;
}
map.addEventListener("click", function () {
    colseInfoWindow()
});
function colseInfoWindow() {
    $(".pop-common").css("display", "none");
}
//三个级别诱导弹窗
function addInfoWindow(guideNo, popLevel, newpoiX, newpoiY) {
    var guideNO = guideNo;
    var level = Number(popLevel);
    var point = new BMap.Point(newpoiX, newpoiY);
    var req = {
        guideNo: guideNO,
        sysCode: sysComm.sysCode
    };
    var opt = {
        data: JSON.stringify(req),
        url: dataUrl.util.getGuideScreenInfo(),
        method: "POST",
        success: function (res, status, xhr) {
            var data = res.data;
            if (res.code === "8888") {
                level = data.level;
                if (1 == level) {
                    alertFirstLevelGuideInfo(data, point);
                } else if (2 == level) {
                    alertSecondLevelGuideInfo(data, point);
                } else if (3 == level) {
                    alertThridLevelGuideInfo(data, point);
                } else {
                    alert("未知的诱导屏等级 level=" + level);
                }
            } else {
                alert("服务请求报错:code=" + res.code + "errMsg=" + res.msg + "-" + res.errMsg);
            }


        }
    }

    sysAjax(opt);
    $('.BMapLabel').empty();


}

//弹出一级诱导信息
function alertFirstLevelGuideInfo(data, point) {
    var guideHtml = '';
    if(undefined == data.filePath ||null == data.filePath){
        guideHtml+='<div id="guidance1-pop" class="guidance1-pop pop-common">' +
            '<div class="pop-content1" style="background:url(../img/guide_first_img_error.png);background-size:100% 100%;width: 300px;height: 234px;"></div>'
    }else{
        guideHtml+='<div id="guidance1-pop" class="guidance1-pop pop-common">' +
            '<div class="pop-content1" style="background:url(' + data.filePath + ')"></div>'
    }


    var configs = data.configs;
    if (configs) {
        $.each(configs, function (index, item) {
            //空余车位数
            var freeNum = item.freeNum == undefined || item.freeNum == null ? 0 : item.freeNum;
            var allBerthNum = item.allBerthNum == undefined || item.allBerthNum == null ? 1 : item.allBerthNum;
            var rate = freeNum / allBerthNum * 100;
            var classStyle;

            if (rate < 1) {
                //车位已满
                classStyle = 'num-full';
            } else if (rate <= 30) {
                //车位不多
                classStyle = 'num-few';
            } else {
                //车位充足
                classStyle = 'num-free';
            }

            guideHtml += '<span class="' + classStyle + '" id="num-full" style="top: ' + item.freeHeight + 'px;left: ' + item.freeWidth + 'px;">' + freeNum + '</span>'

        })
    }
    // '<span class="num-full" id="num-full" style="top: 20px;left: 40px;">280</span>' +
    // '<span class="num-few" id="num-few" style="top:60px ;left:40px ;">80</span>' +
    // '<span class="num-free" id="num-free" style="top:95px ;left: 40px;">20</span>' +

    guideHtml += '<div class="height24"></div>' +
        '<div id="pop-close1" class="pop-close"></div>' +
        '</div>';

    var myLabel1 = new BMap.Label(guideHtml, {
        offset: new BMap.Size(60, -180),                  //label的偏移量,为了让label的中心显示在点上
        position: point
    });
    myLabel1.setStyle({
        color: "#F0F0F0",
        fontSize: "12px",
        //height: "220px",
        // width: "350px",
        padding: "5px",
        whiteSpace: "normal",
        //fontFamily: "微软雅黑",
        zIndex: "1000",
        backgroundColor: "rgba(0, 0, 0, 0)",
        border: "0px"
    });
    map.addOverlay(myLabel1, point);
    map.panTo(point);
}
//弹出二级诱导信息
function alertSecondLevelGuideInfo(data, point) {
    var guideInfos = data.guideInfos;
    var guideHtml = '<div id="guidance2-pop" class="guidance2-pop pop-common"><div class="pop-content"><div class="pop-topcontent"><div class="topcontent-main"><span class="zte-logo"></span><span class="park-picon"></span></div></div><div class="pop-bottomcontent">';
    if (null != guideInfos) {
        $.each(guideInfos, function (index, item) {
            guideHtml += '<div class="bottom-style">' +
                '<div id="bot-tit1" class="bot-tit">' + item.plName + '</div>' +
                '<div class="bot-right">';
            if (item.guidePoint == 1) {
                guideHtml += '<div id="bot-icon" class="left-icon"></div>'
            } else if (item.guidePoint == 2) {
                guideHtml += '<div id="bot-icon" class="right-icon"></div>'
            } else if (item.guidePoint == 3) {
                guideHtml += '<div id="bot-icon" class="around-icon"></div>'
            } else if (item.guidePoint == 4) {
                guideHtml += '<div id="bot-icon" class="run-icon"></div>'
            }
            guideHtml += '<div class="height20"></div>' +
                '<div id="space-firstnum" class="bot-num space-firstnum">' + item.freeNum + '</div> </div></div>'
        })
    }
    guideHtml += '</div></div><div class="height24"></div><div id="pop-close2" class="pop-close"></div></div>';
    var myLabel2 = new BMap.Label(guideHtml, {
        offset: new BMap.Size(60, -180),                  //label的偏移量,为了让label的中心显示在点上
        position: point
    });
    myLabel2.setStyle({
        color: "#F0F0F0",
        fontSize: "12px",
        //height: "220px",
        // width: "350px",
        padding: "5px",
        whiteSpace: "normal",
        //fontFamily: "微软雅黑",
        zIndex: "1000",
        backgroundColor: "rgba(0, 0, 0, 0)",
        border: "0px"
    });
    map.addOverlay(myLabel2, point);
    map.panTo(point);
}
//弹出三级诱导信息
function alertThridLevelGuideInfo(data, point) {
    //是否有限高提示
    var highLimitStatus = data.highLimitStatus;
    //是否有急转弯提示
    var sharpTurnStatus = data.sharpTurnStatus;
    //是否有楼层指示
    var floorStatus = data.floorStatus;
    //时间制式
    var timeSystem = data.timeSystem + '';

    var guideHtml = '<div id="guidance3-pop" class="guidance3-pop pop-common">' +
        '<div class="pop-content3">' +
        '<div class="pop-topcontent3">' +
        '<div class="topcontent-main3">' +
        '<span class="zte-logo3"></span>' +
        '<span class="park-picon3"></span>' +
        '</div>' +
        '</div>' +
        '<div class="pop-bottomcontent3 clearfix">' +
        '<div class="bottom-style3  bg202020">' +
        '<div class="bottom3-left"><span id="upper-case" class="upper-case">' + (data.floor == null ? '--' : data.floor ) + '</span>层</div>' +
        '<div class="width15"></div>' +
        '<div class="bottom3-mid">空闲</div>' +
        '<div class="bottom3-right">' + (data.freeNum == null ? '0' : data.freeNum ) + '</div>' +
        '</div> '
    //判断是否有楼层限高
    if (highLimitStatus == 1) {
        guideHtml += '<div class="maxheight-2m"><span class="maxheight-tit">' + data.highLimitNum + '</span></div>'
    }
    //判断时间营业时间,
    if (null != timeSystem) {
        if (timeSystem.length > 6) {
            guideHtml += '<div class="time-hour"><div class="time-num1">' + timeSystem + '</div></div>'
        } else {
            guideHtml += '<div class="time-24h"></div>'
        }
    }

    if (sharpTurnStatus == 1) {
        guideHtml += '<div class="now-turn"></div>'
    }

    guideHtml += '</div></div><div class="height24"></div><div id="pop-close3" class="pop-close"></div></div>'

    var myLabel3 = new BMap.Label(guideHtml, {
        offset: new BMap.Size(60, -180),                  //label的偏移量,为了让label的中心显示在点上
        position: point
    });
    myLabel3.setStyle({
        color: "#F0F0F0",
        fontSize: "12px",
        //height: "220px",
        // width: "350px",
        padding: "5px",
        whiteSpace: "normal",
        zIndex: "1000",
        backgroundColor: "rgba(0, 0, 0, 0)",
        border: "0px"
    });
    map.addOverlay(myLabel3, point);
    map.panTo(point);
}


//当前行政区域划分
function getBoundary(name) {
    var bdary = new BMap.Boundary();
    map.clearOverlays();
    bdary.get(name, function (rs) {
        var count = rs.boundaries.length; //行政区域的点有多少个
        if (count === 0) {
            alert('未能获取当前输入行政区域');
            return;
        }
        var pointArray = [];
        for (var i = 0; i < count; i++) {

            var ply = new BMap.Polygon(rs.boundaries[i], {
                strokeWeight: 2,
                strokeColor: "#ee07db",
                fillColor: '',
                fillOpacity: 0
            });                     //建立多边形覆盖物
            map.addOverlay(ply);  //添加覆盖物
            pointArray = pointArray.concat(ply.getPath());
        }
        map.setViewport(pointArray);    //调整视野
        // map.setMaxZoom(13);
    });

}

// 获取位置
function theLocation(x, y, guideNo) {
    //map.clearOverlays();
    var new_point = new BMap.Point(x, y);
    map.panTo(new_point);
    map.centerAndZoom(new_point, 15);
    addInfoWindow(guideNo, null, x, y);

}
//点击左侧列表显示相应诱导icon
$(document).on('click', '#list_con >li', function () {
    var x = $(this).find('.coordinate_x').text();
    var y = $(this).find('.coordinate_y').text();
    var guideNo = $(this).find('.coordinate_guideNo').text();
    theLocation(x, y, guideNo)
});


//关闭弹窗
$(document).delegate(".pop-close", 'click', function () {
    $(".pop-common").css("display", "none");
})

//获取地图上诱导屏的信息
function getGuideMapInfo(cond) {
    
    $.ajax({
        type: "post",
        url: dataUrl.util.listGuideScreenForMap(),
        data: JSON.stringify(cond),
        contentType: 'application/json; charset=utf-8',
        dataType: "json",
        success: function (data) {
            if (data.code == '8888') {
                guidanceMapInfo(data.data.dataList);
            }
            else {
                alert("服务请求报错:code=" + data.code + "errMsg=" + data.msg + "-" + data.errMsg);
            }
        }
    });
}

//将诱导屏位置数据放入List中
function guidanceMapInfo(data) {

    //map.clearOverlays();
    guideData = [];
    // console.log(data)
    $.each(data, function (index, domEle) {
        var freeBerthNum = domEle.freeBerthNum;
        var berthNum = domEle.berthNum;
        if (freeBerthNum == null) {
            freeBerthNum = 0;
        }
        if (berthNum == null || berthNum == 0) {
            freeBerthNum = 0;
            berthNum = 1;
        }
        guideData.push({
            'guideNo': domEle.guideNo, 'pointX': domEle.lonId, 'pointY': domEle.latId,
            'level': domEle.level, 'rule': freeBerthNum / berthNum
        });
    })
    //console.log("地图上的数据" + JSON.stringify(guideData));
    //加载地图位置气泡
    drawMarker();
};