fenxiao_order_list.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. mui.init({
  2. pullRefresh: {
  3. container: '#pullrefresh',
  4. down: {},
  5. up: {contentrefresh: '正在加载...', callback: pullupRefresh}
  6. }
  7. });
  8. var pageNumber = 0, pagesize = 10;
  9. function pullupRefresh() {
  10. pageNumber += 1;
  11. var btnArray = ['否', '是'];
  12. $.ajax(base_path + '/placeLogs/unIncomeOrderCastNext?dates=' + new Date().getTime(), {
  13. data: {
  14. "openid": "",
  15. "pageSize": pagesize,
  16. "pageNumber": pageNumber
  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 fenxiao_list = [];
  31. if (fenxiao_list != null) {
  32. fenxiao_list = dt.data.list
  33. }
  34. $(".price_to").html(accDiv(dt.data.amount, 100));
  35. mui('#pullrefresh').pullRefresh().endPullupToRefresh(fenxiao_list.lenght < pagesize);
  36. var table = document.body.querySelector('.my-tab-view-pull');
  37. mui(fenxiao_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 = decodeURI(this.name);
  41. li.innerHTML = '<table class="my-dl-tb-order"><tr><td rowspan="2"><img class="wh-80" src="' + this.img + '"></td><td>订单:' + this.orderNo + '</td><td><span class="cl-red">+¥' + accDiv(this.amount, 100) + '</span></td></tr><tr><td>' + this.name + '</td><td>' + this.strDate + '</td></tr></table>';
  42. table.appendChild(li)
  43. })
  44. } else {
  45. mui.confirm(dt.message, '提示', btnArray, function (e) {
  46. if (e.index == 1) {
  47. location.reload(true)
  48. }
  49. })
  50. }
  51. }
  52. }, error: function (xhr, type, errorThrown) {
  53. console.log(xhr)
  54. }
  55. })
  56. };mui.ready(function () {
  57. mui('#pullrefresh').pullRefresh().pullupLoading();
  58. getCartNum();
  59. document.querySelector('.loading-bg').style.display = 'none'
  60. });