<template>
	<view>
		<mescroll-uni :up="upOption" :down="downOption" ref="mescrollRef" @up="upCallback" @down="downCallback"
			height="1060">
			<view v-for='(item,index) in list' class="item flex">

			</view>
		</mescroll-uni>
	</view>
</template>

<script>
	var that;
	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
	export default {
		mixins: [MescrollMixin],
		data() {
			return {
				downOption: {
					auto: false,
					textColor: '#bbb'
				},
				upOption: {
					page: {
						size: 10 // 每页数据的数量,默认10
					},
					auto: false,
					noMoreSize: 1,
					textNoMore: '没有更多了~',
					textColor: '#bbb'
				},
				userInfo: {
					head: '',
					nickname: '',
					phone: '',
				},
				list: [{
						name: '1'
					},
					{
						name: '2'
					},
					{
						name: '3'
					}, {
						name: '4'
					}, {
						name: '5'
					}, {
						name: '6'
					}, {
						name: '7'
					}, {
						name: '8'
					}, {
						name: '9'
					}, {
						name: '10'
					}, {
						name: '11'
					}
				]
			};
		},
		onLoad() {
			that = this
		},
		onShow() {
			 this.$nextTick(() => {
			        this.mescroll.resetUpScroll()
			    })
		},

		methods: {

			downCallback() {
				this.mescroll.resetUpScroll()

			},
			upCallback(page) {
				that.mescroll.endBySize(0, 0)
				// this.$request.baseRequest('admin.unimall.cardHolderInfo', 'list', {
				// 	page: page.num,
				// 	limit: page.size,
				// }, failres => {
				// 	uni.hideLoading()
				// 	console.log('res+++++', failres.errmsg)
				// 	uni.showToast({
				// 		icon: "none",
				// 		title: failres.errmsg,
				// 		duration: 3000
				// 	});
				// }).then(res => {
				// 	console.log(res)
				// 	if (page.num == 1) this.list = [];
				// 	let curPageLen = res.data.items.length;
				// 	let totalPage = res.data.total;
				// 	this.list = res.data.items
				// 	this.$nextTick(() => {
				// 		that.mescroll.endBySize(curPageLen, totalPage)
				// 	});

				// 	uni.hideLoading()
				// })
			},
		}
	}
</script>

<style lang="scss">

</style>