<template>
	<view class="log-list">
		<zs-list class="store-box" mt="0" @load="loadMore" :status="status">
			<view class="item" v-for="(item,index) in list" :key="index">
				<image class="icon" :src="JSON.parse(item.equityContent).icon" mode=""></image>
				<view class="info">
					<view class="title">
						{{JSON.parse(item.equityContent).equityName}}
					</view>
					<view class="time">
						领取时间：{{item.createTime}}
					</view>
				</view>
				<view class="status" :class="[item.status == 1?'':'used']">
					 {{item.status == 1?'待充值':'已充值'}}
				</view>
			</view>
		</zs-list>
	</view>
</template>

<script>
	import {getLogList} from '@/api/combo.js'
	export default {
		data() {
			return {
				list:[],
				status:'more',
				query:{
					currentPage:1,
					pageSize:10,
				}
			}
		},
		methods: {
			loadMore(){
				this.getLogList()
			},
			getLogList(){
				if(this.status == 'noMore' || this.status == 'loading') return
				this.status = 'loading'
				getLogList(this.query).then(res=>{
					if(res.state == 'Success'){
						this.list = this.list.concat(res.content.records)
						if(this.list.length >= res.content.total){
							this.status = 'noMore'
						}else{
							this.status = 'more'
						}
					}
				})
			}
		},
	}
</script>

<style lang="scss" scoped>
.log-list{
	background: #F9F9F9;
	padding: 20rpx 24rpx;
	min-height: 100vh;
	.zs-list {
		.item {
			padding: 24rpx 0;
			border-bottom: 2rpx solid #F0F0F0;
			display: flex;
			align-items: center;
			.icon{
				width: 160rpx;
				height: 160rpx;
				border-radius: 16rpx;
			}
			.info{
				flex: 1;
				margin-left: 20rpx;
				.title{
					font-weight: 600;
					font-size: 32rpx;
					color: #222222;
				}
				.time{
					font-size: 24rpx;
					color: #AAAAAA;
					margin-top: 20rpx;
				}
			}
			.status{
				width: 120rpx;
				height: 52rpx;
				line-height: 52rpx;
				text-align: center;
				background: #EE4320;
				border-radius: 26rpx 26rpx 26rpx 26rpx;
				font-size: 28rpx;
				color: #FFFFFF;
			}
			.status.used{
				background: rgba(238,67,32,0.1);
				color: #EE4320;
			}
		}
	}
}
</style>