123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- mui.init({
- pullRefresh: {
- container: '#pullrefresh',
- down: {},
- up: {contentrefresh: '正在加载...', callback: pullupRefresh}
- }
- });
- var count = 0, pageNumber = 0, pageSize = 15;
- function pullupRefresh() {
- pageNumber += 1;
- $.ajax(base_path + '/cashLog/list?dates=' + new Date().getTime(), {
- data: {
- "pageNO": pageNumber,
- "pageSize": pageSize
- },
- dataType: 'json',
- type: 'post',
- timeout: 15000,
- xhrFields: {
- withCredentials: true
- },
- crossDomain: true,
- success: function (dt) {
- if (dt.isRedirect) {
- location.href = dt.redirectURL;
- } else {
- if (dt.status) {
- var cash_log_list = [];
- var dataObj = dt.data;
- cash_log_list = dataObj.cashlist;
- pagecount = dataObj.cashlist.length;
- if (dataObj.userIncome != null && typeof(dataObj.userIncome) != "undefined" && dataObj.userIncome != '') {
- var income = accDiv(dataObj.userIncome, 100);
- $("#userIncome").html(income)
- }
- mui('#pullrefresh').pullRefresh().endPullupToRefresh(cash_log_list.length < pageSize);
- var table = document.body.querySelector('.my-tab-view-pull');
- var resType = "";
- var mark = "";
- mui(cash_log_list).each(function (index) {
- var li = document.createElement('li');
- li.className = 'mui-table-view-cell';
- switch (this.cashLogsResType) {
- case 1:
- resType = "订单收入";
- mark = "+";
- break;
- case 2:
- resType = "提现支出";
- mark = "-";
- break;
- case 3:
- resType = "订单支出";
- mark = "-";
- break;
- case 4:
- resType = "线下返利";
- mark = "+";
- break;
- case 5:
- resType = "退订返还";
- mark = "+";
- break;
- case 6:
- resType = "任务奖励";
- mark = "+";
- break;
- default:
- resType = ""
- }
- li.innerHTML = '<span>' + this.cashLogsCreateDate + '</span><span>' + mark + accDiv(this.cashLogsNum, 100) + '元</span><font class="mui-badge mui-badge-inverted">' + resType + '</font>';
- table.appendChild(li)
- })
- }
- }
- }, error: function (xhr, type, errorThrown) {
- errorfn(xhr)
- }
- })
- };mui.ready(function () {
- getCartNum();
- mui('#pullrefresh').pullRefresh().pullupLoading();
- document.querySelector('.loading-bg').style.display = 'none'
- });
|