<template>
	<view class="integralRecord">
		<!-- 分段器 -->
		<view class="segmented">
			<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="text"
				activeColor="#DDB15B"></uni-segmented-control>
		</view>
		
		<view class="List" :style="{'--height':ListHeight+'rpx'}" v-if="current == 0">
			<view class="ListItem" v-for="item in 5">
				<view style="display: flex; justify-content: space-between;">
					<view class="title"><text>500积分</text> </view>
					<view class='data'><text>2022-02-10</text></view>
				</view>
				<view class="content"><text>投票活动奖励</text></view>
			</view>
		</view>
		<view class="List" :style="{'--height':ListHeight+'rpx'}" v-if="current == 1">
			<view class="ListItem" v-for="item in 5">
				<view style="display: flex; justify-content: space-between;">
					<view class="title"><text>500积分</text> </view>
					<view class='data'><text>2022-02-10</text></view>
				</view>
				<view class="content"><text>积分兑换商品</text></view>
			</view>
		</view>
		
		<uni-load-more :status="status" color="#CCCCCC" :content-text="contentText"/>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				// 分段器
				items: ['收入', '支出',],
				current: 0,
				// list高度
				ListHeight: 800,
				// 加载
				status: 'noMore',
				contentText: {
					contentdown: '查看更多',
					contentrefresh: '加载中',
					contentnomore: '——  已经到底啦  ——'
				}
			}
		},
		methods:{
			onClickItem(e) {
				if (this.current != e.currentIndex) {
					this.current = e.currentIndex;
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	$pageColor:#F9F9F9;
	$bgColor:#FFFFFF;
	// flex布局居中对齐
	@mixin flexlayout {
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.integralRecord{
		height: 100%;
		background: $pageColor;
	}
	.segmented{
		height: 112rpx;
		width: 750rpx;
		background: $bgColor;
		box-shadow: 0px 4rpx 8rpx 0px rgba(0,0,0,0.04);
		border-radius: 0px 0px 16rpx 16rpx;
	}
	::v-deep .segmented-control__text {
		font-size: 32rpx !important;
		font-family: PingFang-SC-Heavy, PingFang-SC;
		font-weight: 500 !important;
		color: #666666 !important;
	}
	
	::v-deep .segmented-control__item--text {
		font-size: 32rpx;
		font-family: PingFang-SC-Heavy, PingFang-SC;
		font-weight: 800 !important;
		padding: 10rpx 0 !important;
		border-radius: 4rpx !important;
		color: #D9A94D !important;
	}
	.List {
		width: 750rpx;
		height: var(--height);
		background: $bgColor;
		box-shadow: 0px 4rpx 24rpx -10rpx rgba(101, 95, 90, 0.3);
		border-radius: 12rpx;
		margin-top: 24rpx;
		padding: 8rpx 28rpx 0 32rpx;
		box-sizing: border-box;
	
		.ListItem {
			width: 690rpx;
			height: 160rpx;
			border-bottom: #F0F0F0 solid 0.5rpx;
			position: relative;
			padding-top: 35rpx;
			box-sizing: border-box;
	
			.title {
				margin-bottom: 10rpx;
				text {
					font-size: 32rpx;
					font-family: PingFang-SC-Bold, PingFang-SC;
					font-weight: bold;
					color: #333333;
				}
			}
	
			.data {
				text {
					font-size: 26rpx;
					font-family: PingFang-SC-Medium, PingFang-SC;
					font-weight: 500;
					color: #999999;
				}
			}
			.content {
				text {
					font-size: 28rpx;
					font-family: PingFang-SC-Medium, PingFang-SC;
					font-weight: 500;
					color: #333333;
				}
			}
			
		}
		// 消除最后一个下划线
		.ListItem:last-child {
			width: 690rpx;
			height: 160rpx;
			border-bottom: #F0F0F0 solid 0rpx;
			position: relative;
			padding-top: 35rpx;
			box-sizing: border-box;
			
			.title {
				margin-bottom: 10rpx;
				text {
					font-size: 32rpx;
					font-family: PingFang-SC-Bold, PingFang-SC;
					font-weight: bold;
					color: #333333;
				}
			}
			
			.data {
				text {
					font-size: 26rpx;
					font-family: PingFang-SC-Medium, PingFang-SC;
					font-weight: 500;
					color: #999999;
				}
			}
			.content {
				text {
					font-size: 28rpx;
					font-family: PingFang-SC-Medium, PingFang-SC;
					font-weight: 500;
					color: #333333;
				}
			}
			
		}
	}
	
</style>