text: "use strict";function pageLoad(){var e={page:1,condition:"",data:{condition:null,list:{},hasmore:1}},n={list:null};$(function(){for(var t in $("#conditionBox").tap(function(){$(this).hasClass("now")||(e.condition=$(this).attr("data-condition"),e.page=1,e.data={condition:null,list:{},hasmore:1},$("#loadBox").show(),$("#dataBox").hide(),$("#conditionBox").empty(),$("#listList a").remove(),a())},"a"),n)$("#"+t+"List .template").length&&(n[t]=$("#"+t+"List .template").html(),$("#"+t+"List .template").remove());var o;$("#loadMore").tap(a),$(window).scroll(function(){sessionStorage.setItem($("body").attr("ltype")+"listPageCacheScrollTop",$(window).scrollTop())}),2==performance.navigation.type?((o=JSON.parse(sessionStorage.getItem($("body").attr("ltype")+"listPageCache")))&&(e=o,s()),(o=sessionStorage.getItem($("body").attr("ltype")+"listPageCacheScrollTop"))&&$("html,body").animate({scrollTop:o},0,function(){$(window).trigger("scroll")})):$(window).trigger("scroll")});var i=!1;function a(){if(i||0==e.data.hasmore)return!1;i=!0,$("#loadMore,#noDataBox").hide(),$("#loading").css("display","block"),$.getJS(jsUrl,{act:"list",type:$("body").attr("ltype"),filter:e.condition,page:e.page},function(t){try{var o=JSON.parse(t);if(0===parseInt(o.rt)){if(e.data.condition=o.data.filter,o.data.list)for(var a in o.data.list)e.data.list[o.data.list[a].id]=o.data.list[a];e.data.hasmore=o.data.hasmore,++e.page,s(),$("#loadMore").show(),$("#loading").hide()}else $.showError(o)}catch(t){$.showDataError()}i=!1})}function s(){for(var t in $("#conditionBox .s-slide-menu").remove(),e.data.condition){var o,a=e.data.condition[t],i='<div class="s-slide-menu"><div>';for(o in a)i+="<a"+(a[o]==e.condition?' class="now"':"")+' data-condition="'+a[o]+'">'+o.substr(1)+"</a>";$(i+"</div></div>").appendTo($("#conditionBox"))}if(n.list)if(Object.keys(e.data.list).length)for(var t in e.data.list)$('[data-id="'+e.data.list[t].id+'"]').length||$(parseTemplate(n.list,e.data.list[t])).insertBefore($("#listList .clear"));else $("#noDataBox").show();else console.log("未知的列表模板");1==e.data.hasmore?$("#loadMore").parent().show():$("#loadMore").parent().hide(),$("#loadBox").hide(),$("#dataBox").show(0,function(){$("#conditionBox .s-slide-menu").mySlideMenu(),$("#conditionBox .s-slide-menu").each(function(){$(this).find(".now").length&&$(this).trigger("to",$(this).find(".now").index())})}),sessionStorage.setItem($("body").attr("ltype")+"listPageCache",JSON.stringify(e))}pageLoaded=!0}"undefined"==typeof pageLoaded&&"undefined"!=typeof jsApi&&pageLoad();