123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849 |
- /*
- * @Author: your name
- * @Date: 2021-05-12 14:09:37
- * @LastEditTime: 2021-05-12 14:14:11
- * @LastEditors: Please set LastEditors
- * @Description: In User Settings Edit
- * @FilePath: \ewqeqwqe\huo\huosdk-1.0.2.js
- */
- module.exports = function (e) {
- var t = {};
- function a(r) {
- if (t[r]) return t[r].exports;
- var n = t[r] = {i: r, l: !1, exports: {}};
- return e[r].call(n.exports, n, n.exports, a), n.l = !0, n.exports
- }
- return a.m = e, a.c = t, a.d = function (e, t, r) {
- a.o(e, t) || Object.defineProperty(e, t, {enumerable: !0, get: r})
- }, a.r = function (e) {
- "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {value: "Module"}), Object.defineProperty(e, "__esModule", {value: !0})
- }, a.t = function (e, t) {
- if (1 & t && (e = a(e)), 8 & t) return e;
- if (4 & t && "object" == typeof e && e && e.__esModule) return e;
- var r = Object.create(null);
- if (a.r(r), Object.defineProperty(r, "default", {
- enumerable: !0,
- value: e
- }), 2 & t && "string" != typeof e) for (var n in e) a.d(r, n, function (t) {
- return e[t]
- }.bind(null, n));
- return r
- }, a.n = function (e) {
- var t = e && e.__esModule ? function () {
- return e.default
- } : function () {
- return e
- };
- return a.d(t, "a", t), t
- }, a.o = function (e, t) {
- return Object.prototype.hasOwnProperty.call(e, t)
- }, a.p = "", a(a.s = 2)
- }([function (e, t, a) {
- "use strict";
- var r = {
- debug: !1,
- baseParams: {app_id: "", client_id: "", format: "json"},
- gameParams: {"game-pkg_name": "", "game-app_ver": "", "game-h_ver": "", "game-sdk_ver": "", "game-mp_id": ""},
- agentParams: {"agent-ch": "", "agent-sub_ch": ""},
- deviceParams: {
- "device-device_id": "",
- "device-mac": "",
- "device-ip": "",
- "device-brand": "",
- "device-model": "",
- "device-os": "",
- "device-os_version": "",
- "device-screen": "",
- "device-net": "",
- "device-imsi": "",
- "device-longitude": "",
- "device-latitude": "",
- "device-userua": "",
- "device-disk_space": "",
- "device-open_time": "",
- "device-is_charge": "",
- "device-screen_luminance": "",
- "device-has_sim": "",
- "device-is_break": ""
- },
- extParams: {
- brand: "",
- model: "",
- pixelRatio: "",
- screenWidth: "",
- screenHeight: "",
- windowWidth: "",
- windowHeight: "",
- statusBarHeight: "",
- language: "",
- version: "",
- system: "",
- platform: "",
- fontSizeSetting: "",
- SDKVersion: "",
- benchmarkLevel: "",
- albumAuthorized: "",
- cameraAuthorized: "",
- locationAuthorized: "",
- microphoneAuthorized: "",
- notificationAuthorized: "",
- notificationAlertAuthorized: "",
- notificationBadgeAuthorized: "",
- notificationSoundAuthorized: "",
- bluetoothEnabled: "",
- locationEnabled: "",
- wifiEnabled: "",
- safeArea: ""
- },
- setting: {showLoading: !0, loadingParams: {title: "加载中", mask: !0}, showToast: !1, toastParams: {icon: "none"}},
- launchOptions: {},
- baseUrl: ""
- };
- try {
- r.gameParams["game-pkg_name"] = wx.canIUse ? "" : "game", wx.getSystemInfo({
- success: function (e) {
- r.deviceParams["device-brand"] = encodeURIComponent(e.brand), r.deviceParams["device-model"] = encodeURIComponent(e.model), r.deviceParams["device-screen"] = encodeURIComponent(e.screenWidth + "x" + e.screenHeight), r.deviceParams["device-os"] = "devtools" === e.platform ? "android" : encodeURIComponent(e.platform), r.deviceParams["device-os_version"] = encodeURIComponent(e.system), r.extParams.brand = e.brand, r.extParams.model = e.model, r.extParams.pixelRatio = e.pixelRatio, r.extParams.windowWidth = e.windowWidth, r.extParams.windowHeight = e.windowHeight, r.extParams.statusBarHeight = e.statusBarHeight, r.extParams.language = e.language, r.extParams.version = e.version, r.extParams.system = e.system, r.extParams.platform = e.platform, r.extParams.fontSizeSetting = e.fontSizeSetting, r.extParams.SDKVersion = e.SDKVersion, r.extParams.benchmarkLevel = e.benchmarkLevel, r.extParams["albumAuthorized\t"] = e.albumAuthorized, r.extParams.cameraAuthorized = e.cameraAuthorized, r.extParams.locationAuthorized = e.locationAuthorized, r.extParams.microphoneAuthorized = e.microphoneAuthorized, r.extParams.notificationAuthorized = e.notificationAuthorized, r.extParams.notificationAlertAuthorized = e.notificationAlertAuthorized, r.extParams.notificationBadgeAuthorized = e.notificationBadgeAuthorized, r.extParams.notificationSoundAuthorized = e.notificationSoundAuthorized, r.extParams.bluetoothEnabled = e.bluetoothEnabled, r.extParams.locationEnabled = e.locationEnabled, r.extParams.wifiEnabled = e.wifiEnabled, r.extParams.safeArea = e.safeArea
- }
- }), r.extParams.userua = window.navigator.userAgent, wx.getNetworkType({
- success: function (e) {
- r.deviceParams["device-net"] = encodeURIComponent(e.networkType), r.extParams.net = e.networkType
- }
- }), wx.getScreenBrightness({
- success: function (e) {
- r.deviceParams["device-screen_luminance"] = encodeURIComponent(parseInt(100 * e.value)), r.extParams.screen_luminance = parseInt(100 * e.value)
- }
- })
- } catch (e) {
- }
- e.exports = r
- }, function (e, t, a) {
- "use strict";
- var r = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var a = arguments[t];
- for (var r in a) Object.prototype.hasOwnProperty.call(a, r) && (e[r] = a[r])
- }
- return e
- }, n = i(a(0)), o = i(a(4));
- function i(e) {
- return e && e.__esModule ? e : {default: e}
- }
- var s = void 0, c = {
- ajax: function (e) {
- var t = this.setting(e.conf);
- return e.conf && delete e.conf, t.showLoading && wx.showLoading(t.loadingParams), e = this.params(e), n.default.debug && console.log((new Date).getTime(), e.url, e.data), new Promise((function (a, o) {
- wx.request(r({}, e, {
- success: function (r) {
- n.default.debug && console.log((new Date).getTime(), e.url, r), t.showLoading && wx.hideLoading(), 200 !== r.statusCode || !r.data || void 0 !== r.data.code && 200 !== r.data.code ? (t.showToast && (r.data && r.data.msg && (t.toastParams.title = r.data.msg), wx.showToast(t.toastParams)), o(r)) : a(r)
- }, fail: function (a) {
- n.default.debug && console.log((new Date).getTime(), e.url, a), t.showLoading && wx.hideLoading(), t.showToast && (a.errMsg && (t.toastParams.title = a.errMsg), wx.showToast(t.toastParams)), o(a)
- }
- }))
- }))
- }, params: function (e) {
- if (e.method = (e.method || "get").toUpperCase(), "POST" !== e.method || e.header || (e.header = {"Content-Type": "application/x-www-form-urlencoded"}), !e.private) {
- var t = wx.getStorageSync("userInfo");
- e.data = r({}, n.default.baseParams, n.default.gameParams, n.default.agentParams, n.default.deviceParams, e.data, {
- "device-ext": encodeURIComponent(JSON.stringify(n.default.extParams)),
- token: t ? t.user_token : "",
- ts: (new Date).getTime()
- })
- }
- return e.data.sign = this.sign(e), /^http/.test(e.url) || (e.url = n.default.baseUrl + e.url), delete e.private, delete e.signUrl, e
- }, setting: function () {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
- return r({}, n.default.setting, e)
- }, sign: function (e) {
- var t = "";
- t = e.data.channel_id ? "&clientkey&MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDleNmoD8CwcsVduQnG7UAMqD2aYpwwwswmMLSKvwNZ6pQeC4ugwGaG3E8jfzRvMYzIUcCYkQ9uROuKiA3+LGZ9Zyvy3uIVycCcMwM88WgRMjospa2EoGVI4Ef8qcvbfPGC3vwdIKQRs4dnaG6yQsOcyVkgyRtDq4iQnnlG9Onw5QIDAQAB" : "&clientkey&MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDHrJSESIbzCdsC0+zIwSn3ft9RGaau0izFCdXodH3i/sWgYcoF+wvbvAMB9336tpTYMSfbks4HfSyt8PDunChqyeCnnraj60DRrySOxAIbjjSAxVxI437R5qZt3mFbH1rgptLfi5RP3N6XIWDk8Ecw2XCdlqfDPiQhGCYleldsdQIDAQAB", e.app_key && (t = "app_key=" + e.app_key);
- var a = (e.signUrl || e.url).substr(1), r = Object.keys(e.data).sort(), n = "";
- r.forEach((function (t) {
- n += "&" + t + "=" + e.data[t]
- }));
- var i = "";
- return i = e.app_key ? (0, o.default)(n.substr(1) + "&" + t) : (0, o.default)((e.method + "&" + encodeURIComponent(a) + "&" + encodeURIComponent(n.substr(1)) + "&" + t).replace(/\(/g, "%28").replace(/\)/g, "%29")), i
- }, renderQRCode: function (e, t, a) {
- var r = t.getContext("2d"), n = wx.createImage();
- n.src = a.image, n.onload = function () {
- r.lineJoin = "round", r.lineWidth = 30, r.strokeStyle = "#ffffff", r.strokeRect((window.innerWidth - 240) / 2, (window.innerHeight - 264) / 2, 240, 264), r.fillStyle = "#ffffff", r.fillRect((window.innerWidth - 220) / 2, (window.innerHeight - 244) / 2, 220, 244), r.fillStyle = "#1A83FF", r.font = "bold 14px PingFangSC-Medium", r.textAlign = "center", r.fillText(a.intro, window.innerWidth / 2, (window.innerHeight - 258) / 2 + 218 + 30, 250), r.drawImage(n, (window.innerWidth - 218) / 2, (window.innerHeight - 258) / 2, 218, 218)
- }, s = {canvas: e, qrcvs: t, qrctx: r, data: a}, e.addEventListener("touchstart", d)
- }, removeOffScreen: function () {
- s && (s.qrctx.clearRect(0, 0, s.qrcvs.width, s.qrcvs.height), s.canvas.removeEventListener("touchstart", d))
- }
- };
- function d(e) {
- e.preventDefault();
- var t = e.touches[0], a = t.clientX, r = t.clientY;
- a >= (window.innerWidth - 218) / 2 && a <= (window.innerWidth - 218) / 2 + 218 && r >= (window.innerHeight - 258) / 2 && r <= (window.innerHeight - 258) / 2 + 218 ? wx.previewImage({urls: [s.data.image]}) : (s.qrctx.clearRect(0, 0, s.qrcvs.width, s.qrcvs.height), s.canvas.removeEventListener("touchstart", d))
- }
- e.exports = c
- }, function (e, t, a) {
- "use strict";
- var r = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var a = arguments[t];
- for (var r in a) Object.prototype.hasOwnProperty.call(a, r) && (e[r] = a[r])
- }
- return e
- }, n = function (e, t) {
- if (Array.isArray(e)) return e;
- if (Symbol.iterator in Object(e)) return function (e, t) {
- var a = [], r = !0, n = !1, o = void 0;
- try {
- for (var i, s = e[Symbol.iterator](); !(r = (i = s.next()).done) && (a.push(i.value), !t || a.length !== t); r = !0) ;
- } catch (e) {
- n = !0, o = e
- } finally {
- try {
- !r && s.return && s.return()
- } finally {
- if (n) throw o
- }
- }
- return a
- }(e, t);
- throw new TypeError("Invalid attempt to destructure non-iterable instance")
- }, o = c(a(3)), i = c(a(0)), s = c(a(1));
- function c(e) {
- return e && e.__esModule ? e : {default: e}
- }
- function d(e, t, a) {
- return t in e ? Object.defineProperty(e, t, {
- value: a,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = a, e
- }
- var u = {
- init: function () {
- var e = this, t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
- a = ["app_id", "mp_id", "showLoading", "loadingParams", "showToast", "toastParams", "debug", "baseUrl"];
- return a.map((function (e) {
- void 0 !== t[e] && ("app_id" === e ? i.default.baseParams[e] = t.app_id : ("mp_id" === e ? i.default.gameParams["game-mp_id"] = t.mp_id : ("debug" === e ? i.default.debug = t.debug : ("baseUrl" === e ? i.default.baseUrl = t.baseUrl : i.default.setting[e] = t[e]))))
- })), new Promise((function (a, r) {
- if (t.app_id) {
- var o = wx.getLaunchOptionsSync().query, s = o.q, c = void 0 === s ? "" : s, d = o.state,
- u = void 0 === d ? "" : d, f = o.scene, l = void 0 === f ? "" : f;
- if (c) {
- var m = decodeURIComponent(c).split("?")[1];
- try {
- m = m && m.split("&");
- var g = !0, p = !1, h = void 0;
- try {
- for (var v, _ = m[Symbol.iterator](); !(g = (v = _.next()).done); g = !0) {
- var w = v.value.split("="), y = n(w, 2), P = y[0], b = y[1];
- "huo_state" === P && (u = b)
- }
- } catch (e) {
- p = !0, h = e
- } finally {
- try {
- !g && _.return && _.return()
- } finally {
- if (p) throw h
- }
- }
- } catch (e) {
- console.error(e)
- }
- i.default.launchOptions = {ext: c, state: u}, a(e.reversal())
- } else i.default.launchOptions = {state: l || u || ""}, a({msg: "success"})
- } else r({msg: "fail"})
- }))
- }, reversal: function () {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
- return new Promise((function (t, a) {
- wx.login({
- success: function (r) {
- var n;
- r.code ? (e.data = Object.assign({}, e.data, (d(n = {}, "device-ext", i.default.extParams), d(n, "ext", i.default.launchOptions.ext), d(n, "state", i.default.launchOptions.state), d(n, "code", r.code), n)), t(o.default.reversal(e))) : a(r)
- }, fail: function (e) {
- a(e)
- }
- })
- }))
- }, cpUserCheck: function () {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
- return o.default.cpUserCheck(e)
- }, login: function () {
- var e = this, t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
- return new Promise((function (a, n) {
- wx.checkSession({
- success: function (i) {
- o.default.wxLogin(r({}, t)).then((function (n) {
- console.log(n);
- var i = wx.getLaunchOptionsSync();
- o.default.reportAdClick({
- data: {
- click_id: i.query && i.query.gdt_vid || "",
- url: ""
- }
- }).then((function (e) {
- console.log("数据上报成功1", e)
- })), console.log("执行"), a(e.getUserInfo(r({}, t))), console.log("执行2")
- }), (function (e) {
- n({msg: e.msg || "fail"})
- }))
- }, fail: function (r) {
- console.log("ession_key ", t), o.default.wxLogin(t).then((function (r) {
- var n = wx.getLaunchOptionsSync();
- o.default.reportAdClick({
- data: {
- click_id: n.query && n.query.gdt_vid || "",
- url: ""
- }
- }).then((function (e) {
- console.log("数据上报成功2", e)
- })), a(e.getUserInfo(t))
- }), (function (e) {
- n({msg: e.msg || "fail"})
- }))
- }
- })
- }))
- }, updateUserInfo: function () {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
- return console.log("options1111", e), new Promise((function (t, a) {
- o.default.setUserInfo(e).then((function (e) {
- t(r({}, e, {msg: "success"}))
- }), (function (e) {
- a({msg: e.msg || "fail"})
- }))
- }))
- }, updateRole: function () {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
- return o.default.upRoleInfo(e)
- }, getUserInfo: function () {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
- return o.default.getUserInfo(e)
- }, getShareInfo: function () {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
- return o.default.getShareInfo(e)
- }, addShareInfo: function () {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
- return o.default.addShareInfo(e)
- }, getShareQrcode: function () {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
- return o.default.getShareQrcode(e)
- }, preOrder: function (e) {
- return o.default.preOrder(e)
- }, mpPay: function () {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
- return new Promise((function (t, a) {
- o.default.mpPay(e).then((function (e) {
- t({msg: "success"})
- }), (function (e) {
- a({msg: e.errMsg || "fail"})
- }))
- }))
- }, mpPayQuery: function () {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
- if (!e.data || void 0 === e.data["order-order_id"]) {
- var t = wx.getStorageSync("orderInfo");
- e.data = r({}, e.data, {"order-order_id": t ? t.order_id : ""})
- }
- return o.default.mpPayQuery(e)
- }, midasPay: function () {
- var e = this, t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
- return new Promise((function (a, r) {
- o.default.midasPay(t).then((function (r) {
- t.conf = {showLoading: !1, showToast: !1};
- var n = 0, o = setInterval((function () {
- n++, e.midasPayQuery(t).then((function (e) {
- 2 !== e.data.status && 12 !== n || clearInterval(o)
- }), (function (e) {
- }))
- }), 15e3);
- a({msg: "success"})
- }), (function (e) {
- r({msg: e.errMsg || "fail"})
- }))
- }))
- }, midasPayQuery: function () {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
- if (!e.data || void 0 === e.data["order-order_id"]) {
- var t = wx.getStorageSync("orderInfo");
- e.data = r({}, e.data, {"order-order_id": t ? t.order_id : ""})
- }
- return o.default.midasPayQuery(e)
- }, checkPay: function () {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
- return o.default.checkPay(e)
- }, checkOrderInfo: function () {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
- return o.default.checkOrderInfo(e)
- }, checkOrder: function () {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
- return o.default.checkOrder(e)
- }, checkQrcode: function () {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
- return o.default.checkQrcode(e)
- }, reportAdClick: function () {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
- return o.default.reportAdClick(e)
- }, removeOffScreen: function () {
- o.default.removeOffScreen()
- }, checkMsg: function () {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
- return o.default.checkMsg(e)
- }, gameMinicard: function () {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
- return o.default.gameMinicard(e)
- }, userCheckpay: function () {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
- return o.default.userCheckpay(e)
- }, gameHeartbeat: function () {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
- return o.default.gameHeartbeat(e)
- }, checkImg: function () {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
- t = r({}, i.default.baseParams, i.default.gameParams, i.default.agentParams, i.default.deviceParams, {
- token: wx.getStorageSync("userInfo").user_token,
- ts: (new Date).getTime()
- });
- return t.sign = s.default.sign({url: "/mp/img/check", data: t}), new Promise((function (a, r) {
- wx.uploadFile({
- url: i.default.baseUrl + "/mp/img/check",
- filePath: e.data.filePath,
- name: "image",
- formData: t,
- success: function (e) {
- var t = e.data;
- 200 === (t = JSON.parse(t)).code ? a({msg: "success"}) : r({msg: t.msg || "fail"})
- }
- })
- }))
- }
- };
- e.exports = u
- }, function (e, t, a) {
- "use strict";
- var r = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var a = arguments[t];
- for (var r in a) Object.prototype.hasOwnProperty.call(a, r) && (e[r] = a[r])
- }
- return e
- }, n = i(a(1)), o = i(a(0));
- function i(e) {
- return e && e.__esModule ? e : {default: e}
- }
- var s = !1, c = function (e) {
- var t = e.data, a = e.conf;
- return new Promise((function (r, o) {
- n.default.ajax(e).then((function (e) {
- e.data && e.data.data ? r({data: e.data.data, msg: "success"}) : r({msg: "success"})
- }), (function (e) {
- if (e.data && 1002 === e.data.code) {
- if (s) return !1;
- s = !0, r(d.wxLogin({data: t, conf: a}).then((function (e) {
- return s = !1, d.getUserInfo({data: t, conf: a})
- })))
- } else 41406 === e.data.code || o({msg: e.data ? e.data.msg || "网络异常,请重试" : e.errMsg})
- }))
- }))
- }, d = {
- cpUserCheck: function (e) {
- return c(r({method: "post", url: "/cp/user/check", private: !0}, e))
- }, login: function (e) {
- return o.default.launchOptions.ext ? e.data = Object.assign({}, e.data, r({state: o.default.launchOptions.state}, e)) : e.data = Object.assign({}, e.data, r({}, e)), o.default.launchOptions && o.default.launchOptions.state && (e.data.state = o.default.launchOptions.state), c(r({
- method: "post",
- url: "/mp/wx/login"
- }, e)).then((function (e) {
- return e && wx.setStorageSync("userInfo", e.data), e
- }))
- }, wxLogin: function (e) {
- var t = this;
- return new Promise((function (a, n) {
- wx.login({
- success: function (o) {
- o.code ? (e = r({}, e.data, {
- code: o.code,
- state: e.data && e.data.state || ""
- }), a(t.login(e))) : n(o)
- }, fail: function (e) {
- n(e)
- }
- })
- }))
- }, reversal: function (e) {
- return c(r({method: "post", url: "/mp/reversal"}, e))
- }, setUserInfo: function (e) {
- return console.log("options1111222222", e), c(r({
- method: "post",
- url: "/mp/wx/updateinfo"
- }, e)).then((function (e) {
- return wx.setStorageSync("userInfo", e.data), e
- }))
- }, upRoleInfo: function (e) {
- return e.conf = {showLoading: !1, showToast: !1}, c(r({
- method: "post",
- url: "/mp/user/uprole"
- }, e)).then((function (e) {
- return e
- }))
- }, getUserInfo: function (e) {
- var t = this;
- return c(r({method: "post", url: "/mp/wx/getuserinfo"}, e)).then((function (e) {
- if (null == e.data.code && (e.data.code = 200), 200 == e.data.code) {
- if (e.data.report_status && 2 == e.data.report_status) {
- var a = e.data.report_time;
- try {
- console.log(1111), t.gameHeartbeat({}), setInterval((function () {
- t.gameHeartbeat({})
- }), 1e3 * a)
- } catch (e) {
- console.log(e)
- }
- }
- wx.setStorageSync("userInfo", e.data)
- }
- return e
- }))
- }, newUserInfo: function (e) {
- return new Promise((function (t, a) {
- c(r({method: "post", url: "/mp/wx/getuserinfo"}, e)).then((function (e) {
- t(e)
- })).catch((function (e) {
- a(e)
- }))
- }))
- }, floatInit: function (e) {
- var t = this;
- return c({method: "post", url: "/mp/float/init"}).then((function (a) {
- if (2 == a.data.float_is_show) try {
- var r = "";
- if (window.egret ? r = egret.lifecycle.stage : window.Laya && (r = Laya.stage), r) {
- var n = {
- user: {
- id: "",
- nickname: "",
- avatar: "",
- ptb_cnt: 0,
- ptb_rate: 1,
- entry_name: "",
- entry_image: "",
- card_session_from: "",
- card_title: "",
- card_image: "",
- card_url: ""
- },
- general_gift: {title: "", sub_title: "", gift_code: ""},
- vip_gift: {
- title: "",
- sub_title: "",
- card_session_from: "",
- card_title: "",
- card_image: "",
- card_url: ""
- },
- help_gift: {
- title: "",
- sub_title: "",
- card_session_from: "",
- card_title: "",
- card_image: "",
- card_url: ""
- },
- help: {qq_number: "", offiaccount: ""},
- auth: {subscribe_gift: "", subscribe_float: ""}
- };
- n.user.id = e.mem_id, n.user.avatar = e.avatar, n.user.nickname = e.nickname, n.user.ptb_cnt = e.ptb_cnt, n.auth.subscribe_gift = a.data.subscribe_gift, n.auth.subscribe_float = a.data.subscribe_float, n.user.card_image = a.data.ptb_recharge.miniprogrampage_picture, n.user.card_url = a.data.ptb_recharge.miniprogrampage_url, n.user.card_title = a.data.ptb_recharge.miniprogrampage_title, n.user.card_session_from = a.data.ptb_recharge.session_from, n.user.entry_image = a.data.ptb_recharge.entry_image, n.general_gift.title = a.data.gift_common.title, n.general_gift.sub_title = a.data.gift_common.describe, n.general_gift.gift_code = a.data.gift_common.gift_code, n.vip_gift.title = a.data.gift_vip.title, n.vip_gift.sub_title = a.data.gift_vip.describe, n.vip_gift.card_session_from = a.data.gift_vip.session_from, n.vip_gift.card_title = a.data.gift_vip.miniprogrampage_title, n.vip_gift.card_image = a.data.gift_vip.miniprogrampage_picture, n.vip_gift.card_url = a.data.gift_vip.miniprogrampage_url, n.help_gift.title = a.data.gift_customer.title, n.help_gift.sub_title = a.data.gift_customer.describe, n.help_gift.card_session_from = a.data.gift_customer.session_from, n.help_gift.card_title = a.data.gift_customer.miniprogrampage_title, n.help_gift.card_image = a.data.gift_customer.miniprogrampage_picture, n.help_gift.card_url = a.data.gift_customer.miniprogrampage_url, n.help.qq_number = a.data.customer_service.qq, n.help.offiaccount = a.data.official_accounts.name, n.template_id = a.data.template_id, n.api = t, showFuBiao(r)
- }
- } catch (e) {
- console.log(e)
- }
- }))
- }, accreditReport: function (e) {
- return c(r({url: "/mp/accredit/report"}, e))
- }, giftAdd: function (e) {
- return c(r({url: "/mp/gift/add"}, e))
- }, getShareInfo: function (e) {
- return c(r({url: "/mp/share/detail"}, e))
- }, addShareInfo: function (e) {
- return c(r({url: "/mp/share/add"}, e))
- }, getShareQrcode: function (e) {
- return c(r({url: "/mp/share/qrcode"}, e))
- }, mpPay: function (e) {
- var t = this;
- return this.preOrder(e).then((function (a) {
- return e.data = r({}, e.data, {payway: "wxpay", "order-order_id": a.data.order_id}), t.mpOrder(e)
- }))
- }, midasPay: function (e) {
- var t = this;
- return this.preOrder(e).then((function (a) {
- return t.wxMidasPay(a.data, e)
- }))
- }, wxMidasPay: function (e, t) {
- var a = this;
- return new Promise((function (r, o) {
- var i = e.mode, s = e.env, c = e.offer_id, d = e.currency, u = e.buy_quantity, f = e.platform,
- l = e.zone_id;
- wx.requestMidasPayment({
- mode: i,
- env: s,
- offerId: c,
- currencyType: d,
- buyQuantity: u,
- platform: f,
- zoneId: l,
- success: function (n) {
- t.data["order-order_id"] = e.order_id, t.conf = {
- showLoading: !1,
- showToast: !1
- }, a.midasPayQuery(t).then((function (e) {
- if (e.data && 2 !== e.data.status) var r = 0, n = setInterval((function () {
- r++, a.midasPayQuery(t).then((function (e) {
- 2 !== e.data.status && 8 !== r || clearInterval(n)
- }), (function (e) {
- }))
- }), 15e3)
- }), (function (e) {
- })), n.errMsg && (n.msg = n.errMsg), r(n)
- },
- fail: function (e) {
- if (e.errMsg) if ("requestMidasPayment:fail iOS not supported" === e.errMsg) {
- var a = wx.getStorageSync("userInfo");
- e.msg = a && a.ios_text || "小游戏暂不支持IOS支付,请使用安卓登录后支付。", e.duration = 3e3
- } else e.msg = e.errMsg;
- var r = n.default.setting(t.conf);
- r.showToast && (e.msg && (r.toastParams.title = e.msg), e.duration && (r.toastParams.duration = e.duration), wx.showToast(r.toastParams)), o(e)
- }
- })
- }))
- }, checkPay: function (e) {
- var t = this;
- return this.preOrder(e).then((function (a) {
- return 2 === a.data.check ? t.wxMidasPay(a.data, e) : (e.data["order-order_id"] = a.data.order_id, t.checkPayInfo(e))
- }))
- }, preOrder: function (e) {
- return c(r({method: "post", url: "/mp/preorder"}, e)).then((function (e) {
- return wx.setStorageSync("orderInfo", e.data), e
- }), (function (e) {
- return e
- }))
- }, mpOrder: function (e) {
- var t = this;
- return c(r({method: "post", url: "/mp/wx/pay"}, e)).then((function (a) {
- return t.wxMpPay(JSON.parse(a.data.token), e)
- }))
- }, wxMpPay: function (e, t) {
- return new Promise((function (a, o) {
- wx.requestPayment(r({}, e, {
- success: function (e) {
- e.errMsg && (e.msg = e.errMsg), a(e)
- }, fail: function (e) {
- e.errMsg && (e.msg = e.errMsg);
- var a = n.default.setting(t.conf);
- a.showToast && (e.msg && (a.toastParams.title = e.msg), wx.showToast(a.toastParams)), o(e)
- }, complete: function (e) {
- "requestPayment:cancel" === e.errMsg && o({msg: "requestPayment:fail cancel"})
- }
- }))
- }))
- }, mpPayQuery: function (e) {
- return c(r({method: "post", url: "/mp/order/query"}, e))
- }, midasPayQuery: function (e) {
- return c(r({url: "/mp/mpay/query"}, e))
- }, checkPayInfo: function (e) {
- var t = this;
- return c(r({url: "/mp/order/checkinfo"}, e)).then((function (a) {
- return a.data.order_id = e.data["order-order_id"], new Promise((function (r, n) {
- a.data.image && wx.setStorageSync("orderQRCode", a.data.image);
- var o = a.data;
- wx.getStorageSync("orderQRCode");
- if (a.data && 4 === a.data.pay_type) wx.showModal({
- title: a.data.recharte_title,
- content: a.data.recharte_content,
- showCancel: !1,
- success: function (e) {
- e.confirm && wx.openCustomerServiceConversation({
- sessionFrom: o.session_from,
- showMessageCard: !0,
- sendMessageTitle: o.miniprogrampage_title,
- sendMessagePath: o.miniprogrampage_url,
- sendMessageImg: o.miniprogrampage_picture
- })
- }
- }), r(a); else if (a.data && a.data.mp_id) {
- var i = t, s = e;
- wx.navigateToMiniProgram({
- appId: a.data.mp_id, path: a.data.path, fail: function (e) {
- -1 === e.errMsg.search("jsapi") && -1 === e.errMsg.search("denied") && -1 === e.errMsg.search("navigateToMiniProgramAppIdList") || (s.data.error_mp_id = a.data.mp_id, s.data.error_mp_msg = e.errMsg, i.checkPayInfo(s))
- }, success: function () {
- r(a)
- }
- })
- } else console.log("进入支付二维码模式"), t.checkQrcode(e).then((function (e) {
- var t = e.data.image, n = e.data.poster_img ? e.data.poster_img : "";
- n ? wx.previewImage({current: n, urls: [n]}) : t && wx.previewImage({
- current: t,
- urls: [t]
- }), wx.setStorageSync("orderQRCode", t), a.data.image = t, a.data.poster_img = n, console.log(a.data), console.log(1111111111), console.log(e.data), r(a)
- }), (function (e) {
- r(a)
- }))
- }))
- }))
- }, checkOrderInfo: function (e) {
- return c(r({method: "post", url: "/mp/pay/info"}, e))
- }, checkOrder: function (e) {
- var t = this;
- return c(r({method: "post", url: "/mp/check/pay"}, e)).then((function (a) {
- return t.wxMpPay(JSON.parse(a.data.token), e)
- }))
- }, checkQrcode: function (e) {
- return e.data && (e.data.is_last = 2), c(r({url: "/mp/order/qrcode"}, e))
- }, reportAdClick: function (e) {
- return c(r({url: "/mp/ad/report"}, e))
- }, removeOffScreen: function () {
- n.default.removeOffScreen()
- }, checkMsg: function (e) {
- return c(r({method: "post", url: "/mp/msg/check"}, e))
- }, gameMinicard: function (e) {
- return c(r({method: "post", url: "/mp/game/minicard"}, e))
- }, userCheckpay: function (e) {
- return c(r({method: "post", url: "/mp/user/checkpay"}, e))
- }, gameHeartbeat: function (e) {
- }, complainInit: function (e) {
- var t = this;
- return e.conf = {showLoading: !1, showToast: !1}, c(r({
- method: "post",
- url: "/mp/complain/index"
- }, e)).then((function (e) {
- try {
- var a = "";
- if (window.egret ? a = egret.lifecycle.stage : window.Laya && (a = Laya.stage), a) ({
- show: !0,
- name: e.data.name,
- icon: e.data.icon,
- restore_time: e.data.restore_time,
- session_from: e.data.session_from,
- miniprogrampage_title: e.data.miniprogrampage_title,
- miniprogrampage_picture: e.data.miniprogrampage_picture,
- miniprogrampage_url: e.data.miniprogrampage_url,
- uploadUrl: e.data.upload_url,
- customer_service_qq: e.data.customer_service_qq,
- customer_service_tel: e.data.customer_service_tel,
- list: e.data.list
- }).api = t, console.warn("complainInit-41406-截屏初始化和显示")
- } catch (e) {
- console.log(e)
- }
- }))
- }, memberFreeze: function (e) {
- var t = this;
- return e.conf = {showLoading: !1, showToast: !1}, new Promise((function (a, n) {
- c(r({method: "post", url: "/mp/member/freeze"}, e)).then((function (e) {
- t.getUserInfo(), a(e)
- })).catch((function (e) {
- n(e)
- }))
- }))
- }, complainReport: function (e) {
- return e.conf = {showLoading: !1, showToast: !1}, c(r({method: "post", url: "/mp/complain/report"}, e))
- }
- };
- e.exports = d
- }, function (e, t, a) {
- "use strict";
- var r;
- "function" == typeof Symbol && Symbol.iterator;
- !function (n) {
- function o(e, t) {
- var a = (65535 & e) + (65535 & t);
- return (e >> 16) + (t >> 16) + (a >> 16) << 16 | 65535 & a
- }
- function i(e, t, a, r, n, i) {
- return o(function (e, t) {
- return e << t | e >>> 32 - t
- }(o(o(t, e), o(r, i)), n), a)
- }
- function s(e, t, a, r, n, o, s) {
- return i(t & a | ~t & r, e, t, n, o, s)
- }
- function c(e, t, a, r, n, o, s) {
- return i(t & r | a & ~r, e, t, n, o, s)
- }
- function d(e, t, a, r, n, o, s) {
- return i(t ^ a ^ r, e, t, n, o, s)
- }
- function u(e, t, a, r, n, o, s) {
- return i(a ^ (t | ~r), e, t, n, o, s)
- }
- function f(e, t) {
- e[t >> 5] |= 128 << t % 32, e[14 + (t + 64 >>> 9 << 4)] = t;
- var a, r, n, i, f, l = 1732584193, m = -271733879, g = -1732584194, p = 271733878;
- for (a = 0; a < e.length; a += 16) r = l, n = m, i = g, f = p, m = u(m = u(m = u(m = u(m = d(m = d(m = d(m = d(m = c(m = c(m = c(m = c(m = s(m = s(m = s(m = s(m, g = s(g, p = s(p, l = s(l, m, g, p, e[a], 7, -680876936), m, g, e[a + 1], 12, -389564586), l, m, e[a + 2], 17, 606105819), p, l, e[a + 3], 22, -1044525330), g = s(g, p = s(p, l = s(l, m, g, p, e[a + 4], 7, -176418897), m, g, e[a + 5], 12, 1200080426), l, m, e[a + 6], 17, -1473231341), p, l, e[a + 7], 22, -45705983), g = s(g, p = s(p, l = s(l, m, g, p, e[a + 8], 7, 1770035416), m, g, e[a + 9], 12, -1958414417), l, m, e[a + 10], 17, -42063), p, l, e[a + 11], 22, -1990404162), g = s(g, p = s(p, l = s(l, m, g, p, e[a + 12], 7, 1804603682), m, g, e[a + 13], 12, -40341101), l, m, e[a + 14], 17, -1502002290), p, l, e[a + 15], 22, 1236535329), g = c(g, p = c(p, l = c(l, m, g, p, e[a + 1], 5, -165796510), m, g, e[a + 6], 9, -1069501632), l, m, e[a + 11], 14, 643717713), p, l, e[a], 20, -373897302), g = c(g, p = c(p, l = c(l, m, g, p, e[a + 5], 5, -701558691), m, g, e[a + 10], 9, 38016083), l, m, e[a + 15], 14, -660478335), p, l, e[a + 4], 20, -405537848), g = c(g, p = c(p, l = c(l, m, g, p, e[a + 9], 5, 568446438), m, g, e[a + 14], 9, -1019803690), l, m, e[a + 3], 14, -187363961), p, l, e[a + 8], 20, 1163531501), g = c(g, p = c(p, l = c(l, m, g, p, e[a + 13], 5, -1444681467), m, g, e[a + 2], 9, -51403784), l, m, e[a + 7], 14, 1735328473), p, l, e[a + 12], 20, -1926607734), g = d(g, p = d(p, l = d(l, m, g, p, e[a + 5], 4, -378558), m, g, e[a + 8], 11, -2022574463), l, m, e[a + 11], 16, 1839030562), p, l, e[a + 14], 23, -35309556), g = d(g, p = d(p, l = d(l, m, g, p, e[a + 1], 4, -1530992060), m, g, e[a + 4], 11, 1272893353), l, m, e[a + 7], 16, -155497632), p, l, e[a + 10], 23, -1094730640), g = d(g, p = d(p, l = d(l, m, g, p, e[a + 13], 4, 681279174), m, g, e[a], 11, -358537222), l, m, e[a + 3], 16, -722521979), p, l, e[a + 6], 23, 76029189), g = d(g, p = d(p, l = d(l, m, g, p, e[a + 9], 4, -640364487), m, g, e[a + 12], 11, -421815835), l, m, e[a + 15], 16, 530742520), p, l, e[a + 2], 23, -995338651), g = u(g, p = u(p, l = u(l, m, g, p, e[a], 6, -198630844), m, g, e[a + 7], 10, 1126891415), l, m, e[a + 14], 15, -1416354905), p, l, e[a + 5], 21, -57434055), g = u(g, p = u(p, l = u(l, m, g, p, e[a + 12], 6, 1700485571), m, g, e[a + 3], 10, -1894986606), l, m, e[a + 10], 15, -1051523), p, l, e[a + 1], 21, -2054922799), g = u(g, p = u(p, l = u(l, m, g, p, e[a + 8], 6, 1873313359), m, g, e[a + 15], 10, -30611744), l, m, e[a + 6], 15, -1560198380), p, l, e[a + 13], 21, 1309151649), g = u(g, p = u(p, l = u(l, m, g, p, e[a + 4], 6, -145523070), m, g, e[a + 11], 10, -1120210379), l, m, e[a + 2], 15, 718787259), p, l, e[a + 9], 21, -343485551), l = o(l, r), m = o(m, n), g = o(g, i), p = o(p, f);
- return [l, m, g, p]
- }
- function l(e) {
- var t, a = "", r = 32 * e.length;
- for (t = 0; t < r; t += 8) a += String.fromCharCode(e[t >> 5] >>> t % 32 & 255);
- return a
- }
- function m(e) {
- var t, a = [];
- for (a[(e.length >> 2) - 1] = void 0, t = 0; t < a.length; t += 1) a[t] = 0;
- var r = 8 * e.length;
- for (t = 0; t < r; t += 8) a[t >> 5] |= (255 & e.charCodeAt(t / 8)) << t % 32;
- return a
- }
- function g(e) {
- var t, a, r = "";
- for (a = 0; a < e.length; a += 1) t = e.charCodeAt(a), r += "0123456789abcdef".charAt(t >>> 4 & 15) + "0123456789abcdef".charAt(15 & t);
- return r
- }
- function p(e) {
- return unescape(encodeURIComponent(e))
- }
- function h(e) {
- return function (e) {
- return l(f(m(e), 8 * e.length))
- }(p(e))
- }
- function v(e, t) {
- return function (e, t) {
- var a, r, n = m(e), o = [], i = [];
- for (o[15] = i[15] = void 0, n.length > 16 && (n = f(n, 8 * e.length)), a = 0; a < 16; a += 1) o[a] = 909522486 ^ n[a], i[a] = 1549556828 ^ n[a];
- return r = f(o.concat(m(t)), 512 + 8 * t.length), l(f(i.concat(r), 640))
- }(p(e), p(t))
- }
- function _(e, t, a) {
- return t ? a ? v(t, e) : function (e, t) {
- return g(v(e, t))
- }(t, e) : a ? h(e) : function (e) {
- return g(h(e))
- }(e)
- }
- void 0 === (r = function () {
- return _
- }.call(t, a, t, e)) || (e.exports = r)
- }()
- }]);
|