123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268 |
- "use strict";
- !function(o, n) {
- function e(o) {
- common.loadingShow("加载中..."),
- setTimeout(function() {
- location.href.indexOf("index_mz") > -1 ? androidJsInterface.finishLoading() : common.loadingHide()
- }, o)
- }
- var i = function r(o) {
- this.options = $.extend(r.DEFAULTS, o || {})
- };
- i.DEFAULTS = {
- beforeSend: function() {},
- complete: function() {},
- error: function(o, n) {
- $("#spin").hide(),
- common.tip(n)
- }
- },
- i.prototype = {
- getMobileInfo: function(o, n) {
- common.ajax("/public/getMobileInfo", {
- customer: o
- }, {
- success: function(o) {
- n && n(o.code, o.mobileInfo)
- },
- error: function(o, n) {
- $("#spin").hide(),
- common.tip(n)
- }
- })
- },
- getProductList: function(o, n) {
- var e = o.customer
- , i = o.prodType;
- "undefined" == typeof i && (i = "0");
- common.ajax("/cz/recharge/getProductList", {
- customer: e,
- prodType: i
- }, {
- success: function(o) {
- var e = o.code;
- n && n(e, o)
- },
- error: function(o, e) {
- $("#spin").hide(),
- n && n(o, e),
- common.tip(e)
- }
- })
- },
- getProductListHuafei: function(o, n) {
- var e = o.customer
- , i = o.prodType
- , r = o.is_mz;
- "undefined" == typeof i && (i = "0"),
- common.ajax("/phoneCharge/default/getProductList", {
- customer: e,
- prodType: i,
- is_mz: r
- }, {
- success: function(o) {
- var e = o.code;
- n && n(e, o)
- },
- error: function(o, e) {
- $("#spin").hide(),
- n && n(o, e),
- common.tip(e)
- }
- })
- },
- getProductListHuafeiSlow: function(o, n) {
- var e = o.customer
- , i = o.prodType;
- "undefined" == typeof i && (i = "0");
- common.ajax("/slowCharge/default/getProductList", {
- customer: e,
- prodType: i
- }, {
- success: function(o) {
- var e = o.code;
- n && n(e, o)
- },
- error: function(o, e) {
- $("#spin").hide(),
- n && n(o, e),
- common.tip(e)
- }
- })
- },
- getProductInfo: function(o) {
- return this.prodList ? this.prodList[o] : n
- },
- createOrder: function(o) {
- var n = o.customer
- , i = o.prodId
- , r = (o.notifyUrl || "",
- o.prodPayType || "1",
- o.buyerName,
- o.cb)
- , c = (o.actId || "",
- o.action || 8)
- , t = o.isMeiZuOrder || ""
- , d = o.fingerTouch_position
- , a = o.product_position
- , s = o.pay_position
- , u = o.is_manual_input
- , p = o.buyerId
- , f = {
- type:o.type,
- amount:o.amount,
- phone:n,
- junKh:o.junKh,
- junKm:o.junKm,
- customer: n,
- prodId: i,
- action: c,
- fingerTouch_position: d,
- product_position: a,
- pay_position: s,
- is_manual_input: u,
- buyerId: p
- };
- location.href.indexOf("index_mz") > -1 ? (f.isMeiZuOrder = t,
- androidJsInterface.showLoading()) : common.loadingShow("加载中..."),
- common.ajax("/creatorder", f, {
- success: function(o) {
- e(2e3);
- r && r(o.code, o)
- },
- error: function(o, n) {
- common.tip(n),
- window.location.href ="/login.html"
- }
- })
- },
- createOrderHuafei: function(o) {
- var n = o.customer
- , i = o.prodId
- , r = (o.notifyUrl || "",
- o.prodPayType || "1",
- o.buyerName,
- o.cb)
- , c = o.errorcb
- , t = (o.actId || "",
- o.action || 8)
- , d = o.isMeiZuOrder || ""
- , a = o.fingerTouch_position
- , s = o.product_position
- , u = o.pay_position
- , p = o.is_manual_input
- , f = o.checkData
- , m = o.buyerId
- , h = {
- customer: n,
- prodId: i,
- action: t,
- fingerTouch_position: a,
- product_position: s,
- pay_position: u,
- is_manual_input: p,
- checkData: f,
- buyerId: m
- };
- location.href.indexOf("index_mz") > -1 ? (h.isMeiZuOrder = d,
- androidJsInterface.showLoading()) : common.loadingShow("加载中..."),
- common.ajax("/phoneCharge/default/createOrder", h, {
- success: function(o) {
- e(2e3),
- r && r(o.code, o)
- },
- error: function(o, n) {
- $("#spin,.mask,.modal-nc-wrap").hide(),
- $(".modal-nc-wrap").removeClass("show"),
- $(".paybox").removeClass("open"),
- $(".modal-nc-wrap #nc").html(""),
- common.tip(n),
- location.href.indexOf("index_mz") > -1 ? androidJsInterface.finishLoading() : common.loadingHide()
- },
- errorcb: function(o, n) {
- c && c(o, n),
- location.href.indexOf("index_mz") > -1 ? androidJsInterface.finishLoading() : common.loadingHide()
- }
- })
- },
- createOrderHuafeiSlow: function(o) {
- var n = o.customer
- , e = o.prodId
- , i = (o.notifyUrl || "",
- o.prodPayType || "1",
- o.buyerName,
- o.cb)
- , r = o.errorcb
- , c = (o.actId || "",
- o.action || 8)
- , t = o.isMeiZuOrder || ""
- , d = o.fingerTouch_position
- , a = o.product_position
- , s = o.pay_position
- , u = o.is_manual_input
- , p = o.checkData
- , f = o.buyerId
- , m = {
- customer: n,
- prodId: e,
- action: c,
- fingerTouch_position: d,
- product_position: a,
- pay_position: s,
- is_manual_input: u,
- checkData: p,
- buyerId: f
- };
- location.href.indexOf("index_mz") > -1 ? (m.isMeiZuOrder = t,
- androidJsInterface.showLoading()) : common.loadingShow("加载中..."),
- common.ajax("/slowCharge/default/createOrder", m, {
- success: function(o) {
- i && i(o.code, o)
- },
- error: function(o, n) {
- $("#spin").hide(),
- common.tip(n),
- location.href.indexOf("index_mz") > -1 ? androidJsInterface.finishLoading() : common.loadingHide()
- },
- errorcb: function(o, n) {
- r && r(o, n)
- }
- })
- },
- getProviderType: function(o) {
- var n = o.prodId
- , i = o.customer
- , r = o.cb;
- location.href.indexOf("index_mz") > -1 ? androidJsInterface.showLoading() : common.loadingShow("加载中..."),
- // common.ajax("/phoneCharge/default/getBypassProviderType", {
- // customer: i,
- // prodId: n
- // }, {
- // success: function(o) {
- // e(1e3),
- // r && r(o.code, o)
- // },
- // error: function(o, n) {
- // $("#spin").hide(),
- // common.tip(n)
- // }
- // })
- o='{\n' +
- ' "resultCode": 1000,\n' +
- ' "resultReason": "",\n' +
- ' "code": 1000,\n' +
- ' "msg": "",\n' +
- ' "payType": 0,\n' +
- ' "payUrl": null\n' +
- '}'
- o=JSON.parse(o);
- e(1e3);
- r && r(o.code, o)
- }
- },
- "undefined" != typeof define && define.amd ? define("Recharge", [], function(o) {
- o.exports = i
- }) : o.Recharge = i
- }(window);
|