<template>
	<view class="total-page page-box">
		<Nav :title="'领取任务'" :genre="1" :fixedHeight="110"></Nav>
		<view class="task-tabs task-tabs-width m-t30">
			<TaskImgTab></TaskImgTab>
		</view>
		<!-- <EnButton is_both></EnButton> -->
		<EnScroll ref="scroll" :navHeight="110" class="main" @onRefresh="onRefresh" @onScrollBottom="onScrollBottom">
			<TaskItem :type="2" is_bottom></TaskItem>
		</EnScroll>
	</view>
</template>

<script>
	import TaskItem from "@/common/task/task-item.vue"
	import TaskImgTab from "@/page_task/module/task_ima_tab.vue"

	export default {
		components: {
			TaskImgTab,
			TaskItem
		},
		data() {
			return {

			}
		},
		methods: {
			// 下拉刷新
			onRefresh() {
				uni.showLoading({
					title: '数据加载中'
				})
				setTimeout(() => {
					uni.showToast({
						title: '加载完成',
						icon: 'none'
					})
					this.$refs.scroll.onEndPulling()
				}, 1000)
				console.log("下拉刷新");
			},
			// 滚动到底部
			onScrollBottom() {
				uni.showLoading({
					title: '数据加载中'
				})
				setTimeout(() => {
					uni.showToast({
						title: '加载完成',
						icon: 'none'
					})
				}, 1000)
				console.log("到底部了");
			},
		}
	}
</script>

<style>
	.task-tabs-width {
		width: calc(100% - 40rpx);
	}
</style>