海狸逛逛小程序前端hailigg.zip

  • X4_647351
    了解作者
  • 701.6KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-20 07:25
    上传日期
可用于学习和制作家居行业小程序,可直接在开发者工具运行。
hailigg.zip
内容介绍
var n = require("../../@babel/runtime/helpers/interopRequireDefault")(require("../../@babel/runtime/helpers/typeof")); function e(n) { !function(n, e) { var t = e.success, i = e.fail, r = !1, o = null; e.success = function(n) { r || (o && clearTimeout(o), "function" == typeof t && t(n)); }, e.fail = function() { r || (o && clearTimeout(o), "function" == typeof i && i()); }, n(e), o = setTimeout(function() { o && clearTimeout(o), r = !0, "function" == typeof i && i(r); }, e.timeout || O); }(wx.request, n); } function t(n) { try { N.getNetworkInfo(function(t) { "NOTREACHABLE" === t.networkType || "none" === t.networkType || !1 === t.networkAvailable ? (y().e("请求失败:暂无网络 "), n.fail()) : e(n); }, n.fail); } catch (n) { y().e("请求失败: " + n); } } function i(e, t) { this.id = e, this.ts = Date.now(); var i = (0, n.default)(t); if ("string" === i && t) this[e] = t; else if ("object" === i) for (var r in t) ({}).hasOwnProperty.call(t, r) && (this[r] = t[r]); } function r(n) { var e = null; switch (n) { case $.HALF_SESSION: e = function() { var n = null, e = nn().cloneCurrentSession(); return e && (n = { header: { st: "1" }, analytics: { sessions: [ e ] } }), n; }(); break; case $.CLOSE_SESSION: e = function() { var n = null, e = {}, t = nn().cloneCurrentSession(); if (t) { var i = T().get(), r = G().get(); Array.isArray(i) && i.length && (t.pages = x.clone(i)), Array.isArray(r) && r.length && (t.shares = x.clone(r)), T().clear(), G().clear(), e.sessions = [ t ]; } var o = q().getEkvs(); o && (e.ekvs = x.clone(o), q().clear()); return (e.sessions || e.ekvs) && (n = { analytics: e }), n; }(); break; case $.EKV: e = function() { var n = null, e = q().getEkvs(); e && (n = { analytics: { ekvs: x.clone(e) } }, q().clear()); return n; }(); } return e; } function o(n, e) { var t = s(n, e); return n.id_tracking && (t[e.id_tracking || "id_tracking"] = s(n.id_tracking, rn)), t; } function s(n, e) { var t = {}; for (var i in n) e[i] ? t[e[i]] = n[i] : t[i] = n[i]; return t; } function c(n, e) { var t = {}; if (n) { var i = n.ekvs, r = n.sessions; i && (t[e.ekvs] = i), Array.isArray(r) && (t[e.sessions] = r); } return t; } function u(n, e, i, r) { Z.instance().setIdType(H().getIdType()), Z.instance().setIdTracking(H().getIdTracking()); var s = x.clone(Z.instance().get()); n.header = Object.assign(s, n.header, { ts: Date.now() }); var u = function(n) { return { h: o(n.header, tn), a: c(n.analytics, en) }; }(n), a = S.stringify(u), f = { url: A.LOG_URL, method: "POST", data: x.base64Encode(a), success: function(n) { var t = n.code || n.status || n.statusCode; 200 === t || 413 === t ? (y().i("数据发送成功: ", a), function(n) { if (n) { I().set(A.IMPRINT, n), Z.instance().setItem(A.IMPRINT, n); var e = S.parse(x.base64Decode(n)); y().v("imprint: %o", e); var t = e.report_policy; if (t && x.isNumber(t) && (I().set(A.REPORT_POLICY, t), t === A.REPORT_POLICY_INTERVAL)) { var i = e.report_interval; i && x.isNumber(i) && (i <= A.EVENT_SEND_MIN_INTERVAL ? i = A.EVENT_SEND_MIN_INTERVAL : i > A.EVENT_SEND_MAX_INTERVAL && (i = A.EVENT_SEND_MAX_INTERVAL), I().set(A.REPORT_INTERVAL_TIME, i)); } } }((n.data || {}).imprint), "function" == typeof e && e(n)) : (y().w("数据发送失败: ", a), "function" == typeof i && i()); }, fail: function(n) { y().w("超时: ", a), "function" == typeof i && i(); }, complete: function() { "function" == typeof r && r(); } }; t(Object.assign(f, { header: { "Content-Type": "wxmp/json", "Msg-Type": "wxmp/json" } })); } function a(n) { var e = n, t = []; this.enqueue = function(n) { "number" == typeof e && this.size() >= e && this.dequeue(), t.push(n); }, this.dequeue = function() { return t.shift(); }, this.front = function() { return t[0]; }, this.isEmpty = function() { return 0 === t.length; }, this.clear = function() { t.length = 0; }, this.size = function() { return t.length; }, this.items = function() { return t; }, this.print = function() { console.log(t.toString()); }; } function f() { var e = !1, t = !1; this.init = function(n) { y().v("sdk version: " + A.IMPL_VERSION), e ? y().v("Lib重复实例化") : I().load(function() { y().v("cache初始化成功: ", I().getAll()), H().init(function() { Z.instance().init(), y().v("Header初始化成功"); }), e = !0, "function" == typeof n && n(), y().tip("SDK集成成功"); }); }, this.resume = function(n) { if (e && !t) { y().v("showOptions: ", n), t = !0, on().load(); var i = nn().resume(n), r = nn().getCurrentSessionId(); if (q().setSessionId(r), i) { var o = this; on().add($.HALF_SESSION, function() { m().useOpenid() && m().autoGetOpenid() && !H().getId() ? H().getOpenIdAsync({ success: function(n) { y().v("获取openid成功: %s", n), o.setOpenid(n); }, fail: function() { y().v("获取openid失败"); } }) : on().send(); }); } } }, this.pause = function() { e && (t = !1, nn().pause(), on().send($.CLOSE_SESSION, function() { on().save(), I().save(), y().v("cache save success"); })); }, this.setOpenid = function(n) { H().getId() || (y().v("setOpenId: %s", n), H().setOpenid(n), on().send()); }, this.setUnionid = function(n) { y().v("setUnionid: %s", n), H().setUnionid(n); }, this.setUserid = function(n) { y().v("setUserid: %s", n), H().setUserid(n); }, this.trackEvent = function(t, r) { if (e && (y().v("event: ", t, r), function(e, t) { if (!e || "string" != typeof e) return y().e('please check trackEvent id. id should be "string" and not null'), !1; if (e.length > A.MAX_EVENTID_LENGTH) return y().e("The maximum length of event id shall not exceed " + A.MAX_EVENTID_LENGTH), !1; if (t && ("object" != (0, n.default)(t) || Array.isArray(t)) && "string" != typeof t) return y().e("please check trackEvent properties. properties should be string or object(not include Array)"), !1; if ("object" == (0, n.default)(t)) { var i = 0; for (var r in t) if ({}.hasOwnProperty.call(t, r)) { if (r.length > A.MAX_PROPERTY_KEY_LENGTH) return y().e("The maximum length of property key shall not exceed " + A.MAX_PROPERTY_KEY_LENGTH), !1; if (i >= A.MAX_PROPERTY_KEYS_COUNT) return y().e("The maximum
评论
    相关推荐