/*! www.xiaomi.com - v1.1.0 - 2014 */ if ("undefined" == typeof XIAOMI || !XIAOMI) var XIAOMI = {}; XIAOMI.namespace = function () { var i, j, d, a = arguments, o = null; for (i = 0; i < a.length; i += 1) for (d = ("" + a[i]).split("."), o = XIAOMI, j = "XIAOMI" == d[0] ? 1 : 0; j < d.length; j += 1) o[d[j]] = o[d[j]] || {}, o = o[d[j]]; return o }, XIAOMI.lang = XIAOMI.lang || {}, function () { var L = XIAOMI.lang, OP = Object.prototype, ARRAY_TOSTRING = "[object Array]", FUNCTION_TOSTRING = "[object Function]", OBJECT_TOSTRING = "[object Object]", NOTHING = [], HTML_CHARS = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'", "/": "/", "`": "`" }, ADD = ["toString", "valueOf"], OB = { isArray: function (o) { return OP.toString.apply(o) === ARRAY_TOSTRING }, isBoolean: function (o) { return "boolean" == typeof o }, isFunction: function (o) { return "function" == typeof o || OP.toString.apply(o) === FUNCTION_TOSTRING }, isNull: function (o) { return null === o }, isNumber: function (o) { return "number" == typeof o && isFinite(o) }, isObject: function (o) { return o && ("object" == typeof o || L.isFunction(o)) || !1 }, isString: function (o) { return "string" == typeof o }, isUndefined: function (o) { return "undefined" == typeof o }, _IEEnumFix: -[1] ? function () { } : function (r, s) { var i, fname, f; for (i = 0; i < ADD.length; i += 1) fname = ADD[i], f = s[fname], L.isFunction(f) && f != OP[fname] && (r[fname] = f) }, escapeHTML: function (html) { return html.replace(/[&<>"'\/`]/g, function (match) { return HTML_CHARS[match] }) }, preventDefault: function (e) { e.preventDefault ? e.preventDefault() : e.returnValue = !1 }, extend: function (subc, superc, overrides) { if (!superc || !subc) throw new Error("extend failed, please check that all dependencies are included."); var i, F = function () { }; if (F.prototype = superc.prototype, subc.prototype = new F, subc.prototype.constructor = subc, subc.superclass = superc.prototype, superc.prototype.constructor == OP.constructor && (superc.prototype.constructor = superc), overrides) { for (i in overrides) L.hasOwnProperty(overrides, i) && (subc.prototype[i] = overrides[i]); L._IEEnumFix(subc.prototype, overrides) } }, augmentObject: function (r, s) { if (!s || !r) throw new Error("Absorb failed, verify dependencies."); var i, p, a = arguments, overrideList = a[2]; if (overrideList && overrideList !== !0) for (i = 2; i < a.length; i += 1) r[a[i]] = s[a[i]]; else { for (p in s) !overrideList && p in r || (r[p] = s[p]); L._IEEnumFix(r, s) } return r }, augmentProto: function (r, s) { if (!s || !r) throw new Error("Augment failed, verify dependencies."); var i, a = [r.prototype, s.prototype]; for (i = 2; i < arguments.length; i += 1) a.push(arguments[i]); return L.augmentObject.apply(this, a), r }, dump: function (o, d) { var i, len, s = [], OBJ = "{...}", FUN = "f(){...}", COMMA = ", ", ARROW = " => "; if (!L.isObject(o)) return o + ""; if (o instanceof Date || "nodeType" in o && "tagName" in o) return o; if (L.isFunction(o)) return FUN; if (d = L.isNumber(d) ? d : 3, L.isArray(o)) { for (s.push("["), i = 0, len = o.length; len > i; i += 1) s.push(L.isObject(o[i]) ? d > 0 ? L.dump(o[i], d - 1) : OBJ : o[i]), s.push(COMMA); s.length > 1 && s.pop(), s.push("]") } else { s.push("{"); for (i in o) L.hasOwnProperty(o, i) && (s.push(i + ARROW), s.push(L.isObject(o[i]) ? d > 0 ? L.dump(o[i], d - 1) : OBJ : o[i]), s.push(COMMA)); s.length > 1 && s.pop(), s.push("}") } return s.join("") }, substitute: function (s, o, f, recurse) { for (var i, j, k, key, v, meta, token, dump, objstr, saved = [], lidx = s.length, DUMP = "dump", SPACE = " ", LBRACE = "{", RBRACE = "}"; (i = s.lastIndexOf(LBRACE, lidx), !(0 > i)) && (j = s.indexOf(RBRACE, i), !(i + 1 > j)); ) token = s.substring(i + 1, j), key = token, meta = null, k = key.indexOf(SPACE), k > -1 && (meta = key.substring(k + 1), key = key.substring(0, k)), v = o[key], f && (v = f(key, v, meta)), L.isObject(v) ? L.isArray(v) ? v = L.dump(v, parseInt(meta, 10)) : (meta = meta || "", dump = meta.indexOf(DUMP), dump > -1 && (meta = meta.substring(4)), objstr = v.toString(), v = objstr === OBJECT_TOSTRING || dump > -1 ? L.dump(v, parseInt(meta, 10)) : objstr) : L.isString(v) || L.isNumber(v) || (v = "~-" + saved.length + "-~", saved[saved.length] = token), s = s.substring(0, i) + v + s.substring(j + 1), recurse === !1 && (lidx = i - 1); for (i = saved.length - 1; i >= 0; i -= 1) s = s.replace(new RegExp("~-" + i + "-~"), "{" + saved[i] + "}", "g"); return s }, trim: function (s) { try { return s.replace(/^\s+|\s+$/g, "") } catch (e) { return s } }, merge: function () { var i, o = {}, a = arguments, l = a.length; for (i = 0; l > i; i += 1) L.augmentObject(o, a[i], !0); return o }, later: function (when, o, fn, data, periodic) { when = when || 0, o = o || {}; var f, r, m = fn, d = data; if (L.isString(fn) && (m = o[fn]), !m) throw new TypeError("method undefined"); return L.isUndefined(data) || L.isArray(d) || (d = [data]), f = function () { m.apply(o, d || NOTHING) }, r = periodic ? setInterval(f, when) : setTimeout(f, when), { interval: periodic, cancel: function () { this.interval ? clearInterval(r) : clearTimeout(r) } } }, isValue: function (o) { return L.isObject(o) || L.isString(o) || L.isNumber(o) || L.isBoolean(o) } }; L.hasOwnProperty = OP.hasOwnProperty ? function (o, prop) { return o && o.hasOwnProperty && o.hasOwnProperty(prop) } : function (o, prop) { return !L.isUndefined(o[prop]) && o.constructor.prototype[prop] !== o[prop] }, OB.augmentObject(L, OB, !0), L.augment = L.augmentProto, XIAOMI.augment = L.augmentProto, XIAOMI.extend = L.extend } (); ; (function () { function parse(s, buf, offset) { var i = buf && offset || 0, ii = 0; for (buf = buf || [], s.toLowerCase().replace(/[0-9a-f]{2}/g, function (oct) { 16 > ii && (buf[i + ii++] = _hexToByte[oct]) }); 16 > ii; ) buf[i + ii++] = 0; return buf } function unparse(buf, offset) { var i = offset || 0, bth = _byteToHex; return bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + "-" + bth[buf[i++]] + bth[buf[i++]] + "-" + bth[buf[i++]] + bth[buf[i++]] + "-" + bth[buf[i++]] + bth[buf[i++]] + "-" + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] } function v1(options, buf, offset) { var i = buf && offset || 0, b = buf || []; options = options || {}; var clockseq = null != options.clockseq ? options.clockseq : _clockseq, msecs = null != options.msecs ? options.msecs : (new Date).getTime(), nsecs = null != options.nsecs ? options.nsecs : _lastNSecs + 1, dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 1e4; if (0 > dt && null == options.clockseq && (clockseq = clockseq + 1 & 16383), (0 > dt || msecs > _lastMSecs) && null == options.nsecs && (nsecs = 0), nsecs >= 1e4) throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); _lastMSecs = msecs, _lastNSecs = nsecs, _clockseq = clockseq, msecs += 122192928e5; var tl = (1e4 * (268435455 & msecs) + nsecs) % 4294967296; b[i++] = tl >>> 24 & 255, b[i++] = tl >>> 16 & 255, b[i++] = tl >>> 8 & 255, b[i++] = 255 & tl; var tmh = msecs / 4294967296 * 1e4 & 268435455; b[i++] = tmh >>> 8 & 255, b[i++] = 255 & tmh, b[i++] = tmh >>> 24 & 15 | 16, b[i++] = tmh >>> 16 & 255, b[i++] = clockseq >>> 8 | 128, b[i++] = 255 & clockseq; for (var node = options.node || _nodeId, n = 0; 6 > n; n++) b[i + n] = node[n]; return buf ? buf : unparse(b) } function v4(options, buf, offset) { var i = buf && offset || 0; "string" == typeof options && (buf = "binary" == options ? new BufferClass(16) : null, options = null), options = options || {}; var rnds = options.random || (options.rng || _rng)(); if (rnds[6] = 15 & rnds[6] | 64, rnds[8] = 63 & rnds[8] | 128, buf) for (var ii = 0; 16 > ii; ii++) buf[i + ii] = rnds[ii]; return buf || unparse(rnds) } var _rng, _global = this; if ("function" == typeof require) try { var _rb = require("crypto").randomBytes; _rng = _rb && function () { return _rb(16) } } catch (e) { } if (!_rng && _global.crypto && crypto.getRandomValues) { var _rnds8 = new Uint8Array(16); _rng = function () { return crypto.getRandomValues(_rnds8), _rnds8 } } if (!_rng) { var _rnds = new Array(16); _rng = function () { for (var r, i = 0; 16 > i; i++) 0 === (3 & i) && (r = 4294967296 * Math.random()), _rnds[i] = r >>> ((3 & i) << 3) & 255; return _rnds } } for (var BufferClass = "function" == typeof Buffer ? Buffer : Array, _byteToHex = [], _hexToByte = {}, i = 0; 256 > i; i++) _byteToHex[i] = (i + 256).toString(16).substr(1), _hexToByte[_byteToHex[i]] = i; var _seedBytes = _rng(), _nodeId = [1 | _seedBytes[0], _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5]], _clockseq = 16383 & (_seedBytes[6] << 8 | _seedBytes[7]), _lastMSecs = 0, _lastNSecs = 0, uuid = v4; if (uuid.v1 = v1, uuid.v4 = v4, uuid.parse = parse, uuid.unparse = unparse, uuid.BufferClass = BufferClass, _global.define && define.amd) define(function () { return uuid }); else if ("undefined" != typeof module && module.exports) module.exports = uuid; else { var _previousRoot = _global.uuid; uuid.noConflict = function () { return _global.uuid = _previousRoot, uuid }, _global.uuid = uuid } }).call(this); ; XIAOMI.namespace("app.analytics"), XIAOMI.app.analytics = function (element, options) { this.options = { page: "首页", position: ["A1"], url: !0, BDurl: !0, mstSite: "CN-WW", mstPage: "PC", mstArea: "RM", mstPosition: ["A"], mstHostParams: "", isMst: !1, JQelement: !1 }; for (var p in options) this.options[p] = options[p]; for (var _this = this, isUrl = _this.options.url ? !0 : !1, isBDurl = _this.options.BDurl ? !0 : !1, bindFunction = function (links) { $.each(links, function (k, v) { var mstParamString = isUrl ? $(v).attr("href") : XIAOMI.lang.trim($(v).text()), BDparamString = isBDurl ? $(v).attr("href") : XIAOMI.lang.trim($(v).text()), paramIndex = k, BDparmas_1 = _this.options.page, BDparmas_2 = BDparmas_1 + "_" + _this.options.position[i] + "_" + paramIndex, BDparmas_3 = BDparmas_2 + "_" + BDparamString, BDparmas = "'PC','" + BDparmas_3 + "'", mstParmas = "'" + _this.options.mstSite + "-" + _this.options.mstPage + "-" + _this.options.mstArea + "-" + _this.options.mstPosition[i] + paramIndex + "', '" + mstParamString; mstParmas = mstParmas += "" === _this.options.mstHostParams ? "', '" + paramIndex + "'" : "', '" + _this.options.mstHostParams + "'", _this.options.isMst ? $(v).attr("onclick", "_msq.push(['trackEvent'," + mstParmas + "]);_hmt.push(['_trackEvent'," + BDparmas + "]);") : $(v).attr("onclick", "_hmt.push(['_trackEvent'," + BDparmas + "]);") }) }, i = 0; i < element.length; i++) { var links = _this.options.JQelement ? element[i] : $(element[i]).find("a"); bindFunction(links) } }, XIAOMI.namespace("app.updateMiniCart, app.addShopCart, app.addShopCartEvent"), XIAOMI.app.updateMiniCart = function () { var num = XIAOMI.app.cookie("xm_user_www_num"); return num && parseFloat(num) > 0 ? ($(".J_cartNum").html("(" + num + ")").show(), num) : ($(".J_cartNum").html("").hide(), 0) }, XIAOMI.app.addShopCart = function (gid, callback, obj) { if (gid && "function" == typeof callback) { var ajaxUrl = XIAOMI.GLOBAL_CONFIG.orderSite + "/cart/add/" + gid; $.ajax({ url: ajaxUrl, dataType: "jsonp", jsonp: "jsonpcallback", success: function (data) { callback(data, obj), XIAOMI.app.updateMiniCart() } }) } }, XIAOMI.app.addShopCartEvent = function (options) { var op = { obj: ".xmAddShopCart", callback: null }; $.extend(op, options || {}), $(document).on("click", op.obj, function () { var gid = $(this).attr("data-gid"), isDisabled = $(this).attr("data-disabled"), isPackage = $(this).attr("data-package"); if ("false" === isDisabled) { if ($(this).attr("data-disabled", "true"), !gid || "true" === isPackage || null === op.callback) return !0; var dmSkuArr = XIAOMI.GLOBAL_CONFIG.damiaoGoodsId ? XIAOMI.GLOBAL_CONFIG.damiaoGoodsId : !1, isToDm = !1; if (dmSkuArr !== !1 && "object" == typeof dmSkuArr) for (var i = 0; i < dmSkuArr.length; i += 1) if (gid === dmSkuArr[i]) { isToDm = !0; break } if (isToDm === !0) { var dmLogin = new XIAOMI.app.miniLogin; XIAOMI.app.cookie("serviceToken") ? XIAOMI.app.dmFun.init({ sku: gid, callback: op.callback, obj: $(this) }) : XIAOMI.app.cookie("userId") ? (dmLogin._proxyiframe(), XIAOMI.app.dmFun.init({ sku: gid, callback: op.callback, obj: $(this) })) : dmLogin._toLogin() } else XIAOMI.app.addShopCart(gid, op.callback, $(this)) } return !1 }) }, function () { for (var method, noop = function () { }, methods = ["assert", "clear", "count", "debug", "dir", "dirxml", "error", "exception", "group", "groupCollapsed", "groupEnd", "info", "log", "markTimeline", "profile", "profileEnd", "table", "time", "timeEnd", "timeStamp", "trace", "warn"], length = methods.length, console = window.console = window.console || {}; length--; ) method = methods[length], console[method] || (console[method] = noop) } (), XIAOMI.namespace("app.cookie"), XIAOMI.app.cookie = function (key, value, options) { if (arguments.length > 1 && "[object Object]" !== String(value)) { if (options = jQuery.extend({}, options), (null === value || void 0 === value) && (options.expires = -1), "number" == typeof options.expires) { var days = options.expires, t = options.expires = new Date; t.setDate(t.getDate() + days) } return value = String(value), document.cookie = [encodeURIComponent(key), "=", options.raw ? value : encodeURIComponent(value), options.expires ? "; expires=" + options.expires.toUTCString() : "", options.path ? "; path=" + options.path : "", options.domain ? "; domain=" + options.domain : "", options.secure ? "; secure" : ""].join("") } options = value || {}; var result, decode = options.raw ? function (s) { return s } : decodeURIComponent; return (result = new RegExp("(?:^|; )" + encodeURIComponent(key) + "=([^;]*)").exec(document.cookie)) ? decode(result[1]) : null }, XIAOMI.namespace("app.dmFun"), XIAOMI.app.dmFun = { init: function (options) { this.config = { sku: null, callback: null, obj: null, sourceVal: "bigtap" }, this.inTheQueue = !1, $.extend(this.config, options), this.startQueue(), this.getDmSys(); var _this = this; $("#xmDmReload").on("click", function () { _this.config.obj.trigger("click") }) }, getDmSys: function () { var _this = this, hdget = XIAOMI.GLOBAL_CONFIG.damiaoSite + "hdget/cn?source=" + _this.config.sourceVal + "&product=" + _this.config.sku + "&addcart=1&m=1&_=" + (new Date).getTime(); $.ajax({ type: "GET", url: hdget, dataType: "jsonp", jsonp: "jsonpcallback", jsonpCallback: "hdcontrol", timeout: 3e4, error: function () { return _this.inTheQueue ? (_this.stopQueue(), void $("#xmDmError").modal({ show: !0, backdrop: "static" })) : !1 }, success: function (data) { var jsonStr = data.status, token = jsonStr[_this.config.sku].hdurl, isOver = jsonStr[_this.config.sku].hdstart === !1 && jsonStr[_this.config.sku].hdstop === !0 ? !0 : !1, speed = data.d22a51 ? 1e3 * data.d22a51 : 5e3; return _this.inTheQueue ? isOver === !0 ? (_this.stopQueue(), alert("抱歉,商品已售罄!"), !1) : (_this.getDmTimer && clearInterval(_this.getDmTimer), void (token ? _this.getShopCart(token) : (_this.inTheQueue || _this.startQueue(), _this.getDmTimer = setInterval(function () { _this.getDmSys() }, speed)))) : !1 } }) }, getShopCart: function (token) { if (!token) return !1; var _this = this, addCart = XIAOMI.GLOBAL_CONFIG.orderSite + "/cart/add/" + this.config.sku + "?source=" + _this.config.sourceVal + "&token=" + token; $.ajax({ type: "GET", url: addCart, dataType: "jsonp", jsonp: "jsonpcallback", success: function (data) { _this.stopQueue(), _this.config.callback(data, _this.config.obj), XIAOMI.app.updateMiniCart() } }) }, startQueue: function () { var _this = this; $("#xmDmError").modal("hide"), $("#xmDmQueue").modal({ show: !0, backdrop: "static" }), _this.queueAnimate(), _this.inTheQueue = !0, $("#xmDmQueue").on("hidden.bs.modal", function () { _this.stopQueue(), _this.config.obj.attr("data-disabled", "false") }) }, stopQueue: function () { $("#xmDmQueue").modal("hide"), this.inTheQueue = !1, this.getDmTimer && clearInterval(this.getDmTimer), window.queueAnimateTimer && clearInterval(queueAnimateTimer) }, queueAnimate: function () { var flag = 0, speed = 200, loop = function () { flag -= 90, -900 >= flag && (flag = 0), $("#mituWalking").css({ "background-position": flag + "px 0" }) }; window.queueAnimateTimer = setInterval(loop, speed) }, showLoading: function () { var _this = this; $("#getDmLoading").modal("show"), $("#getDmLoading").on("hidden.bs.modal", function () { _this.config.obj.attr("data-disabled", "false") }) }, hideLoading: function () { $("#getDmLoading").modal("hide") } }, XIAOMI.namespace("app.footer"), XIAOMI.app.footer = { init: function () { var _this = this; _this.retinizer(), _this.weixin(), _this.siteList(), XIAOMI.app.analytics([".J_menuNavMain"], { page: "导航", position: ["A"], mstPage: "HP", mstArea: "NV", mstPosition: ["A"], isMst: !0 }) }, retinizer: function () { var img = new Image; if ("srcset" in img) return !1; if ("undefined" == typeof window.devicePixelRatio || window.devicePixelRatio <= 1.5) return !1; var $img = $("img"); $img.each(function () { var srcset = $(this).attr("srcset"); srcset && srcset.split(" 2x")[0] && $(this).attr("src", srcset.split(" 2x")[0]) }) }, siteList: function () { $(".J_globalList").on({ mouseenter: function () { $(this).find(".global-site-list").show() }, mouseleave: function () { $(this).find(".global-site-list").hide() } }) }, weixin: function () { $(".J_modalWeixin").on("click", function () { var $modalWeixin = $("#J_modalWeixin"); $modalWeixin.css({ width: $modalWeixin.attr("data-width"), height: $modalWeixin.attr("data-height") }).modal({ backdrop: !0, keyboard: !0, show: !0 }) }) } }, XIAOMI.namespace("app.getRegions"), XIAOMI.app.getRegions = { getUrl: "/region/index", getData: function (parent, target, sId) { var _this = this; $.ajax({ type: "GET", url: _this.getUrl, data: "parent=" + parent, dataType: "json", success: function (data) { data && _this.formatData(data, target, sId) } }) }, formatData: function (jsonData, target, sId) { for (var dataArray = jsonData.regions, lens = dataArray.length, obj = $("#" + target), options = "", i = 0; lens > i; i += 1) { var isSelected = dataArray[i].region_id === sId ? "selected" : ""; options += "" } $("#" + target).html(options).attr("disabled", !1) } }, XIAOMI.namespace("app.History"), XIAOMI.app.History = function () { var historyVal = XIAOMI.app.cookie("XM_scan_history"), itemArray = null, goodsUrl = null; if (!historyVal) return !1; historyVal = historyVal.split("#m#"); for (var lens = historyVal.length - 1, objArr = [], i = 0; lens > i; i++) { itemArray = historyVal[i].split(","), goodsUrl = XIAOMI.GLOBAL_CONFIG.wwwSite + "/item/" + itemArray[3]; var pro = {}; pro.imgUrl = itemArray[0], pro.goodsUrl = goodsUrl, pro.name = itemArray[1], pro.price = itemArray[2], pro.starClass = itemArray[4], pro.gid = itemArray[3], objArr.push(pro) } return objArr }, XIAOMI.namespace("app.lazyLoad"), XIAOMI.app.lazyLoad = function (option) { var settings = { defObj: "#lazyLoad-box", defHeight: 50 }; settings = $.extend(settings, option || {}); var defObj = (settings.defHeight, "object" == typeof settings.defObj ? settings.defObj.find("img") : $(settings.defObj).find("img")), isIpad = "ipad" === navigator.userAgent.toLowerCase().match(/iPad/i) ? !0 : !1, pageTop = function () { var d = document, y = isIpad ? window.pageYOffset : Math.max(d.documentElement.scrollTop, d.body.scrollTop); return isIpad && (settings.defHeight = 0), d.documentElement.clientHeight + y + settings.defHeight }, rechangeSrc = function (obj) { var src2 = obj.attr("src2"); src2 && obj.css({ opacity: "0.3" }).attr("src", src2).removeAttr("src2").animate({ opacity: "1" }) }, imgLoad = function () { defObj.each(function () { isIpad ? rechangeSrc($(this)) : $(this).offset().top <= pageTop() && rechangeSrc($(this)) }) }; imgLoad(), $(window).bind("scroll", function () { imgLoad() }), $(window).bind("resize", function () { imgLoad() }) }, XIAOMI.namespace("app.miniCart"), XIAOMI.app.miniCart = { elmCartBtn: $("#J_miniCart"), elmCartList: $("#J_miniCartList"), loadingStr: '

数据加载中,请稍后...

', speed: 500, init: function () { var _this = this, timeOut = null; return "undefined" != typeof miniCartDisable && miniCartDisable ? !1 : "undefined" != typeof XIAOMI.GLOBAL_CONFIG.closeMiniCart && "1" === XIAOMI.GLOBAL_CONFIG.closeMiniCart ? !1 : (_this.elmCartBtn.on({ mouseenter: function () { clearTimeout(timeOut), $(this).hasClass("mini-cart-on") || ($(this).addClass("mini-cart-on"), _this.show(), _this.getData()) }, mouseleave: function () { timeOut = setTimeout(function () { _this.close() }, _this.speed) } }), _this.elmCartList.on({ mouseenter: function () { clearTimeout(timeOut) }, mouseleave: function () { timeOut = setTimeout(function () { _this.close() }, _this.speed) } }), void _this.elmCartList.on("click", ".delItem", function (e) { var gId = $(this).attr("gid"), isBigtap = $(this).attr("data-isbigtap"); return "true" !== isBigtap || confirm("您正在删除开放购买活动商品\n\n删除后您失去本次开放购买资格,无法下单购买此商品。\n确认删除此商品吗?") ? (e.preventDefault(), void _this.delGoods(gId)) : !1 })) }, show: function () { var _this = this; _this.elmCartList.show() }, close: function () { var _this = this; _this.elmCartBtn.removeClass("mini-cart-on"), _this.elmCartList.html(this.loadingStr).hide() }, delGoods: function (gId) { var _this = this; $.ajax({ type: "POST", url: XIAOMI.GLOBAL_CONFIG.orderSite + "/cart/delete/" + gId, dataType: "jsonp", jsonp: "jsonpcallback", cache: "false", success: function (data) { 1 === data.deleteBatch && (_this.getData(), XIAOMI.app.updateMiniCart()) } }) }, getData: function () { var _this = this; $.ajax({ type: "POST", url: XIAOMI.GLOBAL_CONFIG.orderSite + "/cart/miniNew", dataType: "jsonp", jsonp: "jsonpcallback", cache: !1, success: function (data) { _this.formatData(data), XIAOMI.app.updateMiniCart() } }) }, formatData: function (data) { var _this = this; if (0 === data.errorno && data.totalItem > 0) { var lens = data.items.length, goodsUrl = null, listHtml = "