<template>
    <view class='container'>
		<view class="list">
			<scroll-view style="height: 100%;" scroll-y @scrolltolower="scrolltolower">
				<goodslist :goodsDataList="dataList"></goodslist>
			</scroll-view>
			
			<!-- <emptydata v-else></emptydata> -->
		</view>
    </view>
</template>

<script>
export default {
    data() {
        return {
			dataList: [],
			currentPage: 1,
			isEmpty: false
        };
    },
    onLoad() {
		// this.getDataList()
    },
    methods: {
		// 获取数据
		getDataList() {
			const params = {
				url: '/api/goods/track',
				data: {
					page: this.currentPage
				}
			}
			this.$request(params).then(res => {
				// console.log(res)
				this.dataList = this.dataList.concat(res.data.data)
				if (this.dataList.length >= res.data.total) {
					this.isEmpty = true
				}
			}).catch(err => {
		
			})
		},
		scrolltolower(){
			if (!this.isEmpty) {
				this.currentPage += 1
				this.getDataList()
			}
		}
    },
};
</script>

<style scoped>
	.container {
		height: 100%;
		background-color: #F5F5F5;
		padding: 32rpx;
	}
	.list {
		height: 100%;
	}
</style>
