var pageNumber = 1, pagesize = 100;
var typeId = getParam("typeId");
mui.ready(function () {
var btnArray = ['否', '是'];
$.ajax(base_path + '/coupon/couponTypeList', {
data: {
"pageSize": pagesize,
"pageNO": pageNumber,
"typeId": typeId
},
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 coupontype_data = [];
coupontype_data = dt.data.typeList;
var table = document.body.querySelector('.my-yhq');
if (coupontype_data.length == 0) {
$(".no_yhq").show()
}
mui(coupontype_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.couponId != 1 && this.couponId != 2) {
li.innerHTML = '
有效期至' + this.couponEndDate + '
满' + accDiv(this.couponConsumeEnough, 100) + '元可使用