fenxiao_tixian_log.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. mui.init({
  2. pullRefresh: {
  3. container: '#pullrefresh',
  4. down: {},
  5. up: {
  6. contentrefresh: '正在加载...',
  7. callback: pullupRefresh
  8. }
  9. }
  10. });
  11. var pageNumber = 0,
  12. pagesize = 10;
  13. function pullupRefresh() {
  14. var btnArray = ['否', '是'];
  15. $.ajax(base_path + '/WithDrawalsLogs/historyWithdrawNext?dates=' + new Date().getTime(), {
  16. data: {
  17. "openid": "",
  18. "page": {
  19. "pageSize": pagesize,
  20. "pageNumber": pageNumber
  21. }
  22. },
  23. dataType: 'json',
  24. type: 'post',
  25. timeout: 15000,
  26. xhrFields: {
  27. withCredentials: true
  28. },
  29. crossDomain: true,
  30. success: function(dt) {
  31. if(dt.isRedirect) {
  32. location.href = dt.redirectURL;
  33. } else {
  34. if(dt.status) {
  35. var fenxiao_list = [];
  36. fenxiao_list = dt.data.list;
  37. $("#amount").html("¥" + accDiv(dt.data.amount, 100));
  38. mui('#pullrefresh').pullRefresh().endPullupToRefresh(fenxiao_list.length < pagesize);
  39. var table = document.body.querySelector('.my-tab-view-pull');
  40. mui(fenxiao_list).each(function(index) {
  41. var li = document.createElement('li');
  42. li.className = 'mui-table-view-cell';
  43. this.name == null ? this.name = "神仙哥哥" : this.name;
  44. var status = this.status;
  45. switch(status) {
  46. case 1:
  47. status = "申请中";
  48. break;
  49. case 2:
  50. status = "申请成功";
  51. break;
  52. default:
  53. status = "申请失败"
  54. };
  55. li.innerHTML = '<a><div class="mui-media-body">提现:<span class="cl-red">¥' + accDiv(this.withDrawalsNum, 100) + '</span><span class="mui-btn-link">' + status + '</span><span class="mui-badge mui-badge-inverted mui-pull-right">' + this.createDate + '</span><p class="mui-ellipsis">' + this.withDrawalsName + ':' + this.accountNo + '<span class="mui-badge mui-badge-inverted mui-pull-right">' + this.bankLocal + '</span></p></div></a>';
  56. table.appendChild(li)
  57. })
  58. } else {
  59. mui.confirm(dt.message, '爱贝源-提示', btnArray, function(e) {
  60. if(e.index == 1) {
  61. location.reload(true)
  62. }
  63. })
  64. }
  65. }
  66. },
  67. error: function(xhr, type, errorThrown) {
  68. console.log(xhr)
  69. }
  70. });
  71. };
  72. function getMoney() {
  73. window.location.href = base_path + "/drp/withdrawalsPage?openid="
  74. };
  75. mui.ready(function() {
  76. mui('#pullrefresh').pullRefresh().pullupLoading();
  77. getCartNum();
  78. document.querySelector('.loading-bg').style.display = 'none'
  79. });