<template>
	<view class="store">
		
		<view class="bg">
			<view class="info">
				<view class="num">
					3399
				</view>
				<view class="label">
					剩余积分
				</view>
			</view>
			<view class="rule">
				积分规则
			</view>
			<image class="jump-img"  @click="jump('./shop')" src="http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/BwbkTmLONI0K245c64d32574af7de6e0d328048b9f7c.png/1.png" mode=""></image>
		</view>
		
		<view class="title">
			<image class="icon" src="../static/diamon.png" mode=""></image>
			积分明细
		</view>
		
		
	<!-- 	<view class="tab-group">
			<view class="tab" @click="jump('./shop')">
				<image class="icon" src="../static/store.png" mode=""></image>
				<view class="tab-name">
					积分商城
				</view>
			</view>
			
			<view class="tab" @click="jump('./logs')">
				<image class="icon" src="../static/diamon.png" mode=""></image>
				<view class="tab-name">
					积分明细
				</view>
			</view>
			
		</view> -->
		
		<zs-list mt="0" @load="loadMore" :status="status">
		
			<view class="item" v-for="(item,index) in list" :key="index">
				<view class="top">
					<view class="item-title">
						{{item.title}}
					</view>
					<view class="score">
						{{item.score}}
					</view>
				</view>
				<view class="bottom">
					
					<view class="time">
						{{item.time}}
					</view>
					<view class="num">
						剩余{{item.num}}
					</view>
				</view>
			</view>
		</zs-list>
		
		
		
		<!-- <view class="goods-box">
			
			<view class="store-title">
				人气兑换
				<u-icon name="arrow-right" color="#000000" size="38"></u-icon>
			</view>
			
			<view class="box">
				<view class="item" v-for="(item,index) in list" :key="index">
					<image :src="item.src" mode="aspectFill" class="icon"></image>
					<view class="item-title">
						{{item.title}}
					</view>
					<view class="handle-box">
						<view class="price">
							{{item.score}}分
						</view>
						<view class="exchange-btn">
							兑换
						</view>
					</view>
				</view>
				
			</view>
			
			<view class="store-title">
				生活出行
				<u-icon name="arrow-right" color="#000000" size="38"></u-icon>
			</view>
			
			<view class="box">
				<view class="item" v-for="(item,index) in list" :key="index">
					<image :src="item.src" mode="aspectFill" class="icon"></image>
					<view class="item-title">
						{{item.title}}
					</view>
					<view class="handle-box">
						<view class="price">
							{{item.score}}分
						</view>
						<view class="exchange-btn">
							兑换
						</view>
					</view>
				</view>
			</view>
			
		</view> -->
		<zs-skeleton :loading="loading" type="integral"></zs-skeleton>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				loading: false,
				status:'more',
				list:[
					{
						title:'天天签到积分',
						time:'2022-10-01',
						score:'+5',
						num:1233
					},
					{
						title:'天天签到积分',
						time:'2022-10-01',
						score:'+5',
						num:1233
					},
					{
						title:'天天签到积分',
						time:'2022-10-01',
						score:'+5',
						num:233
					},
					{
						title:'天天签到积分',
						time:'2022-10-01',
						score:'+5',
						num:1233
					}],
				
			}
		},
		methods: {
			jump(url) {
				uni.navigateTo({
					url
				})
			},
			loadMore(){
				this.status = 'loading'
					setTimeout(()=>{
						this.status = 'more'
						this.list.push({
						title:'天天签到积分',
						time:'2022-10-01',
						score:'+15',
						num:1233
					})
					},1000)
			}
		},
		onLoad() {
			this.loading = true
			setTimeout(()=>{
				this.loading = false
			},1000)
		}
	}
</script>

<style lang="scss">
.store{
	padding-bottom: 80rpx;
	background: #F9F9F9;
	.bg{
		background: linear-gradient(180deg, #3988FF 0%, #F9F9F9 100%);
		height: 430rpx;
		background-size: 100% 430rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		color: #fff;
		position: relative;
		.jump-img{
			position: absolute;
			bottom: 20rpx;
			left: 50%;
			transform: translateX(-50%);
			width: 660rpx;
			height: 134rpx;
		}
		.info{
			text-align: center;
			color: #222222;
			.num{
				font-size: 56rpx;
				font-weight: bold;
			}
			.label{
				font-size: 24rpx;
			}
		}
		.rule{
			position: absolute;
			top: 50%;
			right: 0%;
			transform: translateY(-50%);
			background: #fff;
			color: $uni-text-primary;
			font-size: 28rpx;
			padding:10rpx 18rpx;
			border-radius: 12rpx;
		}
	}
	
	
	.title{
		font-size: 28rpx;
		font-weight: bold;
		color: #0F0F0F;
		display: flex;
		align-items: center;
		margin: 30rpx;
		.icon{
			width: 40rpx;
			height: 40rpx;
			margin-right: 10rpx;
		}
	}
	
	.item{
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		padding: 25rpx;
		margin:0 30rpx 20rpx;
		border-radius: 16rpx;
		background: #fff;
		.top{
			display: flex;
			align-items: center;
			justify-content: space-between;
			.item-title{
				font-size: 28rpx;
			}
			.score{
				font-size: 38rpx;
				color: rgb(57, 81, 251);
				color: #0F0F0F;
				font-weight: bold;
			}
			
		}
		.bottom{
			display: flex;
			align-items: center;
			justify-content: space-between;
			color: #999999;
			margin-top: 15rpx;
				font-size: 24rpx;
			.time{
			}
			
			.num{
				
			}
		}
	}
	
	
	.goods-box{
		padding: 20rpx 50rpx;
		.store-title{
			font-size: 34rpx;
			display: flex;
			align-items: center;
			position: relative;
			padding-left: 18rpx;
			font-weight: bold;
			margin: 20rpx 0 30rpx;
		}
		.store-title::before{
			width: 7rpx;
			height: 100%;
			background: rgb(57, 81, 251);
			content: '';
			display: flex;
			position: absolute;
			top: 0%;
			left: 0;
			
		}
		.box{
			display: flex;
			justify-content: space-between;
			border-bottom: 1rpx solid #cacaca;
			padding-bottom: 30rpx;
			.item{
				width: 200rpx;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				.icon{
					width: 100%;
					height: 210rpx!important;
					border-radius: 12rpx;
					object-fit: cover;
				}
				.item-title{
					font-size: 26rpx;
					 display: -webkit-box;
					-webkit-box-orient: vertical;
					overflow: hidden;
					-webkit-line-clamp: 2;
					text-overflow: ellipsis;
					margin-top: 10rpx;
				}
				.handle-box{
					display: flex;
					justify-content: space-between;
					align-items: center;
					margin-top: 15rpx;
					.price{
						font-size: 26rpx;
						color: #FE5B47;
					}
					.exchange-btn{
						width: 96rpx;
						height: 40rpx;
						line-height: 40rpx;
						background: $uni-color-primary;
						border-radius: 20rpx;
						text-align: center;
						color: #fff;
						font-size: 22rpx;
					}
				}
			}
		}
	}
	
}
</style>