fenxiao_next_user_list2.js 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. mui.init({
  2. pullRefresh: {
  3. container: '#pullrefresh',
  4. down: {},
  5. up: {contentrefresh: '正在加载...', callback: pullupRefresh}
  6. }
  7. });
  8. var pageNumber = 0, pagesize = 10, endNo = 0;
  9. function pullupRefresh() {
  10. pageNumber += 1;
  11. var btnArray = ['否', '是'];
  12. $.ajax(base_path + '/rebackStatic/underDrpListInfo?dates=' + new Date().getTime(), {
  13. data: {
  14. "pageSize": pagesize,
  15. "pageNumber": pageNumber,
  16. "endNo": endNo
  17. },
  18. dataType: 'json',
  19. type: 'post',
  20. timeout: 15000,
  21. xhrFields: {
  22. withCredentials: true
  23. },
  24. crossDomain: true,
  25. success: function (dt) {
  26. if (dt.isRedirect) {
  27. location.href = dt.redirectURL;
  28. } else {
  29. if (dt.status) {
  30. var itemSum = dt.data.itemNum;
  31. var chanpin_data = [];
  32. if (dt.data.list != null) {
  33. chanpin_data = dt.data.list
  34. }
  35. document.querySelector("#b_accounts").innerHTML = dt.data.size;
  36. endNo = dt.data.endNo;
  37. mui('#pullrefresh').pullRefresh().endPullupToRefresh(chanpin_data.length < pagesize);
  38. var table = document.body.querySelector('.my-tab-view-pull');
  39. var isZuan = dt.data.isZuan;
  40. if (isZuan == 1) {
  41. $('#itemLi').show();
  42. mui(chanpin_data).each(function (index) {
  43. var li = document.createElement('li');
  44. li.className = 'mui-table-view-cell';
  45. if (this.img == null) {
  46. li.innerHTML = '<table class="my-dl-tb-order"><tr><td><img class="wh-50" src="//s.iamberry.com/images/shop/logo_head.png"></td><td></td><td style="color:blue;">' + this.num + '台</td></tr></table>'
  47. } else if (typeof(this.num) == "undefined") {
  48. li.innerHTML = '<table class="my-dl-tb-order"><tr><td><img class="wh-50" src="' + this.img + '"></td><td>' + decodeURI(this.name) + '</td><td style="color:blue;">0台</td></tr></table>'
  49. } else {
  50. li.innerHTML = '<table class="my-dl-tb-order"><tr><td><img class="wh-50" src="' + this.img + '"></td><td>' + decodeURI(this.name) + '</td><td style="color:blue;">' + this.num + '台</td></tr></table>'
  51. }
  52. table.appendChild(li)
  53. });
  54. if (itemSum == null) {
  55. itemSum = 0
  56. }
  57. $('#itemSum').html(itemSum)
  58. } else {
  59. $('#itemLi').hide();
  60. mui(chanpin_data).each(function (index) {
  61. var li = document.createElement('li');
  62. li.className = 'mui-table-view-cell';
  63. if (this.img == null) {
  64. li.innerHTML = '<table class="my-dl-tb-order"><tr><td><img class="wh-50" src="//s.iamberry.com/images/shop/logo_head.png"></td><td>' + this.strDate + '</td><td style="color:blue;">' + this.num + '</td></tr></table>'
  65. } else if (typeof(this.num) == "undefined") {
  66. li.innerHTML = '<table class="my-dl-tb-order"><tr><td><img class="wh-50" src="' + this.img + '"></td><td>' + this.strDate + '</td><td style="color:blue;">0台</td></tr></table>'
  67. } else {
  68. li.innerHTML = '<table class="my-dl-tb-order"><tr><td><img class="wh-50" src="' + this.img + '"></td><td>' + this.strDate + '</td><td style="color:blue;">' + this.num + '台</td></tr></table>'
  69. }
  70. table.appendChild(li)
  71. })
  72. }
  73. } else {
  74. mui.confirm(dt.message, '提示', btnArray, function (e) {
  75. if (e.index == 1) {
  76. }
  77. })
  78. }
  79. }
  80. }, error: function (xhr, type, errorThrown) {
  81. console.log(xhr)
  82. }
  83. })
  84. };mui.ready(function () {
  85. mui('#pullrefresh').pullRefresh().pullupLoading();
  86. getCartNum();
  87. document.querySelector('.loading-bg').style.display = 'none'
  88. });