var d=(t,e,i)=>new Promise((h,a)=>{var o=s=>{try{l(i.next(s))}catch(n){a(n)}},g=s=>{try{l(i.throw(s))}catch(n){a(n)}},l=s=>s.done?h(s.value):Promise.resolve(s.value).then(o,g);l((i=i.apply(t,e)).next())});import{at as c,ak as f,h as u}from"./index-CZJgrp0v.js";const p={data(){return{list:[],page:1,count:0,loading:!1,finished:!1}},computed:{loadStatus(){return this.finished?"nomore":this.loading?"loading":"loadmore"},showSkeleton(){if(this.list.length==0&&!this.finished&&this.loading)return!0},showEmpty(){if(this.list.length==0&&this.finished&&!this.loading)return!0},showLoadMore(){return!this.showEmpty&&this.list.length>0}},onReachBottom(){console.log("onReachBottom触底加载"),this.loadMore()},onPullDownRefresh(){this.page=1,this.list=[],this.finished=!1,this.$nextTick(()=>{this.getList(!0),f()})},methods:{loadMore(){if(this.finished){console.log("加载完成"),this.loading=!1;return}this.page=this.page+1,this.loading=!0,this.getList()},getListExtend(t,e=!1){return d(this,null,function*(){try{t.data=t.data||{},t.data.list=t.data.list||t.data.listData||t.data||[],t.data.count=t.data.count||t.data.total||0;let i=this;t.code===200||t.code===0?(this.handleDataCallBack instanceof Function&&(t.data.list=this.handleDataCallBack(t.data.list)),this.list=this.list.concat(t.data.list),this.count=t.data.count,this.loading=!1,(this.count===0||this.list.length>=this.count)&&(this.finished=!0),yield c(),this.finished||this.$isFullScreen().then(h=>{let{windowHeight:a,scrollHeight:o}=h;a+70>=o&&i.loadMore()}),e&&f()):this.$showToastNone(t.message||t.msg)}catch(i){console.log({eeee:i}),this.$showToastNone(t.message||t.msg),this.finished=!0,this.loading=!1,console.error("handleList",i)}finally{u()}})},resetData(){this.finished=!1,this.loading=!1,this.page=1,this.list=[],this.$nextTick(()=>{this.getList()})}}};export{p as l};
