123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- mui.init({
- pullRefresh: {
- container: '#pullrefresh',
- down: {},
- up: {contentrefresh: '正在加载...', callback: pullupRefresh}
- }
- });
- var pageNumber = 0, pagesize = 10, endNo = 0;
- function pullupRefresh() {
- pageNumber += 1;
- var btnArray = ['否', '是'];
- $.ajax(base_path + '/rebackStatic/underUnderlingStatisc?dates=' + new Date().getTime(), {
- data: {
- "pageSize": pagesize,
- "pageNumber": pageNumber,
- "endNo": endNo,
- "openid": getParam("openid")
- },
- dataType: 'json',
- type: 'post',
- timeout: 15000,
- xhrFields: {
- withCredentials: true
- },
- crossDomain: true,
- success: function (dt) {
- if (dt.isRedirect) {
- location.href = dt.redirectURL;
- } else {
- console.log(dt);
- if (dt.status) {
- var chanpin_data = [];
- if (dt.data.list != null) {
- chanpin_data = dt.data.list
- }
- document.querySelector("#b_accounts").innerHTML = dt.data.size;
- endNo = dt.data.endNo;
- mui('#pullrefresh').pullRefresh().endPullupToRefresh(chanpin_data.length < pagesize);
- var table = document.body.querySelector('.my-tab-view-pull');
- mui(chanpin_data).each(function (index) {
- var li = document.createElement('li');
- li.className = 'mui-table-view-cell';
- if (this.img == null) {
- 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>'
- } else {
- 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>'
- }
- table.appendChild(li)
- })
- } else {
- mui.confirm(dt.message, '提示', btnArray, function (e) {
- if (e.index == 1) {
- }
- })
- }
- }
- }, error: function (xhr, type, errorThrown) {
- console.log(xhr)
- }
- })
- };mui.ready(function () {
- mui('#pullrefresh').pullRefresh().pullupLoading();
- getCartNum();
- document.querySelector('.loading-bg').style.display = 'none'
- });
|