window.AOS && AOS.init({ mirror: true }); var toI18n = (function toI18n() { var getLangsMap = function(language) { var languageMap = { "ZH-CN": { tips: "提示", close: "关闭", cancel: "取消", confirm: "确定", success: "成功", improveIt: "请完善", enterPhoneNo: "请输入手机号码", sendVerificationCode: "发送验证码", bedroom: "室", hall: "厅", kitchen: "厨", bathroom: "卫", balcony: "阳台", your: "您的", RMB: "元", }, EN: { tips: "tips", close: "Close", cancel: "Cancel", confirm: "Confirm", success: "Success", improveIt: "improve it", enterPhoneNo: "enter phone No", sendVerificationCode: "send verification code", bedroom: "bedroom", hall: "hall", kitchen: "kitchen", bathroom: "bathroom", balcony: "balcony", your: "your", RMB: "RMB", }, }; if (!(language in languageMap)) { language = "ZH-CN"; } return languageMap[language]; }; var language = document.documentElement.getAttribute("lang") || "ZH-CN"; return function(str) { return getLangsMap(language)[str]; }; })(); function application() { this.level = 202003121716; this.regular = { realName: /([\u4e00-\u9fa5]{2,4})/, phone: /^[1][3-9][0-9]{9}$/, email: /^[\w\+\-]+(\.[\w\+\-]+)*@[a-z\d\-]+(\.[a-z\d\-]+)*\.([a-z]{2,4})$/, }; } application.prototype = { itop: function() { $("html,body") .stop() .animate( { scrollTop: 0, }, 200 ); }, alert: function(params) { var html = ""; var title = params.title || toI18n("tips"); var close = $( '' + toI18n("close") + "" ); var cancel = $('"); var confirm = $( '" ); html += '
'; html += '
'; html += '
'; html += "

" + title + "

"; html += "
"; html += '
'; html += "

" + params.content + "

"; html += "
"; html += '
'; html += '
'; html += "
"; html += "
"; html += "
"; html += '
'; html += "
"; var layer = $(html); layer.appendTo("body"); layer.find(".head").append(close); layer.find(".button").append(confirm); close.bind({ click: function() { layer.remove(); }, }); confirm.bind({ click: function() { layer.remove(); if (params.success) { return params.success({ confirm: true, }); } }, }); }, showToast: function(params) { var html = ""; var title = params.title || toI18n("success"); var duration = params.duration || 1000; var close = $( '' + toI18n("close") + "" ); var icon = $( '' ); html += '
'; html += '
'; html += '' + title + ""; html += "
"; html += "
"; var layer = $(html); layer.appendTo("body"); layer.find(".inner").prepend(icon); layer.find(".inner").append(close); close.bind({ click: function() { layer.remove(); }, }); setTimeout(function() { layer.remove(); }, duration); }, bdmap: function(params) { var container = params.container || "bdmap"; var height = params.height || 400; var map = new BMap.Map(container); var point = new BMap.Point(params.longitude, params.latitude); var marker = new BMap.Marker(point); document.getElementById(container).style.height = height + "px"; map.addOverlay(marker); map.centerAndZoom(point, params.zoom); map.enableScrollWheelZoom(true); map.addControl( new BMap.NavigationControl({ anchor: BMAP_ANCHOR_TOP_RIGHT, type: BMAP_NAVIGATION_CONTROL_SMALL, }) ); var opts = { width: 320, height: 100, title: '

' + params.title + "

", enableMessage: false, message: "", }; var infoWindow = new BMap.InfoWindow( '

' + params.content + "

", opts ); marker.addEventListener("click", function() { map.openInfoWindow(infoWindow, point); }); map.openInfoWindow(infoWindow, point); }, validate: function(params) { var that = this; var container = $("#" + params.container); container.find('[type="submit"]').bind({ click: function(e) { var boolen = true; container.find("[data-required]").each(function(index, element) { var required = $(this).attr("data-required"); if (!required) { return; } var name = $(this).attr("name"); var label = $(this).data("label"); var type = $(this).attr("type"); var value = $.trim($(this).val()); var placeholder = $(this).attr("placeholder") || toI18n("improveIt") + label; var error = $(this).attr("error") || placeholder; if (required == "required") { var rval = ""; if (type == "radio") { rval = $(':radio[name="' + name + '"]:checked').val(); } else if (type == "checkbox") { rval = $(':checkbox[name="' + name + '"]:checked').val(); } else { rval = value && value !== placeholder ? value : ""; } if (!rval) { that.showToast({ title: error, }); boolen = false; return false; } } else { var valid = true; if ( (required == "realName" && !value.match(that.regular.realName)) || value == "" || value == placeholder ) { valid = false; } else if ( required == "phone" && !value.match(that.regular.phone) ) { valid = false; } else if ( required == "email" && value != "" && !value.match(that.regular.email) ) { valid = false; } else if (required == "huxing") { if ( value == "" || value.indexOf("-1") > -1 || value.indexOf(-1) > -1 ) { valid = false; } } if (!valid) { that.showToast({ title: error, }); boolen = false; return false; } } }); e.preventDefault(); if (boolen && params.success) { return params.success(true); } else { if (!boolen && params.error) { return params.error(false); } } }, }); container.find("input, textarea").bind({ focus: function() { if ($(this).val() == $(this).attr("placeholder")) { $(this).val(""); } }, blur: function() { if ($(this).val() == "") { // todo不再自动val // $(this).val($(this).attr('placeholder')); } }, keyup: function() {}, }); }, scrollThumbs: function(params) { var $this = $("#" + params.id); var $list = $this.find(".carousel-list-box"); var $list2 = $this.find(".carousel-thumb-list-box"); var $prev = $this.find(".prev"); var $next = $this.find(".next"); var length = $this.find(".carousel-item-box").length; var width = $this.width(); var index = 0; var autoplay = params.autoplay; var duration = params.duration; var speed = params.speed; var timer; $list.append($list.html()); $list2.append($list2.html()); $list.find(".carousel-item-box").width(width); function next() { if (index < length) { index++; } else { $list.css({ left: 0, }); $list2.css({ left: 0, }); index = 1; } scroll(); } function prev() { console.log(987); if (index > 0) { index--; } else { $list.css({ left: -width * length, }); $list2.css({ left: -width * 0.2 * length, }); index = length - 1; } scroll(); } function scroll() { $list.stop().animate( { left: -width * index, }, speed ); $list2.stop().animate( { left: -width * 0.2 * index, }, speed ); $list2 .find(".carousel-thumb-item-box") .eq(index) .addClass("active") .siblings() .removeClass("active"); } if (autoplay) { timer = setInterval(function() { next(); }, duration); } $(window).bind({ resize: function() { clearInterval(timer); width = $this.width(); $list.find(".carousel-item-box").width(width); $list.css({ let: -width * index, }); if (autoplay) { timer = setInterval(function() { next(); }, duration); } }, }); $this.bind({ mouseenter: function() { clearInterval(timer); }, mouseleave: function() { if (autoplay) { timer = setInterval(function() { next(); }, duration); } }, }); $prev.bind({ click: function() { prev(); }, }); $next.bind({ click: function() { next(); }, }); $list2.find(".carousel-thumb-item-box").bind({ click: function() { if ($(this).index() >= length) { index = $(this).index() - length; } else { index = $(this).index(); } scroll(); }, }); }, scroll3D: function(params) { var $this = $("#" + params.id); var $list = $this.find(".carousel-list-box"); var $prev = $this.find(".prev"); var $next = $this.find(".next"); var length = $this.find(".carousel-item-box").length; var width = $this.width(); var index = 0; var autoplay = params.autoplay; var duration = params.duration; var speed = params.speed; var timer; $list.append($list.html()); $list .find(".carousel-item-box") .width(width * 0.3333) .eq(0) .addClass("prevs") .end() .eq(1) .addClass("active") .end() .eq(2) .addClass("nexts"); $list.find(".carousel-item-box").on("click", function() { index = $(this).index() - 1; scroll(); }); function next() { if (index < length) { index++; } else { $list.css({ left: 0, }); index = 1; } scroll(); } function prev() { if (index > 0) { index--; } else { $list.css({ left: -width * length, }); index = length - 1; } scroll(); } function scroll() { $list.stop().animate( { left: -width * 0.3333 * index, }, speed ); $list .find(".carousel-item-box") .eq(index) .addClass("prevs") .siblings() .removeClass("prevs"); $list .find(".carousel-item-box") .eq(index + 1) .addClass("active") .siblings() .removeClass("active"); $list .find(".carousel-item-box") .eq(index + 2) .addClass("nexts") .siblings() .removeClass("nexts"); } if (autoplay) { timer = setInterval(function() { next(); }, duration); } $(window).bind({ resize: function() { clearInterval(timer); width = $this.width(); $list.find(".carousel-item-box").width(width); $list.css({ let: -width * index, }); if (autoplay) { timer = setInterval(function() { next(); }, duration); } }, }); $this.bind({ mouseenter: function() { clearInterval(timer); }, mouseleave: function() { if (autoplay) { timer = setInterval(function() { next(); }, duration); } }, }); $prev.bind({ click: function() { prev(); }, }); $next.bind({ click: function() { next(); }, }); }, showVideoDialog: function(params) { var code = params.code; var soure = params.soure; var poster = params.poster || ""; var autoMode = params.autoMode; if (Number(soure) === 0) { window.videoDialogType = "player"; $("#videoPlayer").show(); if ($("#myVideo").length) { } else { if ($("#newVideo").length) { $("#newVideo").attr({ poster: poster, src: code, }); if (!autoMode) { newPlayer = document.getElementById("newVideo"); newPlayer.play(); } } } } else { window.videoDialogType = "iframe"; $("#videoIframe").show(); $("#videoIframe").html(code); } $("#videoPlayerDialog").show(); $("#videoPlayerDialog .video-player-close") .unbind() .on({ click: function() { app.hideVideoDialog(); }, }); }, hideVideoDialog: function(params) { if ($("#myVideo").length) { } if ($("#newVideo").length) { if (window.videoDialogType === "player") { newPlayer.pause(); } } $("#videoIframe") .hide() .html(""); $("#videoPlayer").hide(); if ($("#myVideo").length) { $("#myVideo").attr({ poster: "", }); $("#myVideo .source").attr({ src: "", }); } else { if ($("#newVideo").length) { $("#newVideo").attr({ poster: "", src: "", }); } } $("#videoPlayerDialog").hide(); }, download: function(url, name) { console.log(987); if (url == "" || name == "") { return; } if (url.indexOf(".pdf") > 0) { return window.open(url, "_blank"); } var xhr = new XMLHttpRequest(); xhr.open("GET", url, true); xhr.responseType = "blob"; xhr.onload = function() { if (xhr.status === 200) { if (window.navigator.msSaveOrOpenBlob) { navigator.msSaveBlob(xhr.response, name); } else { var link = document.createElement("a"); var body = document.querySelector("body"); link.href = window.URL.createObjectURL(xhr.response); link.download = name; link.style.display = "none"; body.appendChild(link); link.click(); body.removeChild(link); window.URL.revokeObjectURL(link.href); } } }; xhr.send(); }, formatForceNumber: function(obj) { obj.value = obj.value.replace(/[^\d.]/g, ""); obj.value = obj.value.replace(/\.{2,}/g, "."); obj.value = obj.value .replace(".", "$#$") .replace(/\./g, "") .replace("$#$", "."); obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3"); if (obj.value.indexOf(".") < 0 && obj.value != "") { obj.value = parseFloat(obj.value); } }, sendSms: function(name) { var that = this; var timer = 120; var scode = $("#scode-" + name); var phone = $('input[name="' + name + '"]') .val() .trim(); if (!phone.match(that.regular.phone)) { app.showToast({ title: toI18n("enterPhoneNo"), }); } else { $.post( SCENEID + "/sms", { phone: phone, }, function(res) { scode.attr({ "data-disabled": "disabled", }); function clicker() { timer -= 1; scode.text(timer + "S"); if (timer > 0) { setTimeout(clicker, 1000); } else { scode .removeAttr("data-disabled") .text(toI18n("sendVerificationCode")); } } clicker(); } ); } }, refreshHits: function(params) { $.post(SCENEID + "/view", params); }, }; var app = new application(); (function() { var $id = $(".ui-product-album-box"); var $list = $id.find(".ui-product-album"); var $dots = $id.find(".dots"); var $prev = $id.find(".prev"); var $next = $id.find(".next"); var $video = document.getElementById("mainVideo"); var width = $list.width(); var offset = 67; var interval = 5000; var index = 0; var timer; var autoplay = false; var length = $list.find(".auto-img-box").length; var NEED_SCROLL = length > 6; var HAS_VIDEO = !!$("#mainVideo").length; $list.find(".auto-img-box").width(width); $list.append($list.html()); if (NEED_SCROLL) { $dots.width(2 * length * offset); $dots.append($dots.html()); } if (length < 2) { $dots.remove(); } $dots .find(".auto-img-box") .eq(0) .addClass("active"); function prev() { if (index < 0) { $list.css({ left: -length * width, }); if (NEED_SCROLL) { $dots.css({ left: -length * offset, }); } index = length - 1; } $list.stop().animate({ left: -index * width, }); if (NEED_SCROLL) { $dots.stop().animate({ left: -index * offset, }); } videoStatus(); $dots .find(".auto-img-box") .eq(index) .addClass("active") .siblings() .removeClass("active"); } function next() { if (index >= length) { $list.css({ left: width, }); if (NEED_SCROLL) { $dots.css({ left: offset, }); } index = 0; } $list.stop().animate({ left: -index * width, }); if (NEED_SCROLL) { $dots.stop().animate({ left: -index * offset, }); } videoStatus(); $dots .find(".auto-img-box") .eq(index) .addClass("active") .siblings() .removeClass("active"); } function videoStatus() { if (HAS_VIDEO) { if (index === 0) { $video.paused && $video.play(); } else { $video.paused || $video.pause(); } } } $id.bind({ mouseenter: function() { if (autoplay) { clearInterval(timer); } }, mouseleave: function() { if (length > 1) { if (autoplay) { timer = setInterval(function() { index += 1; next(); }, interval); } } }, }); $dots.on("click", ".auto-img-box", function() { index = $(this).index(); next(); }); $prev.bind({ click: function() { index -= 1; prev(); }, }); $next.bind({ click: function() { index += 1; next(); }, }); if (length > 1) { if (autoplay) { timer = setInterval(function() { index += 1; next(); }, interval); } } // 放大镜功能 (function handleImgZoom($) { var previewContainer = $(".img-zoom-viewer"); var lastShowingImg = null; var showingImg = null; var $container = $(".ui-page-product-detail .loop-item"); var containerWidth = $container.width(); var containerHeight = $container.height(); var $zoomIcon = $container.find(".zoom-icon"); var $previewImgs = $(".img-zoom-viewer .target"); var targetImg = ""; // 全局偏移变量 var wider = false; //图片更宽还是更高 var left = 0; var top = 0; var imageScale = 1; previewContainer.css("height", containerHeight); function getPreviewImg(img) { var src = img.src; // targetImg = Array.from($previewImgs).find(item => item.src === src) targetImg = [].slice.call($previewImgs).find(function(item) { return item.src === src; }); } function getCurrentImg() { var $album = $(".ui-product-album"); var index = Math.abs(parseInt($album.css("left"))) / containerWidth; if (parseInt(index) !== index) return; var $img = $album.find("img.auto-img")[index]; return $img; } function ifImgTooSmall(img) { var naturalWidth = img.naturalWidth, naturalHeight = img.naturalHeight; return naturalWidth <= containerWidth && naturalHeight <= containerHeight; } function changeGlobalScale(img) { if (!img) return; var naturalWidth = img.naturalWidth, naturalHeight = img.naturalHeight, width = img.width, height = img.height; var containerAspectRatio = containerWidth / containerHeight; var imgAspectRatio = naturalWidth / naturalHeight; wider = imgAspectRatio > containerAspectRatio; if (wider) { imageScale = width / naturalWidth; } else { imageScale = height / naturalHeight; } } function handleSourceOffset(e) { var container = $container[0]; var containerRect = container.getBoundingClientRect(), containerY = containerRect.top, containerX = containerRect.left; var clientX = e.clientX, clientY = e.clientY; var iconWidth = $zoomIcon.width(); var iconHeight = $zoomIcon.height(); left = clientX - containerX - iconWidth / 2; top = clientY - containerY - iconHeight / 2; if (left <= 0) left = 0; if (left > containerWidth - iconWidth) left = containerWidth - iconWidth; if (top <= 0) top = 0; if (top > containerHeight - iconHeight) top = containerHeight - iconHeight; } function showIcon(e) { lastShowingImg = showingImg; showingImg = getCurrentImg(); if (!showingImg) return; if (ifImgTooSmall(showingImg)) { $zoomIcon.css({ visibility: "hidden", }); return $previewImgs.css("visibility", "hidden"); } changeGlobalScale(showingImg); $zoomIcon.css({ width: containerWidth * imageScale, height: containerHeight * imageScale, visibility: "visible", }); } function handleZoomIconMove(e) { lastShowingImg = showingImg; showingImg = getCurrentImg(); if (!showingImg) return; if (ifImgTooSmall(showingImg)) { $zoomIcon.css({ visibility: "hidden", }); return $previewImgs.css("visibility", "hidden"); } else if (lastShowingImg !== showingImg) { showIcon(e); } handleSourceOffset(e); $zoomIcon.css({ left: left, top: top, }); previewContainer.show(); var scaleLeft = -left / imageScale; var scaleTop = -top / imageScale; var naturalWidth = showingImg.naturalWidth; var naturalHeight = showingImg.naturalHeight; if (wider) scaleTop += (containerHeight - imageScale * naturalHeight) / 2 / imageScale; else scaleLeft += (containerWidth - imageScale * naturalWidth) / 2 / imageScale; $previewImgs.css("visibility", "hidden"); getPreviewImg(showingImg); if (targetImg) { $(targetImg).css("visibility", "visible"); } $(targetImg).css({ left: scaleLeft, top: scaleTop, }); } function handleMouseout() { $zoomIcon.css("visibility", "hidden"); previewContainer.hide(); } $(".ui-page-product-detail").on("mouseenter", ".loop-item", showIcon); $(".ui-page-product-detail").on( "mousemove", ".loop-item", handleZoomIconMove ); $(".ui-page-product-detail").on("mouseleave", ".loop-item", handleMouseout); })(jQuery); })(window, jQuery); (function() { var huxing_height = 260; var window_height = $(window).height(); var hid = ""; var timer; var $picker = $("#huxingPicker"); function getList(length) { return Array(length) .fill(void 0) .map(function(item, index) { return index + 1; }); } function ImproveListUnit(list, name) { return list.map(function(item) { return (item += name); }); } $(".form-huxing") .on("mouseenter", function() { var left = $(this).offset().left; var top = $(this).offset().top; var height = $(this).height(); var currentValue = $(this) .find("input") .val(); hid = $(this).attr("id"); var values = currentValue ? currentValue.split(",").map(Number) : [-1, -1, -1, -1, -1]; toI18n("bedroom"); var arrays = [ ImproveListUnit(getList(6), toI18n("bedroom")), ImproveListUnit(getList(6), toI18n("hall")), ImproveListUnit(getList(6), toI18n("kitchen")), ImproveListUnit(getList(6), toI18n("bathroom")), ImproveListUnit(getList(6), toI18n("balcony")), ]; var htmlArr = arrays.map(function(item, index) { var strArr = item.map(function(it, i) { var temp = i == values[index] ? '
' : "
"; temp += "" + it + "
"; return temp; }); return "
" + strArr.join("") + "
"; }); $picker.find(".list").html(htmlArr.join("")); var calcTop = top + height; if (top + height + huxing_height > window_height) { calcTop = top - huxing_height; } $picker .css({ left: left, top: calcTop, }) .show(); }) .on("mouseleave", function() { timer = setTimeout(function() { $picker.hide(); }, 300); }); $picker .on("mouseenter", function() { clearTimeout(timer); }) .on("mouseleave", function() { $(this).hide(); }) .on("click", "dd", function() { $(this) .addClass("active") .siblings() .removeClass("active"); var tempArr = []; var tempHtmlArr = []; $picker.find("dl").each(function() { $dd = $(this).find("dd.active"); if ($dd.length) { tempArr.push($dd.index()); tempHtmlArr.push( '' + $dd.children("span").text() + "" ); } else { tempArr.push(-1); } }); $("#" + hid) .find(".form-huxing-item-box") .html(tempHtmlArr.join("")) .next() .val(tempArr.join(",")); }); $(window).bind({ scroll: function() { window_height = $(window).height() + $(window).scrollTop(); }, }); })(window, jQuery); $.extend({ createModal: (function() { if ($.createModal) { $.createModal = $.createModal; return; } function toggleClass() { $(".jw-dialog .wrapper").toggleClass("in"); $(".jw-modal").toggleClass("in"); } $("body").on("click", ".jw-dialog", function(e) { if (e.target === this) { toggleClass(); setTimeout(function() { $(e.target).remove(); $(".jw-modal").remove(); }, 300); } }); return function(str) { if ($(".jw-dialog").length) return; var modalHtml = '
' + str + '
'; $("body").append(modalHtml); setTimeout(function() { toggleClass(); }, 0); }; })(), }); // 报价函数开始 !(function(t) { var n = {}; function a(e) { if (n[e]) return n[e].exports; var r = (n[e] = { i: e, l: !1, exports: {}, }); return t[e].call(r.exports, r, r.exports, a), (r.l = !0), r.exports; } (a.m = t), (a.c = n), (a.d = function(e, r, t) { a.o(e, r) || Object.defineProperty(e, r, { enumerable: !0, get: t, }); }), (a.r = function(e) { typeof Symbol !== "undefined" && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module", }), Object.defineProperty(e, "__esModule", { value: !0, }); }), (a.t = function(r, e) { if ((1 & e && (r = a(r)), 8 & e)) return r; if (4 & e && typeof r === "object" && r && r.__esModule) return r; var t = Object.create(null); if ( (a.r(t), Object.defineProperty(t, "default", { enumerable: !0, value: r, }), 2 & e && typeof r !== "string") ) for (var n in r) a.d( t, n, function(e) { return r[e]; }.bind(null, n) ); return t; }), (a.n = function(e) { var r = e && e.__esModule ? function() { return e.default; } : function() { return e; }; return a.d(r, "a", r), r; }), (a.o = function(e, r) { return Object.prototype.hasOwnProperty.call(e, r); }), (a.p = ""), a((a.s = 0)); })([ function(module, exports) { function _defineProperty(e, r, t) { return ( r in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0, }) : (e[r] = t), e ); } function _slicedToArray(e, r) { return ( _arrayWithHoles(e) || _iterableToArrayLimit(e, r) || _unsupportedIterableToArray(e, r) || _nonIterableRest() ); } function _nonIterableRest() { throw new TypeError( "Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." ); } function _unsupportedIterableToArray(e, r) { if (e) { if (typeof e === "string") return _arrayLikeToArray(e, r); var t = Object.prototype.toString.call(e).slice(8, -1); return ( t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set" ? Array.from(e) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(e, r) : void 0 ); } } function _arrayLikeToArray(e, r) { (r == null || r > e.length) && (r = e.length); for (var t = 0, n = new Array(r); t < r; t++) n[t] = e[t]; return n; } function _iterableToArrayLimit(e, r) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(e)) { var t = []; var n = !0; var a = !1; var o = void 0; try { for ( var i, l = e[Symbol.iterator](); !(n = (i = l.next()).done) && (t.push(i.value), !r || t.length !== r); n = !0 ); } catch (e) { (a = !0), (o = e); } finally { try { n || l.return == null || l.return(); } finally { if (a) throw o; } } return t; } } function _arrayWithHoles(e) { if (Array.isArray(e)) return e; } !(function(window, $) { var NUMBER_TYPE = 5; var USER_INPUT = 0; var STATIC = 1; var CAL = 2; var IS_PRODUCT = 1; var IS_IF = 2; var IS_IFS = 3; var id = 0; var fields = []; var cache = Object.create(null); var $currentForm = $("body"); var createModalHtml; function floatFormat(e) { return ( typeof e !== "string" && (e = parseFloat(e)), parseFloat(e.toFixed(2)) ); } function PRODUCT() { for (var e = arguments.length, r = new Array(e), t = 0; t < e; t++) r[t] = arguments[t]; return floatFormat( r.reduce(function(e, r) { return e * r; }, 1) ); } function IF(e, r, t) { return floatFormat(Number(e ? r || 0 : t || 0)); } function IFS(calc) { return ( (calc = calc .split(";") .map(function(e) { return e.replace(/\,/g, "?"); }) .join(":") + ":0"), floatFormat(Number(eval(calc))) ); } function parseCal(e) { return e .split("-") .map(function(e) { var r = _slicedToArray(e.split(":"), 2); var t = r[0]; var n = r[1]; return ( t === "v" && (n = "{".concat(n, "}")), t === "c" && (n = ""), n ); }) .join("") .replace(/([}\d])(=)([{\d])/g, "$1===$3") .replace(/\{((?:.|\n)+?)\}/g, "getFieldPrice($&)") .replace(/[{}]/g, ""); } function getDetailField(r) { return fields.find(function(e) { return e.id === r; }); } function getOfferDetail(e) { function r(e) { return { label: getFieldLabel(e), price: getFieldPrice(e), }; } return Array.isArray(e) ? e.map(r) : r(e); } function getFieldLabel(e) { return getDetailField(e).label; } function getFieldPrice(e) { if (cache[e]) return cache[e]; if (id++ > 299) throw new Error("函数之间不能循环调用!"); var r = null; var t = getDetailField(e); if (!t || t.format !== NUMBER_TYPE) return 0; var n = t.h; var a = t.calcType; return ( n === USER_INPUT && (r = parseFloat($currentForm.find('[name="'.concat(e, '"]')).val()) || 0), n === STATIC && (r = parseFloat(t.data) || 0), n === CAL && (r = getCalValue(parseCal(t.calc), a)), (cache[e] = r) ); } function getCalValue(calc, type) { var _calMap; var calMap = ((_calMap = {}), _defineProperty(_calMap, IS_PRODUCT, function() { return eval("PRODUCT(".concat(calc, ")")); }), _defineProperty(_calMap, IS_IF, function() { return eval("IF(".concat(calc, ")")); }), _defineProperty(_calMap, IS_IFS, function() { return IFS(calc); }), _calMap); return calMap[type](); } function toggleClass() { $(".jw-offer-dialog .offer-modal").toggleClass("in"), $(".jw-modal").toggleClass("in"); } (window.startOffer = function(e) { var r = e.offer; var t = e._id; if ( ((fields = e.fields), (id = 0), ($currentForm = $(t ? "#ui-".concat(t) : "body")), (cache = Object.create(null)), r && window.$) ) { var n = r.tot.fieldId; var a = r.det.map(function(e) { return e.fieldId; }); return { main: getOfferDetail(n), detail: getOfferDetail(a), }; } }), $.createOfferModal || ($("body").on("click", ".close-button", function(e) { toggleClass(), setTimeout(function() { $(".jw-offer-dialog").remove(), $(".jw-modal").remove(); }, 300); }), (createModalHtml = function(e) { var r = startOffer(e); var t = $( '\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n ' ); var n = r.main; var a = n.label; var o = n.price; var i = r.detail; var l = "\n " + toI18n("your") + '' .concat( a, '\n
' ) .concat(o, "" + toI18n("RMB") + "
\n "); var c = i .map(function(e) { var r = e.label; var t = e.price; return '\n
\n ' .concat(r, '') .concat( t, "" + toI18n("RMB") + "\n
\n " ); }) .join(""); return ( t.find(".main").append(l), t.find(".content").append(c), i.length || t.find(".content").remove(), t ); }), $.extend({ createOfferModal: function(e) { $(".jw-offer-dialog").length || ($("body").append(createModalHtml(e)), setTimeout(function() { toggleClass(); }, 0)); }, })); })(window, jQuery); }, ]); // 报价函数结束 // 百度推送代码 (function() { var script = document.createElement("script"); script.src = "//push.zhanzhang.baidu.com/push.js"; if (/^https/.test(window.location.protocol)) { script.src = "//zz.bdstatic.com/linksubmit/push.js"; } document.body.appendChild(script); })(); (function() { $(".ui-page-product-list .category-aside-icon-arrow").on("click", function() { if ( $(this) .parents(".category-aside-item") .hasClass("active") ) { $(this) .parents(".category-aside-item") .removeClass("active"); } else { $(this) .parents(".category-aside-item") .addClass("active"); } }); $(".ui-page-product-list .category-aside-item-link.active").on( "click", function() { if ( $(this) .parents(".category-aside-item") .hasClass("active") ) { $(this) .parents(".category-aside-item") .removeClass("active"); } else { $(this) .parents(".category-aside-item") .addClass("active"); } } ); $(".ui-page-product-list .category-aside-item-link.active") .parent() .addClass("active") .parents(".category-aside-item") .addClass("active"); })(); // ui-map地图渲染函数开始 function createMapInfo(marker) { var detail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var caption = detail.caption; var address = detail.address; var contact = detail.contact; var et = detail.et; var extendInfo = (et || []) .map(function(_ref) { var caption = _ref.caption; var v = _ref.v; if (!caption || !v) return ""; return "
".concat(caption, "\uFF1A").concat(v, "
"); }) .join(""); var infoWindow = new BMap.InfoWindow( '\n
\n

' .concat(caption, "

\n
") .concat(address, "
\n
\u8054\u7CFB\u7535\u8BDD\uFF1A") .concat(contact, "
\n ") .concat(extendInfo, "\n
\n ") ); marker.addEventListener("click", function() { marker.openInfoWindow(infoWindow); }); } function addOverLays(map, addressDetailList) { return addressDetailList.map(function(item, i) { var lng = item.lng; var lat = item.lat; var point = null; var marker = new BMap.Marker((point = new BMap.Point(lng, lat))); map.addOverlay(marker); marker.setAnimation(window.BMAP_ANIMATION_BOUNCE); createMapInfo(marker, item); return point; }); } function renderOverLays(map, addressDetailList, scale) { scale = scale || 14; if (addressDetailList.length > 1) { var pointList = addOverLays(map, addressDetailList); map.setViewport(pointList); } else if (addressDetailList.length === 1) { var pointList = addOverLays(map, addressDetailList); var view = map.getViewport(pointList); map.centerAndZoom(view.center, scale); } else { map.centerAndZoom("长沙市", scale); } map.enableScrollWheelZoom(true); } // ui-map地图渲染函数结束 /** * 不兼容火狐 */ // window.onload = function () { // // 响应小屏幕展现效果 // // window.screen.width // // window.innerWidth // console.log(`window.innerWidth: ${window.innerWidth}`) // console.log(`window.screen.width: ${window.screen.width}`) // console.log(`document.body.scrollWidth: ${document.body.scrollWidth}`) // // document.body.style.zoom = Math.floor(window.innerWidth / document.body.scrollWidth * 100) / 100 // const zoom = Math.floor(window.screen.width / document.body.scrollWidth * 100) / 100 // if (zoom < 1) { // document.body.style.zoom = zoom // } // }; /******************* * 弹窗 */ (function() { // 洗劫所有A链接 $("a").each(function() { var href = Number($(this).attr("href")); if (typeof href === "number" && !isNaN(href) && href > 0) { $(this).attr({ href: "javascript:showDialogLayer(" + href + ");", }); } }); // 关闭弹窗 $(".saas-dialog").on("click", ".saas-dialog-close", function() { $(this) .parents(".saas-dialog") .hide(); if ($(this).parents(".saas-dialog-auto").length) { var showtype = $(".saas-dialog-auto").attr("data-showtype"); var opentype = $(".saas-dialog-auto").attr("data-opentype"); if (showtype) { if (opentype > 0) { setTimeout(function() { $(".saas-dialog-auto") .find(".saas-dialog") .show(); }, opentype * 1000); } } } }); // 自动弹窗 if ($(".saas-dialog-auto").length) { var showtype = $(".saas-dialog-auto").attr("data-showtype"); var opentype = $(".saas-dialog-auto").attr("data-opentype"); if (showtype === "true") { setTimeout(function() { $(".saas-dialog-auto") .find(".saas-dialog") .show(); }, opentype * 1000); } } })(); // 打开弹窗 function showDialogLayer(dialogId) { if ($("#saas-dialog-" + dialogId).length) { var $dialog = $("#saas-dialog-" + dialogId).find(".saas-dialog"); $dialog.show(); } } // 补全字符串 function prefixZero(num, n) { return (Array(n).join(0) + num).slice(-n); } // 格式化千分位 function thousandTextSeparator(num, isSep) { num = String(num).replace(/,/g, ""); if (isSep) { var reg = /\d{1,3}(?=(\d{3})+$)/g; return (num + "").replace(reg, "$&,"); } else { return num; } } (function() { if ($(".ui-page-product-introduction").length) { // 产品详情 var $content = $(".ui-page-product-introduction"); $(".ui-page-product-introduction table").each(function(index, item) { $(item).after('
' + item.outerHTML + "
"); $(item).remove(); }); } if ($(".ui-page-article-content").length) { // 产品详情 var $content = $(".ui-page-article-content"); $(".ui-page-article-content table").each(function(index, item) { $(item).after('
' + item.outerHTML + "
"); $(item).remove(); }); } })(window, jQuery); /** * 统计代码 */ (function() { if (!$("#hasTongji").length) return false; if (!$("#jwTongji").length) return false; var html = ""; if ($("#jwTongji a").length) { $("#jwTongji a").each(function(index, item) { var link = $(item).addClass("ui-copy-right-item-link")[0].outerHTML; if ( item.outerHTML.indexOf("https://www.cnzz.com/stat/website.php") >= 0 ) { // cnzz html = link; } else if ( item.outerHTML.indexOf("https://uweb.umeng.com/v1/login.php") >= 0 ) { // umeng html = link; } else { // other html = link; } }); } else { // no creat link var script = $("#jwTongji").html(); if (script.indexOf("https://hm.baidu.com/hm.js") >= 0) { // baidu html = '站长统计'; } else if ( script.indexOf("http://mps.jwyun.net/mps_collection/v1/visit") >= 0 ) { // mps html = '站长统计'; } else if (script.indexOf("cnzz.com") >= 0) { // cnzz $("#jwTongji") .find("script") .each(function(index, item) { if ($(item).attr("src")) { var webids = $(item) .attr("src") .split("?") .reverse(); if (webids.length) { var webid = webids[0]; html = '站长统计'; } else { html = '站长统计'; } } }); } } if ($("#jwTongjLabel").length) { var url = $("#jwTongjLabel").attr("data-url"); var text = $("#jwTongjLabel").attr("data-text"); var eleStr = '' + text + ""; if ($.trim(url)) { $("#jwTongjLabel").append(eleStr); } else { $("#jwTongjLabel").append(html); } if ($("#jwTongjLabel img").length) { $('#jwTongjLabel').addClass('ui-copy-right-block'); } } })(window, jQuery);