wx21dee3.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827
  1. try {
  2. (function(e) {
  3. if (/msie 6/i.test(navigator.userAgent)) {
  4. window.location = "/cgi-bin/readtemplate?t=err/noie6_tmpl";
  5. return;
  6. }
  7. window.console || (window.console = {
  8. log: function() {},
  9. error: function() {},
  10. info: function() {}
  11. }), e.wx = e.wx || {}, wx.T = function(e, t) {
  12. return template.compile(e)(t);
  13. }, wx.url = function(e) {
  14. if (e.startsWith("javasript:")) return e;
  15. var t = wx.data.param;
  16. return e.indexOf("?") != -1 ? e + t : e + "?1=1" + t;
  17. }, wx.getUrl = function(e) {
  18. var t = (window.location + "&").match(new RegExp("(?:\\?|\\&)" + e + "=(.*?)\\&"));
  19. if (t && t[1]) return String(t[1]).html(!0);
  20. }, $.fn.setClass = function(e) {
  21. this.attr("class", e);
  22. }, function() {
  23. function t(e, t) {
  24. if (t.indexOf("ueditor") != -1 || t.indexOf("media/appmsg_edit") != -1) return;
  25. jQuery.ajax({
  26. url: "/misc/jslog?1=1" + wx.data.param,
  27. data: {
  28. content: t,
  29. id: e,
  30. level: "error"
  31. },
  32. type: "POST"
  33. });
  34. }
  35. var e = {
  36. fakeid: wx.data.uin,
  37. userAgent: window.navigator.userAgent,
  38. url: location.href
  39. };
  40. jQuery("img").error(function() {
  41. t(1, "[fakeid={fakeid}] [img] [url={url}] [useragent={userAgent}] [src={0}]".format(e).format([ jQuery(this).src || "" ]));
  42. }), jQuery("script").error(function() {
  43. t(2, "[fakeid={fakeid}] [script] [url={url}] [useragent={userAgent}] [src={0}]".format(e).format([ jQuery(this).src || "" ]));
  44. }), wx.jslog = function(n, r, i) {
  45. i = i || 3, n = jQuery.extend(n, e);
  46. var s = [];
  47. !r || jQuery.each([ "message", "stack", "lineNumber" ], function(e, t) {
  48. s.push(t + ":" + (r[t] || ""));
  49. }), n.e = s.join(";").replace(/\s/g, " ");
  50. var o = "[fakeid={fakeid}] [script] [url={url}] [useragent={userAgent}] [src={src}] [exception={e}]".format(n);
  51. t(i, o), console && console.error && r && console.error(r);
  52. };
  53. }(), setTimeout(function() {
  54. seajs.use("biz_web/lib/store.js", function(e) {
  55. var t = $("#logout");
  56. t.click(function() {
  57. function r() {
  58. var t = e.get(n);
  59. return new Date - t > 864e5;
  60. }
  61. e.remove("hasNotice"), e.remove("templateClassStatus"), e.remove("templateClassStatusTime");
  62. var t = "__draft__" + wx.data.uin, n = "__draft__time__" + wx.data.uin;
  63. r() && (e.remove(t), e.remove(n));
  64. });
  65. });
  66. }, 5e3), wx.resPath = location.hostname == "mp.weixin.qq.com" ? "https://res.wx.qq.com" : "", wx.injectXss = function(e, t, n) {
  67. function r(e) {
  68. for (var n = 0; n < t.length; n++) if (e == t[n]) return !0;
  69. return !1;
  70. }
  71. if (e == null) return;
  72. t || (t = []), n || (n = "'\"<script>console.log(%s);</script><!--# &");
  73. for (var i in e) {
  74. var s = e[i];
  75. typeof s == "string" ? r(i) || (e[i] = n.sprintf(i) + s) : typeof s == "object" && wx.injectXss(e[i]);
  76. }
  77. };
  78. })(window);
  79. } catch (e) {
  80. wx.jslog({
  81. src: "wx/wx.js"
  82. }, m);
  83. };;//样式居中
  84. $.fn.extend({
  85. center: function() {
  86. this.css("position", "absolute"), this.css("top", ($(window).height() - this.height()) / 2 + $(window).scrollTop() + "px"), this.css("left", ($(window).width() - this.width()) / 2 + $(window).scrollLeft() + "px");
  87. }
  88. });;$.fn.disable = function(e) {
  89. e = e || "btn_disabled";
  90. var t = this.hasClass("btn_input") ? this.find("button") : this;
  91. return t.attr("disabled", "disabled"), e && this.addClass(e), this.parent().filter(".btn_input").addClass(e), this;
  92. }, $.fn.enable = function(e) {
  93. e = e || "btn_disabled";
  94. var t = this.hasClass("btn_input") ? this.find("button") : this;
  95. return t.attr("disabled", !1), e && this.removeClass(e), this.parent().filter(".btn_input").removeClass(e), this;
  96. }, function() {
  97. var e = function(e, t) {
  98. e = e || "btn_loading";
  99. if (!t || $.support.leadingWhitespace) {
  100. var n = this.hasClass("btn_input") ? this.find("button") : this;
  101. n.prepend("<i></i>");
  102. }
  103. return this.disable(e), this;
  104. }, t = function(e, t) {
  105. e = e || "btn_loading";
  106. if (!t || $.support.leadingWhitespace) {
  107. var n = this.hasClass("btn_input") ? this.find("button") : this;
  108. n.find("i:first-child").remove();
  109. }
  110. return this.enable(e), this;
  111. };
  112. $.fn.btn = function(n, r, i) {
  113. return n ? t.call(this, r, i) : e.call(this, r, i);
  114. };
  115. }();;//滚屏延迟加载
  116. $.fn.scrollLoading = function(e) {
  117. function r(t) {
  118. return t.offset().top > $(window).scrollTop() && t.offset().top + t.height() < $(window).scrollTop() + $(window).height() + e.pre;
  119. }
  120. function i() {
  121. $.each(n, function(t, n) {
  122. var i = r($(n.obj));
  123. i && (n.src && n.tag.toLowerCase() == "img" && (n.obj.src = n.src, n.obj.data_src = n.src = ""), $.isFunction(e.callback) ? e.callback.apply(n.obj) : "");
  124. });
  125. }
  126. var t = {
  127. callback: $.noop,
  128. pre: 100,
  129. context: window
  130. };
  131. e = $.extend({}, t, e || {});
  132. var n = [];
  133. $(this).each(function() {
  134. var e = this.nodeName;
  135. if (!e) return;
  136. n.push({
  137. obj: this,
  138. src: $(this).data("src"),
  139. tag: e.toLowerCase()
  140. });
  141. }), i(), e.context.unbind("scroll", i), e.context.bind("scroll", i);
  142. }, $.fn.fixed = function() {
  143. var e = this, t = e.offset().top;
  144. $(document).on("scroll", function(n) {
  145. $(window).scrollTop() < t ? e.css("position", "static") : e.css("position", "fixed").css("top", 0);
  146. });
  147. };;//定义快捷操作
  148. (function(e) {
  149. var t = function() {};
  150. "placeholder" in document.createElement("input") || (t = function() {
  151. var t = e(this), n = t.attr("placeholder");
  152. n && (t.focus(function() {
  153. this.value === n && (this.value = ""), t.removeClass("placeholder");
  154. }).blur(function() {
  155. this.value === "" && (this.value = n, t.addClass("placeholder"));
  156. }), t.val() === "" && t.addClass("placeholder"), t.val() || t.val(n));
  157. }), e.fn.placeholder = t;
  158. })(jQuery);;//控制台输出
  159. $.extend({
  160. log: function(e) {
  161. console && console.log(e);
  162. }
  163. });;$.fn.extend({
  164. serializeObject: function() {
  165. var e = this.serializeArray(), t = {};
  166. return $(e).each(function(e, n) {
  167. t[n.name] = n.value;
  168. }), t;
  169. }
  170. }), define("common/qq/jquery.plugin/serializeObject.js", [], function(e, t, n) {
  171. try {
  172. var r = +(new Date);
  173. "use strict";
  174. } catch (i) {
  175. wx.jslog({
  176. src: "common/qq/jquery.plugin/serializeObject.js"
  177. }, i);
  178. }
  179. });;(function() {
  180. function u(e, t) {
  181. for (var n in t) e[n] = t[n];
  182. return e;
  183. }
  184. function a(e, t) {
  185. if (t === !0) {
  186. var n;
  187. if (Object.isArray(e)) {
  188. n = [];
  189. for (var r in e) e.hasOwnProperty(r) && (Object.isObject(e[r]) ? n.push(Object.clone(e[r], !0)) : n.push(e[r]));
  190. } else {
  191. n = {};
  192. for (var r in e) e.hasOwnProperty(r) && (Object.isObject(e[r]) ? n[r] = Object.clone(e[r], !0) : n[r] = e[r]);
  193. }
  194. return n;
  195. }
  196. return u({}, e);
  197. }
  198. function f(e) {
  199. return !!this && e.nodeType == 1;
  200. }
  201. function l(e) {
  202. return Object.prototype.toString.call(e) === s;
  203. }
  204. function c(e) {
  205. return Object.prototype.toString.call(e) === i;
  206. }
  207. function h(t) {
  208. return Object.prototype.toString.call(t) === e;
  209. }
  210. function p(e) {
  211. return Object.prototype.toString.call(e) === r;
  212. }
  213. function d(e) {
  214. return Object.prototype.toString.call(e) === n;
  215. }
  216. function v(e) {
  217. return Object.prototype.toString.call(e) === o;
  218. }
  219. function m(e) {
  220. return typeof e == "undefined";
  221. }
  222. function g(e, t) {
  223. var n = [];
  224. for (var r in e) e.hasOwnProperty(r) && (t === !0 ? n.push([ encodeURIComponent(r), "=", encodeURIComponent(e[r]), "&" ].join("")) : n.push([ r, "=", e[r], "&" ].join("")));
  225. return n.join("").slice(0, -1);
  226. }
  227. function y(e, t) {
  228. if (typeof t == "undefined") return;
  229. for (var n in e) if (e.hasOwnProperty(n) && t(e[n], n) === !1) break;
  230. }
  231. var e = "[object Function]", t = "[object Boolean]", n = "[object Number]", r = "[object String]", i = "[object Array]", s = "[object Object]", o = "[object Date]";
  232. u(Object, {
  233. extend: u,
  234. clone: a,
  235. isObject: l,
  236. isElement: f,
  237. isArray: c,
  238. isFunction: h,
  239. isString: p,
  240. isNumber: d,
  241. isDate: v,
  242. isUndefined: m,
  243. param: g,
  244. each: y
  245. });
  246. })(), Object.extend(String.prototype, function() {
  247. function e(e) {
  248. return this.replace(/\{(\w+)\}/g, function(t, n) {
  249. return e[n] !== undefined ? e[n] : t;
  250. });
  251. }
  252. function t() {
  253. return this.replace(/[^\x00-\xff]/g, "**").length;
  254. }
  255. function n(e, t) {
  256. return e = e || 30, t = Object.isUndefined(t) ? "..." : t, this.length > e ? this.slice(0, e - t.length) + t : String(this);
  257. }
  258. function r(e) {
  259. return e === !0 ? this.replace(/^\s+/, "") : e === !1 ? this.replace(/\s+$/, "") : this.replace(/^\s+/, "").replace(/\s+$/, "");
  260. }
  261. function s(e) {
  262. var t = [ "&", "&amp;", "<", "&lt;", ">", "&gt;", " ", "&nbsp;", '"', "&quot;", "'", "&#39;" ];
  263. e === !1 && t.reverse();
  264. for (var n = 0, r = this; n < t.length; n += 2) r = r.replace(new RegExp(t[n], "g"), t[1 + n]);
  265. return r;
  266. }
  267. function o(e) {
  268. return this.indexOf(e) > -1;
  269. }
  270. function u(e) {
  271. return this.lastIndexOf(e, 0) === 0;
  272. }
  273. function a(e) {
  274. var t = this.length - e.length;
  275. return t >= 0 && this.indexOf(e, t) === t;
  276. }
  277. function f() {
  278. return this == "";
  279. }
  280. function l() {
  281. return this.replace(/<\/?[^>]*\/?>/g, "");
  282. }
  283. function c() {
  284. return /^\s*$/.test(this);
  285. }
  286. function h() {
  287. var e, t = this, n, r, i = arguments.length;
  288. if (i < 1) return l;
  289. e = 0;
  290. while (e < i) t = t.replace(/%s/, "{#" + e++ + "#}");
  291. t.replace("%s", ""), e = 0;
  292. while ((n = arguments[e]) !== undefined) r = new RegExp("{#" + e + "#}", "g"), t = t.replace(r, n), e++;
  293. return t;
  294. }
  295. function p() {
  296. var e = this, t = 0, n, r = 0;
  297. while (n = e.charAt(t++)) r += n.charCodeAt().toString(16).length / 2;
  298. return r;
  299. }
  300. function d(e, t) {
  301. if (typeof this.split == "function") {
  302. var n = this.split(t || "&"), r = {};
  303. return n.each(function(t) {
  304. arr = t.split("="), arr.length == 2 && arr[0] && arr[1] && (e === !0 ? r[decodeURIComponent(arr[0])] = decodeURIComponent(arr[1]) : r[arr[0]] = arr[1]);
  305. }), r;
  306. }
  307. }
  308. var i = document.createElement("div");
  309. return {
  310. format: e,
  311. sprintf: h,
  312. text: l,
  313. len: t,
  314. truncate: n,
  315. trim: String.prototype.trim || r,
  316. https2http: function() {
  317. return this.replace(/https:\/\/mmbiz\.qlogo\.cn\//g, "http://mmbiz.qpic.cn/");
  318. },
  319. http2https: function() {
  320. return this.replace(/http:\/\/mmbiz\.qpic\.cn\//g, "https://mmbiz.qlogo.cn/");
  321. },
  322. html: s,
  323. has: o,
  324. startsWith: u,
  325. endsWith: a,
  326. param: d,
  327. empty: f,
  328. blank: c,
  329. bytes: p
  330. };
  331. }()), Object.extend(Function.prototype, function() {
  332. function t(e, t) {
  333. var n = e.length, r = t.length;
  334. while (r--) e[n + r] = t[r];
  335. return e;
  336. }
  337. function n(n, r) {
  338. return n = e.call(n, 0), t(n, r);
  339. }
  340. function r(t) {
  341. if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this;
  342. var r = this, i = e.call(arguments, 1);
  343. return function() {
  344. var e = n(i, arguments);
  345. return r.apply(t, e);
  346. };
  347. }
  348. function i(t, n) {
  349. var r = this;
  350. return args = e.call(arguments, 2), t *= 1e3, window.setTimeout(function() {
  351. return r.apply(n || r, args);
  352. }, t);
  353. }
  354. function s() {
  355. var e = t([ .01, null ], arguments);
  356. return this.delay.apply(this, e);
  357. }
  358. function o(e) {
  359. var t = this;
  360. return function() {
  361. return e.apply(this, arguments) === !1 ? !1 : t.apply(this, arguments);
  362. };
  363. }
  364. function u(e) {
  365. var n = this;
  366. return function() {
  367. var r = n.apply(this, arguments), i = t([ r ], arguments);
  368. return e.apply(this, i), r;
  369. };
  370. }
  371. function a(e) {
  372. var n = this;
  373. return function() {
  374. var r = t([ n.bind(this) ], arguments);
  375. return e.apply(this, r);
  376. };
  377. }
  378. var e = Array.prototype.slice;
  379. return {
  380. bind: r,
  381. delay: i,
  382. defer: s,
  383. before: o,
  384. after: u,
  385. wrap: a
  386. };
  387. }()), function() {
  388. function n(e, t) {
  389. for (var n = 0, r = this.length >>> 0; n < r; n++) n in this && e.call(t, this[n], n, this);
  390. }
  391. function r() {
  392. return this[this.length - 1];
  393. }
  394. function i(e) {
  395. return e === !0 ? Object.clone.apply(this, arguments) : t.call(this, 0);
  396. }
  397. function s(e) {
  398. var t = [];
  399. return this.each(function(n, r) {
  400. t.push(e(n, r));
  401. }), t;
  402. }
  403. function o(e) {
  404. var t = -1;
  405. return this.each(function(n, r) {
  406. if (e == n) return t = r, !1;
  407. }), t;
  408. }
  409. var e = Array.prototype, t = e.slice;
  410. Object.extend(e, {
  411. each: Array.prototype.forEach || n,
  412. indexOf: Array.prototype.indexOf || o,
  413. last: r,
  414. clone: i,
  415. map: s
  416. });
  417. }();;define("common/qq/Class.js", [], function(e, t, n) {
  418. try {
  419. var r = +(new Date);
  420. "use strict", t.create = function(e) {
  421. var t = function() {
  422. this.construct && this.construct.apply(this, arguments);
  423. };
  424. return e.apply(t.prototype, arguments), t;
  425. }, function() {
  426. function e(e) {
  427. for (var t = 1, n = arguments.length; t < n; t++) for (var r in arguments[t]) Object.prototype.hasOwnProperty.call(arguments[t], r) && (e[r] = arguments[t][r]);
  428. return e;
  429. }
  430. function n() {
  431. return this.__instance__ || (this.__instance__ = new this(arguments[0], arguments[1], arguments[2]));
  432. }
  433. function r(e) {
  434. var t = i.call(this, e);
  435. return t.prototype.parent = this, t;
  436. }
  437. function i(t) {
  438. var i = typeof this == "function" ? this : function() {}, s = function() {
  439. function n(e, r) {
  440. e.Super && n(e.Super, r), e.init && e.init.apply(r, t);
  441. }
  442. var e = this, t = arguments;
  443. e.Root = i.__base__, e.Super = i.prototype, n(e, e);
  444. };
  445. return e(s.prototype, i.prototype || {}, t), s.__base__ = i.__base__ || s.prototype, s.GetStaticInstance = n, s.Inherit = s.inherit = r, s;
  446. }
  447. t.declare = i;
  448. }();
  449. } catch (i) {
  450. wx.jslog({
  451. src: "common/qq/Class.js"
  452. }, i);
  453. }
  454. });;(function(e) {
  455. function r(e) {
  456. return e >= 49 && e <= 90;
  457. }
  458. function i(e) {
  459. return (e || "").toLowerCase().split("+").sort().join("").replace(/\s/ig, "");
  460. }
  461. function s(e) {
  462. var t = e.type;
  463. return t == "mousewheel" || t == "DOMMouseScroll";
  464. }
  465. function o(e) {
  466. return e.wheelDelta > 0 || e.detail < 0 ? "mousewheelup" : "mousewheeldown";
  467. }
  468. function u(e) {
  469. var i = e.keyCode, u = t[i], a = !u && r(i) && String.fromCharCode(i).toLowerCase() || s(e) && o(e), f = e.ctrlKey, l = e.shiftKey, c = e.altKey, h = l && (n[a] || n[u]), p = [];
  470. return !f && !c && h && (u = h, l = a = null), f && p.push("ctrl"), l && p.push("shift"), c && p.push("alt"), u && p.push(u), a && p.push(a), p.join("+");
  471. }
  472. function a(e, t) {
  473. return i(u(e)) == i(t);
  474. }
  475. var t = {
  476. 27: "esc",
  477. 9: "tab",
  478. 32: "space",
  479. 13: "enter",
  480. 8: "backspace",
  481. 145: "scroll",
  482. 20: "capslock",
  483. 144: "numlock",
  484. 19: "pause",
  485. 45: "insert",
  486. 36: "home",
  487. 46: "del",
  488. 35: "end",
  489. 33: "pageup",
  490. 34: "pagedown",
  491. 37: "left",
  492. 38: "up",
  493. 39: "right",
  494. 40: "down",
  495. 107: "=",
  496. 109: "-",
  497. 112: "f1",
  498. 113: "f2",
  499. 114: "f3",
  500. 115: "f4",
  501. 116: "f5",
  502. 117: "f6",
  503. 118: "f7",
  504. 119: "f8",
  505. 120: "f9",
  506. 121: "f10",
  507. 122: "f11",
  508. 123: "f12",
  509. 188: "<",
  510. 190: ">",
  511. 191: "/",
  512. 192: "`",
  513. 219: "[",
  514. 220: "\\",
  515. 221: "]",
  516. 222: "'"
  517. }, n = {
  518. "`": "~",
  519. "1": "!",
  520. "2": "@",
  521. "3": "#",
  522. "4": "$",
  523. "5": "%",
  524. "6": "^",
  525. "7": "&",
  526. "8": "*",
  527. "9": "(",
  528. "0": ")",
  529. "-": "_",
  530. "=": "+",
  531. ";": ":",
  532. "'": '"',
  533. ",": "<",
  534. ".": ">",
  535. "/": "?",
  536. "\\": "|"
  537. };
  538. e.wx = e.wx || {}, e.wx.hotkeyStr = u, e.wx.isHotkey = a;
  539. })(window);;define("common/wx/Tips.js", [], function(e, t, n) {
  540. try {
  541. var r = +(new Date);
  542. "use strict";
  543. var i = t, s = {
  544. errMsg: "系统发生错误,请稍后重试",
  545. sucMsg: "操作成功",
  546. delay: 2
  547. }, o;
  548. function u(e, t, n) {
  549. $(".JS_TIPS").remove(), o = $(template.compile('<div class="JS_TIPS page_tips {type}" id="wxTips_' + (new Date).getTime() + '"><div class="inner">{=msg}</div></div>')({
  550. type: e || "error",
  551. msg: t
  552. })).appendTo("body").fadeIn(), a.delay(n || s.delay, null, o);
  553. }
  554. function a(e) {
  555. e.length > 0 && e.fadeOut({
  556. complete: function() {
  557. e.remove();
  558. }
  559. });
  560. }
  561. i.err = function(e, t) {
  562. u("error", e || s.errMsg, t);
  563. }, i.suc = function(e, t) {
  564. u("success", e || s.sucMsg, t);
  565. };
  566. } catch (f) {
  567. wx.jslog({
  568. src: "common/wx/Tips.js"
  569. }, f);
  570. }
  571. });;define("common/wx/Cgi.js", [ "common/qq/mask.js", "common/wx/dialog.js", "common/wx/Tips.js", "common/wx/cgiReport.js", "common/lib/MockJax.js", "common/qq/events.js" ], function(e, t, n) {
  572. try {
  573. var r = +(new Date);
  574. "use strict";
  575. var i = e("common/qq/mask.js"), s = e("common/wx/dialog.js"), o = e("common/wx/Tips.js"), u = e("common/wx/cgiReport.js");
  576. e("common/lib/MockJax.js");
  577. var a = e("common/qq/events.js")(!0), f = {
  578. dataType: "json",
  579. mask: !1,
  580. timeout: 45e3,
  581. error: $.noop,
  582. mock: !1,
  583. data: {
  584. token: wx.data.t,
  585. lang: wx.data.lang,
  586. f: "json",
  587. ajax: "1"
  588. }
  589. };
  590. t.get = function(e, t) {
  591. return l("get", e, t);
  592. }, t.post = function(e, t) {
  593. return l("post", e, t);
  594. };
  595. function l(e, t, n) {
  596. var r, s;
  597. n && typeof n == "object" ? (r = n.done, s = n.fail) : r = n, typeof t == "string" && t.length > 0 && (t = {
  598. url: t
  599. }), t = $.extend(!0, {}, f, {
  600. type: e,
  601. data: {
  602. random: Math.random().toString()
  603. }
  604. }, t), t.mock && (t.mock === !0 ? t.mock = {
  605. responseText: {
  606. ret: 0,
  607. data: {},
  608. url: t.url,
  609. param: t.data
  610. }
  611. } : t.mock && !t.mock.responseText && !t.mock.response && (t.mock = {
  612. responseText: t.mock
  613. }), t.mock.url = t.mock.url || t.url, $.mockjax(t.mock)), !t.mask || ($.isPlainObject(t.mask) ? i.show(t.mask) : i.show());
  614. var o = $.ajax(t);
  615. return o.callback = o.done, o.done(function(e) {
  616. r && r(e);
  617. }).fail(function(e, n, r) {
  618. s && s(n), u.error(n, t), a.trigger("xhrError", e, n, r, t);
  619. }).always(function() {
  620. t.mask && i.hide();
  621. }), o;
  622. }
  623. var c = {
  624. "0": "恭喜你,操作成功!",
  625. "-1": "系统错误,请稍后尝试。",
  626. "-2": "参数错误,请核对参数后重试。",
  627. "-3": "登录态超时,请重新登录。",
  628. "-4": "请求页面的域名没有授权。",
  629. "-5": "请求方式错误,请确认请求方式后重试。",
  630. "-6": "表单名称验证出错,请核对表单名称后重试。",
  631. "-7": "对不起,你没有权限访问目标请求。"
  632. };
  633. t.show = function(e, t) {
  634. var n = c[e.base_resp.ret] || "系统繁忙,请稍后尝试!";
  635. if (e.base_resp.ret == 0) {
  636. t ? s.show({
  637. type: "succ",
  638. msg: "系统提示|" + n
  639. }) : o.suc(n);
  640. return;
  641. }
  642. t ? s.show("系统错误|" + n) : o.err(n);
  643. };
  644. } catch (h) {
  645. wx.jslog({
  646. src: "common/wx/Cgi.js"
  647. }, h);
  648. }
  649. });;define("common/wx/dialog.js", [ "biz_common/jquery.ui/jquery.ui.draggable.js", "tpl/dialog.html.js" ], function(e, t, n) {
  650. try {
  651. var r = +(new Date);
  652. "use strict", e("biz_common/jquery.ui/jquery.ui.draggable.js");
  653. var i = {
  654. title: "温馨提示",
  655. type: "warn",
  656. msg: "错误信息|对不起,系统繁忙请稍后尝试。",
  657. buttons: [ {
  658. text: "确定",
  659. click: function(e) {
  660. this.remove(e);
  661. }
  662. } ],
  663. width: 720,
  664. height: 0,
  665. draggable: !0,
  666. mask: !0,
  667. className: ""
  668. }, s = {
  669. uid: 0,
  670. uiName: "wxDialog",
  671. iconClass: {
  672. succ: "success",
  673. err: "error",
  674. warn: "warn",
  675. info: "info"
  676. },
  677. btTypes: {
  678. primary: "btn_primary",
  679. normal: "btn_default",
  680. disabled: "btn_disabled"
  681. }
  682. };
  683. s.html = e("tpl/dialog.html.js");
  684. function o(e) {
  685. var t = this;
  686. typeof e == "string" && (e = {
  687. msg: e
  688. }), e = $.extend(!0, {}, i, e), t.id = e.id = [ s.uiName, "_", ++s.uid ].join(""), e.icon = s.iconClass[e.type || "warn"];
  689. var n = [];
  690. n = e.msg.split("|"), n[0] ? n[1] ? e.msg = {
  691. title: n[0],
  692. text: n[1],
  693. msgClass: ""
  694. } : e.msg = {
  695. title: e.msg,
  696. msgClass: "single_line"
  697. } : e.msg = {
  698. text: n[1],
  699. msgClass: "single_line"
  700. }, $.each(e.buttons, function(e, t) {
  701. t.type = s.btTypes[t.type || "primary"];
  702. }), t.opt = e, $(template.compile(s.html)(e)).appendTo("body"), t.dom = $("#" + this.id).parent(), t.dom.css("margin-left", -1 * t.dom.outerWidth() / 2).css("margin-top", -1 * t.dom.outerHeight() / 2), t.dom.fadeIn(), e.draggable && t.dom.draggable(), function() {
  703. $.each($("#" + t.id + " .js_btn"), function(n, r) {
  704. e.buttons[n].click && $(r).click(function() {
  705. return e.buttons[n].click.apply(t), !1;
  706. });
  707. }), $("#" + t.id + " .pop_closed").click(function() {
  708. if (e.close && typeof e.close == "function") {
  709. e.close() && t.remove();
  710. return;
  711. }
  712. t.remove();
  713. });
  714. }();
  715. }
  716. o.prototype = {
  717. hide: function() {
  718. this.opt.mask && this.dom.next().remove(), this.dom.fadeOut();
  719. },
  720. remove: function() {
  721. this.opt.mask && this.dom.next().remove(), this.dom.remove();
  722. },
  723. resetPos: function() {
  724. var e = this;
  725. e.dom.css("margin-left", -1 * e.dom.outerWidth() / 2).css("margin-top", -1 * e.dom.outerHeight() / 2);
  726. }
  727. }, t.show = function(e) {
  728. return new o(e);
  729. };
  730. } catch (u) {
  731. wx.jslog({
  732. src: "common/wx/dialog.js"
  733. }, u);
  734. }
  735. });;define("common/wx/popup.js", [ "common/wx/widgetBridge.js", "tpl/popup.html.js" ], function(e, t, n) {
  736. try {
  737. var r = +(new Date);
  738. "use strict", e("common/wx/widgetBridge.js");
  739. var i = e("tpl/popup.html.js"), s = template.compile(i), o = {
  740. disabled: "btn_disabled",
  741. primary: "btn_primary",
  742. "default": "btn_default"
  743. };
  744. $.widgetBridge("popup", {
  745. $dialogWrp: null,
  746. options: {
  747. title: "温馨提示",
  748. width: 726,
  749. height: null,
  750. template: template.compile,
  751. data: {},
  752. buttons: [],
  753. onHide: null,
  754. onShow: null,
  755. onOK: null,
  756. onCancel: null,
  757. mask: !0,
  758. autoShow: !0
  759. },
  760. _create: function() {
  761. var e = this, t = $.extend(!0, {}, this.options), n = function() {
  762. e.hide();
  763. };
  764. t.buttons && !$.isArray(t.buttons) && (t.buttons = [ t.buttons ]), !t.buttons.length && t.onOK && (t.buttons = [ {
  765. text: "确定",
  766. type: "primary",
  767. click: function() {
  768. var e = t.onOK && t.onOK.call(this);
  769. !e && n();
  770. }
  771. }, {
  772. text: "取消",
  773. click: function() {
  774. var e = t.onCancel && t.onCancel.call(this);
  775. !e && n();
  776. }
  777. } ]), $.each(t.buttons, function(e, t) {
  778. t.type = o[t.type || "default"];
  779. });
  780. var r;
  781. if (this.element.is("script[type=text/html]")) r = this.element.html(), this.options.data && this.options.template && (r = this.options.template(r)(this.options.data)); else {
  782. var i = $("<div></div>").append(this.element.clone()), r = i.html();
  783. this.options.data && this.options.template && (r = this.options.template(r)(this.options.data));
  784. }
  785. t.content = r, this.$dialogWrp = $(s(t)).appendTo("body"), this.$dialogWrp.find(".dialog_bd").children(":first").show(), t.autoShow || this.$dialogWrp.hide(), this.$dialogWrp.find(".pop_closed").click(t.onClose || n), this.$dialogWrp.find(".js_btn").each(function(n, r) {
  786. var i = t.buttons[n].click, s = i ? function(t) {
  787. i.call(e, t);
  788. } : function() {};
  789. $(this).click(s);
  790. }), this.resetPosition();
  791. if (t.autoShow) {
  792. var u = e.options.onShow;
  793. typeof u == "function" && u.call(e);
  794. }
  795. return this.get();
  796. },
  797. show: function() {
  798. var e = this, t = e.options.onShow, n = !0;
  799. this.$dialogWrp.fadeIn(function() {
  800. n && (typeof t == "function" && t.call(e), n = !1);
  801. });
  802. },
  803. resetPosition: function() {
  804. $(this.$dialogWrp.get(0)).css({
  805. "margin-left": -1 * this.$dialogWrp.outerWidth() / 2,
  806. "margin-top": -1 * this.$dialogWrp.outerHeight() / 2
  807. });
  808. },
  809. get: function() {
  810. return this.$dialogWrp.filter(".dialog_wrp");
  811. },
  812. hide: function() {
  813. var e = this, t = e.options.onHide || e.options.close, n = !0;
  814. this.$dialogWrp.fadeOut(function() {
  815. n && (typeof t == "function" && t.call(e), n = !1);
  816. });
  817. },
  818. remove: function() {
  819. this.destroy(), this.$dialogWrp.remove();
  820. }
  821. });
  822. } catch (u) {
  823. wx.jslog({
  824. src: "common/wx/popup.js"
  825. }, u);
  826. }
  827. });;