You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

withdrawal_list.js 3.1 KiB

3 jaren geleden
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //提现明细
  2. window.onload = function () {
  3. ifLogin(function (flag) {
  4. $('body').show();
  5. httpLoadInfo();
  6. });
  7. }
  8. function httpLoadInfo() {
  9. $.ajax({
  10. type: "post",
  11. url: base_api + 'user/fx-user/apply-commission-detail',
  12. dataType: 'json',
  13. success: function (res_data) {
  14. ZZLog(res_data);
  15. if (false == res_data['flag']) {
  16. if (codeNotLogin == res_data['code']) {
  17. alert(infoNotLogin);
  18. var URL = '/web/fx/withdrawal_list.html';
  19. URL = encodeURI(URL);
  20. location.href = res_data['url'] + URL;
  21. } else if (codeNotRegister == res_data['code']) {
  22. location.href = 'register.html';
  23. } else {
  24. alert(res_data['msg']);
  25. }
  26. } else {
  27. //..
  28. var data = res_data['data'];
  29. var apply_list = data['apply_list'];
  30. var HTML = '';
  31. var total_balance = 0;
  32. if (apply_list.length != 0)
  33. // total_balance = apply_list.map(c => c['apply_money']).reduce(function(a, b) { return parseInt(a) + parseInt(b) });
  34. total_balance = apply_list.map(function (c) {
  35. c['apply_money']
  36. }).reduce(function (a, b) {
  37. return ((100 * parseFloat(a) + 100 * parseFloat(b)) / 100);
  38. });
  39. for (var i = 0, m = apply_list.length; i < m; i++) {
  40. var dict = apply_list[i];
  41. var tempHTML = getHTMLWithParam(dict);
  42. HTML += tempHTML;
  43. }
  44. // $('#total_balance').text(`提现金额(累计${total_balance}元)`);
  45. // `提现金额(累计${total_balance}元)`
  46. $('#total_balance').text('提现金额(累计' + total_balance + '元)');
  47. $('.list_info').html(HTML);
  48. if (apply_list.length == 0) {
  49. $('#no_info').show();
  50. }
  51. }
  52. },
  53. error: function () {
  54. alert(infoApiError);
  55. }
  56. });
  57. }
  58. function getHTMLWithParam(dict) {
  59. //1:待审核 2:已审核
  60. if ('1' == dict['status']) {
  61. var html1 = '<li class="ub tx-c ui_p_t13 ui_p_b13">' +
  62. '<div class="ub-f2 li_font_dark" style="width: 1%;">' + dict['create_date'] + '</div>' +
  63. '<div class="ub-f4 li_font_dark" style="width: 1%;">¥' + dict['apply_money'] + '</div>' +
  64. '<div class="ub-f2 li_font_red" style="width: 1%;">' + dict['status_desc'] + '</div>' +
  65. '</li>';
  66. return html1;
  67. } else {
  68. var html2 = '<li class="ub tx-c ui_p_t13 ui_p_b13">' +
  69. '<div class="ub-f2 li_font_dark" style="width: 1%;">' + dict['create_date'] + '</div>' +
  70. '<div class="ub-f4 li_font_dark" style="width: 1%;">¥' + dict['apply_money'] + '</div>' +
  71. '<div class="ub-f2 li_font_gray" style="width: 1%;">' + dict['status_desc'] + '</div>' +
  72. '</li>';
  73. return html2;
  74. }
  75. }