var tabindex = 0, pageNumber = 0, pagesize = 10;
mui.init({
pullRefresh: {
container: '#pullrefresh_yhq_list',
down: {},
up: {contentrefresh: '正在加载...', callback: pullupRefresh}
}
});
function pullupRefresh() {
pageNumber += 1;
var btnArray = ['否', '是'];
$.ajax(base_path + '/coupon/couponItemList', {
data: {
"pageSize": pagesize,
"useStatus": tabindex,
"pageNO": pageNumber
},
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 coupon_data = [];
coupon_data = dt.data.itemList;
mui('#pullrefresh_yhq_list').pullRefresh().endPullupToRefresh(coupon_data.length < pagesize);
var table = document.body.querySelector('.my-yhq-list');
mui(coupon_data).each(function (index) {
var li = document.createElement('li');
li.className = 'my-yhq-cell';
var ptrice;
if (this.couponType == 1) {
ptrice = accDiv(this.couponReduce, 100) + '元'
} else {
ptrice = "-" + (100 - this.couponReduce) + "%"
}
if (this.couponUseStatus == 1 && tabindex <= 1 && this.couponItemRemark == "normal") {
li.innerHTML = '
有效期至' + this.couponUseEndDate + '
满' + accDiv(this.couponConsumeEnough, 100) + '元可使用有效期至' + this.couponUseEndDate + '
满' + accDiv(this.couponConsumeEnough, 100) + '元可使用