123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850 |
- var t = require;
- var e = module;
- var i,
- s,
- o,
- a,
- r,
- l,
- h,
- c,
- d,
- n,
- u,
- p,
- f,
- g,
- m,
- _,
- y,
- v,
- U,
- Z,
- C,
- b,
- S,
- T,
- I =
- "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
- ? function (t) {
- return typeof t;
- }
- : function (t) {
- return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype
- ? "symbol"
- : typeof t;
- };
- function w(t, s) {
- 0 < t.length
- ? wx.request({
- url: l + "/api/wx/wx_subscribe",
- method: "POST",
- data: {tmpid: t, appid: p, openid: f, sign: g, platform: y},
- success: function (t) {
- var e,
- i = t.data.data;
- for (e in i) wx.setStorageSync(e, i[e]);
- s({code: 1, msg: "订阅成功", tem_ids: i});
- },
- fail: function (t) {
- console.log(t, "rrrrrrrrrr");
- }
- })
- : s({code: 0, msg: "拒绝订阅"});
- }
- function M(e) {
- wx.checkSession({
- success: function () {
- var t;
- console.log("重新获取 success-" + f),
- f
- ? ((t = {user: {openid: f, sign: g}, shareInfo: _.query}), e(t))
- : T.login(function (t) {
- f ? e(t) : wx.showModal({title: "提示", content: "登录异常,请重新打开小游戏4"});
- });
- },
- fail: function () {
- "develop" == h && console.log("重新获取openid fail"),
- T.login(function (t) {
- f ? e(t) : wx.showModal({title: "提示", content: "登录异常,请重新打开小游戏3"});
- });
- }
- });
- }
- function D(t) {
- new Array();
- for (var e = t.split("&"), i = 0; i < e.length; i++) {
- if ("" == e[i]) return;
- var s = t.split("=");
- if ("chid" == s[0] || "subchid" == s[0] || "shareid" == s[0] || "sharetype" == s[0]) return;
- }
- return 1;
- }
- "function" == typeof Symbol && I(Symbol.iterator),
- (t = t("config")),
- (r = "v3.17"),
- (h = "develop"),
- (d = "test_sub_channel_id"),
- (m = {}),
- (_ = {}),
- (U = 120),
- (C = Z = y = g = f = p = n = c = l = ""),
- (S = b = v = u = 0),
- (T = {
- getDybUserInfo: function (e) {
- (v = +new Date()),
- "develop" == h && console.log("----------getDybUserInfo-------------"),
- M(function (t) {
- T.initData(function () {}), e(t);
- });
- },
- login: function (s) {
- "develop" == h && console.log(f + "======login========"),
- wx.login({
- success: function (t) {
- t = {
- code: t.code,
- game_appid: p,
- channel_id: c,
- sub_channel_id: d,
- shareid: u,
- sharetype: n,
- version: r,
- gdt: "",
- platform: y,
- clue_token: Z,
- click_id: C,
- ad_id: b,
- creative_id: S
- };
- "develop" == h && console.log(t, "初始化登陆logins数据"),
- wx.request({
- url: l + "/api/wx/get_wx_userinfo",
- header: {"content-type": "application/x-www-form-urlencoded"},
- method: "POST",
- data: t,
- dataType: "json",
- success: function (t) {
- var e, i;
- t.data.code
- ? ((i = {
- user: (e = {openid: t.data.data.openid, sign: t.data.data.sign}),
- shareInfo: _.query
- }),
- (f = t.data.data.openid),
- (g = t.data.data.sign),
- (m = e),
- wx.setStorageSync("sop_user", e),
- s(i))
- : wx.showModal({title: "提示", content: t.data.msg});
- },
- fail: function (t) {
- console.log("调用失败", t),
- wx.showModal({title: "提示", content: "登录异常,请重新打开小游戏1"});
- }
- });
- },
- fail: function (t) {
- console.log("调用失败", t),
- wx.showModal({title: "提示", content: "登录异常,请重新打开小游戏2"});
- }
- });
- },
- initData: function () {
- "develop" == h && console.log("----------init_Data-------------");
- var t = {};
- (t.openid = f),
- (t.sign = g),
- (t.game_appid = p),
- (t.channel_id = c),
- (t.sub_channel_id = d),
- (t.version = r),
- (t.platform = y),
- (t.clue_token = Z),
- (t.click_id = C),
- wx.request({
- url: l + "/api/wx/init_data",
- data: t,
- method: "post",
- header: {"content-type": "application/x-www-form-urlencoded"},
- success: function (t) {
- "develop" == h && console.log(t.data, "init_data_success"),
- 1 == t.data.code && (U = t.data.data.online_time || 60);
- }
- });
- },
- createRole: function (t, i) {
- console.log("获取字节创角clue_token", Z),
- "develop" == h && console.log("----------roleData-------------"),
- M(function () {
- var e = {openid: f, game_appid: p, sign: g, gdt: "", version: r, platform: y};
- return null == I(t.server_id) && "" == String(t.server_id) && "undefined" == String(t.server_id)
- ? void i({code: 0, msg: "服务器ID不正确"})
- : ((e.server_id = t.server_id),
- null != I(t.server_name) ||
- "" != String(t.server_name) ||
- "undefined" != String(t.server_name)
- ? (e.server_name = t.server_name)
- : (e.server_name = "默认区服"),
- null == I(t.role_name) && "" == String(t.role_name) && "undefined" == String(t.role_name)
- ? void i({code: 0, msg: "角色名称不正确"})
- : ((e.role_name = t.role_name),
- void wx.request({
- url: l + "/api/wx/create_role",
- data: e,
- method: "post",
- header: {"content-type": "application/x-www-form-urlencoded"},
- success: function (t) {
- i(t.data),
- 1 == t.data.code
- ? wx.request({
- url: l + "/api/wx/role_login",
- data: e,
- method: "post",
- header: {"content-type": "application/x-www-form-urlencoded"},
- complete: function () {}
- })
- : i(t.data);
- },
- complete: function () {
- console.log("finshshow-----"), wx.reportAnalytics("finishShow");
- }
- })));
- });
- },
- submitOrder: function (t, a) {
- var n = +new Date();
- console.log("开始时间:", n),
- "develop" == h && console.log("----------提交订单-------------支付环境"),
- M(function () {
- var e, o;
- null != I(t.server_name) && "" != String(t.server_name) && "undefined" != String(t.server_name)
- ? null != I(t.role_name) && "" != String(t.role_name) && "undefined" != String(t.role_name)
- ? ((e = {
- game_appid: p,
- extra_info: t.extra_info,
- goods_count: t.goods_count,
- goods_name: t.goods_name,
- pay_amount: t.pay_amount,
- account_id: f,
- redirect_uri: t.redirect_uri,
- role_name: t.role_name,
- server_name: t.server_name,
- channel_id: c,
- sub_channel_id: d,
- order_sn: t.order_sn,
- sign: g,
- gdt: "",
- version: r,
- platform: y
- }),
- (o = +new Date() - n),
- console.log("request_before", o),
- wx.request({
- url: l + "/api/wx/wxgame_create",
- method: "POST",
- header: {"content-type": "application/x-www-form-urlencoded"},
- data: e,
- success: function (s) {
- var t,
- i = +new Date() - n;
- "develop" == h && console.log(s.data, "支付接口返回", i),
- s.data.code
- ? 2 == s.data.data.pay_type
- ? wx.openCustomerServiceConversation({
- showMessageCard: !0,
- sendMessageTitle: s.data.data.order_sn,
- sendMessagePath: JSON.stringify(e),
- sendMessageImg: l + "/kefuIcon.png",
- success: function (t) {
- wx.hideLoading(),
- a({code: 1, msg: "支付success 客服回调"}),
- console.log(t, "客服回调");
- },
- fail: function (t) {
- wx.hideLoading(),
- a({code: 0, msg: "取消支付"}),
- console.log(t, "客服回调fail");
- }
- })
- : 1 == s.data.data.pay_type
- ? (wx.hideLoading(),
- wx.navigateToMiniProgram({
- appId: "wxab2e839b6578e72c",
- path: "pages/come/come?scene=" + s.data.data.id,
- extraData: {game_appid: p, openid: f},
- envVersion: "release",
- success: function (t) {
- wx.hideLoading(),
- a({code: 1, msg: "支付success "}),
- console.log(t, "res");
- },
- fail: function (t) {
- wx.hideLoading(),
- a({code: 0, msg: "支付dail"}),
- console.log(t, "fff");
- },
- complete: function () {
- wx.hideLoading();
- }
- }))
- : 3 == s.data.data.pay_type
- ? wx.request({
- url: l + "/api/wx/native_pay",
- method: "POST",
- data: {id: s.data.data.id},
- header: {"content-type": "application/json"},
- success: function (t) {
- console.log(t, "sss"),
- t.data.code &&
- ((t = l + "/" + t.data.data.url),
- console.log(t),
- wx.previewImage({
- current: t,
- urls: [t, t],
- success: function () {
- wx.hideLoading();
- },
- fail: function (t) {
- wx.hideLoading(), console.log(t, "prf");
- },
- complete: function (t) {
- wx.hideLoading(), console.log(t, "com");
- }
- }));
- }
- })
- : 4 == s.data.data.pay_type
- ? wx.request({
- url: l + "/api/mini/getUnlimit",
- method: "POST",
- data: {scene: s.data.data.id, appid: "wxab2e839b6578e72c"},
- header: {"content-type": "application/json"},
- success: function (t) {
- console.log(t, "sss"),
- t.data.code &&
- (console.log(l + "/" + t.data.data.url),
- wx.previewImage({
- current: l + "/" + t.data.data.url,
- urls: [l + "/" + t.data.data.url],
- success: function () {
- wx.hideLoading();
- },
- fail: function (t) {
- wx.hideLoading(), console.log(t, "prf");
- }
- }));
- }
- })
- : "android" == y || "windows" == y
- ? wx.requestMidasPayment({
- mode: s.data.data.param.mode,
- offerId: s.data.data.param.offerId,
- currencyType: s.data.data.param.currencyType,
- platform: s.data.data.param.platform,
- buyQuantity: s.data.data.param.buyQuantity,
- success: function () {
- a({code: 1, msg: "支付成功"}),
- "develop" == h && console.log("支付成功回调函数");
- var e = 0,
- t = s.data.data.order_sn,
- i = setInterval(function () {
- wx.request({
- url: l + "/api/wx/wxgame_notify",
- method: "POST",
- header: {
- "content-type":
- "application/x-www-form-urlencoded"
- },
- data: {
- bill_no: t,
- game_appid: p,
- account_id: f,
- sign: g
- },
- success: function (t) {
- "develop" == h &&
- console.log(t.data, "支付成功查询回调"),
- (1 == t.data.code || 10 < e) &&
- clearInterval(i),
- e++;
- },
- complete: function () {
- 30 < e && clearInterval(i);
- }
- });
- }, 2e3);
- },
- fail: function (t) {
- "develop" == h && console.log("支付失败", t),
- wx.hideLoading(),
- a({code: 0, msg: "支付失败"});
- var e = +new Date() - n;
- console.log("fail_time", e),
- (t.request_before = o),
- (t.req_success = i),
- (t.failTime = e),
- (t.appid = p),
- (t.openid = f),
- wx.request({
- url: l + "/api/wx/fail_pay",
- method: "POST",
- header: {
- "content-type":
- "application/x-www-form-urlencoded"
- },
- data: t,
- success: function () {}
- });
- }
- })
- : (wx.hideLoading(),
- wx.showModal({
- title: "提示",
- content: "请使用手机完成支付",
- showCancel: !1,
- cancelColor: "cancelColor"
- }))
- : (wx.hideLoading(),
- (t = s.data.data.data) &&
- 90011 == t.errcode &&
- ((f = ""), wx.removeStorageSync("sop_user")),
- a({code: 0, msg: s.data.msg}));
- },
- fail: function () {
- a({code: 0, msg: "请求失败"});
- }
- }))
- : a({code: 0, msg: "缺少角色名"})
- : a({code: 0, msg: "缺少服务器名"});
- });
- },
- toGameClub: function (t, e) {
- wx.openPage({
- openlink: t,
- success: function (t) {
- e(t.errMsg);
- },
- fail: function (t) {
- e({code: 0, msg: "open gameclub fail!", res: t.errMsg});
- }
- });
- },
- getUserData: function (e) {
- M(function () {
- wx.request({
- url: l + "/api/wx/get_userInfo_data",
- method: "POST",
- header: {"content-type": "application/x-www-form-urlencoded"},
- data: {game_appid: p, account_id: f, sign: g},
- success: function (t) {
- t = t.data;
- e(1 == t.code ? t.data : t);
- },
- fail: function (t) {
- console.log("getUserData", t);
- }
- });
- });
- },
- transfer: function () {
- wx.request({
- url: l + "/api/wx/transfer",
- method: "POST",
- header: {"content-type": "application/x-www-form-urlencoded"},
- data: {game_appid: p, account_id: f, sign: g, platform: y},
- success: function (t) {
- t = t.data;
- console.log(t, "ssssssss"),
- 1 == t.code &&
- wx.showModal({
- title: "转移大福利",
- content:
- "大大您好,这里看到您近期游戏体验较为活跃,作为我们的忠实玩家,现推出app版本,诚邀您参与体验,切换微信不再会影响游戏进程,游戏体验更流畅,app微信实现双登录,更有专属福利活动等着您,如有疑问,请联系官方客服QQ:800821618",
- confirmText: "立即前往",
- cancelText: "暂时跳过",
- success: function (t) {
- t.confirm
- ? (console.log("用户点击确定"),
- wx.openCustomerServiceConversation({
- showMessageCard: !0,
- sendMessageTitle: "转移",
- sendMessagePath: y,
- success: function (t) {
- console.log(t, "客服回调");
- },
- fail: function (t) {
- console.log(t, "客服回调fail"),
- wx.showModal({
- title: "转移大福利",
- content:
- "大大您好,这里看到您近期游戏体验较为活跃,作为我们的忠实玩家,现推出app版本,诚邀您参与体验,切换微信不再会影响游戏进程,游戏体验更流畅,app微信实现双登录,更有专属福利活动等着您,如有疑问,请联系官方客服QQ:800821618",
- confirmText: "立即前往",
- cancelText: "暂时跳过",
- success: function (t) {
- t.confirm
- ? (console.log("用户点击确定"),
- wx.openCustomerServiceConversation({
- showMessageCard: !0,
- sendMessageTitle: "转移",
- sendMessagePath: y,
- success: function (t) {
- console.log(t, "客服回调");
- },
- fail: function (t) {
- console.log(t, "客服回调fail");
- }
- }))
- : console.log("用户点击取消");
- }
- });
- }
- }))
- : console.log("用户点击取消");
- }
- });
- },
- fail: function (t) {
- console.log("transfer", t);
- }
- });
- },
- subscribeMsg: function (t, s) {
- var e,
- o = [],
- a = [];
- for (e in t) wx.getStorageSync(t[e]) || o.push(t[e]);
- if (0 == o.length) return console.log("已经订阅"), void s({code: 2, msg: "已经订阅"});
- var n = [];
- wx.requestSubscribeMessage({
- tmplIds: o,
- success: function (t) {
- if ((console.log(t, "success-ssssssss"), "requestSubscribeMessage:ok" == t.errMsg)) {
- for (var e in o)
- wx.getStorageSync(o[e]) ||
- ("accept" == t[o[e]]
- ? (a.push(o[e]), console.log(a, "upppppppp"))
- : (n.push(o[e]),
- wx.showModal({
- title: "订阅",
- content: "为了及时了解游戏动态,请订阅通知",
- cancelColor: "cancelColor",
- success: function (t) {
- t.confirm
- ? wx.openSetting({
- withSubscriptions: !0,
- success: function (t) {
- console.log(t, "openSetting");
- var e,
- i = t.subscriptionsSetting.itemSettings;
- for (e in n)
- wx.getStorageSync(n[e]) ||
- ("accept" == i[n[e]] && (a[o[e]] = o[e]));
- }
- })
- : s({code: 0, msg: "拒绝订阅"});
- }
- })));
- w(a, s);
- }
- },
- fail: function (t) {
- console.log(t, "fail"),
- wx.openSetting({
- withSubscriptions: !0,
- success: function (t) {
- console.log(t, "openSetting");
- var e,
- i = t.subscriptionsSetting.itemSettings;
- for (e in o) wx.getStorageSync(o[e]) || ("accept" == i[o[e]] && a.push(o[e]));
- w(a, s);
- },
- fail: function () {
- s({code: 0, msg: "拒绝订阅"});
- }
- });
- }
- });
- },
- onShare: function (t) {
- "develop" == h && console.log("----------设置转发-------------"),
- !t.query || D(t.query)
- ? (wx.showShareMenu({showShareItems: ["shareAppMessage", "shareTimeline"], withShareTicket: !0}),
- wx.onShareAppMessage(function () {
- return {
- title: t.title,
- imageUrl: t.imageUrl,
- query: "subchid=" + d + "&sharetype=onshare&shareid=" + f + "&" + t.query
- };
- }))
- : console.log("query error");
- },
- share: function (t) {
- "develop" == h && console.log("----------主动转发-------------"),
- M(function () {
- !t.query || D(t.query)
- ? (wx.showShareMenu({
- showShareItems: ["shareAppMessage", "shareTimeline"],
- withShareTicket: !0
- }),
- wx.shareAppMessage({
- title: t.title,
- imageUrl: t.imageUrl,
- query: "subchid=" + d + "&sharetype=share&shareid=" + f + "&" + t.query
- }))
- : console.log("query error");
- });
- },
- dot: function (t, e) {
- wx.request({
- url: l + "/api/wx/dot_record",
- method: "POST",
- header: {"content-type": "application/x-www-form-urlencoded"},
- data: {game_appid: p, account_id: f, step: t, sign: g, version: r, platform: y},
- success: function (t) {
- e(t.data);
- },
- fail: function (t) {
- e({code: 0, msg: "网络请求失败", res: t});
- }
- });
- },
- createVideoAd: function (t, i) {
- var e;
- "develop" == h && console.log(void 0 === s ? "undefined" : I(s), "typeof(video)"),
- "object" != (void 0 === s ? "undefined" : I(s))
- ? ("develop" == h && console.log(o, "typeof(adUnitId11)"),
- (o = t),
- (s = wx.createRewardedVideoAd({adUnitId: t})).onError(function (t) {
- var e = {};
- "develop" == h && console.log(t, "----------onError-------------"),
- (e.msg = t.errMsg),
- (e.state = "error"),
- (e.isEnded = !1),
- (e.res = t),
- i(e);
- }),
- s.onClose(function (t) {
- var e = {};
- T.advertisement("close", function () {}),
- (e.state = "close"),
- (e.isEnded = t.isEnded),
- (e.msg = "视频广告关闭"),
- i(e);
- }),
- s
- .load()
- .then(function () {
- console.log("激励视频加载成功"),
- s
- .show()
- .then(function () {
- T.advertisement("show", function () {}),
- i({state: "show", msg: "视频展示成功", isEnded: !1});
- })
- .catch(function (t) {
- var e = {code: 2, state: "error"};
- (e.msg = t.errMsg), (e.isEnded = !1), i(t);
- });
- })
- .catch(function (t) {
- console.log("激励视频加载失败", t);
- }))
- : o != t
- ? ("develop" == h && console.log(o, t, "typeof(new)"),
- (o = t),
- (e = wx.createRewardedVideoAd({adUnitId: t}))
- .load()
- .then(function () {
- e.show()
- .then(function () {
- T.advertisement("show", function () {}),
- i({state: "show", msg: "视频展示成功", isEnded: !1});
- })
- .catch(function (t) {
- var e = {code: 2, state: "error"};
- (e.msg = t.errMsg), (e.isEnded = !1), i(t);
- });
- })
- .catch(function (t) {
- console.log("激励视频加载失败", t);
- }))
- : ("develop" == h && console.log(s, "----------createVideoAd-------------"),
- s
- .show()
- .then(function () {
- T.advertisement("show", function () {}),
- i({state: "show", msg: "视频展示成功", isEnded: !1});
- })
- .catch(function (t) {
- var e = {code: 2, state: "error"};
- (e.msg = t.errMsg), (e.isEnded = !1), i(t);
- }));
- },
- advertisement: function (e, i) {
- "develop" == h && console.log(e, "----------上报广告-------------"),
- M(function () {
- var t = "";
- "show" == e
- ? (t = l + "/api/wx/videoClick")
- : "close" == e
- ? (t = l + "/api/wx/watch")
- : "share" == e && (t = l + "/api/wx/share"),
- wx.request({
- url: t,
- data: {openid: f, game_appid: p, sign: g, version: r, platform: y},
- method: "post",
- header: {"content-type": "application/x-www-form-urlencoded"},
- complete: function (t) {
- i(t.data);
- }
- });
- });
- },
- gameLevel: function (t, e) {
- var i = {};
- (i.openid = f),
- (i.appid = p),
- (i.sign = g),
- (i.level = t),
- (i.version = r),
- (i.platform = y),
- wx.request({
- url: l + "/api/wx/game_level",
- data: i,
- method: "post",
- header: {"content-type": "application/x-www-form-urlencoded"},
- complete: function (t) {
- e(t.data);
- }
- });
- },
- msg_check: function (t, e) {
- var i = {};
- (i.content = t),
- (i.appid = p),
- (i.openid = f),
- (i.version = r),
- wx.request({
- url: l + "/api/wx/msg_sec_check",
- data: i,
- method: "post",
- header: {"content-type": "application/x-www-form-urlencoded"},
- success: function (t) {
- e(t.data);
- }
- });
- },
- img_check: function (t, e) {
- wx.uploadFile({
- url: l + "/api/v2/img_sec_check",
- filePath: t,
- name: "media",
- formData: {appid: p, openid: f},
- success: function (t) {
- e(t.data);
- }
- });
- },
- media_check: function (t, e, i) {
- wx.request({
- url: l + "/api/v2/media_check",
- data: {appid: p, media_url: t, type: e},
- method: "post",
- header: {"content-type": "application/x-www-form-urlencoded"},
- success: function (t) {
- i(t.data);
- }
- });
- }
- }),
- cc.sys.platform === cc.sys.WECHAT_GAME &&
- ((m = wx.getStorageSync("sop_user")),
- (f = m.openid),
- (g = m.sign),
- console.log("==wxsdk version==", r),
- (h = t.env),
- (l = t.url),
- (p = t.appid),
- (function () {
- (_ = wx.getLaunchOptionsSync()), "develop" == h && console.log(_, "wx.getLaunchOptionsSync(111)");
- var t = _.query;
- (c = _.scene),
- (C = t.gdt_vid || ""),
- console.log("来源广告的广告id是: " + C),
- (Z = t.clue_token || ""),
- (b = t.ad_id || ""),
- (S = t.creative_id || "");
- var e = _.referrerInfo;
- t.via
- ? ((d = t.via || "test_sub_channel_id"), (u = t.shareid || 0), (n = t.sharetype || ""))
- : t.subchid
- ? ((d = t.subchid || "test_sub_channel_id"), (u = t.shareid || 0), (n = t.sharetype || ""))
- : e &&
- "string" == typeof e.extraData &&
- ((e.extraData = JSON.parse(e.extraData)),
- (d = e.extraData.subchid),
- (u = e.extraData.shareid || 0),
- (n = e.extraData.sharetype || "")),
- (i = wx.getSystemInfoSync()),
- (y = i.platform),
- (a = i.SDKVersion);
- })(),
- wx.onHide(function () {
- var t;
- console.log("onhide", v),
- (t = Math.floor((+new Date() - v) / 1e3)),
- "develop" == h && console.log("----------timing-------------:", t, U, v),
- !f ||
- t < U ||
- wx.request({
- url: l + "/api/wx/online_time",
- data: {openid: f, game_appid: p, timing: t, sign: g, version: r, platform: y},
- method: "post",
- header: {"content-type": "application/x-www-form-urlencoded"},
- success: function () {
- v = +new Date();
- }
- }),
- (v = +new Date());
- }),
- wx.onShow(function (t) {
- (v = +new Date()), console.log(JSON.stringify(t), "show");
- var e = t.referrerInfo;
- console.log(e, "refer"),
- e.extraData &&
- ((t = e.extraData),
- console.log("data-----------", e.appId),
- "wxab2e839b6578e72c" == e.appId &&
- ("success" == t.pay
- ? wx.showToast({
- title: "成功",
- icon: "success",
- duration: 2e3,
- fail: function (t) {
- console.log(t, "eeeeeee");
- }
- })
- : wx.showToast({
- title: "支付失败",
- icon: "error",
- duration: 2e3,
- fail: function (t) {
- console.log(t, "eeeeeee");
- }
- })));
- }),
- 0 <=
- (function (t, e) {
- (t = t.split(".")), (e = e.split("."));
- for (var i = Math.max(t.length, e.length); t.length < i; ) t.push("0");
- for (; e.length < i; ) e.push("0");
- for (var s = 0; s < i; s++) {
- var o = parseInt(t[s]),
- a = parseInt(e[s]);
- if (a < o) return 1;
- if (o < a) return -1;
- }
- return 0;
- })(a, "2.10.3") && wx.onAddToFavorites(function () {}),
- (window.dyb = T));
|