<template>
	<view class="deliverList">
		<loadlogo v-if="!loadlogo" />
		<view  v-if="loadlogo && inviteList.length > 0">
			<work-List :flag="false" :inviteList="inviteList"></work-List>
			<load-more :isMore="isMore"  :bgc="'#ffffff'"></load-more>
			<TabBars :tabBarAct="0" pageType="15"></TabBars>
		</view>
		<nonemores v-else-if="inviteList.length == 0"></nonemores>
		<far-bottom></far-bottom>
	</view>
</template>

<script>
	import App from '@/common/js/app.js';
	import loadMore from '@/components/template/loadmore.vue';
	import Loadlogo from '@/components/template/loadlogo.vue';
	import workList from '@/components/template/workList.vue';
	import TabBars from '@/components/template/tabBar.vue';
	import nonemores from '@/components/template/nonemores.vue'
	export default{
		data(){
			return{
				loadlogo:true,
				isMore:true,
				inviteList:[],
				page:1,
				page_index:10,
				total:1
			}
		},
		components:{
			loadMore,
			Loadlogo,
			workList,
			TabBars,
			nonemores
		},
		onLoad() {
			this.getList()
		},
		onReachBottom() {
			if(this.total < this.page) return
			this.isMore = false;
			this.page++;
			this.getList(true)
		},
		methods:{
			getList(flag){
				let data = {
					is_total:1,
					page:this.page,
					page_index:this.page_index
				}
				App._post_form(
					`&p=recruit&do=getMyJobSearch`,
					data,
					res => {
						if(flag){
							this.inviteList = this.inviteList.concat(res.data.list);
						}else{
							this.inviteList = res.data.list;
						}
						console.log(this.inviteList,res.data.list);
						this.total = res.data.total;
						this.isMore = true;
						this.loadlogo = true;
					},
					false,
					() => {
						this.loadlogo = true;
					}
				);
			}
		}
	}
</script>

<style lang="scss" scoped>
	.deliverList{
		background-color: #FFFFFF;
		padding-bottom: 100upx;
	}
</style>
