tixian_log_cash.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. pageNumber += 1;
  15. $.ajax(base_path + '/withdraw/selectUserLogs', {
  16. data: {
  17. "pageSize": pagesize,
  18. "pageNo": pageNumber
  19. },
  20. dataType: 'json',
  21. type: 'post',
  22. timeout: 15000,
  23. xhrFields: {
  24. withCredentials: true
  25. },
  26. crossDomain: true,
  27. success: function(dt) {
  28. if(dt.isRedirect) {
  29. location.href = dt.redirectURL;
  30. } else {
  31. if(dt.status) {
  32. var log_list = [];
  33. log_list = dt.data;
  34. mui('#pullrefresh').pullRefresh().endPullupToRefresh((log_list.length < pagesize));
  35. var table = document.body.querySelector('.my-tab-view-pull');
  36. var fenxiaostr = "";
  37. mui(log_list).each(function(index) {
  38. var li = document.createElement('li');
  39. li.className = 'mui-table-view-cell';
  40. this.name == null ? this.name = "神仙哥哥" : this.name;
  41. var status = this.withdrawalsStatus;
  42. switch(status) {
  43. case 1:
  44. status = "提现成功";
  45. break;
  46. case 2:
  47. status = "提现申请中";
  48. break;
  49. default:
  50. status = "提现失败"
  51. };
  52. var num = accDiv(this.withdrawalsLogsAmount, 100);
  53. li.innerHTML = '<span>提现:<span class="cl-red">¥ -' + num + '</span></span><span class="mui-btn-link">' + status + '</span><font class="mui-badge mui-badge-inverted">' + this.withdrawalsLogsDate + '</font>';
  54. table.appendChild(li)
  55. })
  56. } else {
  57. var btnArray = ['否', '是'];
  58. mui.confirm(dt.message + '是否刷新页面?', '提示', btnArray, function(e) {
  59. if(e.index == 1) {
  60. location.reload(true)
  61. }
  62. })
  63. }
  64. }
  65. },
  66. error: function(xhr, type, errorThrown) {
  67. console.log(xhr)
  68. }
  69. })
  70. };
  71. mui.ready(function() {
  72. mui('#pullrefresh').pullRefresh().pullupLoading();
  73. getCartNum();
  74. document.querySelector('.loading-bg').style.display = 'none'
  75. });