<template>


	<view>
		<view v-if="state === 0">
			<uni-load-more status="loading"></uni-load-more>
		</view>
		<!-- 错误 -->
		<z-paging-empty-view v-if="state === 1" emptyViewText="很抱歉,加载失败" :showEmptyViewReload="true"
			:emptyViewImg="errorImg" @reload="reload">
		</z-paging-empty-view>
		<view v-if="state != 0 && state != 1">
			<slot></slot>
		</view>

		<!-- 无数据 -->
		<uni-load-more v-if="state === 100" status="noMore" :content-text="contentText"></uni-load-more>

	</view>
</template>
<script>
	import zStatic from '../../../z-paging/components/z-paging/js/z-paging-static.js'
	export default {
		data() {
			return {
				state: 0,
				contentText: {
					contentdown: "上拉显示更多",
					contentrefresh: "正在加载...",
					contentnomore: "无数据"
				}
			};
		},
		computed: {
			errorImg() {
				return zStatic.base64Error
			},
			notDataImg() {
				return zStatic.base64Empty
			}
		},
		methods: {
			setLoadState(state) {
				this.state = state
			},
			getLoadState() {
				return this.state
			},
			reload() {
				this.request()
			},
			request() {
				this.$emit('request');
			}
		}
	}
</script>
<style>
</style>