1window.AOS && AOS.init({ mirror: true }); 2var toI18n = (function toI18n() { 3 var getLangsMap = function(language) { 4 var languageMap = { 5 "ZH-CN": { 6 tips: "æç¤º", 7 close: "å ³é", 8 cancel: "åæ¶", 9 confirm: "ç¡®å®", 10 success: "æå", 11 improveIt: "请å®å", 12 enterPhoneNo: "请è¾å ¥ææºå·ç ", 13 sendVerificationCode: "åééªè¯ç ", 14 bedroom: "室", 15 hall: "å ", 16 kitchen: "å¨", 17 bathroom: "å«", 18 balcony: "é³å°", 19 your: "æ¨ç", 20 RMB: "å ", 21 }, 22 EN: { 23 tips: "tips", 24 close: "Close", 25 cancel: "Cancel", 26 confirm: "Confirm", 27 success: "Success", 28 improveIt: "improve it", 29 enterPhoneNo: "enter phone No", 30 sendVerificationCode: "send verification code", 31 bedroom: "bedroom", 32 hall: "hall", 33 kitchen: "kitchen", 34 bathroom: "bathroom", 35 balcony: "balcony", 36 your: "your", 37 RMB: "RMB", 38 }, 39 }; 40 if (!(language in languageMap)) { 41 language = "ZH-CN"; 42 } 43 return languageMap[language]; 44 }; 45 var language = document.documentElement.getAttribute("lang") || "ZH-CN"; 46 return function(str) { 47 return getLangsMap(language)[str]; 48 }; 49})(); 50 51function application() { 52 this.level = 202003121716; 53 this.regular = { 54 realName: /([\u4e00-\u9fa5]{2,4})/, 55 phone: /^[1][3-9][0-9]{9}$/, 56 email: /^[\w\+\-]+(\.[\w\+\-]+)*@[a-z\d\-]+(\.[a-z\d\-]+)*\.([a-z]{2,4})$/, 57 }; 58} 59application.prototype = { 60 itop: function() { 61 $("html,body") 62 .stop() 63 .animate( 64 { 65 scrollTop: 0, 66 }, 67 200 68 ); 69 }, 70 alert: function(params) { 71 var html = ""; 72 var title = params.title || toI18n("tips"); 73 var close = $( 74 '<a href="javascript:;" class="close">' + toI18n("close") + "</a>" 75 ); 76 var cancel = $('<button class="cancel">' + toI18n("cancel") + "</button>"); 77 var confirm = $( 78 '<button class="confirm">' + toI18n("confirm") + "</button>" 79 ); 80 html += '<div class="ui-layer">'; 81 html += '<div class="inner">'; 82 html += '<div class="head">'; 83 html += "<h3>" + title + "</h3>"; 84 html += "</div>"; 85 html += '<div class="main">'; 86 html += "<p>" + params.content + "</p>"; 87 html += "</div>"; 88 html += '<div class="foot">'; 89 html += '<div class="button">'; 90 html += "</div>"; 91 html += "</div>"; 92 html += "</div>"; 93 html += '<div class="shadow"></div>'; 94 html += "</div>"; 95 var layer = $(html); 96 layer.appendTo("body"); 97 layer.find(".head").append(close); 98 layer.find(".button").append(confirm); 99 close.bind({ 100 click: function() { 101 layer.remove(); 102 }, 103 }); 104 confirm.bind({ 105 click: function() { 106 layer.remove(); 107 if (params.success) { 108 return params.success({ 109 confirm: true, 110 }); 111 } 112 }, 113 }); 114 }, 115 showToast: function(params) { 116 var html = ""; 117 var title = params.title || toI18n("success"); 118 var duration = params.duration || 1000; 119 var close = $( 120 '<a href="javascript:;" class="close">' + toI18n("close") + "</a>" 121 ); 122 var icon = $( 123 '<img class="icon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUBAMAAAB/pwA+AAAAKlBMVEUAAAD6VVX6VFT5VFT6VFT6VVX5VFT6VVX6VFT6VFT8U1P8VFT/UFD6VVWzB/dLAAAADXRSTlMAYMDgoDCw0PBwUE8QJZIqgAAAAHZJREFUCNdjIAZwOalsgLBYa+/evR4AZkbcBYJWMLP28t27ttdBLMa7Cr5XmO4KAJlsdy+yOMjeTQAyme7eFWC8e1cBwnRgATLBCq4wCvgCFYC0GcheZAZrY7C9dPeu7mWwubEIK1ht7969DLGY4aSy2QRinA0AtTsuAoZRRRAAAAAASUVORK5CYII=" />' 124 ); 125 html += '<div class="ui-toast">'; 126 html += '<div class="inner">'; 127 html += '<span class="text">' + title + "</span>"; 128 html += "</div>"; 129 html += "</div>"; 130 var layer = $(html); 131 layer.appendTo("body"); 132 layer.find(".inner").prepend(icon); 133 layer.find(".inner").append(close); 134 close.bind({ 135 click: function() { 136 layer.remove(); 137 }, 138 }); 139 setTimeout(function() { 140 layer.remove(); 141 }, duration); 142 }, 143 bdmap: function(params) { 144 var container = params.container || "bdmap"; 145 var height = params.height || 400; 146 var map = new BMap.Map(container); 147 var point = new BMap.Point(params.longitude, params.latitude); 148 var marker = new BMap.Marker(point); 149 document.getElementById(container).style.height = height + "px"; 150 map.addOverlay(marker); 151 map.centerAndZoom(point, params.zoom); 152 map.enableScrollWheelZoom(true); 153 map.addControl( 154 new BMap.NavigationControl({ 155 anchor: BMAP_ANCHOR_TOP_RIGHT, 156 type: BMAP_NAVIGATION_CONTROL_SMALL, 157 }) 158 ); 159 var opts = { 160 width: 320, 161 height: 100, 162 title: 163 '<h3 style="color:#1b8dd0; font-size:16px; line-height:20px; word-break:break-word;">
163' + 164 params.title + 165 "</h3>", 166 enableMessage: false, 167 message: "", 168 }; 169 var infoWindow = new BMap.InfoWindow( 170 '<p style="color:#999; padding-top:5px; line-height:18px; word-break:break-word;">' + 171 params.content + 172 "</p>", 173 opts 174 ); 175 marker.addEventListener("click", function() { 176 map.openInfoWindow(infoWindow, point); 177 }); 178 map.openInfoWindow(infoWindow, point); 179 }, 180 validate: function(params) { 181 var that = this; 182 var container = $("#" + params.container); 183 container.find('[type="submit"]').bind({ 184 click: function(e) { 185 var boolen = true; 186 container.find("[data-required]").each(function(index, element) { 187 var required = $(this).attr("data-required"); 188 if (!required) { 189 return; 190 } 191 var name = $(this).attr("name"); 192 var label = $(this).data("label"); 193 var type = $(this).attr("type"); 194 var value = $.trim($(this).val()); 195 var placeholder = 196 $(this).attr("placeholder") || toI18n("improveIt") + label; 197 var error = $(this).attr("error") || placeholder; 198 if (required == "required") { 199 var rval = ""; 200 if (type == "radio") { 201 rval = $(':radio[name="' + name + '"]:checked').val(); 202 } else if (type == "checkbox") { 203 rval = $(':checkbox[name="' + name + '"]:checked').val(); 204 } else { 205 rval = value && value !== placeholder ? value : ""; 206 } 207 if (!rval) { 208 that.showToast({ 209 title: error, 210 }); 211 boolen = false; 212 return false; 213 } 214 } else { 215 var valid = true; 216 if ( 217 (required == "realName" && !value.match(that.regular.realName)) || 218 value == "" || 219 value == placeholder 220 ) { 221 valid = false; 222 } else if ( 223 required == "phone" && 224 !value.match(that.regular.phone) 225 ) { 226 valid = false; 227 } else if ( 228 required == "email" && 229 value != "" && 230 !value.match(that.regular.email) 231 ) { 232 valid = false; 233 } else if (required == "huxing") { 234 if ( 235 value == "" || 236 value.indexOf("-1") > -1 || 237 value.indexOf(-1) > -1 238 ) { 239 valid = false; 240 } 241 } 242 if (!valid) { 243 that.showToast({ 244 title: error, 245 }); 246 boolen = false; 247 return false; 248 } 249 } 250 }); 251 e.preventDefault(); 252 if (boolen && params.success) { 253 return params.success(true); 254 } else { 255 if (!boolen && params.error) { 256 return params.error(false); 257 } 258 } 259 }, 260 }); 261 container.find("input, textarea").bind({ 262 focus: function() { 263 if ($(this).val() == $(this).attr("placeholder")) { 264 $(this).val(""); 265 } 266 }, 267 blur: function() { 268 if ($(this).val() == "") { 269 // todoä¸åèªå¨val 270 // $(this).val($(this).attr('placeholder')); 271 } 272 }, 273 keyup: function() {}, 274 }); 275 }, 276 scrollThumbs: function(params) { 277 var $this = $("#" + params.id); 278 var $list = $this.find(".carousel-list-box"); 279 var $list2 = $this.find(".carousel-thumb-list-box"); 280 var $prev = $this.find(".prev"); 281 var $next = $this.find(".next"); 282 var length = $this.find(".carousel-item-box").length; 283 var width = $this.width(); 284 var index = 0; 285 var autoplay = params.autoplay; 286 var duration = params.duration; 287 var speed = params.speed; 288 var timer; 289 $list.append($list.html()); 290 $list2.append($list2.html()); 291 $list.find(".carousel-item-box").width(width); 292 function next() { 293 if (index < length) { 294 index++; 295 } else { 296 $list.css({ 297 left: 0, 298 }); 299 $list2.css({ 300 left: 0, 301 }); 302 index = 1; 303 } 304 scroll(); 305 } 306 307 function prev() { 308 console.log(987); 309 if (index > 0) { 310 index--; 311 } else { 312 $list.css({ 313 left: -width * length, 314 }); 315 $list2.css({ 316 left: -width * 0.2 * length, 317 }); 318 index = length - 1; 319 } 320 scroll(); 321 } 322 323 function scroll() { 324 $list.stop().animate( 325 { 326 left: -width * index, 327 }, 328 speed 329 ); 330 $list2.stop().animate( 331 { 332 left: -width * 0.2 * index, 333 }, 334 speed 335 ); 336 $list2 337 .find(".carousel-thumb-item-box") 338 .eq(index) 339 .addClass("active") 340 .siblings() 341 .removeClass("active"); 342 } 343 if (autoplay) { 344 timer = setInterval(function() { 345 next(); 346 }, duration); 347 } 348 $(window).bind({ 349 resize: function() { 350 clearInterval(timer); 351 width = $this.width(); 352 $list.find(".carousel-item-box").width(width); 353 $list.css({ 354 let: -width * index, 355 }); 356 if (autoplay) { 357 timer = setInterval(function() { 358 next(); 359 }, duration); 360 } 361 }, 362 }); 363 $this.bind({ 364 mouseenter: function() { 365 clearInterval(timer); 366 }, 367 mouseleave: function() { 368 if (autoplay) { 369 timer = setInterval(function() { 370 next(); 371 }, duration); 372 } 373 }, 374 }); 375 $prev.bind({ 376 click: function() { 377 prev(); 378 }, 379 }); 380 $next.bind({ 381 click: function() { 382 next(); 383 }, 384 }); 385 $list2.find(".carousel-thumb-item-box").bind({ 386 click: function() { 387 if ($(this).index() >= length) { 388 index = $(this).index() - length; 389 } else { 390 index = $(this).index(); 391 } 392 scroll(); 393 }, 394 }); 395 }, 396 scroll3D: function(params) { 397 var $this = $("#" + params.id); 398 var $list = $this.find(".carousel-list-box"); 399 var $prev = $this.find(".prev"); 400 var $next = $this.find(".next"); 401 var length = $this.find(".carousel-item-box").length; 402 var width = $this.width(); 403 var index = 0; 404 var autoplay = params.autoplay; 405 var duration = params.duration; 406 var speed = params.speed; 407 var timer; 408 $list.append($list.html()); 409 $list 410 .find(".carousel-item-box") 411 .width(width * 0.3333) 412 .eq(0) 413 .addClass("prevs") 414 .end() 415 .eq(1) 416 .addClass("active") 417 .end() 418 .eq(2) 419 .addClass("nexts"); 420 $list.find(".carousel-item-box").on("click", function() { 421 index = $(this).index() - 1; 422 scroll(); 423 }); 424 425 function next() { 426 if (index < length) { 427 index++; 428 } else { 429 $list.css({ 430 left: 0, 431 }); 432 index = 1; 433 } 434 scroll(); 435 } 436 437 function prev() { 438 if (index > 0) { 439 index--; 440 } else { 441 $list.css({ 442 left: -width * length, 443 }); 444 index = length - 1; 445 } 446 scroll(); 447 } 448 449 function scroll() { 450 $list.stop().animate( 451 { 452 left: -width * 0.3333 * index, 453 }, 454 speed 455 ); 456 $list 457 .find(".carousel-item-box") 458 .eq(index) 459 .addClass("prevs") 460 .siblings() 461 .removeClass("prevs"); 462 $list 463 .find(".carousel-item-box") 464 .eq(index + 1) 465 .addClass("active") 466 .siblings() 467 .removeClass("active"); 468 $list 469 .find(".carousel-item-box") 470 .eq(index + 2) 471 .addClass("nexts") 472 .siblings() 473 .removeClass("nexts"); 474 } 475 if (autoplay) { 476 timer = setInterval(function() { 477 next(); 478 }, duration); 479 } 480 $(window).bind({ 481 resize: function() { 482 clearInterval(timer); 483 width = $this.width(); 484 $list.find(".carousel-item-box").width(width); 485 $list.css({ 486 let: -width * index, 487 }); 488 if (autoplay) { 489 timer = setInterval(function() { 490 next(); 491 }, duration); 492 } 493 }, 494 }); 495 $this.bind({ 496 mouseenter: function() { 497 clearInterval(timer); 498 }, 499 mouseleave: function() { 500 if (autoplay) { 501 timer = setInterval(function() { 502 next(); 503 }, duration); 504 } 505 }, 506 }); 507 $prev.bind({ 508 click: function() { 509 prev(); 510 }, 511 }); 512 $next.bind({ 513 click: function() { 514 next(); 515 }, 516 }); 517 }, 518 showVideoDialog: function(params) { 519 var code = params.code; 520 var soure = params.soure; 521 var poster = params.poster || ""; 522 var autoMode = params.autoMode; 523 if (Number(soure) === 0) { 524 window.videoDialogType = "player"; 525 $("#videoPlayer").show(); 526 if ($("#myVideo").length) { 527 } else { 528 if ($("#newVideo").length) { 529 $("#newVideo").attr({ 530 poster: poster, 531 src: code, 532 }); 533 if (!autoMode) { 534 newPlayer = document.getElementById("newVideo"); 535 newPlayer.play(); 536 } 537 } 538 } 539 } else { 540 window.videoDialogType = "iframe"; 541 $("#videoIframe").show(); 542 $("#videoIframe").html(code); 543 } 544 $("#videoPlayerDialog").show(); 545 $("#videoPlayerDialog .video-player-close") 546 .unbind() 547 .on({ 548 click: function() { 549 app.hideVideoDialog(); 550 }, 551 }); 552 }, 553 hideVideoDialog: function(params) { 554 if ($("#myVideo").length) { 555 } 556 if ($("#newVideo").length) { 557 if (window.videoDialogType === "player") { 558 newPlayer.pause(); 559 } 560 } 561 $("#videoIframe") 562 .hide() 563 .html(""); 564 $("#videoPlayer").hide(); 565 if ($("#myVideo").length) { 566 $("#myVideo").attr({ 567 poster: "", 568 }); 569 $("#myVideo .source").attr({ 570 src: "", 571 }); 572 } else { 573 if ($("#newVideo").length) { 574 $("#newVideo").attr({ 575 poster: "", 576 src: "", 577 }); 578 } 579 } 580 $("#videoPlayerDialog").hide(); 581 }, 582 download: function(url, name) { 583 console.log(987); 584 if (url == "" || name == "") { 585 return; 586 } 587 if (url.indexOf(".pdf") > 0) { 588 return window.open(url, "_blank"); 589 } 590 var xhr = new XMLHttpRequest(); 591 xhr.open("GET", url, true); 592 xhr.responseType = "blob"; 593 xhr.onload = function() { 594 if (xhr.status === 200) { 595 if (window.navigator.msSaveOrOpenBlob) { 596 navigator.msSaveBlob(xhr.response, name); 597 } else { 598 var link = document.createElement("a"); 599 var body = document.querySelector("body"); 600 link.href = window.URL.createObjectURL(xhr.response);
601 link.download = name; 602 link.style.display = "none"; 603 body.appendChild(link); 604 link.click(); 605 body.removeChild(link); 606 window.URL.revokeObjectURL(link.href); 607 } 608 } 609 }; 610 xhr.send(); 611 }, 612 formatForceNumber: function(obj) { 613 obj.value = obj.value.replace(/[^\d.]/g, ""); 614 obj.value = obj.value.replace(/\.{2,}/g, "."); 615 obj.value = obj.value 616 .replace(".", "$#$") 617 .replace(/\./g, "") 618 .replace("$#$", "."); 619 obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3"); 620 if (obj.value.indexOf(".") < 0 && obj.value != "") { 621 obj.value = parseFloat(obj.value); 622 } 623 }, 624 sendSms: function(name) { 625 var that = this; 626 var timer = 120; 627 var scode = $("#scode-" + name); 628 var phone = $('input[name="' + name + '"]') 629 .val() 630 .trim(); 631 if (!phone.match(that.regular.phone)) { 632 app.showToast({ 633 title: toI18n("enterPhoneNo"), 634 }); 635 } else { 636 $.post( 637 SCENEID + "/sms", 638 { 639 phone: phone, 640 }, 641 function(res) { 642 scode.attr({ 643 "data-disabled": "disabled", 644 }); 645 646 function clicker() { 647 timer -= 1; 648 scode.text(timer + "S"); 649 if (timer > 0) { 650 setTimeout(clicker, 1000); 651 } else { 652 scode 653 .removeAttr("data-disabled") 654 .text(toI18n("sendVerificationCode")); 655 } 656 } 657 clicker(); 658 } 659 ); 660 } 661 }, 662 refreshHits: function(params) { 663 $.post(SCENEID + "/view", params); 664 }, 665}; 666var app = new application(); 667 668(function() { 669 var $id = $(".ui-product-album-box"); 670 var $list = $id.find(".ui-product-album"); 671 var $dots = $id.find(".dots"); 672 var $prev = $id.find(".prev"); 673 var $next = $id.find(".next"); 674 var $video = document.getElementById("mainVideo"); 675 var width = $list.width(); 676 var offset = 67; 677 var interval = 5000; 678 var index = 0; 679 var timer; 680 var autoplay = false; 681 var length = $list.find(".auto-img-box").length; 682 var NEED_SCROLL = length > 6; 683 var HAS_VIDEO = !!$("#mainVideo").length; 684 $list.find(".auto-img-box").width(width); 685 $list.append($list.html()); 686 if (NEED_SCROLL) { 687 $dots.width(2 * length * offset); 688 $dots.append($dots.html()); 689 } 690 if (length < 2) { 691 $dots.remove(); 692 } 693 $dots 694 .find(".auto-img-box") 695 .eq(0) 696 .addClass("active"); 697 function prev() { 698 if (index < 0) { 699 $list.css({ 700 left: -length * width, 701 }); 702 if (NEED_SCROLL) { 703 $dots.css({ 704 left: -length * offset, 705 }); 706 } 707 index = length - 1; 708 } 709 $list.stop().animate({ 710 left: -index * width, 711 }); 712 if (NEED_SCROLL) { 713 $dots.stop().animate({ 714 left: -index * offset, 715 }); 716 } 717 videoStatus(); 718 $dots 719 .find(".auto-img-box") 720 .eq(index) 721 .addClass("active") 722 .siblings() 723 .removeClass("active"); 724 } 725 function next() { 726 if (index >= length) { 727 $list.css({ 728 left: width, 729 }); 730 if (NEED_SCROLL) { 731 $dots.css({ 732 left: offset, 733 }); 734 } 735 index = 0; 736 } 737 $list.stop().animate({ 738 left: -index * width, 739 }); 740 if (NEED_SCROLL) { 741 $dots.stop().animate({ 742 left: -index * offset, 743 }); 744 } 745 videoStatus(); 746 $dots 747 .find(".auto-img-box") 748 .eq(index) 749 .addClass("active") 750 .siblings() 751 .removeClass("active"); 752 } 753 function videoStatus() { 754 if (HAS_VIDEO) { 755 if (index === 0) { 756 $video.paused && $video.play(); 757 } else { 758 $video.paused || $video.pause(); 759 } 760 } 761 } 762 $id.bind({ 763 mouseenter: function() { 764 if (autoplay) { 765 clearInterval(timer); 766 } 767 }, 768 mouseleave: function() { 769 if (length > 1) { 770 if (autoplay) { 771 timer = setInterval(function() { 772 index += 1; 773 next(); 774 }, interval); 775 } 776 } 777 }, 778 }); 779 780 $dots.on("click", ".auto-img-box", function() { 781 index = $(this).index(); 782 next(); 783 }); 784 785 $prev.bind({ 786 click: function() { 787 index -= 1; 788 prev(); 789 }, 790 }); 791 792 $next.bind({ 793 click: function() { 794 index += 1; 795 next(); 796 }, 797 }); 798 799 if (length > 1) { 800 if (autoplay) { 801 timer = setInterval(function() { 802 index += 1; 803 next(); 804 }, interval); 805 } 806 } 807 // æ¾å¤§éåè½
808 (function handleImgZoom($) { 809 var previewContainer = $(".img-zoom-viewer"); 810 var lastShowingImg = null; 811 var showingImg = null; 812 var $container = $(".ui-page-product-detail .loop-item"); 813 var containerWidth = $container.width(); 814 var containerHeight = $container.height(); 815 var $zoomIcon = $container.find(".zoom-icon"); 816 var $previewImgs = $(".img-zoom-viewer .target"); 817 var targetImg = ""; 818 // å ¨å±åç§»åé 819 var wider = false; //å¾çæ´å®½è¿æ¯æ´é« 820 var left = 0; 821 var top = 0; 822 var imageScale = 1; 823 previewContainer.css("height", containerHeight); 824 825 function getPreviewImg(img) { 826 var src = img.src; 827 // targetImg = Array.from($previewImgs).find(item => item.src === src) 828 targetImg = [].slice.call($previewImgs).find(function(item) { 829 return item.src === src; 830 }); 831 } 832 833 function getCurrentImg() { 834 var $album = $(".ui-product-album"); 835 var index = Math.abs(parseInt($album.css("left"))) / containerWidth; 836 if (parseInt(index) !== index) return; 837 var $img = $album.find("img.auto-img")[index]; 838 return $img; 839 } 840 841 function ifImgTooSmall(img) { 842 var naturalWidth = img.naturalWidth, 843 naturalHeight = img.naturalHeight; 844 return naturalWidth <= containerWidth && naturalHeight <= containerHeight; 845 } 846 847 function changeGlobalScale(img) { 848 if (!img) return; 849 var naturalWidth = img.naturalWidth, 850 naturalHeight = img.naturalHeight, 851 width = img.width, 852 height = img.height; 853 var containerAspectRatio = containerWidth / containerHeight;
854 var imgAspectRatio = naturalWidth / naturalHeight; 855 wider = imgAspectRatio > containerAspectRatio; 856 857 if (wider) { 858 imageScale = width / naturalWidth; 859 } else { 860 imageScale = height / naturalHeight; 861 } 862 } 863 864 function handleSourceOffset(e) { 865 var container = $container[0]; 866 var containerRect = container.getBoundingClientRect(), 867 containerY = containerRect.top, 868 containerX = containerRect.left; 869 var clientX = e.clientX, 870 clientY = e.clientY; 871 var iconWidth = $zoomIcon.width(); 872 var iconHeight = $zoomIcon.height(); 873 left = clientX - containerX - iconWidth / 2; 874 top = clientY - containerY - iconHeight / 2; 875 if (left <= 0) left = 0; 876 if (left > containerWidth - iconWidth) left = containerWidth - iconWidth; 877 if (top <= 0) top = 0; 878 if (top > containerHeight - iconHeight) 879 top = containerHeight - iconHeight; 880 } 881 882 function showIcon(e) { 883 lastShowingImg = showingImg; 884 showingImg = getCurrentImg(); 885 if (!showingImg) return; 886 if (ifImgTooSmall(showingImg)) { 887 $zoomIcon.css({ 888 visibility: "hidden", 889 }); 890 return $previewImgs.css("visibility", "hidden"); 891 } 892 changeGlobalScale(showingImg); 893 $zoomIcon.css({ 894 width: containerWidth * imageScale, 895 height: containerHeight * imageScale, 896 visibility: "visible", 897 }); 898 } 899 900 function handleZoomIconMove(e) { 901 lastShowingImg = showingImg; 902 showingImg = getCurrentImg(); 903 if (!showingImg) return; 904 if (ifImgTooSmall(showingImg)) { 905 $zoomIcon.css({ 906 visibility: "hidden", 907 }); 908 return $previewImgs.css("visibility", "hidden"); 909 } else if (lastShowingImg !== showingImg) { 910 showIcon(e); 911 } 912 handleSourceOffset(e); 913 $zoomIcon.css({ 914 left: left, 915 top: top, 916 }); 917 previewContainer.show(); 918 var scaleLeft = -left / imageScale; 919 var scaleTop = -top / imageScale; 920 921 var naturalWidth = showingImg.naturalWidth; 922 var naturalHeight = showingImg.naturalHeight; 923 924 if (wider) 925 scaleTop += 926 (containerHeight - imageScale * naturalHeight) / 2 / imageScale; 927 else 928 scaleLeft += 929 (containerWidth - imageScale * naturalWidth) / 2 / imageScale; 930 $previewImgs.css("visibility", "hidden"); 931 getPreviewImg(showingImg); 932 if (targetImg) { 933 $(targetImg).css("visibility", "visible"); 934 } 935 $(targetImg).css({ 936 left: scaleLeft, 937 top: scaleTop, 938 }); 939 } 940 941 function handleMouseout() { 942 $zoomIcon.css("visibility", "hidden"); 943 previewContainer.hide(); 944 } 945 946 $(".ui-page-product-detail").on("mouseenter", ".loop-item", showIcon); 947 $(".ui-page-product-detail").on( 948 "mousemove", 949 ".loop-item", 950 handleZoomIconMove 951 ); 952 $(".ui-page-product-detail").on("mouseleave", ".loop-item", handleMouseout); 953 })(jQuery); 954})(window, jQuery); 955 956(function() { 957 var huxing_height = 260; 958 var window_height = $(window).height(); 959 var hid = ""; 960 var timer; 961 var $picker = $("#huxingPicker"); 962 963 function getList(length) { 964 return Array(length) 965 .fill(void 0) 966 .map(function(item, index) { 967 return index + 1; 968 }); 969 } 970 971 function ImproveListUnit(list, name) { 972 return list.map(function(item) { 973 return (item += name); 974 }); 975 } 976 $(".form-huxing") 977 .on("mouseenter", function() { 978 var left = $(this).offset().left; 979 var top = $(this).offset().top; 980 var height = $(this).height(); 981 var currentValue = $(this) 982 .find("input") 983 .val(); 984 hid = $(this).attr("id"); 985 986 var values = currentValue 987 ? currentValue.split(",").map(Number) 988 : [-1, -1, -1, -1, -1]; 989 toI18n("bedroom"); 990 var arrays = [ 991 ImproveListUnit(getList(6), toI18n("bedroom")), 992 ImproveListUnit(getList(6), toI18n("hall")), 993 ImproveListUnit(getList(6), toI18n("kitchen")), 994 ImproveListUnit(getList(6), toI18n("bathroom")), 995 ImproveListUnit(getList(6), toI18n("balcony")), 996 ]; 997 var htmlArr = arrays.map(function(item, index) { 998 var strArr = item.map(function(it, i) { 999 var temp = i == values[index] ? '<dd class="active">' : "<dd>"; 1000 temp += "<span>" + it + "</span></dd>"; 1001 return temp; 1002 }); 1003 return "<dl>" + strArr.join("") + "</dl>"; 1004 }); 1005 $picker.find(".list").html(htmlArr.join("")); 1006 1007 var calcTop = top + height; 1008 if (top + height + huxing_height > window_height) { 1009 calcTop = top - huxing_height; 1010 } 1011 $picker 1012 .css({ 1013 left: left, 1014 top: calcTop, 1015 }) 1016 .show(); 1017 }) 1018 .on("mouseleave", function() { 1019 timer = setTimeout(function() { 1020 $picker.hide(); 1021 }, 300); 1022 }); 1023 1024 $picker 1025 .on("mouseenter", function() { 1026 clearTimeout(timer); 1027 }) 1028 .on("mouseleave", function() { 1029 $(this).hide(); 1030 }) 1031 .on("click", "dd", function() { 1032 $(this) 1033 .addClass("active") 1034 .siblings() 1035 .removeClass("active"); 1036 var tempArr = []; 1037 var tempHtmlArr = []; 1038 $picker.find("dl").each(function() { 1039 $dd = $(this).find("dd.active"); 1040 if ($dd.length) { 1041 tempArr.push($dd.index()); 1042 tempHtmlArr.push( 1043 '<span class="form-huxing-item">' + 1044 $dd.children("span").text() + 1045 "</span>" 1046 ); 1047 } else { 1048 tempArr.push(-1); 1049 } 1050 }); 1051 $("#" + hid) 1052 .find(".form-huxing-item-box") 1053 .html(tempHtmlArr.join("")) 1054 .next() 1055 .val(tempArr.join(",")); 1056 }); 1057 $(window).bind({ 1058 scroll: function() { 1059 window_height = $(window).height() + $(window).scrollTop(); 1060 }, 1061 }); 1062})(window, jQuery); 1063 1064$.extend({ 1065 createModal: (function() { 1066 if ($.createModal) { 1067 $.createModal = $.createModal; 1068 return; 1069 } 1070 1071 function toggleClass() {
1072 $(".jw-dialog .wrapper").toggleClass("in"); 1073 $(".jw-modal").toggleClass("in"); 1074 } 1075 $("body").on("click", ".jw-dialog", function(e) { 1076 if (e.target === this) { 1077 toggleClass(); 1078 setTimeout(function() { 1079 $(e.target).remove(); 1080 $(".jw-modal").remove(); 1081 }, 300); 1082 } 1083 }); 1084 return function(str) { 1085 if ($(".jw-dialog").length) return; 1086 var modalHtml = 1087 '<div class="jw-dialog"><div class="wrapper"><div class="content"><div class="right-icon"><div class="check-style-icon"></div></div><div class="title">' + 1088 str + 1089 '</div></div></div></div><div class="jw-modal"></div>'; 1090 $("body").append(modalHtml); 1091 setTimeout(function() { 1092 toggleClass(); 1093 }, 0); 1094 }; 1095 })(), 1096}); 1097 1098// æ¥ä»·å½æ°å¼å§ 1099!(function(t) { 1100 var n = {}; 1101 1102 function a(e) { 1103 if (n[e]) return n[e].exports; 1104 var r = (n[e] = { 1105 i: e, 1106 l: !1, 1107 exports: {}, 1108 }); 1109 return t[e].call(r.exports, r, r.exports, a), (r.l = !0), r.exports; 1110 } 1111 (a.m = t), 1112 (a.c = n), 1113 (a.d = function(e, r, t) { 1114 a.o(e, r) || 1115 Object.defineProperty(e, r, { 1116 enumerable: !0, 1117 get: t, 1118 }); 1119 }), 1120 (a.r = function(e) { 1121 typeof Symbol !== "undefined" && 1122 Symbol.toStringTag && 1123 Object.defineProperty(e, Symbol.toStringTag, { 1124 value: "Module", 1125 }), 1126 Object.defineProperty(e, "__esModule", { 1127 value: !0, 1128 }); 1129 }), 1130 (a.t = function(r, e) { 1131 if ((1 & e && (r = a(r)), 8 & e)) return r; 1132 if (4 & e && typeof r === "object" && r && r.__esModule) return r; 1133 var t = Object.create(null); 1134 if ( 1135 (a.r(t), 1136 Object.defineProperty(t, "default", { 1137 enumerable: !0, 1138 value: r, 1139 }), 1140 2 & e && typeof r !== "string") 1141 ) 1142 for (var n in r) 1143 a.d( 1144 t, 1145 n, 1146 function(e) { 1147 return r[e]; 1148 }.bind(null, n) 1149 ); 1150 return t; 1151 }), 1152 (a.n = function(e) { 1153 var r = 1154 e && e.__esModule 1155 ? function() { 1156 return e.default; 1157 } 1158 : function() { 1159 return e; 1160 }; 1161 return a.d(r, "a", r), r; 1162 }), 1163 (a.o = function(e, r) { 1164 return Object.prototype.hasOwnProperty.call(e, r); 1165 }), 1166 (a.p = ""), 1167 a((a.s = 0)); 1168})([ 1169 function(module, exports) { 1170 function _defineProperty(e, r, t) { 1171 return ( 1172 r in e 1173 ? Object.defineProperty(e, r, { 1174 value: t, 1175 enumerable: !0, 1176 configurable: !0, 1177 writable: !0, 1178 }) 1179 : (e[r] = t), 1180 e 1181 ); 1182 } 1183 1184 function _slicedToArray(e, r) { 1185 return ( 1186 _arrayWithHoles(e) || 1187 _iterableToArrayLimit(e, r) || 1188 _unsupportedIterableToArray(e, r) || 1189 _nonIterableRest() 1190 ); 1191 } 1192 1193 function _nonIterableRest() { 1194 throw new TypeError( 1195 "Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." 1196 ); 1197 } 1198 1199 function _unsupportedIterableToArray(e, r) { 1200 if (e) { 1201 if (typeof e === "string") return _arrayLikeToArray(e, r); 1202 var t = Object.prototype.toString.call(e).slice(8, -1); 1203 return ( 1204 t === "Object" && e.constructor && (t = e.constructor.name), 1205 t === "Map" || t === "Set" 1206 ? Array.from(e) 1207 : t === "Arguments" || 1208 /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) 1209 ? _arrayLikeToArray(e, r) 1210 : void 0 1211 ); 1212 } 1213 } 1214 1215 function _arrayLikeToArray(e, r) { 1216 (r == null || r > e.length) && (r = e.length); 1217 for (var t = 0, n = new Array(r); t < r; t++) n[t] = e[t]; 1218 return n; 1219 } 1220 1221 function _iterableToArrayLimit(e, r) { 1222 if (typeof Symbol !== "undefined" && Symbol.iterator in Object(e)) { 1223 var t = []; 1224 var n = !0; 1225 var a = !1; 1226 var o = void 0; 1227 try { 1228 for ( 1229 var i, l = e[Symbol.iterator](); 1230 !(n = (i = l.next()).done) && 1231 (t.push(i.value), !r || t.length !== r); 1232 n = !0 1233 ); 1234 } catch (e) { 1235 (a = !0), (o = e); 1236 } finally { 1237 try { 1238 n || l.return == null || l.return(); 1239 } finally { 1240 if (a) throw o; 1241 } 1242 } 1243 return t; 1244 } 1245 } 1246 1247 function _arrayWithHoles(e) { 1248 if (Array.isArray(e)) return e; 1249 } 1250 !(function(window, $) { 1251 var NUMBER_TYPE = 5; 1252 var USER_INPUT = 0; 1253 var STATIC = 1; 1254 var CAL = 2; 1255 var IS_PRODUCT = 1; 1256 var IS_IF = 2; 1257 var IS_IFS = 3; 1258 var id = 0; 1259 var fields = []; 1260 var cache = Object.create(null); 1261 var $currentForm = $("body"); 1262 var createModalHtml; 1263 1264 function floatFormat(e) { 1265 return ( 1266 typeof e !== "string" && (e = parseFloat(e)), parseFloat(e.toFixed(2)) 1267 ); 1268 } 1269 1270 function PRODUCT() { 1271 for (var e = arguments.length, r = new Array(e), t = 0; t < e; t++) 1272 r[t] = arguments[t]; 1273 return floatFormat( 1274 r.reduce(function(e, r) { 1275 return e * r; 1276 }, 1) 1277 ); 1278 } 1279 1280 function IF(e, r, t) { 1281 return floatFormat(Number(e ? r || 0 : t || 0)); 1282 } 1283 1284 function IFS(calc) { 1285 return ( 1286 (calc = 1287 calc 1288 .split(";") 1289 .map(function(e) { 1290 return e.replace(/\,/g, "?"); 1291 }) 1292 .join(":") + ":0"), 1293 floatFormat(Number(eval(calc))) 1294 ); 1295 } 1296 1297 function parseCal(e) { 1298 return e 1299 .split("-") 1300 .map(function(e) { 1301 var r = _slicedToArray(e.split(":"), 2); 1302 var t = r[0]; 1303 var n = r[1]; 1304 return ( 1305 t === "v" && (n = "{".concat(n, "}")), t === "c" && (n = ""), n 1306 ); 1307 }) 1308 .join("") 1309 .replace(/([}\d])(=)([{\d])/g, "$1===$3") 1310 .replace(/\{((?:.|\n)+?)\}/g, "getFieldPrice($&)") 1311 .replace(/[{}]/g, ""); 1312 } 1313 1314 function getDetailField(r) { 1315 return fields.find(function(e) { 1316 return e.id === r; 1317 }); 1318 } 1319 1320 function getOfferDetail(e) { 1321 function r(e) { 1322 return { 1323 label: getFieldLabel(e), 1324 price: getFieldPrice(e), 1325 }; 1326 } 1327 return Array.isArray(e) ? e.map(r) : r(e); 1328 } 1329 1330 function getFieldLabel(e) { 1331 return getDetailField(e).label; 1332 } 1333 1334 function getFieldPrice(e) { 1335 if (cache[e]) return cache[e]; 1336 if (id++ > 299) throw new Error("彿°ä¹é´ä¸è½å¾ªç¯è°ç¨ï¼"); 1337 var r = null; 1338 var t = getDetailField(e); 1339 if (!t || t.format !== NUMBER_TYPE) return 0; 1340 var n = t.h; 1341 var a = t.calcType; 1342 return ( 1343 n === USER_INPUT && 1344 (r = 1345 parseFloat($currentForm.find('[name="'.concat(e, '"]')).val()) || 1346 0), 1347 n === STATIC && (r = parseFloat(t.data) || 0), 1348 n === CAL && (r = getCalValue(parseCal(t.calc), a)), 1349 (cache[e] = r) 1350 ); 1351 } 1352 1353 function getCalValue(calc, type) { 1354 var _calMap; 1355 var calMap = 1356 ((_calMap = {}), 1357 _defineProperty(_calMap, IS_PRODUCT, function() { 1358 return eval("PRODUCT(".concat(calc, ")")); 1359 }), 1360 _defineProperty(_calMap, IS_IF, function() { 1361 return eval("IF(".concat(calc, ")")); 1362 }), 1363 _defineProperty(_calMap, IS_IFS, function() { 1364 return IFS(calc); 1365 }), 1366 _calMap); 1367 return calMap[type](); 1368 } 1369 1370 function toggleClass() { 1371 $(".jw-offer-dialog .offer-modal").toggleClass("in"), 1372 $(".jw-modal").toggleClass("in"); 1373 } 1374 (window.startOffer = function(e) { 1375 var r = e.offer; 1376 var t = e._id; 1377 if ( 1378 ((fields = e.fields), 1379 (id = 0), 1380 ($currentForm = $(t ? "#ui-".concat(t) : "body")), 1381 (cache = Object.create(null)), 1382 r && window.$) 1383 ) { 1384 var n = r.tot.fieldId; 1385 var a = r.det.map(function(e) { 1386 return e.fieldId; 1387 }); 1388 return { 1389 main: getOfferDetail(n), 1390 detail: getOfferDetail(a), 1391 }; 1392 } 1393 }), 1394 $.createOfferModal || 1395 ($("body").on("click", ".close-button", function(e) { 1396 toggleClass(), 1397 setTimeout(function() { 1398 $(".jw-offer-dialog").remove(), $(".jw-modal").remove(); 1399 }, 300); 1400 }), 1401 (createModalHtml = function(e) { 1402 var r = startOffer(e); 1403 var t = $( 1404 '\n <div class="jw-offer-dialog">\n <div class="offer-modal">\n <div class="container">\n <div class="main">\n </div>\n <div class="content">\n </div>\n </div>\n <button type="button" class="close-button">
1404\n <span>' + 1405 toI18n("close") + 1406 '</span>\n </button>\n </div>\n </div>\n <div class="jw-modal"></div>\n ' 1407 ); 1408 var n = r.main; 1409 var a = n.label; 1410 var o = n.price; 1411 var i = r.detail; 1412 var l = 1413 "\n " + 1414 toI18n("your") + 1415 '<span class="label">' 1416 .concat( 1417 a, 1418 '</span>\n <div class="price"><span class="number">' 1419 ) 1420 .concat(o, "</span>" + toI18n("RMB") + "</div>\n "); 1421 var c = i 1422 .map(function(e) { 1423 var r = e.label; 1424 var t = e.price; 1425 return '\n <div class="detail">\n <span class="label">' 1426 .concat(r, '</span>ï¼<span class="price">') 1427 .concat( 1428 t, 1429 "</span>" + toI18n("RMB") + "\n </div>\n " 1430 ); 1431 }) 1432 .join(""); 1433 return ( 1434 t.find(".main").append(l), 1435 t.find(".content").append(c), 1436 i.length || t.find(".content").remove(), 1437 t 1438 ); 1439 }), 1440 $.extend({ 1441 createOfferModal: function(e) { 1442 $(".jw-offer-dialog").length || 1443 ($("body").append(createModalHtml(e)), 1444 setTimeout(function() { 1445 toggleClass(); 1446 }, 0)); 1447 }, 1448 })); 1449 })(window, jQuery); 1450 }, 1451]); 1452// æ¥ä»·å½æ°ç»æ 1453 1454// ç¾åº¦æ¨é代ç 1455(function() { 1456 var script = document.createElement("script"); 1457 script.src = "//push.zhanzhang.baidu.com/push.js"; 1458 if (/^https/.test(window.location.protocol)) { 1459 script.src = "//zz.bdstatic.com/linksubmit/push.js"; 1460 } 1461 document.body.appendChild(script); 1462})(); 1463 1464(function() { 1465 $(".ui-page-product-list .category-aside-icon-arrow").on("click", function() { 1466 if ( 1467 $(this) 1468 .parents(".category-aside-item") 1469 .hasClass("active") 1470 ) { 1471 $(this) 1472 .parents(".category-aside-item") 1473 .removeClass("active"); 1474 } else { 1475 $(this) 1476 .parents(".category-aside-item") 1477 .addClass("active"); 1478 } 1479 }); 1480 $(".ui-page-product-list .category-aside-item-link.active").on( 1481 "click", 1482 function() { 1483 if ( 1484 $(this) 1485 .parents(".category-aside-item") 1486 .hasClass("active") 1487 ) { 1488 $(this) 1489 .parents(".category-aside-item") 1490 .removeClass("active"); 1491 } else { 1492 $(this) 1493 .parents(".category-aside-item") 1494 .addClass("active"); 1495 } 1496 } 1497 ); 1498 $(".ui-page-product-list .category-aside-item-link.active") 1499 .parent() 1500 .addClass("active") 1501 .parents(".category-aside-item") 1502 .addClass("active"); 1503})(); 1504 1505// ui-mapå°å¾æ¸²æå½æ°å¼å§ 1506function createMapInfo(marker) { 1507 var detail = 1508 arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 1509 var caption = detail.caption; 1510 var address = detail.address; 1511 var contact = detail.contact; 1512 var et = detail.et; 1513 var extendInfo = (et || []) 1514 .map(function(_ref) { 1515 var caption = _ref.caption; 1516 var v = _ref.v; 1517 if (!caption || !v) return ""; 1518 return "<div>".concat(caption, "\uFF1A").concat(v, "</div>"); 1519 }) 1520 .join(""); 1521 var infoWindow = new BMap.InfoWindow( 1522 '\n <div style="font-size: 13px;">\n <h4>' 1523 .concat(caption, "</h4>\n <div>") 1524 .concat(address, "</div>\n <div>\u8054\u7CFB\u7535\u8BDD\uFF1A") 1525 .concat(contact, "</div>\n ") 1526 .concat(extendInfo, "\n </div>\n ") 1527 ); 1528 marker.addEventListener("click", function() { 1529 marker.openInfoWindow(infoWindow); 1530 }); 1531} 1532 1533function addOverLays(map, addressDetailList) { 1534 return addressDetailList.map(function(item, i) { 1535 var lng = item.lng; 1536 var lat = item.lat; 1537 var point = null; 1538 var marker = new BMap.Marker((point = new BMap.Point(lng, lat))); 1539 map.addOverlay(marker); 1540 marker.setAnimation(window.BMAP_ANIMATION_BOUNCE); 1541 createMapInfo(marker, item); 1542 return point; 1543 }); 1544} 1545 1546function renderOverLays(map, addressDetailList, scale) { 1547 scale = scale || 14; 1548 if (addressDetailList.length > 1) { 1549 var pointList = addOverLays(map, addressDetailList);
1550 map.setViewport(pointList); 1551 } else if (addressDetailList.length === 1) { 1552 var pointList = addOverLays(map, addressDetailList); 1553 var view = map.getViewport(pointList); 1554 map.centerAndZoom(view.center, scale); 1555 } else { 1556 map.centerAndZoom("é¿æ²å¸", scale); 1557 } 1558 map.enableScrollWheelZoom(true); 1559} 1560// ui-mapå°å¾æ¸²æå½æ°ç»æ 1561 1562/** 1563 * ä¸å ¼å®¹ç«ç 1564 */ 1565// window.onload = function () { 1566// // ååºå°å±å¹å±ç°ææ 1567// // window.screen.width 1568// // window.innerWidth 1569// console.log(`window.innerWidth: ${window.innerWidth}`) 1570// console.log(`window.screen.width: ${window.screen.width}`) 1571// console.log(`document.body.scrollWidth: ${document.body.scrollWidth}`) 1572// // document.body.style.zoom = Math.floor(window.innerWidth / document.body.scrollWidth * 100) / 100 1573// const zoom = Math.floor(window.screen.width / document.body.scrollWidth * 100) / 100 1574// if (zoom < 1) { 1575// document.body.style.zoom = zoom 1576// } 1577// }; 1578 1579/******************* 1580 * å¼¹çª 1581 */ 1582(function() { 1583 // æ´å«ææA龿¥ 1584 $("a").each(function() { 1585 var href = Number($(this).attr("href")); 1586 if (typeof href === "number" && !isNaN(href) && href > 0) { 1587 $(this).attr({ 1588 href: "javascript:showDialogLayer(" + href + ");", 1589 }); 1590 } 1591 }); 1592 1593 // å ³éå¼¹çª 1594 $(".saas-dialog").on("click", ".saas-dialog-close", function() { 1595 $(this) 1596 .parents(".saas-dialog") 1597 .hide(); 1598 if ($(this).parents(".saas-dialog-auto").length) { 1599 var showtype = $(".saas-dialog-auto").attr("data-showtype"); 1600 var opentype = $(".saas-dialog-auto").attr("data-opentype"); 1601 if (showtype) { 1602 if (opentype > 0) { 1603 setTimeout(function() { 1604 $(".saas-dialog-auto") 1605 .find(".saas-dialog") 1606 .show(); 1607 }, opentype * 1000); 1608 } 1609 } 1610 } 1611 }); 1612 1613 // èªå¨å¼¹çª 1614 if ($(".saas-dialog-auto").length) { 1615 var showtype = $(".saas-dialog-auto").attr("data-showtype"); 1616 var opentype = $(".saas-dialog-auto").attr("data-opentype"); 1617 if (showtype === "true") { 1618 setTimeout(function() { 1619 $(".saas-dialog-auto") 1620 .find(".saas-dialog") 1621 .show(); 1622 }, opentype * 1000); 1623 } 1624 } 1625})(); 1626 1627// æå¼å¼¹çª 1628function showDialogLayer(dialogId) { 1629 if ($("#saas-dialog-" + dialogId).length) { 1630 var $dialog = $("#saas-dialog-" + dialogId).find(".saas-dialog"); 1631 $dialog.show(); 1632 } 1633} 1634 1635// è¡¥å ¨å符串 1636function prefixZero(num, n) { 1637 return (Array(n).join(0) + num).slice(-n); 1638} 1639 1640// æ ¼å¼åååä½ 1641function thousandTextSeparator(num, isSep) { 1642 num = String(num).replace(/,/g, ""); 1643 if (isSep) { 1644 var reg = /\d{1,3}(?=(\d{3})+$)/g; 1645 return (num + "").replace(reg, "$&,"); 1646 } else { 1647 return num; 1648 } 1649} 1650 1651(function() { 1652 if ($(".ui-page-product-introduction").length) { 1653 // 产å详æ 1654 var $content = $(".ui-page-product-introduction"); 1655 $(".ui-page-product-introduction table").each(function(index, item) { 1656 $(item).after('<div class="table">' + item.outerHTML + "</div>"); 1657 $(item).remove(); 1658 }); 1659 } 1660 if ($(".ui-page-article-content").length) { 1661 // 产å详æ 1662 var $content = $(".ui-page-article-content"); 1663 $(".ui-page-article-content table").each(function(index, item) { 1664 $(item).after('<div class="table">' + item.outerHTML + "</div>"); 1665 $(item).remove(); 1666 }); 1667 } 1668})(window, jQuery); 1669 1670/** 1671 * ç»è®¡ä»£ç 1672 */ 1673(function() { 1674 if (!$("#hasTongji").length) return false; 1675 if (!$("#jwTongji").length) return false; 1676 var html = ""; 1677 if ($("#jwTongji a").length) { 1678 $("#jwTongji a").each(function(index, item) { 1679 var link = $(item).addClass("ui-copy-right-item-link")[0].outerHTML; 1680 if ( 1681 item.outerHTML.indexOf("https://www.cnzz.com/stat/website.php") >= 0 1682 ) { 1683 // cnzz 1684 html = link; 1685 } else if ( 1686 item.outerHTML.indexOf("https://uweb.umeng.com/v1/login.php") >= 0 1687 ) { 1688 // umeng 1689 html = link; 1690 } else { 1691 // other 1692 html = link; 1693 } 1694 }); 1695 } else { 1696 // no creat link 1697 var script = $("#jwTongji").html(); 1698 if (script.indexOf("https://hm.baidu.com/hm.js") >= 0) { 1699 // baidu 1700 html = 1701 '<a href="//tongji.baidu.com/web/welcome/login" target="_blank" title="ç«é¿ç»è®¡" class="ui-copy-right-item-link">ç«é¿ç»è®¡</a>'; 1702 } else if ( 1703 script.indexOf("http://mps.jwyun.net/mps_collection/v1/visit") >= 0 1704 ) { 1705 // mps 1706 html = 1707 '<a href="//mps.jwyun.net" target="_blank" title="ç«é¿ç»è®¡" class="ui-copy-right-item-link">ç«é¿ç»è®¡</a>'; 1708 } else if (script.indexOf("cnzz.com") >= 0) { 1709 // cnzz 1710 $("#jwTongji") 1711 .find("script") 1712 .each(function(index, item) { 1713 if ($(item).attr("src")) { 1714 var webids = $(item) 1715 .attr("src") 1716 .split("?") 1717 .reverse(); 1718 if (webids.length) { 1719 var webid = webids[0]; 1720 html = 1721 '<a href="//www.cnzz.com/stat/website.php?web_' + 1722 webid + 1723 '" target="_blank" title="ç«é¿ç»è®¡" class="ui-copy-right-item-link">ç«é¿ç»è®¡</a>'; 1724 } else { 1725 html = 1726 '<a href="//passport.umeng.com/login" target="_blank" title="ç«é¿ç»è®¡" class="ui-copy-right-item-link">ç«é¿ç»è®¡</a>'; 1727 } 1728 } 1729 }); 1730 } 1731 } 1732 1733 if ($("#jwTongjLabel").length) { 1734 var url = $("#jwTongjLabel").attr("data-url"); 1735 var text = $("#jwTongjLabel").attr("data-text"); 1736 var eleStr = 1737 '<a href="' + 1738 url + 1739 '" target="_blank" title="' + 1740 text + 1741 '" class="ui-copy-right-item-link">' + 1742 text + 1743 "</a>"; 1744 if ($.trim(url)) { 1745 $("#jwTongjLabel").append(eleStr); 1746 } else { 1747 $("#jwTongjLabel").append(html); 1748 } 1749 if ($("#jwTongjLabel img").length) { 1750 $('#jwTongjLabel').addClass('ui-copy-right-block'); 1751 } 1752 } 1753})(window, jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.