qqapi.js 59 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248
  1. (function(e, t) {
  2. this[e] = t(), typeof define == "function" ? define(this[e]) : typeof module == "object" && (module.exports = this[e])
  3. })("mqq", function(e) {
  4. "use strict";
  5. function p(e, t) {
  6. e = String(e).split("."), t = String(t).split(".");
  7. try {
  8. for (var n = 0, r = Math.max(e.length, t.length); n < r; n++) {
  9. var i = isFinite(e[n]) && Number(e[n]) || 0,
  10. s = isFinite(t[n]) && Number(t[n]) || 0;
  11. if (i < s) return -1;
  12. if (i > s) return 1
  13. }
  14. } catch (o) {
  15. return -1
  16. }
  17. return 0
  18. }
  19. function m(e, t, n, r, i) {
  20. if (!e || !t || !n) return;
  21. var s = e + "://" + t + "/" + n,
  22. o, f, c, h;
  23. r = r || [];
  24. if (!i || !u[i] && !window[i]) {
  25. i = null;
  26. for (f = 0, c = r.length; f < c; f++) {
  27. o = r[f], typeof o == "object" && (o = o.callbackName || o.callback);
  28. if (o && (u[o] || window[o])) {
  29. i = o;
  30. break
  31. }
  32. }
  33. }
  34. i && (a[i] = {
  35. uri: s,
  36. startTime: Date.now()
  37. }, h = String(i).match(/__MQQ_CALLBACK_(\d+)/), h && (a[h[1]] = a[i])), d.send(s, l)
  38. }
  39. function g(e) {
  40. var t = e.split("."),
  41. n = window;
  42. return t.forEach(function(e) {
  43. !n[e] && (n[e] = {}), n = n[e]
  44. }), n
  45. }
  46. function y(e, t, n) {
  47. var i = typeof e == "function" ? e : window[e];
  48. if (!i) return;
  49. var s = b(e),
  50. o = "__MQQ_CALLBACK_" + s;
  51. return window[o] = function() {
  52. var e = r.call(arguments);
  53. w(s, e, t, n)
  54. }, o
  55. }
  56. function b(e) {
  57. var t = o++;
  58. return e && (u[t] = e), t
  59. }
  60. function w(e, t, n, r) {
  61. var i = typeof e == "function" ? e : u[e] || window[e],
  62. s = Date.now();
  63. t = t || [], typeof i == "function" ? r ? setTimeout(function() {
  64. i.apply(null, t)
  65. }, 0) : i.apply(null, t) : console.log("mqqapi: not found such callback: " + e), n && (delete u[e], delete window["__MQQ_CALLBACK_" + e]);
  66. if (a[e]) {
  67. var o = a[e];
  68. delete a[e], Number(e) && delete a["__MQQ_CALLBACK_" + e];
  69. var f = c,
  70. l = ["retCode", "retcode", "resultCode", "ret", "code", "r"],
  71. h, p, v;
  72. if (t.length) {
  73. h = t[0];
  74. if (typeof h == "object" && h !== null) {
  75. for (p = 0, v = l.length; p < v; p++)
  76. if (l[p] in h) {
  77. f = h[l[p]];
  78. break
  79. }
  80. } else /^-?\d+$/.test(String(h)) && (f = h)
  81. }
  82. d.send(o.uri + "#callback", f, s - o.startTime)
  83. }
  84. }
  85. function E(e) {
  86. v.debug("execGlobalCallback: " + JSON.stringify(arguments));
  87. var n = r.call(arguments, 1);
  88. t.android && n && n.length && n.forEach(function(e, t) {
  89. typeof e == "object" && "r" in e && "result" in e && (n[t] = e.result)
  90. }), w(e, n)
  91. }
  92. function S() {}
  93. function x(e, n) {
  94. var r = null,
  95. i = e.lastIndexOf("."),
  96. s = e.substring(0, i),
  97. o = e.substring(i + 1),
  98. u = g(s);
  99. n.iOS && t.iOS ? r = n.iOS : n.android && t.android ? r = n.android : n.browser && (r = n.browser), u[o] = r || S, f[e] = n.support
  100. }
  101. function T(e) {
  102. var n = f[e] || f[e.replace("qw.", "mqq.")],
  103. r = t.iOS ? "iOS" : t.android ? "android" : "browser";
  104. return !n || !n[r] ? !1 : t.compare(n[r]) > -1
  105. }
  106. function N(n, r) {
  107. v.debug("openURL: " + n);
  108. var i = document.createElement("iframe");
  109. i.style.cssText = "display:none;width:0px;height:0px;";
  110. var s = function() {
  111. E(r, {
  112. r: -201,
  113. result: "error"
  114. })
  115. };
  116. t.iOS && (i.onload = s, i.src = n);
  117. var o = document.body || document.documentElement;
  118. o.appendChild(i), t.android && (i.onload = s, i.src = n);
  119. var u = t.__RETURN_VALUE;
  120. return t.__RETURN_VALUE = e, setTimeout(function() {
  121. i.parentNode.removeChild(i)
  122. }, 0), u
  123. }
  124. function C(e) {
  125. return t.iOS ? !0 : t.android && t.__supportAndroidNewJSBridge ? h[e] && t.compare(h[e]) < 0 ? !1 : !0 : !1
  126. }
  127. function k(e, n, i, s) {
  128. if (!e || !n) return null;
  129. var o, u;
  130. i = r.call(arguments, 2), s = i.length && i[i.length - 1], s && typeof s == "function" ? i.pop() : typeof s == "undefined" ? i.pop() : s = null, u = b(s), (n !== "pbReport" || !i[0] || !i[0].__internalReport) && m("jsbridge", e, n, i, u);
  131. if (t.android && !t.__supportAndroidJSBridge)
  132. if (window[e] && window[e][n]) {
  133. var a = window[e][n].apply(window[e], i);
  134. if (!s) return a;
  135. w(u, [a])
  136. } else s && w(u, [t.ERROR_NO_SUCH_METHOD]);
  137. else
  138. if (C(e, n)) {
  139. o = "jsbridge://" + encodeURIComponent(e) + "/" + encodeURIComponent(n), i.forEach(function(e, t) {
  140. typeof e == "object" && (e = JSON.stringify(e)), t === 0 ? o += "?p=" : o += "&p" + t + "=", o += encodeURIComponent(String(e))
  141. }), n !== "pbReport" && (o += "#" + u);
  142. var f = N(o);
  143. if (t.iOS) {
  144. f = f ? f.result : null;
  145. if (!s) return f;
  146. w(u, [f], !1, !0)
  147. }
  148. } else t.android && (o = "jsbridge://" + encodeURIComponent(e) + "/" + encodeURIComponent(n) + "/" + u, i.forEach(function(e) {
  149. typeof e == "object" && (e = JSON.stringify(e)), o += "/" + encodeURIComponent(String(e))
  150. }), N(o, u));
  151. return null
  152. }
  153. function L(e, t, n, i, s) {
  154. if (!e || !t || !n) return null;
  155. var o = r.call(arguments),
  156. u;
  157. typeof o[o.length - 1] == "function" ? (s = o[o.length - 1], o.pop()) : s = null, o.length === 4 ? i = o[o.length - 1] : i = {}, s && (i.callback_type = "javascript", u = y(s), i.callback_name = u), i.src_type = i.src_type || "web", i.version || (i.version = 1);
  158. var a = e + "://" + encodeURIComponent(t) + "/" + encodeURIComponent(n) + "?" + O(i);
  159. N(a), m(e, t, n, o, u)
  160. }
  161. function A(e) {
  162. var t, n, r, i = e.indexOf("?"),
  163. s = e.substring(i + 1).split("&"),
  164. o = {};
  165. for (t = 0; t < s.length; t++) i = s[t].indexOf("="), n = s[t].substring(0, i), r = s[t].substring(i + 1), o[n] = decodeURIComponent(r);
  166. return o
  167. }
  168. function O(e) {
  169. var t = [];
  170. for (var n in e) e.hasOwnProperty(n) && t.push(encodeURIComponent(String(n)) + "=" + encodeURIComponent(String(e[n])));
  171. return t.join("&")
  172. }
  173. function M(e, t) {
  174. var n = document.createElement("a");
  175. n.href = e;
  176. var r;
  177. return n.search && (r = A(String(n.search).substring(1)), t.forEach(function(e) {
  178. delete r[e]
  179. }), n.search = "?" + O(r)), n.hash && (r = A(String(n.hash).substring(1)), t.forEach(function(e) {
  180. delete r[e]
  181. }), n.hash = "#" + O(r)), e = n.href, n = null, e
  182. }
  183. function _(e, t) {
  184. var n = "evt-" + e;
  185. return (u[n] = u[n] || []).push(t), !0
  186. }
  187. function D(e, t) {
  188. var n = "evt-" + e,
  189. r = u[n],
  190. i = !1;
  191. if (!r) return !1;
  192. if (!t) return delete u[n], !0;
  193. for (var s = r.length - 1; s >= 0; s--) t === r[s] && (r.splice(s, 1), i = !0);
  194. return i
  195. }
  196. function P(e) {
  197. var t = "evt-" + e,
  198. n = u[t],
  199. i = r.call(arguments, 1);
  200. n && n.forEach(function(e) {
  201. w(e, i, !1, !0)
  202. })
  203. }
  204. function H(e, n, r) {
  205. var i = {
  206. event: e,
  207. data: n || {},
  208. options: r || {}
  209. };
  210. t.android && i.options.broadcast === !1 && t.compare("5.2") <= 0 && (i.options.domains = ["localhost"], i.options.broadcast = !0);
  211. var s = "jsbridge://event/dispatchEvent?p=" + encodeURIComponent(JSON.stringify(i) || "");
  212. N(s), m("jsbridge", "event", "dispatchEvent")
  213. }
  214. var t = {}, n = navigator.userAgent,
  215. r = Array.prototype.slice,
  216. i = /(iPad|iPhone|iPod).*? (IPad)?QQ\/([\d\.]+)/,
  217. s = /\bV1_AND_SQI?_([\d\.]+)(.*? QQ\/([\d\.]+))?/,
  218. o = 1,
  219. u = {}, a = {}, f = {}, l = -1e5,
  220. c = -2e5,
  221. h = {
  222. qbizApi: "5.0",
  223. pay: "999999",
  224. SetPwdJsInterface: "999999",
  225. GCApi: "999999",
  226. q_download: "999999",
  227. qqZoneAppList: "999999",
  228. qzone_app: "999999",
  229. qzone_http: "999999",
  230. qzone_imageCache: "999999",
  231. RoamMapJsPlugin: "999999"
  232. };
  233. t.debuging = !1, t.iOS = i.test(n), t.android = s.test(n), t.iOS && t.android && (t.iOS = !1), t.version = "20140902003", t.QQVersion = "0", t.ERROR_NO_SUCH_METHOD = "no such method", t.ERROR_PERMISSION_DENIED = "permission denied", !t.android && !t.iOS && console.log("mqqapi: not android or ios"), t.compare = function(e) {
  234. return p(t.QQVersion, e)
  235. }, t.android && (t.QQVersion = function(e) {
  236. return e && (e[3] || e[1]) || 0
  237. }(n.match(s)), window.JsBridge || (window.JsBridge = {}), window.JsBridge.callMethod = k, window.JsBridge.callback = E, window.JsBridge.compareVersion = t.compare), t.iOS && (window.iOSQQApi = t, t.__RETURN_VALUE = e, t.QQVersion = function(e) {
  238. return e && e[3] || 0
  239. }(n.match(i))), t.platform = t.iOS ? "IPH" : t.android ? "AND" : "OTH";
  240. var d = function() {
  241. function f() {
  242. var i = e;
  243. e = [], r = 0;
  244. if (!i.length) return;
  245. var o = {};
  246. o.appid = s, o.releaseversion = u, o.sdkversion = t.version, o.qua = a, o.frequency = 1, o.t = Date.now(), o.key = ["commandid", "resultcode", "tmcost"].join(","), i.forEach(function(e, t) {
  247. o[t + 1 + "_1"] = e[0], o[t + 1 + "_2"] = e[1], o[t + 1 + "_3"] = e[2]
  248. }), o = new String(O(o));
  249. var l = new Image;
  250. l.onload = function() {
  251. l = null
  252. }, l.src = "http://wspeed.qq.com/w.cgi?" + o, r = setTimeout(f, n)
  253. }
  254. function l(t, s, o) {
  255. e.push([t, s || 0, o || 0]), r || (i = Date.now(), r = setTimeout(f, n))
  256. }
  257. var e = [],
  258. n = 200,
  259. r = 0,
  260. i = 0,
  261. s = 1000218,
  262. o = String(t.QQVersion).split(".").slice(0, 3).join("."),
  263. u = t.platform + "_MQQ_" + o,
  264. a = t.platform + t.QQVersion + "/" + t.version;
  265. return {
  266. send: l
  267. }
  268. }(),
  269. v = function() {
  270. function e() {
  271. if (!t.debuging) return;
  272. var e = r.call(arguments),
  273. n = [];
  274. e.forEach(function(e) {
  275. typeof e == "object" && (e = JSON.stringify(e)), n.push(e)
  276. }), alert(n.join("\n"))
  277. }
  278. return {
  279. debug: e
  280. }
  281. }();
  282. return t.__androidForSamsung = /_NZ\b/.test(n), t.__supportAndroidJSBridge = t.android && (t.compare("4.5") > -1 || t.__androidForSamsung), t.__supportAndroidNewJSBridge = t.android && t.compare("4.7.2") > -1, t.__aCallbacks = u, t.__aReports = a, t.__aSupports = f, t.__fireCallback = w, t.__reportAPI = m, t.build = x, t.support = T, t.invoke = k, t.invokeSchema = L, t.callback = y, t.execGlobalCallback = E, t.mapQuery = A, t.toQuery = O, t.removeQuery = M, t.addEventListener = _, t.removeEventListener = D, t.execEventCallback = P, t.dispatchEvent = H, t
  283. }),
  284. function(e) {
  285. "use strict";
  286. function l(e, n, r) {
  287. return r ? function() {
  288. var r = [e, n].concat(t.call(arguments));
  289. mqq.invoke.apply(mqq, r)
  290. } : function() {
  291. var r = t.call(arguments),
  292. i = null;
  293. r.length && typeof r[r.length - 1] == "function" && (i = r[r.length - 1], r.pop());
  294. var s = f[e][n].apply(f[e], r);
  295. if (!i) return s;
  296. i(s)
  297. }
  298. }
  299. function c(e, t) {
  300. t = t || 1;
  301. if (mqq.compare(t) < 0) {
  302. console.info("jsbridge: version not match, apis ignored");
  303. return
  304. }
  305. for (var n in e) {
  306. var r = e[n];
  307. if (!r || !r.length || !Array.isArray(r)) continue;
  308. var i = window[n];
  309. if (!i) {
  310. if (!a) continue;
  311. window[n] = {}
  312. } else typeof i == "object" && i.getClass && (f[n] = i, window[n] = {});
  313. var s = f[n];
  314. i = window[n];
  315. for (var o = 0, u = r.length; o < u; o++) {
  316. var c = r[o];
  317. if (i[c]) continue;
  318. s ? s[c] && (i[c] = l(n, c, !1)) : i[c] = l(n, c, !0)
  319. }
  320. }
  321. }
  322. var t = Array.prototype.slice,
  323. n = {
  324. QQApi: ["isAppInstalled", "isAppInstalledBatch", "startAppWithPkgName", "checkAppInstalled", "checkAppInstalledBatch", "getOpenidBatch", "startAppWithPkgNameAndOpenId"]
  325. }, r = {
  326. QQApi: ["lauchApp"]
  327. }, i = {
  328. publicAccount: ["close", "getJson", "getLocation", "hideLoading", "openInExternalBrowser", "showLoading", "viewAccount"]
  329. }, s = {
  330. publicAccount: ["getMemberCount", "getNetworkState", "getValue", "open", "openEmoji", "openUrl", "setRightButton", "setValue", "shareMessage", "showDialog"],
  331. qqZoneAppList: ["getCurrentVersion", "getSdPath", "getWebDisplay", "goUrl", "openMsgCenter", "showDialog", "setAllowCallBackEvent"],
  332. q_download: ["doDownloadAction", "getQueryDownloadAction", "registerDownloadCallBackListener", "cancelDownload", "cancelNotification"],
  333. qzone_http: ["httpRequest"],
  334. qzone_imageCache: ["downloadImage", "getImageRootPath", "imageIsExist", "sdIsMounted", "updateImage", "clearImage"],
  335. qzone_app: ["getAllDownAppInfo", "getAppInfo", "getAppInfoBatch", "startSystemApp", "uninstallApp"]
  336. }, o = {
  337. coupon: ["addCoupon", "addFavourBusiness", "gotoCoupon", "gotoCouponHome", "isCouponValid", "isFavourBusiness", "isFavourCoupon", "removeFavourBusiness"]
  338. }, u = navigator.userAgent,
  339. a = mqq.__supportAndroidJSBridge,
  340. f = {};
  341. window.JsBridge || (window.JsBridge = {}), window.JsBridge.restoreApis = c, c(n), c(r, "4.5"), a ? /\bPA\b/.test(u) || mqq.compare("4.6") >= 0 ? (c(i), c(s, "4.5"), c(o, "4.5")) : /\bQR\b/.test(u) && (c(o, "4.5"), mqq.compare("4.5") >= 0 && mqq.compare("4.6") < 0 && (window.publicAccount = {
  342. openUrl: function(e) {
  343. location.href = e
  344. }
  345. })) : c(i, "4.2")
  346. }(), mqq.build("mqq.app.checkAppInstalled", {
  347. android: function(e, t) {
  348. mqq.invoke("QQApi", "checkAppInstalled", e, t)
  349. },
  350. support: {
  351. android: "4.2"
  352. }
  353. }), mqq.build("mqq.app.checkAppInstalledBatch", {
  354. android: function(e, t) {
  355. e = e.join("|"), mqq.invoke("QQApi", "checkAppInstalledBatch", e, function(e) {
  356. e = (e || "").split("|"), t(e)
  357. })
  358. },
  359. support: {
  360. android: "4.2"
  361. }
  362. }), mqq.build("mqq.app.isAppInstalled", {
  363. iOS: function(e, t) {
  364. return mqq.invoke("app", "isInstalled", {
  365. scheme: e
  366. }, t)
  367. },
  368. android: function(e, t) {
  369. mqq.invoke("QQApi", "isAppInstalled", e, t)
  370. },
  371. support: {
  372. iOS: "4.2",
  373. android: "4.2"
  374. }
  375. }), mqq.build("mqq.app.isAppInstalledBatch", {
  376. iOS: function(e, t) {
  377. return mqq.invoke("app", "batchIsInstalled", {
  378. schemes: e
  379. }, t)
  380. },
  381. android: function(e, t) {
  382. e = e.join("|"), mqq.invoke("QQApi", "isAppInstalledBatch", e, function(e) {
  383. var n = [];
  384. e = (e + "").split("|");
  385. for (var r = 0; r < e.length; r++) n.push(parseInt(e[r]) === 1);
  386. t(n)
  387. })
  388. },
  389. support: {
  390. iOS: "4.2",
  391. android: "4.2"
  392. }
  393. }), mqq.build("mqq.app.launchApp", {
  394. iOS: function(e) {
  395. mqq.invokeSchema(e.name, "app", "launch", e)
  396. },
  397. android: function(e) {
  398. mqq.invoke("QQApi", "startAppWithPkgName", e.name)
  399. },
  400. support: {
  401. iOS: "4.2",
  402. android: "4.2"
  403. }
  404. }), mqq.build("mqq.app.launchAppWithTokens", {
  405. iOS: function(e, t) {
  406. return typeof e == "object" ? mqq.invoke("app", "launchApp", e) : mqq.invoke("app", "launchApp", {
  407. appID: e,
  408. paramsStr: t
  409. })
  410. },
  411. android: function(e) {
  412. mqq.compare("5.2") >= 0 ? mqq.invoke("QQApi", "launchAppWithTokens", e) : mqq.compare("4.6") >= 0 ? mqq.invoke("QQApi", "launchAppWithTokens", e.appID, e.paramsStr, e.packageName, e.flags || e.falgs || 0) : mqq.invoke("QQApi", "launchApp", e.appID, e.paramsStr, e.packageName)
  413. },
  414. support: {
  415. iOS: "4.6",
  416. android: "4.6"
  417. }
  418. }), mqq.build("mqq.app.sendFunnyFace", {
  419. iOS: function(e) {
  420. mqq.invoke("app", "sendFunnyFace", e)
  421. },
  422. android: function(e) {
  423. mqq.invoke("qbizApi", "sendFunnyFace", e.type, e.sessionType, e.gcode, e.guin, e.faceID)
  424. },
  425. support: {
  426. iOS: "4.6",
  427. android: "4.6"
  428. }
  429. }), mqq.build("mqq.coupon.addCoupon", {
  430. iOS: function(e, t, n, r, i) {
  431. if (typeof e == "object") {
  432. var s = e;
  433. (s.callback = mqq.callback(t)) && mqq.invoke("coupon", "addCoupon", s)
  434. } else typeof r == "function" && (i = r, r = ""), mqq.invoke("coupon", "addCoupon", {
  435. bid: e,
  436. cid: t,
  437. sourceId: n,
  438. city: r || "",
  439. callback: mqq.callback(i)
  440. })
  441. },
  442. android: function(e, t) {
  443. var n = mqq.callback(t, !0);
  444. mqq.invoke("coupon", "addCoupon", e.bid, e.sourceId, e.cid, n)
  445. },
  446. support: {
  447. iOS: "4.6",
  448. android: "4.6"
  449. }
  450. }), mqq.build("mqq.coupon.addFavourBusiness", {
  451. iOS: function(e, t, n) {
  452. if (typeof e == "object") {
  453. var r = e;
  454. (r.callback = mqq.callback(t)) && mqq.invoke("coupon", "addFavourBusiness", r)
  455. } else mqq.invoke("coupon", "addFavourBusiness", {
  456. bid: e,
  457. sourceId: t,
  458. callback: mqq.callback(n)
  459. })
  460. },
  461. android: function(e, t) {
  462. var n = mqq.callback(t, !0);
  463. mqq.invoke("coupon", "addFavourBusiness", e.bid, e.sourceId, n)
  464. },
  465. support: {
  466. iOS: "4.6",
  467. android: "4.6"
  468. }
  469. }), mqq.build("mqq.coupon.goToCouponHomePage", {
  470. iOS: function(e) {
  471. mqq.invoke("coupon", "goToCouponHomePage", {
  472. params: e
  473. })
  474. },
  475. android: function(e) {
  476. e = JSON.stringify(e || {}), mqq.invoke("coupon", "goToCouponHomePage", e)
  477. },
  478. support: {
  479. iOS: "4.6",
  480. android: "4.6"
  481. }
  482. }), mqq.build("mqq.coupon.isFavourBusiness", {
  483. iOS: function(e, t, n) {
  484. if (typeof e == "object") {
  485. var r = e;
  486. (r.callback = mqq.callback(t)) && mqq.invoke("coupon", "isFavourBusiness", r)
  487. } else mqq.invoke("coupon", "isFavourBusiness", {
  488. bid: e,
  489. sourceId: t,
  490. callback: mqq.callback(n)
  491. })
  492. },
  493. android: function(e, t) {
  494. mqq.invoke("coupon", "isFavourBusiness", e.bid, e.sourceId, t)
  495. },
  496. support: {
  497. iOS: "4.6",
  498. android: "4.6"
  499. }
  500. }), mqq.build("mqq.coupon.isFavourCoupon", {
  501. iOS: function(e, t, n, r) {
  502. if (typeof e == "object") {
  503. var i = e;
  504. (i.callback = mqq.callback(t)) && mqq.invoke("coupon", "isFavourCoupon", i)
  505. } else mqq.invoke("coupon", "isFavourCoupon", {
  506. bid: e,
  507. cid: t,
  508. sourceId: n,
  509. callback: mqq.callback(r)
  510. })
  511. },
  512. android: function(e, t) {
  513. mqq.invoke("coupon", "isFavourCoupon", e.bid, e.cid, e.sourceId, t)
  514. },
  515. support: {
  516. iOS: "4.6",
  517. android: "4.6"
  518. }
  519. }), mqq.build("mqq.coupon.removeCoupon", {
  520. iOS: function(e, t, n, r) {
  521. if (typeof e == "object") {
  522. var i = e;
  523. (i.callback = mqq.callback(t)) && mqq.invoke("coupon", "removeCoupon", i)
  524. } else mqq.invoke("coupon", "removeCoupon", {
  525. bid: e,
  526. cid: t,
  527. sourceId: n,
  528. callback: mqq.callback(r)
  529. })
  530. },
  531. support: {
  532. iOS: "4.6"
  533. }
  534. }), mqq.build("mqq.coupon.removeFavourBusiness", {
  535. iOS: function(e, t, n) {
  536. if (typeof e == "object") {
  537. var r = e;
  538. (r.callback = mqq.callback(t)) && mqq.invoke("coupon", "removeFavourBusiness", r)
  539. } else mqq.invoke("coupon", "removeFavourBusiness", {
  540. bid: e,
  541. sourceId: t,
  542. callback: mqq.callback(n)
  543. })
  544. },
  545. android: function(e, t) {
  546. var n = mqq.callback(t, !0);
  547. mqq.invoke("coupon", "removeFavourBusiness", e.bid, e.sourceId, n)
  548. },
  549. support: {
  550. iOS: "4.6",
  551. android: "4.6"
  552. }
  553. }), mqq.build("mqq.data.batchFetchOpenID", {
  554. iOS: function(e, t) {
  555. var n = e.appIDs;
  556. mqq.data.fetchJson({
  557. url: "http://cgi.connect.qq.com/api/get_openids_by_appids",
  558. params: {
  559. appids: JSON.stringify(n)
  560. }
  561. }, t)
  562. },
  563. android: function(e, t) {
  564. var n = e.appIDs;
  565. mqq.data.fetchJson({
  566. url: "http://cgi.connect.qq.com/api/get_openids_by_appids",
  567. params: {
  568. appids: JSON.stringify(n)
  569. }
  570. }, t)
  571. },
  572. support: {
  573. iOS: "4.5",
  574. android: "4.6"
  575. }
  576. }), mqq.build("mqq.data.deleteH5Data", {
  577. iOS: function(e, t) {
  578. var n = t ? mqq.callback(t) : null;
  579. mqq.invoke("data", "deleteWebviewBizData", {
  580. callback: n,
  581. params: e
  582. })
  583. },
  584. android: function(e, t) {
  585. e = JSON.stringify(e || {}), mqq.invoke("publicAccount", "deleteH5Data", e, mqq.callback(t, !0))
  586. },
  587. support: {
  588. iOS: "4.6",
  589. android: "4.6"
  590. }
  591. }), mqq.build("mqq.data.deleteH5DataByHost", {
  592. iOS: function(e, t) {
  593. var n = t ? mqq.callback(t) : null;
  594. mqq.invoke("data", "deleteWebviewBizData", {
  595. callback: n,
  596. delallhostdata: 1,
  597. params: e
  598. })
  599. },
  600. android: function(e, t) {
  601. e = JSON.stringify(e || {}), mqq.invoke("publicAccount", "deleteH5DataByHost", e, mqq.callback(t, !0))
  602. },
  603. support: {
  604. iOS: "4.6",
  605. android: "4.6"
  606. }
  607. }),
  608. function() {
  609. function n() {
  610. return "UID_" + ++t
  611. }
  612. var e = {}, t = 1;
  613. window.clientCallback = function(t, n) {
  614. var r = e[n];
  615. if (!r) {
  616. console.log("this getJson no callbackToken!");
  617. return
  618. }
  619. if (r.callback) {
  620. clearTimeout(r.timer);
  621. if (typeof t == "string") try {
  622. t = JSON.parse(t)
  623. } catch (i) {
  624. t = null
  625. }
  626. r.callback(t, r.context || window, 200), r.callback = null
  627. }
  628. }, mqq.build("mqq.data.fetchJson", {
  629. iOS: function(e, t) {
  630. var n = e.url,
  631. r = e.params || {}, i = e.options || {}, s = e.context;
  632. r._t = +(new Date);
  633. var o = t ? mqq.callback(function(e, n, r) {
  634. if (typeof e == "string") try {
  635. e = JSON.parse(e)
  636. } catch (i) {
  637. e = null
  638. }
  639. t(e, n, r)
  640. }, !0, !0) : null;
  641. mqq.invoke("data", "fetchJson", {
  642. method: i.method || "GET",
  643. timeout: i.timeout || -1,
  644. options: i,
  645. url: n,
  646. params: mqq.toQuery(r),
  647. callback: o,
  648. context: JSON.stringify(s)
  649. })
  650. },
  651. android: function(t, r) {
  652. var i = t.options || {}, s = i.method || "GET",
  653. o = {
  654. param: t.params,
  655. method: s
  656. };
  657. o = JSON.stringify(o);
  658. var u = n();
  659. t.callback = r, e[u] = t, i.timeout && (t.timer = setTimeout(function() {
  660. t.callback && (t.callback("timeout", t.context || window, 0), t.callback = null)
  661. }, i.timeout)), mqq.invoke("publicAccount", "getJson", t.url, o, "", u)
  662. },
  663. support: {
  664. iOS: "4.5",
  665. android: "4.6"
  666. }
  667. })
  668. }(), mqq.build("mqq.data.followUin", {
  669. iOS: function(e, t) {
  670. e.callback = mqq.callback(t), mqq.invoke("data", "followUin", e)
  671. },
  672. android: function(e, t) {
  673. mqq.invoke("publicAccount", "followUin", e, mqq.callback(t))
  674. },
  675. support: {
  676. iOS: "4.7",
  677. android: "4.7"
  678. }
  679. }), mqq.build("mqq.data.getClipboard", {
  680. iOS: function(e) {
  681. var t = {}, n = mqq.invoke("data", "getClipboard", t);
  682. e && e(n)
  683. },
  684. android: function(e) {
  685. var t = {};
  686. e && (t.callback = mqq.callback(e)), mqq.invoke("data", "getClipboard", t)
  687. },
  688. support: {
  689. iOS: "4.7.2",
  690. android: "4.7.2"
  691. }
  692. }), mqq.build("mqq.data.getPageLoadStamp", {
  693. iOS: function(e) {
  694. mqq.invoke("data", "getPageLoadStamp", {
  695. callback: mqq.callback(e)
  696. })
  697. },
  698. android: function(e) {
  699. mqq.invoke("publicAccount", "getPageLoadStamp", mqq.callback(e))
  700. },
  701. support: {
  702. iOS: "4.6",
  703. android: "4.6"
  704. }
  705. }),
  706. function() {
  707. var e = function(e) {
  708. return function(t) {
  709. if (mqq.android && t && t.result === undefined) {
  710. try {
  711. t = JSON.parse(t)
  712. } catch (n) {}
  713. t = {
  714. result: 0,
  715. data: t,
  716. message: "\u6210\u529f"
  717. }
  718. }
  719. e(t)
  720. }
  721. }, t = function(t) {
  722. if (mqq.compare("4.7.1") >= 0) mqq.invoke("qw_data", "getPerformance", e(t));
  723. else try {
  724. common.getPerformance(e(t))
  725. } catch (n) {
  726. t({
  727. result: -1,
  728. message: "\u8be5\u63a5\u53e3\u5728\u624bQ v4.7.1 \u6216\u4ee5\u4e0a\u624d\u652f\u6301\uff01",
  729. data: null
  730. })
  731. }
  732. };
  733. mqq.build("mqq.data.getPerformance", {
  734. iOS: t,
  735. android: t,
  736. support: {
  737. iOS: "4.7.1",
  738. android: "4.7.1"
  739. }
  740. })
  741. }(), mqq.build("mqq.data.getUrlImage", {
  742. iOS: function(e, t) {
  743. var n = t ? mqq.callback(t, !1, !0) : null;
  744. mqq.invoke("data", "getUrlImage", {
  745. callback: n,
  746. params: e
  747. })
  748. },
  749. android: function(e, t) {
  750. e = JSON.stringify(e || {}), mqq.invoke("publicAccount", "getUrlImage", e, mqq.callback(t))
  751. },
  752. support: {
  753. iOS: "4.6",
  754. android: "4.6"
  755. }
  756. }), mqq.build("mqq.data.getUserInfo", {
  757. iOS: function(e) {
  758. return mqq.invoke("data", "userInfo", e)
  759. },
  760. android: function(e) {
  761. mqq.invoke("data", "userInfo", {
  762. callback: mqq.callback(e)
  763. })
  764. },
  765. support: {
  766. iOS: "4.7",
  767. android: "4.7"
  768. }
  769. }), mqq.build("mqq.data.isFollowUin", {
  770. iOS: function(e, t) {
  771. e.callback = mqq.callback(t), mqq.invoke("data", "isFollowUin", e)
  772. },
  773. android: function(e, t) {
  774. mqq.invoke("publicAccount", "isFollowUin", e, mqq.callback(t))
  775. },
  776. support: {
  777. iOS: "4.7",
  778. android: "4.7"
  779. }
  780. }), mqq.build("mqq.data.pbReport", {
  781. iOS: function(e, t) {
  782. mqq.invoke("data", "pbReport", {
  783. type: String(e),
  784. data: t
  785. })
  786. },
  787. android: function(e, t) {
  788. mqq.invoke("publicAccount", "pbReport", String(e), t)
  789. },
  790. support: {
  791. iOS: "4.6",
  792. android: "4.6"
  793. }
  794. }), mqq.build("mqq.data.readH5Data", {
  795. iOS: function(e, t) {
  796. var n = t ? mqq.callback(t) : null;
  797. mqq.invoke("data", "readWebviewBizData", {
  798. callback: n,
  799. params: e
  800. })
  801. },
  802. android: function(e, t) {
  803. e = JSON.stringify(e || {}), mqq.invoke("publicAccount", "readH5Data", e, mqq.callback(function(e) {
  804. if (e && e.response && e.response.data) {
  805. var n = e.response.data;
  806. n = n.replace(/\\/g, ""), n = decodeURIComponent(n), e.response.data = n
  807. }
  808. t(e)
  809. }, !0))
  810. },
  811. support: {
  812. iOS: "4.6",
  813. android: "4.6"
  814. }
  815. }), mqq.build("mqq.data.sendRequest", {
  816. iOS: function(e, t) {
  817. var n = e.url,
  818. r = e.params,
  819. i = e.options || {}, s = e.context;
  820. r._t = +(new Date), mqq.invoke("data", "fetchJson", {
  821. method: i.method || "GET",
  822. options: i,
  823. url: n,
  824. params: mqq.toQuery(r),
  825. callback: mqq.callback(t),
  826. context: JSON.stringify(s)
  827. })
  828. },
  829. android: function(e, t) {
  830. e.callback = mqq.callback(t), mqq.invoke("data", "sendRequest", e)
  831. },
  832. support: {
  833. iOS: "4.5",
  834. android: "4.7"
  835. }
  836. }), mqq.build("mqq.data.setClipboard", {
  837. iOS: function(e, t) {
  838. mqq.invoke("data", "setClipboard", e), t && t(!0)
  839. },
  840. android: function(e, t) {
  841. t && (e.callback = mqq.callback(t)), mqq.invoke("data", "setClipboard", e)
  842. },
  843. support: {
  844. iOS: "4.7.2",
  845. android: "4.7.2"
  846. }
  847. }), mqq.build("mqq.data.setShareInfo", {
  848. iOS: function(e, t) {
  849. return e.share_url && (e.share_url = mqq.removeQuery(e.share_url, ["sid", "3g_sid"])), e.desc && (e.desc = e.desc.length > 50 ? e.desc.substring(0, 50) + "..." : e.desc), mqq.invoke("data", "setShareInfo", {
  850. params: e
  851. }, t)
  852. },
  853. android: function(e, t) {
  854. e.share_url && (e.share_url = mqq.removeQuery(e.share_url, ["sid", "3g_sid"])), e.desc && (e.desc = e.desc.length > 50 ? e.desc.substring(0, 50) + "..." : e.desc), mqq.invoke("QQApi", "setShareInfo", e, t)
  855. },
  856. support: {
  857. iOS: "4.6",
  858. android: "4.6"
  859. }
  860. }), mqq.build("mqq.data.setShareURL", {
  861. iOS: function(e, t) {
  862. e.url && (e.url = mqq.removeQuery(e.url, ["sid", "3g_sid"])), mqq.invoke("data", "setShareURL", e, t)
  863. },
  864. android: function(e, t) {
  865. e.url && (e.url = mqq.removeQuery(e.url, ["sid", "3g_sid"])), mqq.compare("4.6") < 0 ? t(!1) : mqq.invoke("QQApi", "setShareURL", e.url, t)
  866. },
  867. support: {
  868. iOS: "4.6",
  869. android: "4.6"
  870. }
  871. }), mqq.build("mqq.data.startSyncData", {
  872. iOS: function(e, t) {
  873. var n = mqq.callback(t);
  874. n && (e.callback = n, mqq.invoke("data", "startSyncData", e))
  875. },
  876. android: function(e, t) {
  877. var n = mqq.callback(t);
  878. mqq.invoke("qbizApi", "startSyncData", e.appID, n)
  879. },
  880. support: {
  881. iOS: "4.6",
  882. android: "4.6"
  883. }
  884. }), mqq.build("mqq.data.stopSyncData", {
  885. iOS: function(e) {
  886. mqq.invoke("data", "stopSyncData", e)
  887. },
  888. android: function(e) {
  889. mqq.invoke("qbizApi", "stopSyncData", e.appID, name)
  890. },
  891. support: {
  892. iOS: "4.6",
  893. android: "4.6"
  894. }
  895. }), mqq.build("mqq.data.writeH5Data", {
  896. iOS: function(e, t) {
  897. var n = t ? mqq.callback(t) : null;
  898. mqq.invoke("data", "writeWebviewBizData", {
  899. callback: n,
  900. params: e
  901. })
  902. },
  903. android: function(e, t) {
  904. var n = e.data;
  905. n && (n = encodeURIComponent(n)), e.data = n, mqq.invoke("publicAccount", "writeH5Data", e, mqq.callback(t, !0))
  906. },
  907. support: {
  908. iOS: "4.6",
  909. android: "4.6"
  910. }
  911. }), mqq.build("mqq.debug.hide", {
  912. iOS: function(e) {
  913. if (mqq.compare("4.7.1") >= 0) return e == null && (e = !0), mqq.invoke("qw_debug", "hide", {
  914. flag: e
  915. })
  916. },
  917. android: function(e) {
  918. if (mqq.compare("4.7.1") >= 0) return e == null && (e = !0), mqq.invoke("qw_debug", "hide", {
  919. flag: e
  920. })
  921. },
  922. support: {
  923. iOS: "4.7.1",
  924. android: "4.7.1"
  925. }
  926. }), mqq.build("mqq.debug.log", {
  927. iOS: function(e) {
  928. var t = "",
  929. n = function(e) {
  930. return e === null ? "null" : e === undefined ? "undefined" : Object.prototype.toString.call(e).slice(8, -1).toLowerCase()
  931. }, r = n(e);
  932. r === "function" ? t = e.toString() : r === "string" ? t = e : r === "array" ? t = "[" + e.join() + "]" : t = JSON.stringify(e);
  933. if (mqq.compare("4.7.1") >= 0) return mqq.invoke("qw_debug", "log", {
  934. msg: t
  935. })
  936. },
  937. android: function(e) {
  938. var t = "",
  939. n = function(e) {
  940. return e === null ? "null" : e === undefined ? "undefined" : Object.prototype.toString.call(e).slice(8, -1).toLowerCase()
  941. }, r = n(e);
  942. r === "function" ? t = e.toString() : r === "string" ? t = e : r === "array" ? t = "[" + e.join() + "]" : t = JSON.stringify(e), mqq.compare("4.7.1") >= 0 && mqq.invoke("qw_debug", "log", {
  943. msg: t
  944. })
  945. },
  946. support: {
  947. iOS: "4.7.1",
  948. android: "4.7.1"
  949. }
  950. }), mqq.build("mqq.debug.show", {
  951. iOS: function(e) {
  952. if (mqq.compare("4.7.1") >= 0) return e == null && (e = !0), mqq.invoke("qw_debug", "show", {
  953. flag: e
  954. })
  955. },
  956. android: function(e) {
  957. mqq.compare("4.7.1") >= 0 && (e == null && (e = !0), mqq.invoke("qw_debug", "show", {
  958. flag: e
  959. }))
  960. },
  961. support: {
  962. iOS: "4.7.1",
  963. android: "4.7.1"
  964. }
  965. }), mqq.build("mqq.debug.start", {
  966. iOS: function() {
  967. if (mqq.compare("4.7.1") >= 0) return mqq.invoke("qw_debug", "start")
  968. },
  969. android: function() {
  970. mqq.compare("4.7.1") >= 0 && mqq.invoke("qw_debug", "start")
  971. },
  972. support: {
  973. iOS: "4.7.1",
  974. android: "4.7.1"
  975. }
  976. }), mqq.build("mqq.debug.stop", {
  977. iOS: function() {
  978. if (mqq.compare("4.7.1") >= 0) return mqq.invoke("qw_debug", "stop")
  979. },
  980. android: function() {
  981. mqq.compare("4.7.1") >= 0 && mqq.invoke("qw_debug", "stop")
  982. },
  983. support: {
  984. iOS: "4.7.1",
  985. android: "4.7.1"
  986. }
  987. }), mqq.build("mqq.device.connectToWiFi", {
  988. iOS: function(e, t) {
  989. t && t(mqq.ERROR_NO_SUCH_METHOD)
  990. },
  991. android: function(e, t) {
  992. e.callback = mqq.callback(t), mqq.invoke("qbizApi", "connectToWiFi", e)
  993. },
  994. support: {
  995. android: "4.7"
  996. }
  997. }), mqq.build("mqq.device.qqVersion", {
  998. iOS: function(e) {
  999. return mqq.invoke("device", "qqVersion", e)
  1000. },
  1001. support: {
  1002. iOS: "4.5"
  1003. }
  1004. }), mqq.build("mqq.device.qqBuild", {
  1005. iOS: function(e) {
  1006. return mqq.invoke("device", "qqBuild", e)
  1007. },
  1008. support: {
  1009. iOS: "4.5"
  1010. }
  1011. }), mqq.build("mqq.device.getClientInfo", {
  1012. iOS: function(e) {
  1013. var t = {
  1014. qqVersion: this.qqVersion(),
  1015. qqBuild: this.qqBuild()
  1016. }, n = mqq.callback(e, !1, !0);
  1017. mqq.__reportAPI("web", "device", "getClientInfo", null, n);
  1018. if (typeof e != "function") return t;
  1019. mqq.__fireCallback(n, [t])
  1020. },
  1021. android: function(e) {
  1022. if (mqq.compare("4.6") >= 0) {
  1023. var t = e;
  1024. e = function(e) {
  1025. try {
  1026. e = JSON.parse(e)
  1027. } catch (n) {}
  1028. t && t(e)
  1029. }, mqq.invoke("qbizApi", "getClientInfo", e)
  1030. } else mqq.__reportAPI("web", "device", "getClientInfo"), e({
  1031. qqVersion: mqq.QQVersion,
  1032. qqBuild: function(e) {
  1033. return e = e && e[1] || 0, e && e.slice(e.lastIndexOf(".") + 1) || 0
  1034. }(navigator.userAgent.match(/\bqq\/([\d\.]+)/i))
  1035. })
  1036. },
  1037. support: {
  1038. iOS: "4.5",
  1039. android: "4.6"
  1040. }
  1041. }), mqq.build("mqq.device.systemName", {
  1042. iOS: function(e) {
  1043. return mqq.invoke("device", "systemName", e)
  1044. },
  1045. support: {
  1046. iOS: "4.5"
  1047. }
  1048. }), mqq.build("mqq.device.systemVersion", {
  1049. iOS: function(e) {
  1050. return mqq.invoke("device", "systemVersion", e)
  1051. },
  1052. support: {
  1053. iOS: "4.5"
  1054. }
  1055. }), mqq.build("mqq.device.model", {
  1056. iOS: function(e) {
  1057. return mqq.invoke("device", "model", e)
  1058. },
  1059. support: {
  1060. iOS: "4.5"
  1061. }
  1062. }), mqq.build("mqq.device.modelVersion", {
  1063. iOS: function(e) {
  1064. return mqq.invoke("device", "modelVersion", e)
  1065. },
  1066. support: {
  1067. iOS: "4.5"
  1068. }
  1069. }), mqq.build("mqq.device.getDeviceInfo", {
  1070. iOS: function(e) {
  1071. if (mqq.compare(4.7) >= 0) return mqq.invoke("device", "getDeviceInfo", e);
  1072. var t = mqq.callback(e, !1, !0);
  1073. mqq.__reportAPI("web", "device", "getClientInfo", null, t);
  1074. var n = {
  1075. isMobileQQ: this.isMobileQQ(),
  1076. systemName: this.systemName(),
  1077. systemVersion: this.systemVersion(),
  1078. model: this.model(),
  1079. modelVersion: this.modelVersion()
  1080. };
  1081. if (typeof e != "function") return n;
  1082. mqq.__fireCallback(t, [n])
  1083. },
  1084. android: function(e) {
  1085. if (mqq.compare("4.6") >= 0) {
  1086. var t = e;
  1087. e = function(e) {
  1088. try {
  1089. e = JSON.parse(e)
  1090. } catch (n) {}
  1091. t && t(e)
  1092. }, mqq.invoke("qbizApi", "getDeviceInfo", e)
  1093. } else {
  1094. var n = navigator.userAgent;
  1095. mqq.__reportAPI("web", "device", "getClientInfo"), e({
  1096. isMobileQQ: !0,
  1097. systemName: "android",
  1098. systemVersion: function(e) {
  1099. return e && e[1] || 0
  1100. }(n.match(/\bAndroid ([\d\.]+)/i)),
  1101. model: function(e) {
  1102. return e && e[1] || null
  1103. }(n.match(/;\s([^;]+)\s\bBuild\/\w+/i))
  1104. })
  1105. }
  1106. },
  1107. support: {
  1108. iOS: "4.5",
  1109. android: "4.5"
  1110. }
  1111. }), mqq.build("mqq.device.getNetworkType", {
  1112. iOS: function(e) {
  1113. var t = mqq.invoke("device", "networkStatus");
  1114. t = Number(t);
  1115. if (typeof e != "function") return t;
  1116. mqq.__fireCallback(e, [t], !1, !0)
  1117. },
  1118. android: function(e) {
  1119. mqq.compare("4.6") >= 0 ? mqq.invoke("qbizApi", "getNetworkType", e) : mqq.invoke("publicAccount", "getNetworkState", function(t) {
  1120. var n = {
  1121. "-1": 0,
  1122. 0: 3,
  1123. 1: 1
  1124. }, r = t in n ? n[t] : 4;
  1125. e(r)
  1126. })
  1127. },
  1128. support: {
  1129. iOS: "4.5",
  1130. android: "4.6"
  1131. }
  1132. }), mqq.build("mqq.device.networkStatus", {
  1133. iOS: mqq.device.getNetworkType,
  1134. support: {
  1135. iOS: "4.5"
  1136. }
  1137. }), mqq.build("mqq.device.networkType", {
  1138. iOS: mqq.device.getNetworkType,
  1139. support: {
  1140. iOS: "4.5"
  1141. }
  1142. }), mqq.build("mqq.device.getWebViewType", {
  1143. iOS: function(e) {
  1144. return mqq.invoke("device", "webviewType", e)
  1145. },
  1146. android: function(e) {
  1147. var t = 1,
  1148. n = navigator.userAgent;
  1149. return /\bPA\b/.test(n) ? (t = 5, /\bCoupon\b/.test(n) ? t = 2 : /\bMyCoupon\b/.test(n) && (t = 3)) : /\bQR\b/.test(n) && (t = 4), mqq.__reportAPI("web", "device", "getWebViewType"), e ? e(t) : t
  1150. },
  1151. support: {
  1152. iOS: "4.6",
  1153. android: "4.6"
  1154. }
  1155. }), mqq.build("mqq.device.webviewType", {
  1156. iOS: mqq.device.getWebViewType,
  1157. support: {
  1158. iOS: "4.6"
  1159. }
  1160. }), mqq.build("mqq.device.isMobileQQ", {
  1161. iOS: function(e) {
  1162. var t = mqq.iOS;
  1163. return e ? e(t) : t
  1164. },
  1165. android: function(e) {
  1166. var t = mqq.android;
  1167. return e ? e(t) : t
  1168. },
  1169. browser: function(e) {
  1170. var t = mqq.android || mqq.iOS;
  1171. return e ? e(t) : t
  1172. },
  1173. support: {
  1174. iOS: "4.2",
  1175. android: "4.2"
  1176. }
  1177. }), mqq.build("mqq.device.setScreenStatus", {
  1178. iOS: function(e, t) {
  1179. e = e || {}, e.callback = mqq.callback(t), mqq.invoke("device", "setScreenStatus", e)
  1180. },
  1181. android: function(e, t) {
  1182. e = e || {}, e.callback = mqq.callback(t), mqq.invoke("device", "setScreenStatus", e)
  1183. },
  1184. support: {
  1185. android: "5.0"
  1186. }
  1187. }), mqq.build("mqq.media.getLocalImage", {
  1188. iOS: function(e, t) {
  1189. e.callback = mqq.callback(t, !0, !0), mqq.invoke("media", "getLocalImage", e)
  1190. },
  1191. android: function(e, t) {
  1192. e.callback = mqq.callback(t), mqq.invoke("media", "getLocalImage", e)
  1193. },
  1194. support: {
  1195. iOS: "4.7.2",
  1196. android: "4.7.2"
  1197. }
  1198. }), mqq.build("mqq.media.getPicture", {
  1199. iOS: function(e, t) {
  1200. !e.outMaxWidth && e.maxWidth && (e.outMaxWidth = e.maxWidth, delete e.maxWidth), !e.outMaxHeight && e.maxHeight && (e.outMaxHeight = e.maxHeight, delete e.maxHeight), e.callback = mqq.callback(function(e, n) {
  1201. n && n.forEach && n.forEach(function(e, t) {
  1202. typeof e == "string" && (n[t] = {
  1203. data: e,
  1204. imageID: "",
  1205. match: 0
  1206. })
  1207. }), t && t(e, n)
  1208. }, !0, !0), mqq.invoke("media", "getPicture", e)
  1209. },
  1210. android: function(e, t) {
  1211. e.callback = mqq.callback(t), mqq.invoke("media", "getPicture", e)
  1212. },
  1213. support: {
  1214. iOS: "4.7",
  1215. android: "4.7"
  1216. }
  1217. }), mqq.build("mqq.media.playLocalSound", {
  1218. iOS: function(e) {
  1219. mqq.invoke("sensor", "playLocalSound", e)
  1220. },
  1221. android: function(e) {
  1222. mqq.invoke("qbizApi", "playVoice", e.bid, e.url)
  1223. },
  1224. support: {
  1225. iOS: "4.6",
  1226. android: "4.6"
  1227. }
  1228. }), mqq.build("mqq.media.preloadSound", {
  1229. iOS: function(e, t) {
  1230. e.callback = mqq.callback(t, !0), mqq.invoke("sensor", "preloadSound", e)
  1231. },
  1232. android: function(e, t) {
  1233. mqq.invoke("qbizApi", "preloadVoice", e.bid, e.url, mqq.callback(t, !0))
  1234. },
  1235. support: {
  1236. iOS: "4.6",
  1237. android: "4.6"
  1238. }
  1239. }), mqq.build("mqq.offline.checkUpdate", {
  1240. iOS: function(e, t) {
  1241. var n = mqq.callback(t);
  1242. n && (e.callback = n, mqq.invoke("offline", "checkUpdate", e))
  1243. },
  1244. android: function(e, t) {
  1245. mqq.invoke("qbizApi", "checkUpdate", e.bid, mqq.callback(t))
  1246. },
  1247. support: {
  1248. iOS: "4.6",
  1249. android: "4.6"
  1250. }
  1251. }), mqq.build("mqq.offline.downloadUpdate", {
  1252. iOS: function(e, t) {
  1253. var n = mqq.callback(t);
  1254. n && (e.callback = n, mqq.invoke("offline", "downloadUpdate", e))
  1255. },
  1256. android: function(e, t) {
  1257. var n = mqq.callback(t);
  1258. e.fileSize && e.fileSize > 0 ? mqq.invoke("qbizApi", "forceUpdate", e.bid, e.url, e.fileSize, n) : mqq.invoke("qbizApi", "forceUpdate", e.bid, e.url, n)
  1259. },
  1260. support: {
  1261. iOS: "4.6",
  1262. android: "4.6"
  1263. }
  1264. }), mqq.build("mqq.offline.isCached", {
  1265. iOS: function(e, t) {
  1266. var n = mqq.callback(t);
  1267. n && (e.callback = n, mqq.invoke("offline", "isCached", e))
  1268. },
  1269. android: function(e, t) {
  1270. mqq.invoke("qbizApi", "isCached", e.bid, mqq.callback(t))
  1271. },
  1272. support: {
  1273. iOS: "4.6",
  1274. android: "4.6"
  1275. }
  1276. }), mqq.build("mqq.pay.enablePay", {
  1277. iOS: function(e) {
  1278. mqq.invoke("pay", "enablePay", {
  1279. params: e
  1280. })
  1281. },
  1282. support: {
  1283. iOS: "4.6"
  1284. }
  1285. }), mqq.build("mqq.pay.pay", {
  1286. iOS: function(e, t) {
  1287. var n = t ? mqq.callback(t) : null;
  1288. mqq.invoke("pay", "pay", {
  1289. params: e,
  1290. callback: n
  1291. })
  1292. },
  1293. support: {
  1294. iOS: "4.6"
  1295. }
  1296. }), mqq.build("mqq.redpoint.getAppInfo", {
  1297. iOS: function(e, t) {
  1298. var n = mqq.callback(t);
  1299. n && (e.callback = n), mqq.invoke("redpoint", "getAppInfo", e)
  1300. },
  1301. android: function(e, t) {
  1302. var n = mqq.callback(t);
  1303. n && (e.callback = n), mqq.invoke("redpoint", "getAppInfo", e)
  1304. },
  1305. support: {
  1306. iOS: "4.7",
  1307. android: "4.7"
  1308. }
  1309. }),
  1310. function() {
  1311. function n(n) {
  1312. var r = null;
  1313. if (e === !1) {
  1314. e = location.search == "" ? location.hash == "" ? "" : location.hash.substring(1) : location.search.substring(1), e = e.split("&");
  1315. if (e.length > 0)
  1316. for (var i = 0; i < e.length; i++) {
  1317. r = e[i], r = r.split("=");
  1318. if (r.length > 1) try {
  1319. t[r[0]] = decodeURIComponent(r[1])
  1320. } catch (s) {
  1321. t[r[0]] = ""
  1322. }
  1323. }
  1324. }
  1325. return typeof t[n] != "undefined" ? t[n] : ""
  1326. }
  1327. function f(e) {
  1328. var t = {
  1329. sid: r,
  1330. appid: e.substring(e.lastIndexOf(".") + 1),
  1331. platid: i,
  1332. qqver: s,
  1333. format: "json",
  1334. _: (new Date).getTime()
  1335. }, n = "get_new_msg_cnt";
  1336. try {
  1337. Zepto.ajax({
  1338. type: "get",
  1339. url: o + n,
  1340. dataType: "json",
  1341. data: t,
  1342. timeout: 1e4,
  1343. success: function(e) {
  1344. var t = {
  1345. ret: e.ecode,
  1346. count: 0
  1347. };
  1348. e.ecode == 0 && (t.count = e.new_msg_cnt), a(t)
  1349. },
  1350. error: function() {
  1351. a({
  1352. ret: -1,
  1353. count: 0
  1354. })
  1355. }
  1356. })
  1357. } catch (u) {
  1358. a({
  1359. ret: -2,
  1360. count: 0
  1361. })
  1362. }
  1363. }
  1364. function l(e) {
  1365. if (e.code == 0) {
  1366. var t = {
  1367. ret: e.code,
  1368. count: 0
  1369. }, n = e.data.buffer,
  1370. r = [];
  1371. n = typeof n != "object" && n != "" ? JSON.parse(n) : n;
  1372. if (typeof n.msg != "undefined")
  1373. for (var i in n.msg) n.msg[i].stat == 1 && t.count++;
  1374. a(t)
  1375. } else a({
  1376. ret: e.code,
  1377. list: []
  1378. })
  1379. }
  1380. var e = !1,
  1381. t = {}, r = n("sid"),
  1382. i = mqq.iOS ? 110 : mqq.android ? 109 : 0,
  1383. s = mqq.QQVersion ? mqq.QQVersion : "",
  1384. o = "http://msg.vip.qq.com/cgi-bin/",
  1385. u = function() {
  1386. return mqq.compare("4.7") >= 0
  1387. }(),
  1388. a = null;
  1389. mqq.build("mqq.redpoint.getNewMsgCnt", {
  1390. iOS: function(e, t) {
  1391. appid = String(e.path), a = t;
  1392. if (u) mqq.redpoint.getAppInfo(e, l);
  1393. else {
  1394. if (!Zepto) {
  1395. typeof t == "function" ? t({
  1396. ret: -1e4,
  1397. count: 0
  1398. }) : null;
  1399. return
  1400. }
  1401. f(appid)
  1402. }
  1403. },
  1404. android: function(e, t) {
  1405. appid = String(e.path), a = t;
  1406. if (u) mqq.redpoint.getAppInfo(e, l);
  1407. else {
  1408. if (!Zepto) {
  1409. typeof t == "function" ? t({
  1410. ret: -1e4,
  1411. count: 0
  1412. }) : null;
  1413. return
  1414. }
  1415. f(appid)
  1416. }
  1417. },
  1418. support: {
  1419. iOS: "4.5",
  1420. android: "4.5"
  1421. }
  1422. })
  1423. }(),
  1424. function() {
  1425. function n(n) {
  1426. var r = null;
  1427. if (e === !1) {
  1428. e = location.search == "" ? location.hash == "" ? "" : location.hash.substring(1) : location.search.substring(1), e = e.split("&");
  1429. if (e.length > 0)
  1430. for (var i = 0; i < e.length; i++) {
  1431. r = e[i], r = r.split("=");
  1432. if (r.length > 1) try {
  1433. t[r[0]] = decodeURIComponent(r[1])
  1434. } catch (s) {
  1435. t[r[0]] = ""
  1436. }
  1437. }
  1438. }
  1439. return typeof t[n] != "undefined" ? t[n] : ""
  1440. }
  1441. function f(e) {
  1442. var t = {
  1443. sid: r,
  1444. appid: e.substring(e.lastIndexOf(".") + 1),
  1445. platid: i,
  1446. qqver: s,
  1447. format: "json",
  1448. _: (new Date).getTime()
  1449. }, n = "read_msg";
  1450. try {
  1451. Zepto.ajax({
  1452. type: "get",
  1453. url: o + n,
  1454. dataType: "json",
  1455. data: t,
  1456. timeout: 1e4,
  1457. success: function(e) {
  1458. var t = {
  1459. ret: e.ecode,
  1460. list: []
  1461. };
  1462. if (e.ecode == 0) {
  1463. var n = e.msg,
  1464. r = [];
  1465. for (var i in n) r.push({
  1466. content: n[i].content ? n[i].content : "",
  1467. link: n[i].link ? n[i].link : "",
  1468. img: n[i].img ? n[i].img : "",
  1469. pubTime: n[i].time ? n[i].time : "",
  1470. title: n[i].title ? n[i].title : "",
  1471. src: n[i].src ? n[i].src : "",
  1472. ext1: n[i].ext1 ? n[i].ext1 : "",
  1473. ext2: n[i].ext2 ? n[i].ext2 : "",
  1474. ext3: n[i].ext3 ? n[i].ext3 : "",
  1475. id: i
  1476. });
  1477. t.list = r
  1478. }
  1479. a(t)
  1480. },
  1481. error: function() {
  1482. a({
  1483. ret: -1,
  1484. list: []
  1485. })
  1486. }
  1487. })
  1488. } catch (u) {
  1489. a({
  1490. ret: -2,
  1491. list: []
  1492. })
  1493. }
  1494. }
  1495. function l(e) {
  1496. if (e.code == 0) {
  1497. var t = {
  1498. ret: e.code,
  1499. list: []
  1500. }, n = e.data.buffer,
  1501. u = [];
  1502. n = typeof n != "object" && n != "" ? JSON.parse(n) : n;
  1503. if (typeof n.msg != "undefined") {
  1504. for (var f in n.msg) n.msg[f].stat == 1 && (u.push({
  1505. content: n.msg[f].content ? n.msg[f].content : "",
  1506. link: n.msg[f].link ? n.msg[f].link : "",
  1507. img: n.msg[f].img ? n.msg[f].img : "",
  1508. pubTime: n.msg[f].time ? n.msg[f].time : "",
  1509. title: n.msg[f].title ? n.msg[f].title : "",
  1510. src: n.msg[f].src ? n.msg[f].src : "",
  1511. ext1: n.msg[f].ext1 ? n.msg[f].ext1 : "",
  1512. ext2: n.msg[f].ext2 ? n.msg[f].ext2 : "",
  1513. ext3: n.msg[f].ext3 ? n.msg[f].ext3 : "",
  1514. id: f
  1515. }), n.msg[f].stat = 2);
  1516. e.data.buffer = JSON.stringify(n);
  1517. if (u.length > 0) {
  1518. t.list = u, mqq.redpoint.setAppInfo({
  1519. appInfo: e.data
  1520. }, function(e) {
  1521. console.log(JSON.stringify(e))
  1522. });
  1523. var l = e.data.appID,
  1524. c = {
  1525. sid: r,
  1526. appid: l,
  1527. platid: i,
  1528. qqver: s,
  1529. format: "json",
  1530. _: (new Date).getTime()
  1531. }, h = "read_msg";
  1532. try {
  1533. Zepto.ajax({
  1534. type: "get",
  1535. url: o + h,
  1536. dataType: "json",
  1537. data: c,
  1538. timeout: 1e4,
  1539. success: function(e) {},
  1540. error: function() {}
  1541. })
  1542. } catch (p) {}
  1543. }
  1544. }
  1545. a(t)
  1546. } else a({
  1547. ret: e.code,
  1548. list: []
  1549. })
  1550. }
  1551. var e = !1,
  1552. t = {}, r = n("sid"),
  1553. i = mqq.iOS ? 110 : mqq.android ? 109 : 0,
  1554. s = mqq.QQVersion ? mqq.QQVersion : "",
  1555. o = "http://msg.vip.qq.com/cgi-bin/",
  1556. u = function() {
  1557. return mqq.compare("4.7") >= 0
  1558. }(),
  1559. a = null;
  1560. mqq.build("mqq.redpoint.getNewMsgList", {
  1561. iOS: function(e, t) {
  1562. appid = String(e.path), a = t;
  1563. if (u) mqq.redpoint.getAppInfo(e, l);
  1564. else {
  1565. if (!Zepto) {
  1566. typeof t == "function" ? t({
  1567. ret: -1e4,
  1568. count: 0
  1569. }) : null;
  1570. return
  1571. }
  1572. f(appid)
  1573. }
  1574. },
  1575. android: function(e, t) {
  1576. appid = String(e.path), a = t;
  1577. if (u) mqq.redpoint.getAppInfo(e, l);
  1578. else {
  1579. if (!Zepto) {
  1580. typeof t == "function" ? t({
  1581. ret: -1e4,
  1582. count: 0
  1583. }) : null;
  1584. return
  1585. }
  1586. f(appid)
  1587. }
  1588. },
  1589. support: {
  1590. iOS: "4.5",
  1591. android: "4.5"
  1592. }
  1593. })
  1594. }(), mqq.build("mqq.redpoint.getRedPointShowInfo", {
  1595. iOS: function(e, t) {
  1596. var n = mqq.callback(t);
  1597. n && (e.callback = n), mqq.invoke("redpoint", "getRedPointShowInfo", e)
  1598. },
  1599. android: function(e, t) {
  1600. var n = mqq.callback(t);
  1601. n && (e.callback = n), mqq.invoke("redpoint", "getRedPointShowInfo", e)
  1602. },
  1603. support: {
  1604. iOS: "4.7",
  1605. android: "4.7"
  1606. }
  1607. }), mqq.build("mqq.redpoint.reportRedTouch", {
  1608. iOS: function(e, t) {
  1609. var n = mqq.callback(t);
  1610. n && (e.callback = n), mqq.invoke("redpoint", "reportRedTouch", e)
  1611. },
  1612. android: function(e, t) {
  1613. var n = mqq.callback(t);
  1614. n && (e.callback = n), mqq.invoke("redpoint", "reportRedTouch", e)
  1615. },
  1616. support: {
  1617. iOS: "4.7",
  1618. android: "4.7"
  1619. }
  1620. }), mqq.build("mqq.redpoint.setAppInfo", {
  1621. iOS: function(e, t) {
  1622. var n = mqq.callback(t);
  1623. n && (e.callback = n), mqq.invoke("redpoint", "setAppInfo", e)
  1624. },
  1625. android: function(e, t) {
  1626. var n = mqq.callback(t);
  1627. n && (e.callback = n), mqq.invoke("redpoint", "setAppInfo", e)
  1628. },
  1629. support: {
  1630. iOS: "4.7",
  1631. android: "4.7"
  1632. }
  1633. }), mqq.build("mqq.sensor.getLocation", {
  1634. iOS: function(e) {
  1635. return mqq.invoke("data", "queryCurrentLocation", {
  1636. callback: mqq.callback(e)
  1637. })
  1638. },
  1639. android: function(e) {
  1640. var t = mqq.callback(function(t) {
  1641. var n = -1,
  1642. r = null,
  1643. i = null;
  1644. t && t !== "null" && (t = (t + "").split(","), t.length === 2 && (n = 0, r = parseFloat(t[0] || 0), i = parseFloat(t[1] || 0))), e(n, i, r)
  1645. }, !0);
  1646. mqq.invoke("publicAccount", "getLocation", t)
  1647. },
  1648. browser: function(e) {
  1649. navigator.geolocation ? navigator.geolocation.getCurrentPosition(function(t) {
  1650. var n = t.coords.latitude,
  1651. r = t.coords.longitude;
  1652. e(0, n, r)
  1653. }, function() {
  1654. e(-1)
  1655. }) : e(-1)
  1656. },
  1657. support: {
  1658. iOS: "4.5",
  1659. android: "4.6",
  1660. browser: "0"
  1661. }
  1662. }), mqq.build("mqq.sensor.getRealLocation", {
  1663. iOS: function(e, t) {
  1664. var n = t ? mqq.callback(t) : null;
  1665. return mqq.invoke("data", "getOSLocation", {
  1666. params: e,
  1667. callback: n
  1668. })
  1669. },
  1670. android: function(e, t) {
  1671. e = JSON.stringify(e || {}), mqq.invoke("publicAccount", "getRealLocation", e, mqq.callback(t, !0))
  1672. },
  1673. support: {
  1674. iOS: "4.6",
  1675. android: "4.6"
  1676. }
  1677. }), mqq.build("mqq.sensor.getSensorStatus", {
  1678. iOS: function(e, t) {
  1679. e = e || {
  1680. type: "gps"
  1681. }, e.callbackName = mqq.callback(t), mqq.invoke("sensor", "getSensorStatus", e)
  1682. },
  1683. support: {
  1684. iOS: "4.7"
  1685. }
  1686. }), mqq.build("mqq.sensor.startAccelerometer", {
  1687. iOS: function(e) {
  1688. var t = mqq.callback(e, !1, !0);
  1689. t && mqq.invoke("sensor", "startAccelerometer", {
  1690. callback: t
  1691. })
  1692. },
  1693. android: function(e) {
  1694. var t = mqq.callback(e, !1, !0);
  1695. mqq.invoke("qbizApi", "startAccelerometer", t)
  1696. },
  1697. support: {
  1698. iOS: "4.6",
  1699. android: "4.6"
  1700. }
  1701. }), mqq.build("mqq.sensor.startCompass", {
  1702. iOS: function(e) {
  1703. var t = mqq.callback(e, !1, !0);
  1704. t && mqq.invoke("sensor", "startCompass", {
  1705. callback: t
  1706. })
  1707. },
  1708. android: function(e) {
  1709. var t = mqq.callback(e, !1, !0);
  1710. mqq.invoke("qbizApi", "startCompass", t)
  1711. },
  1712. support: {
  1713. iOS: "4.6",
  1714. android: "4.6"
  1715. }
  1716. }), mqq.build("mqq.sensor.startListen", {
  1717. iOS: function(e) {
  1718. var t = mqq.callback(e, !1, !0);
  1719. t && mqq.invoke("sensor", "startListen", {
  1720. callback: t
  1721. })
  1722. },
  1723. android: function(e) {
  1724. var t = mqq.callback(e, !1, !0);
  1725. mqq.invoke("qbizApi", "startListen", t)
  1726. },
  1727. support: {
  1728. iOS: "4.6",
  1729. android: "4.6"
  1730. }
  1731. }), mqq.build("mqq.sensor.stopAccelerometer", {
  1732. iOS: function() {
  1733. mqq.invoke("sensor", "stopAccelerometer")
  1734. },
  1735. android: function() {
  1736. mqq.invoke("qbizApi", "stopAccelerometer")
  1737. },
  1738. support: {
  1739. iOS: "4.6",
  1740. android: "4.6"
  1741. }
  1742. }), mqq.build("mqq.sensor.stopCompass", {
  1743. iOS: function() {
  1744. mqq.invoke("sensor", "stopCompass")
  1745. },
  1746. android: function() {
  1747. mqq.invoke("qbizApi", "stopCompass")
  1748. },
  1749. support: {
  1750. iOS: "4.6",
  1751. android: "4.6"
  1752. }
  1753. }), mqq.build("mqq.sensor.stopListen", {
  1754. iOS: function() {
  1755. mqq.invoke("sensor", "stopListen")
  1756. },
  1757. android: function() {
  1758. mqq.invoke("qbizApi", "stopListen")
  1759. },
  1760. support: {
  1761. iOS: "4.6",
  1762. android: "4.6"
  1763. }
  1764. }), mqq.build("mqq.sensor.vibrate", {
  1765. iOS: function(e) {
  1766. e = e || {}, mqq.invoke("sensor", "vibrate", e)
  1767. },
  1768. android: function(e) {
  1769. e = e || {}, mqq.invoke("qbizApi", "phoneVibrate", e.time)
  1770. },
  1771. support: {
  1772. iOS: "4.6",
  1773. android: "4.6"
  1774. }
  1775. }), mqq.build("mqq.tenpay.buyGoods", {
  1776. android: function(e, t) {
  1777. mqq.invoke("pay", "buyGoods", JSON.stringify(e), t)
  1778. },
  1779. support: {
  1780. android: "4.6.1"
  1781. }
  1782. }), mqq.build("mqq.tenpay.openService", {
  1783. android: function(e, t) {
  1784. mqq.invoke("pay", "openService", JSON.stringify(e), t)
  1785. },
  1786. support: {
  1787. android: "4.6.1"
  1788. }
  1789. }), mqq.build("mqq.tenpay.openTenpayView", {
  1790. iOS: function(e, t) {
  1791. var n = t ? mqq.callback(t) : null;
  1792. mqq.invoke("pay", "openTenpayView", {
  1793. params: e,
  1794. callback: n
  1795. })
  1796. },
  1797. android: function(e, t) {
  1798. mqq.invoke("pay", "openTenpayView", JSON.stringify(e), t)
  1799. },
  1800. support: {
  1801. iOS: "4.6.1",
  1802. android: "4.6.1"
  1803. }
  1804. }),
  1805. function() {
  1806. var e = function(e) {
  1807. return function(t, n) {
  1808. t = Number(t);
  1809. var r = {
  1810. resultCode: t,
  1811. retmsg: "",
  1812. data: {}
  1813. };
  1814. if (t === 0) {
  1815. var i = n;
  1816. n = mqq.mapQuery(n), n.sp_data = i, n.attach && n.attach.indexOf("{") === 0 && (n.attach = JSON.parse(n.attach)), n.time_end && (n.pay_time = n.time_end), r.data = n
  1817. } else t === 1 || t === -1 ? (r.retmsg = "\u7528\u6237\u4e3b\u52a8\u653e\u5f03\u652f\u4ed8", r.resultCode = -1) : r.retmsg = n;
  1818. e && e(r)
  1819. }
  1820. };
  1821. mqq.build("mqq.tenpay.pay", {
  1822. iOS: function(t, n) {
  1823. t.order_no = t.tokenId || t.tokenID, t.app_info = t.app_info || t.appInfo, mqq.compare("4.6.2") >= 0 ? mqq.invokeSchema("mqqapi", "wallet", "pay", t, e(n)) : mqq.invokeSchema("mqqapiwallet", "wallet", "pay", t, e(n))
  1824. },
  1825. android: function(t, n) {
  1826. t.token_id = t.tokenId || t.tokenID, t.app_info = t.app_info || t.appInfo, mqq.compare("4.6.1") >= 0 ? mqq.invoke("pay", "pay", JSON.stringify(t), n) : mqq.invokeSchema("mqqapi", "tenpay", "pay", t, e(n))
  1827. },
  1828. support: {
  1829. iOS: "4.6.1",
  1830. android: "4.6.1"
  1831. }
  1832. })
  1833. }(), mqq.build("mqq.tenpay.rechargeGameCurrency", {
  1834. android: function(e, t) {
  1835. mqq.invoke("pay", "rechargeGameCurrency", JSON.stringify(e), t)
  1836. },
  1837. support: {
  1838. android: "4.6.1"
  1839. }
  1840. }), mqq.build("mqq.tenpay.rechargeQb", {
  1841. android: function(e, t) {
  1842. mqq.invoke("pay", "rechargeQb", JSON.stringify(e), t)
  1843. },
  1844. support: {
  1845. android: "4.6.1"
  1846. }
  1847. }), mqq.build("mqq.ui.openAIO", {
  1848. iOS: function(e) {
  1849. mqq.invokeSchema("mqqapi", "im", "chat", e)
  1850. },
  1851. android: function(e) {
  1852. mqq.invokeSchema("mqqapi", "im", "chat", e)
  1853. },
  1854. support: {
  1855. iOS: "4.5",
  1856. android: "4.5"
  1857. }
  1858. }), mqq.build("mqq.ui.openUrl", {
  1859. iOS: function(e) {
  1860. e || (e = {});
  1861. switch (e.target) {
  1862. case 0:
  1863. window.open(e.url, "_self");
  1864. break;
  1865. case 1:
  1866. e.styleCode = {
  1867. 1: 4,
  1868. 2: 2,
  1869. 3: 5
  1870. }[e.style] || 1, mqq.invoke("nav", "openLinkInNewWebView", {
  1871. url: e.url,
  1872. options: e
  1873. });
  1874. break;
  1875. case 2:
  1876. mqq.invoke("nav", "openLinkInSafari", {
  1877. url: e.url
  1878. })
  1879. }
  1880. },
  1881. android: function(e) {
  1882. e.target === 2 ? mqq.compare("4.6") >= 0 ? mqq.invoke("publicAccount", "openInExternalBrowser", e.url) : mqq.compare("4.5") >= 0 && mqq.invoke("openUrlApi", "openUrl", e.url) : e.target === 1 ? (e.style || (e.style = 0), mqq.compare("4.6") >= 0 ? mqq.invoke("qbizApi", "openLinkInNewWebView", e.url, e.style) : mqq.compare("4.5") >= 0 ? mqq.invoke("publicAccount", "openUrl", e.url) : location.href = e.url) : location.href = e.url
  1883. },
  1884. browser: function(e) {
  1885. e.target === 2 ? window.open(e.url, "_blank") : location.href = e.url
  1886. },
  1887. support: {
  1888. iOS: "4.5",
  1889. android: "4.6",
  1890. browser: "0"
  1891. }
  1892. }),
  1893. function() {
  1894. var e = {}, t = {
  1895. Abount: "com.tencent.mobileqq.activity.AboutActivity",
  1896. GroupTribePublish: "com.tencent.mobileqq.troop.activity.TroopBarPublishActivity",
  1897. GroupTribeReply: "com.tencent.mobileqq.troop.activity.TroopBarReplyActivity",
  1898. GroupTribeComment: "com.tencent.mobileqq.troop.activity.TroopBarCommentActivity"
  1899. };
  1900. mqq.build("mqq.ui.openView", {
  1901. iOS: function(t) {
  1902. t.name = e[t.name] || t.name, typeof t.onclose == "function" && (t.onclose = mqq.callback(t.onclose)), mqq.invoke("nav", "openViewController", t)
  1903. },
  1904. android: function(e) {
  1905. e.name = t[e.name] || e.name, typeof e.onclose == "function" && (e.onclose = mqq.callback(e.onclose)), mqq.compare("5.0") > -1 ? mqq.invoke("ui", "openView", e) : mqq.invoke("publicAccount", "open", e.name)
  1906. },
  1907. support: {
  1908. iOS: "4.5",
  1909. android: "4.6"
  1910. }
  1911. })
  1912. }(), mqq.build("mqq.ui.pageVisibility", {
  1913. iOS: function(e) {
  1914. mqq.invoke("ui", "pageVisibility", e)
  1915. },
  1916. android: function(e) {
  1917. mqq.invoke("ui", "pageVisibility", e)
  1918. },
  1919. support: {
  1920. iOS: "4.7",
  1921. android: "4.7"
  1922. }
  1923. }), mqq.build("mqq.ui.popBack", {
  1924. iOS: function() {
  1925. mqq.invoke("nav", "popBack")
  1926. },
  1927. android: function() {
  1928. mqq.invoke("publicAccount", "close")
  1929. },
  1930. support: {
  1931. iOS: "4.5",
  1932. android: "4.6"
  1933. }
  1934. }), mqq.build("mqq.ui.refreshTitle", {
  1935. iOS: function() {
  1936. mqq.invoke("nav", "refreshTitle")
  1937. },
  1938. support: {
  1939. iOS: "4.6"
  1940. }
  1941. }), mqq.build("mqq.ui.returnToAIO", {
  1942. iOS: function() {
  1943. mqq.invoke("nav", "returnToAIO")
  1944. },
  1945. android: function() {
  1946. mqq.invoke("qbizApi", "returnToAIO")
  1947. },
  1948. support: {
  1949. iOS: "4.6",
  1950. android: "4.6"
  1951. }
  1952. }), mqq.build("mqq.ui.scanQRcode", {
  1953. iOS: function(e, t) {
  1954. e = e || {}, t && (e.callback = mqq.callback(t)), mqq.invoke("ui", "scanQRcode", e)
  1955. },
  1956. android: function(e, t) {
  1957. e = e || {}, t && (e.callback = mqq.callback(t)), mqq.invoke("ui", "scanQRcode", e)
  1958. },
  1959. support: {
  1960. iOS: "4.7",
  1961. android: "4.7"
  1962. }
  1963. }), mqq.build("mqq.ui.setActionButton", {
  1964. iOS: function(e, t) {
  1965. typeof e != "object" && (e = {
  1966. title: e
  1967. });
  1968. var n = mqq.callback(t, !1, !0);
  1969. e.callback = n, mqq.invoke("nav", "setActionButton", e)
  1970. },
  1971. android: function(e, t) {
  1972. var n = mqq.callback(t);
  1973. e.hidden && (e.title = ""), mqq.compare("4.7") >= 0 ? (e.callback = n, mqq.invoke("ui", "setActionButton", e)) : mqq.invoke("publicAccount", "setRightButton", e.title, "", n)
  1974. },
  1975. support: {
  1976. iOS: "4.6",
  1977. android: "4.6"
  1978. }
  1979. }), mqq.build("mqq.ui.setLoading", {
  1980. iOS: function(e) {
  1981. e && (e.visible === !0 ? mqq.invoke("nav", "showLoading") : e.visible === !1 && mqq.invoke("nav", "hideLoading"), e.color && mqq.invoke("nav", "setLoadingColor", {
  1982. r: e.color[0],
  1983. g: e.color[1],
  1984. b: e.color[2]
  1985. }))
  1986. },
  1987. android: function(e) {
  1988. "visible" in e && (e.visible ? mqq.invoke("publicAccount", "showLoading") : mqq.invoke("publicAccount", "hideLoading"))
  1989. },
  1990. support: {
  1991. iOS: "4.6",
  1992. android: "4.6"
  1993. }
  1994. }), mqq.build("mqq.ui.setOnCloseHandler", {
  1995. iOS: function(e) {
  1996. mqq.invoke("ui", "setOnCloseHandler", {
  1997. callback: mqq.callback(e, !1, !0)
  1998. })
  1999. },
  2000. android: function(e) {
  2001. mqq.invoke("ui", "setOnCloseHandler", {
  2002. callback: mqq.callback(e)
  2003. })
  2004. },
  2005. support: {
  2006. iOS: "4.7",
  2007. android: "4.7"
  2008. }
  2009. }), mqq.build("mqq.ui.setOnShareHandler", {
  2010. iOS: function(e) {
  2011. mqq.invoke("nav", "addWebShareListener", {
  2012. callback: mqq.callback(e, !1, !0)
  2013. })
  2014. },
  2015. android: function(e) {
  2016. mqq.invoke("ui", "setOnShareHandler", {
  2017. callback: mqq.callback(e, !1, !0)
  2018. })
  2019. },
  2020. support: {
  2021. iOS: "4.7.2",
  2022. android: "4.7.2"
  2023. }
  2024. }), mqq.build("mqq.ui.setWebViewBehavior", {
  2025. iOS: function(e) {
  2026. mqq.invoke("ui", "setWebViewBehavior", e)
  2027. },
  2028. android: function(e) {
  2029. mqq.invoke("ui", "setWebViewBehavior", e)
  2030. },
  2031. support: {
  2032. iOS: "4.7.2",
  2033. android: "5.1"
  2034. }
  2035. }), mqq.build("mqq.ui.shareAudio", {
  2036. iOS: function(e, t) {
  2037. var n = mqq.callback(t, !0);
  2038. e.desc && (e.desc = e.desc.length > 50 ? e.desc.substring(0, 50) + "..." : e.desc), mqq.invoke("nav", "shareAudio", {
  2039. params: e,
  2040. callback: n
  2041. })
  2042. },
  2043. android: function(e, t) {
  2044. e.req_type = 2, t && (e.callback = mqq.callback(t, !0)), e.desc && (e.desc = e.desc.length > 50 ? e.desc.substring(0, 50) + "..." : e.desc), mqq.invoke("QQApi", "shareMsg", e)
  2045. },
  2046. support: {
  2047. iOS: "4.7",
  2048. android: "4.7"
  2049. }
  2050. }), mqq.build("mqq.ui.shareMessage", {
  2051. iOS: function(e, t) {
  2052. !("needPopBack" in e) && "back" in e && (e.needPopBack = e.back), e.share_url && (e.share_url = mqq.removeQuery(e.share_url, ["sid", "3g_sid"])), e.desc && (e.desc = e.desc.length > 50 ? e.desc.substring(0, 50) + "..." : e.desc), e.callback = mqq.callback(t, !0, !0), mqq.invoke("nav", "shareURLWebRichData", e)
  2053. },
  2054. android: function(e, t) {
  2055. e.share_url && (e.share_url = mqq.removeQuery(e.share_url, ["sid", "3g_sid"])), e.callback = mqq.callback(function(e) {
  2056. t && t({
  2057. retCode: e ? 0 : 1
  2058. })
  2059. }, !0), e.desc && (e.desc = e.desc.length > 50 ? e.desc.substring(0, 50) + "..." : e.desc);
  2060. if (e.share_type && (e.share_type === 2 || e.share_type === 3) && mqq.compare("5.2") < 0 && mqq.support("mqq.app.isAppInstalled")) {
  2061. var n = "\u60a8\u5c1a\u672a\u5b89\u88c5\u5fae\u4fe1\uff0c\u4e0d\u53ef\u4f7f\u7528\u6b64\u529f\u80fd";
  2062. mqq.app.isAppInstalled("com.tencent.mm", function(t) {
  2063. t ? mqq.invoke("QQApi", "shareMsg", e) : mqq.support("mqq.ui.showTips") ? mqq.ui.showTips({
  2064. text: n
  2065. }) : alert(n)
  2066. })
  2067. } else mqq.invoke("QQApi", "shareMsg", e)
  2068. },
  2069. support: {
  2070. iOS: "4.7.2",
  2071. android: "4.7.2"
  2072. }
  2073. }), mqq.build("mqq.ui.shareRichMessage", {
  2074. iOS: function(e, t) {
  2075. e.puin = e.oaUin, e.desc = e.desc || e.summary, e.share_url && (e.share_url = mqq.removeQuery(e.share_url, ["sid", "3g_sid"])), e.desc && (e.desc = e.desc.length > 50 ? e.desc.substring(0, 50) + "..." : e.desc), e.callback = mqq.callback(t), mqq.invoke("nav", "officalAccountShareRichMsg2QQ", e)
  2076. },
  2077. android: function(e, t) {
  2078. e.puin = e.oaUin, e.desc = e.desc || e.summary, e.desc && (e.desc = e.desc.length > 50 ? e.desc.substring(0, 50) + "..." : e.desc), mqq.compare("5.0") >= 0 ? (e.share_url = e.share_url || e.targetUrl, e.image_url = e.image_url || e.imageUrl, e.share_url && (e.share_url = mqq.removeQuery(e.share_url, ["sid", "3g_sid"])), e.callback = t ? mqq.callback(function(e) {
  2079. t({
  2080. ret: e ? 0 : 1
  2081. })
  2082. }) : null, mqq.invoke("QQApi", "shareMsg", e)) : (e.targetUrl = e.targetUrl || e.share_url, e.imageUrl = e.imageUrl || e.image_url, e.targetUrl && (e.targetUrl = mqq.removeQuery(e.targetUrl, ["sid", "3g_sid"])), e.callback = mqq.callback(t), mqq.invoke("publicAccount", "officalAccountShareRichMsg2QQ", e))
  2083. },
  2084. support: {
  2085. iOS: "4.7",
  2086. android: "4.7"
  2087. }
  2088. }), mqq.build("mqq.data.shareRichMessage", {
  2089. iOS: mqq.ui.shareRichMessage,
  2090. android: mqq.ui.shareRichMessage,
  2091. support: {
  2092. iOS: "4.7",
  2093. android: "4.7"
  2094. }
  2095. }), mqq.build("mqq.ui.showActionSheet", {
  2096. iOS: function(e, t) {
  2097. return t && (e.onclick = mqq.callback(t, !1, !0)), mqq.invoke("ui", "showActionSheet", e)
  2098. },
  2099. android: function(e, t) {
  2100. return t && (e.onclick = mqq.callback(t)), mqq.invoke("ui", "showActionSheet", e)
  2101. },
  2102. support: {
  2103. iOS: "4.7",
  2104. android: "4.7"
  2105. }
  2106. }), mqq.build("mqq.ui.showDialog", {
  2107. iOS: function(e, t) {
  2108. e && (e.callback = mqq.callback(t, !0, !0), e.title = e.title + "", e.text = e.text + "", "needOkBtn" in e || (e.needOkBtn = !0), "needCancelBtn" in e || (e.needCancelBtn = !0), mqq.invoke("nav", "showDialog", e))
  2109. },
  2110. android: function(e, t) {
  2111. if (mqq.compare("4.8.0") >= 0) e.callback = mqq.callback(t, !0), mqq.invoke("ui", "showDialog", e);
  2112. else {
  2113. var n = "",
  2114. r = "";
  2115. t && (n = mqq.callback(function() {
  2116. t({
  2117. button: 0
  2118. })
  2119. }, !0), r = mqq.callback(function() {
  2120. t({
  2121. button: 1
  2122. })
  2123. }, !0), n += "()", r += "()"), e.title = e.title + "", e.text = e.text + "", "needOkBtn" in e || (e.needOkBtn = !0), "needCancelBtn" in e || (e.needCancelBtn = !0), mqq.invoke("publicAccount", "showDialog", e.title, e.text, e.needOkBtn, e.needCancelBtn, n, r)
  2124. }
  2125. },
  2126. support: {
  2127. iOS: "4.6",
  2128. android: "4.6"
  2129. }
  2130. }), mqq.build("mqq.ui.showEQQ", {
  2131. iOS: function(e) {
  2132. mqq.invoke("nav", "showBusinessAccountProfile", e)
  2133. },
  2134. android: function(e) {
  2135. mqq.invoke("eqq", "showEQQ", e)
  2136. },
  2137. support: {
  2138. iOS: "4.7",
  2139. android: "4.7"
  2140. }
  2141. }), mqq.build("mqq.ui.showOfficalAccountDetail", {
  2142. iOS: function(e) {
  2143. var t = typeof e == "object" ? e : {
  2144. uin: e
  2145. };
  2146. mqq.invoke("nav", "showOfficalAccountDetail", t)
  2147. },
  2148. android: function(e) {
  2149. mqq.compare("4.6") >= 0 ? mqq.invoke("publicAccount", "viewAccount", e.uin, e.showAIO) : mqq.invoke("publicAccount", "viewAccount", e.uin)
  2150. },
  2151. support: {
  2152. iOS: "4.5",
  2153. android: "4.6"
  2154. }
  2155. }), mqq.build("mqq.ui.showProfile", {
  2156. iOS: function(e) {
  2157. mqq.compare("4.7") >= 0 ? mqq.invoke("nav", "showProfile", e) : mqq.compare("4.6") >= 0 && !e.uinType ? mqq.invoke("nav", "showProfile", e) : (e.uinType === 1 && (e.card_type = "group"), mqq.invokeSchema("mqqapi", "card", "show_pslcard", e))
  2158. },
  2159. android: function(e) {
  2160. mqq.compare("4.7") >= 0 ? mqq.invoke("publicAccount", "showProfile", e) : mqq.compare("4.6") >= 0 && !e.uinType ? mqq.invoke("publicAccount", "showProfile", e.uin) : (e.uinType === 1 && (e.card_type = "group"), mqq.invokeSchema("mqqapi", "card", "show_pslcard", e))
  2161. },
  2162. support: {
  2163. iOS: "4.5",
  2164. android: "4.5"
  2165. }
  2166. }), mqq.build("mqq.ui.showTips", {
  2167. iOS: function(e) {
  2168. mqq.invoke("ui", "showTips", e)
  2169. },
  2170. android: function(e) {
  2171. mqq.invoke("ui", "showTips", e)
  2172. },
  2173. support: {
  2174. iOS: "4.7",
  2175. android: "4.7"
  2176. }
  2177. }), mqq.build("mqq.viewTracks.getTrackInfo", {
  2178. iOS: function(e, t) {
  2179. e = e || {};
  2180. var n = mqq.callback(t);
  2181. n && (e.callback = n), mqq.invoke("viewTracks", "getTrackInfo", e)
  2182. },
  2183. android: function(e, t) {
  2184. e = e || {};
  2185. var n = mqq.callback(t);
  2186. n && (e.callback = n), mqq.invoke("viewTracks", "getTrackInfo", e)
  2187. },
  2188. support: {
  2189. iOS: "5.1",
  2190. android: "5.1"
  2191. }
  2192. }), mqq.build("mqq.viewTracks.pop", {
  2193. iOS: function(e, t) {
  2194. e = e || {};
  2195. var n = mqq.callback(t);
  2196. n && (e.callback = n), mqq.invoke("viewTracks", "pop", e)
  2197. },
  2198. android: function(e, t) {
  2199. e = e || {};
  2200. var n = mqq.callback(t);
  2201. n && (e.callback = n), mqq.invoke("viewTracks", "pop", e)
  2202. },
  2203. support: {
  2204. iOS: "5.1",
  2205. android: "5.1"
  2206. }
  2207. }), mqq.build("mqq.viewTracks.push", {
  2208. iOS: function(e, t) {
  2209. var n = mqq.callback(t);
  2210. n && (e.callback = n), mqq.invoke("viewTracks", "push", e)
  2211. },
  2212. android: function(e, t) {
  2213. var n = mqq.callback(t);
  2214. n && (e.callback = n), mqq.invoke("viewTracks", "push", e)
  2215. },
  2216. support: {
  2217. iOS: "5.1",
  2218. android: "5.1"
  2219. }
  2220. })