'); flyer.fly({ start: { left: e.pageX, top: e.pageY-h-30 }, end: { left: cartOffset.left, top: cartOffset.top-h, width: 20, height: 20 }, onEnd: function(){ this.destory(); //移除dom //数据准备 var dshopid=_t.data("shopid"); var dshopname=_t.data("shopname"); var djztime=_t.data("jztime"); var dprice=_t.data("price"); var _tpp=_t.parent().parent(); var duselimt=$(".uselimt",_tpp).html(); cls=""; if (dprice >= 100) { cls = "coupon-lg"; } if (dprice <= 50) { cls = "coupon-sm"; } //html准备 var htmlcont='
  • '; htmlcont+=''; htmlcont+='
    '+dshopname+'
    '; htmlcont+='

    ¥'+dprice+''+duselimt+'

    '; htmlcont+='

    截止'+djztime+'

    '; htmlcont+='
    '; htmlcont+='
  • '; $('.side-asset-list ul').prepend(htmlcont); var cpcount=$("#mycouponcount").html(); cpcount=parseInt(cpcount); cpcount=cpcount+1; $("#mycouponcount").html(cpcount); $.dialog.succeedTips('领取成功!'); if(isNeedJump=="1"){ window.location.reload(); } } }); } else { if (data.status!=-1) { _t.removeClass("btnexchange").addClass("disabled"); } //失效 var isshowerr = true; switch (data.status) { case -2: isshowerr = false; _t.html("己过期"); break; case -3: _t.html("不可领"); break; case -4: isshowerr = false; _t.html("积分不足"); break; } if (isshowerr) { $.dialog.errorTips(data.msg, 3); } } }); }); }); var giftpage = 1; var ismoredata = true; var autoloading=$("#autoLoad"); $(window).scroll(function () { var scrollTop = $(this).scrollTop(); var scrollHeight = $(document).height(); var windowHeight = $(this).height(); if (scrollTop + windowHeight >= scrollHeight - 300) { giftpage++; if(giftpage>giftmaxpage){ ismoredata=false; giftpage=giftmaxpage; } if(ismoredata){ LoadGift(giftpage); }else{ if(giftpage>1){ autoloading.html('没有积分礼品'); }else{ autoloading.html(""); } } } }); (function ($) { var li = $('#giftbox').find('li'); if (li.length == 0) { ismoredata=false; autoloading.html('没有积分礼品'); } })($); function LoadGift(page) { var url = '/IntegralMall/GiftList'; if (ismoredata) { //打开loading autoloading.html(""); $.post(url, { page: page, rows: '12' }, function (result) { var html = ''; if (result.length > 0) { $.each(result, function (i, rows) { html += '
  • '; html += ''; html += '

    ' + rows.GiftName + '

    '; html += '

    ' + rows.NeedIntegral + '分¥' + rows.GiftValue + ''+rows.NeedGradeName+'

    '; html += '

    ' + rows.SumSales + '人已经兑换

    '; html += '' + (rows.StockQuantity > 0 ? '去兑换' : '无库存') + ''; html += '
  • '; }); $('#giftbox').append(html); //关闭loading autoloading.html(""); }else { ismoredata = false; autoloading.html('没有更多积分礼品了'); } }); } }