fenxiao_mendian_next_user_list.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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/underUnderlingStatisc?dates=' + new Date().getTime(), {
  13. data: {
  14. "pageSize": pagesize,
  15. "pageNumber": pageNumber,
  16. "endNo": endNo,
  17. "openid": getParam("openid")
  18. },
  19. dataType: 'json',
  20. type: 'post',
  21. timeout: 15000,
  22. xhrFields: {
  23. withCredentials: true
  24. },
  25. crossDomain: true,
  26. success: function (dt) {
  27. if (dt.isRedirect) {
  28. location.href = dt.redirectURL;
  29. } else {
  30. console.log(dt);
  31. if (dt.status) {
  32. var chanpin_data = [];
  33. if (dt.data.list != null) {
  34. chanpin_data = dt.data.list
  35. }
  36. document.querySelector("#b_accounts").innerHTML = dt.data.size;
  37. endNo = dt.data.endNo;
  38. mui('#pullrefresh').pullRefresh().endPullupToRefresh(chanpin_data.length < pagesize);
  39. var table = document.body.querySelector('.my-tab-view-pull');
  40. mui(chanpin_data).each(function (index) {
  41. var li = document.createElement('li');
  42. li.className = 'mui-table-view-cell';
  43. if (this.img == null) {
  44. 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 class="mui-text-left">' + decodeURI("未命名") + '</td><td style="color:blue;">' + this.roleName + '</td><td>' + this.strDate + '</td></tr></table>'
  45. } else {
  46. li.innerHTML = '<table class="my-dl-tb-order"><tr><td><img class="wh-50" src="' + this.img + '"></td><td class="mui-text-left">' + decodeURI(this.name) + '</td><td style="color:blue;">' + this.roleName + '</td><td>' + this.strDate + '</td></tr></table>'
  47. }
  48. table.appendChild(li)
  49. })
  50. } else {
  51. mui.confirm(dt.message, '提示', btnArray, function (e) {
  52. if (e.index == 1) {
  53. }
  54. })
  55. }
  56. }
  57. }, error: function (xhr, type, errorThrown) {
  58. console.log(xhr)
  59. }
  60. })
  61. };mui.ready(function () {
  62. mui('#pullrefresh').pullRefresh().pullupLoading();
  63. getCartNum();
  64. document.querySelector('.loading-bg').style.display = 'none'
  65. });