You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
7.0 KiB
JavaScript

5 years ago
/*create by2016-01-22! The author:118154194@qq.com! */
define(["jquery","base","kkpager"],function(){function a(a,b){var c=new Date(1e3*a),d=c.getFullYear(),e=c.getMonth()+1<10?"0"+(c.getMonth()+1):c.getMonth()+1,f=c.getDate()<10?"0"+c.getDate():c.getDate(),g=c.getHours()<10?"0"+c.getHours():c.getHours(),h=c.getMinutes()<10?"0"+c.getMinutes():c.getMinutes();return"y-m-dd h:i"==b?d+"-"+e+"-"+f+" "+g+":"+h:"m-d"==b?e+"-"+f:"h:i"==b?g+":"+h:void 0}var b={u:window.location.href,api:"http://api.65.com/"},c={seagift:"#seagift",btnsergift:"#btn-sergift",getgifts:".get-gifts",seagift:"#seagift",btnsergift:"#btn-sergift"},d={giftlist:function(c){$.getJSON(b.api+"65api/mplantform_info.php?callback=?",{action:"card_list",page:c,end:12},function(b){if(1==b.code){for(var e="",f=b.card_list.length,g=0;f>g;g++)0==b.card_list[g].card_isuse?e+='<li><img class="abs gift-img" src="'+b.card_list[g].game_pic+'" alt="'+b.card_list[g].game_name+'"><div class="abs gift-name"><div><strong>'+b.card_list[g].game_name+"</strong><span>"+b.card_list[g].type_name+'</span><p class="fl ico-3 ginfo"><i class="ico-3 ico-'+b.card_list[g].card_gtype+'"></i></p></div></div><p class="abs gift-tab"><a title="礼包内容" href="javascript:" class="fl gift-info on">礼包内容</a><a title="使用说明" href="javascript:" class="fr gift-dec">使用说明</a></p><p class="abs gift-tab-cont" style="display: block;">'+b.card_list[g].gift_content+'</p><p class="abs gift-tab-cont hide" style="display: none;">'+b.card_list[g].gift_direction+'</p><p class="abs gift-time">(兑换截止:<span>'+a(b.card_list[g].type_die_time,"y-m-dd h:i")+'</span></p><p class="abs login-tip">请先 <a class="login-link login-link2" href="javascript:" title="登录">[登录]</a> 或 <a class="registet-link" href="javascript:" title="注册">[注册]</a></p><p class="abs get-gifts-show get-gifts-btn" style="display: none;"></p><a href="javascript:;" class="abs ico-3 ico-btn-ani get-gifts get-gifts-btn" data-type-id="'+b.card_list[g].type_id+'">领取礼包</a></li>':1==b.card_list[g].card_isuse&&(e+='<li><img class="abs gift-img" src="'+b.card_list[g].game_pic+'" alt="'+b.card_list[g].game_name+'"><div class="abs gift-name"><div><strong>'+b.card_list[g].game_name+"</strong><span>"+b.card_list[g].type_name+'</span><p class="fl ico-3 ginfo"><i class="ico-3 ico-'+b.card_list[g].card_gtype+'"></i></p></div></div><p class="abs gift-tab"><a title="礼包内容" href="javascript:" class="fl gift-info on">礼包内容</a><a title="使用说明" href="javascript:" class="fr gift-dec">使用说明</a></p><p class="abs gift-tab-cont" style="display: block;">'+b.card_list[g].gift_content+'</p><p class="abs gift-tab-cont hide" style="display: none;">'+b.card_list[g].gift_direction+'</p><p class="abs gift-time">(兑换截止:<span>'+a(b.card_list[g].type_die_time,"y-m-dd h:i")+'</span></p><p class="abs get-gifts-btn">激活码:'+b.card_list[g].card_num+"</p></li>");$("#gift-list").html(e);var h=b.total,i=Math.ceil(h/12);kkpager.generPageHtml({pno:c,total:i,totalRecords:h,isShowTotalPage:!1,isShowCurrPage:!1,isGoPage:!1,mode:"click",click:function(a){return d.giftlist(a),this.selectPage(a),!1}})}})},sergiftlist:function(e,f){var g=$(c.seagift).val(),h=""==g||null==g?e:g;$.getJSON(b.api+"65api/mplantform_info.php?callback=?",{action:"card_list",page:f,end:12,keyword:h},function(e){if(1==e.code){var g="",h=e.card_list.length;if(0==h||""==h)return alert("您搜索的内容不存在,请重新输入"),!1;for(var i=0;h>i;i++)0==e.card_list[i].card_isuse?g+='<li><img class="abs gift-img" src="'+e.card_list[i].game_pic+'" alt="'+e.card_list[i].game_name+'"><div class="abs gift-name"><div><strong>'+e.card_list[i].game_name+"</strong><span>"+e.card_list[i].type_name+'</span><p class="fl ico-3 ginfo"><i class="ico-3 ico-'+e.card_list[i].card_gtype+'"></i></p></div></div><p class="abs gift-tab"><a title="礼包内容" href="javascript:" class="fl gift-info on">礼包内容</a><a title="使用说明" href="javascript:" class="fr gift-dec">使用说明</a></p><p class="abs gift-tab-cont" style="display: block;">'+e.card_list[i].gift_content+'</p><p cl