<template>
    <view class='container'>
		<view class="list">
			<!--  v-if="dataList.length > 0" -->
			<scroll-view scroll-y style="height: 100%;" @scrolltolower="scrolltolower">
				<view v-for="(item, index) in 8" :key="index" class="item">
					<view class="flex-column">
						<text>购买商品支出</text>
						<text class="fs-28 mt-16">2324.7.14 13:23</text>
					</view>
					<view class="flex-column">
						<text class="fs-36 fw-600" style="color: #FE2C24;">-10</text>
						<text class="fs-24 mt-16">积分：200</text>
					</view>
				</view>
			</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: '/addons/shop/api.score/logs',
				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%;
	}
	.list {
		height: 100%;
	}
	.item {
		padding: 24rpx 32rpx;
		border-radius: 16rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		border-bottom: 2rpx solid #F5F5F5;
	}
</style>
