flowRecharge.min.js 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. "use strict";
  2. !function(o, n) {
  3. function e(o) {
  4. common.loadingShow("加载中..."),
  5. setTimeout(function() {
  6. location.href.indexOf("index_mz") > -1 ? androidJsInterface.finishLoading() : common.loadingHide()
  7. }, o)
  8. }
  9. var i = function r(o) {
  10. this.options = $.extend(r.DEFAULTS, o || {})
  11. };
  12. i.DEFAULTS = {
  13. beforeSend: function() {},
  14. complete: function() {},
  15. error: function(o, n) {
  16. $("#spin").hide(),
  17. common.tip(n)
  18. }
  19. },
  20. i.prototype = {
  21. getMobileInfo: function(o, n) {
  22. common.ajax("/public/getMobileInfo", {
  23. customer: o
  24. }, {
  25. success: function(o) {
  26. n && n(o.code, o.mobileInfo)
  27. },
  28. error: function(o, n) {
  29. $("#spin").hide(),
  30. common.tip(n)
  31. }
  32. })
  33. },
  34. getProductList: function(o, n) {
  35. var e = o.customer
  36. , i = o.prodType;
  37. "undefined" == typeof i && (i = "0");
  38. common.ajax("/cz/recharge/getProductList", {
  39. customer: e,
  40. prodType: i
  41. }, {
  42. success: function(o) {
  43. var e = o.code;
  44. n && n(e, o)
  45. },
  46. error: function(o, e) {
  47. $("#spin").hide(),
  48. n && n(o, e),
  49. common.tip(e)
  50. }
  51. })
  52. },
  53. getProductListHuafei: function(o, n) {
  54. var e = o.customer
  55. , i = o.prodType
  56. , r = o.is_mz;
  57. "undefined" == typeof i && (i = "0"),
  58. common.ajax("/phoneCharge/default/getProductList", {
  59. customer: e,
  60. prodType: i,
  61. is_mz: r
  62. }, {
  63. success: function(o) {
  64. var e = o.code;
  65. n && n(e, o)
  66. },
  67. error: function(o, e) {
  68. $("#spin").hide(),
  69. n && n(o, e),
  70. common.tip(e)
  71. }
  72. })
  73. },
  74. getProductListHuafeiSlow: function(o, n) {
  75. var e = o.customer
  76. , i = o.prodType;
  77. "undefined" == typeof i && (i = "0");
  78. common.ajax("/slowCharge/default/getProductList", {
  79. customer: e,
  80. prodType: i
  81. }, {
  82. success: function(o) {
  83. var e = o.code;
  84. n && n(e, o)
  85. },
  86. error: function(o, e) {
  87. $("#spin").hide(),
  88. n && n(o, e),
  89. common.tip(e)
  90. }
  91. })
  92. },
  93. getProductInfo: function(o) {
  94. return this.prodList ? this.prodList[o] : n
  95. },
  96. createOrder: function(o) {
  97. var n = o.customer
  98. , i = o.prodId
  99. , r = (o.notifyUrl || "",
  100. o.prodPayType || "1",
  101. o.buyerName,
  102. o.cb)
  103. , c = (o.actId || "",
  104. o.action || 8)
  105. , t = o.isMeiZuOrder || ""
  106. , d = o.fingerTouch_position
  107. , a = o.product_position
  108. , s = o.pay_position
  109. , u = o.is_manual_input
  110. , p = o.buyerId
  111. , f = {
  112. type:o.type,
  113. amount:o.amount,
  114. phone:n,
  115. junKh:o.junKh,
  116. junKm:o.junKm,
  117. customer: n,
  118. prodId: i,
  119. action: c,
  120. fingerTouch_position: d,
  121. product_position: a,
  122. pay_position: s,
  123. is_manual_input: u,
  124. buyerId: p
  125. };
  126. location.href.indexOf("index_mz") > -1 ? (f.isMeiZuOrder = t,
  127. androidJsInterface.showLoading()) : common.loadingShow("加载中..."),
  128. common.ajax("/creatorder", f, {
  129. success: function(o) {
  130. e(2e3);
  131. r && r(o.code, o)
  132. },
  133. error: function(o, n) {
  134. common.tip(n),
  135. window.location.href ="/login.html"
  136. }
  137. })
  138. },
  139. createOrderHuafei: function(o) {
  140. var n = o.customer
  141. , i = o.prodId
  142. , r = (o.notifyUrl || "",
  143. o.prodPayType || "1",
  144. o.buyerName,
  145. o.cb)
  146. , c = o.errorcb
  147. , t = (o.actId || "",
  148. o.action || 8)
  149. , d = o.isMeiZuOrder || ""
  150. , a = o.fingerTouch_position
  151. , s = o.product_position
  152. , u = o.pay_position
  153. , p = o.is_manual_input
  154. , f = o.checkData
  155. , m = o.buyerId
  156. , h = {
  157. customer: n,
  158. prodId: i,
  159. action: t,
  160. fingerTouch_position: a,
  161. product_position: s,
  162. pay_position: u,
  163. is_manual_input: p,
  164. checkData: f,
  165. buyerId: m
  166. };
  167. location.href.indexOf("index_mz") > -1 ? (h.isMeiZuOrder = d,
  168. androidJsInterface.showLoading()) : common.loadingShow("加载中..."),
  169. common.ajax("/phoneCharge/default/createOrder", h, {
  170. success: function(o) {
  171. e(2e3),
  172. r && r(o.code, o)
  173. },
  174. error: function(o, n) {
  175. $("#spin,.mask,.modal-nc-wrap").hide(),
  176. $(".modal-nc-wrap").removeClass("show"),
  177. $(".paybox").removeClass("open"),
  178. $(".modal-nc-wrap #nc").html(""),
  179. common.tip(n),
  180. location.href.indexOf("index_mz") > -1 ? androidJsInterface.finishLoading() : common.loadingHide()
  181. },
  182. errorcb: function(o, n) {
  183. c && c(o, n),
  184. location.href.indexOf("index_mz") > -1 ? androidJsInterface.finishLoading() : common.loadingHide()
  185. }
  186. })
  187. },
  188. createOrderHuafeiSlow: function(o) {
  189. var n = o.customer
  190. , e = o.prodId
  191. , i = (o.notifyUrl || "",
  192. o.prodPayType || "1",
  193. o.buyerName,
  194. o.cb)
  195. , r = o.errorcb
  196. , c = (o.actId || "",
  197. o.action || 8)
  198. , t = o.isMeiZuOrder || ""
  199. , d = o.fingerTouch_position
  200. , a = o.product_position
  201. , s = o.pay_position
  202. , u = o.is_manual_input
  203. , p = o.checkData
  204. , f = o.buyerId
  205. , m = {
  206. customer: n,
  207. prodId: e,
  208. action: c,
  209. fingerTouch_position: d,
  210. product_position: a,
  211. pay_position: s,
  212. is_manual_input: u,
  213. checkData: p,
  214. buyerId: f
  215. };
  216. location.href.indexOf("index_mz") > -1 ? (m.isMeiZuOrder = t,
  217. androidJsInterface.showLoading()) : common.loadingShow("加载中..."),
  218. common.ajax("/slowCharge/default/createOrder", m, {
  219. success: function(o) {
  220. i && i(o.code, o)
  221. },
  222. error: function(o, n) {
  223. $("#spin").hide(),
  224. common.tip(n),
  225. location.href.indexOf("index_mz") > -1 ? androidJsInterface.finishLoading() : common.loadingHide()
  226. },
  227. errorcb: function(o, n) {
  228. r && r(o, n)
  229. }
  230. })
  231. },
  232. getProviderType: function(o) {
  233. var n = o.prodId
  234. , i = o.customer
  235. , r = o.cb;
  236. location.href.indexOf("index_mz") > -1 ? androidJsInterface.showLoading() : common.loadingShow("加载中..."),
  237. // common.ajax("/phoneCharge/default/getBypassProviderType", {
  238. // customer: i,
  239. // prodId: n
  240. // }, {
  241. // success: function(o) {
  242. // e(1e3),
  243. // r && r(o.code, o)
  244. // },
  245. // error: function(o, n) {
  246. // $("#spin").hide(),
  247. // common.tip(n)
  248. // }
  249. // })
  250. o='{\n' +
  251. ' "resultCode": 1000,\n' +
  252. ' "resultReason": "",\n' +
  253. ' "code": 1000,\n' +
  254. ' "msg": "",\n' +
  255. ' "payType": 0,\n' +
  256. ' "payUrl": null\n' +
  257. '}'
  258. o=JSON.parse(o);
  259. e(1e3);
  260. r && r(o.code, o)
  261. }
  262. },
  263. "undefined" != typeof define && define.amd ? define("Recharge", [], function(o) {
  264. o.exports = i
  265. }) : o.Recharge = i
  266. }(window);