<template>
	<view class="verification">
		<view class="nav">
			<!-- 搜索栏 -->
			<view class="navbox">
				<view class="search">
					<u-input placeholder="搜索" border='none'>
						<template slot="suffix" style='margin-right:40rpx;'>
							<u-image :showLoading="true" :showError='true' src="/static/icon/search.png" width="40rpx"
								height="32rpx"></u-image>
						</template>
					</u-input>
				</view>
				<view>
					<image src="/static/icon/scan.png" style="width: 48rpx ;height: 48rpx;"></image>
				</view>
			</view>
			<!-- 分段器 -->
			<view class="segmented">
				<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="text"
					activeColor="#DDB15B"></uni-segmented-control>
			</view>
		</view>
		
		<!-- 未核销列表 -->
		<view v-if="current === 0">
			<view class="card" v-for="item in 2">
				<view class="toptitle">
					<view>洲际天堂大饭店</view>
					<view>未核销</view>
				</view>
				<view class="shopCard">
					<image  src="/static/icon/Kudosbg.png"></image>
					<view style="margin-left: 24rpx;">
						<text class="name">端午佳节五香肉粽子，仅限前</text>
						<text class="tag">礼盒装 2000积分</text>
					</view>
				</view>
				<view class="points">
					<text class="totalName">共计:</text>
					<text class="totalContent">2000积分</text>
				</view>
				<view class="btn" @click="goOrderVF">
					<text>核销</text>
				</view>
			</view>
		</view>
		<!-- 已核销列表 -->
		<view v-if="current === 1">
			<view class="card" v-for="item in 2">
				<view class="toptitle">
					<view>洲际天堂大饭店</view>
					<view>未核销</view>
				</view>
				<view class="shopCard">
					<image  src="/static/icon/Kudosbg.png"></image>
					<view style="margin-left: 24rpx;">
						<text class="name">端午佳节五香肉粽子，仅限前</text>
						<text class="tag">礼盒装 2000积分</text>
					</view>
				</view>
				<view class="points">
					<text class="totalName">共计:</text>
					<text class="totalContent">2000积分</text>
				</view>
				<view class="btn" v-if="false">
					<text>核销</text>
				</view>
			</view>
		</view>
		<!-- 我的列表 -->
		<view v-if="current === 2">
			<view class="card" v-for="item in 2">
				<view class="toptitle">
					<view>洲际天堂大饭店</view>
					<view>未核销</view>
				</view>
				<view class="shopCard">
					<image  src="/static/icon/Kudosbg.png"></image>
					<view style="margin-left: 24rpx;">
						<text class="name">端午佳节五香肉粽子，仅限前</text>
						<text class="tag">礼盒装 2000积分</text>
					</view>
				</view>
				<view class="points">
					<text class="totalName">共计:</text>
					<text class="totalContent">2000积分</text>
				</view>
				<view class="btn" v-if="false">
					<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,
				status: 'noMore',
				contentText: {
					contentdown: '查看更多',
					contentrefresh: '加载中',
					contentnomore: '——  已经到底啦  ——'
				},
			}
		},
		methods:{
			onClickItem(e) {
				if (this.current != e.currentIndex) {
					this.current = e.currentIndex;
				}
			},
			// 跳转核销订单
			goOrderVF(){
				uni.navigateTo({
					url:'/pages/my/verification/orderVerification'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	$pageColor:#F9F9F9;
	$bgColor:#FFFFFF;
	
	// flex布局居中对齐
	@mixin flexlayout {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.verification {
		height: 100%;
		background: $pageColor;
	}
	// ::v-deep .segmented-control__item{
	// 	justify-content: center !important;
	// 	margin: 0 30rpx;
	// }
	::v-deep .segmented-control__text {
		font-size: 32rpx !important;
		font-family: PingFang-SC-Heavy, PingFang-SC;
		font-weight: 500 !important;
		color: #666666;
		
	}
	
	::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;
		
	}
	.nav {
		height: 216rpx;
		width: 750rpx;
		background: $bgColor;

		.navbox {
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 0 30rpx;
			box-sizing: border-box;
			// 搜索
			.search {
				height: 124rpx;
				width: 614rpx;
				background-color: $bgColor;
				@include flexlayout;
			
				::v-deep .u-input {
					width: 690rpx !important;
					height: 68rpx !important;
					background: #F1F1F1;
					border-radius: 74rpx;
				}
			
				::v-deep .u-input__content__field-wrapper {
					padding-left: 36rpx;
				}
			}
		}
	}
	.card{
		margin-top: 24rpx;
		// width: 750rpx;
		// height: 426rpx;
		background: $bgColor;
		border-radius: 16rpx;
		padding:32rpx 28rpx 24rpx 28rpx;
		box-sizing: border-box;
		.toptitle{
			display: flex;
			justify-content: space-between;
			align-items: center;
			font-size: 28rpx;
			font-family: PingFang-SC-Bold, PingFang-SC;
			font-weight: bold;
			color: #080F18;
		}
		.shopCard{
			margin-top: 28rpx;
			width: 694rpx;
			height: 164rpx;
			background: #F4F5F6;
			border-radius: 10rpx;
			display: flex;
			align-items: center;
			image{
				width: 132rpx;
				height: 132rpx; 
				margin-left: 16rpx;
				display: inline-block;
			}
			.name{
				font-size: 28rpx;
				font-family: PingFangSC-Medium, PingFang SC;
				font-weight: 500;
				color: #080F18;
				display: block;
			}
			.tag{
				font-size: 24rpx;
				font-family: PingFang-SC-Medium, PingFang-SC;
				font-weight: 500;
				color: #666666;
			}
		}
		.points{
			display: flex;
			justify-content: flex-end;
			align-items: center;
			margin-top: 30rpx;
			.totalName{
				font-size: 22rpx;
				font-family: PingFang-SC-Medium, PingFang-SC;
				font-weight: 500;
				color: #080F18;
				margin-right: 10rpx;
			}
			.totalContent{
				font-size: 30rpx;
				font-family: PingFang-SC-Heavy, PingFang-SC;
				font-weight: 800;
				color: #080F18;
			}
		}
		.btn{
			width: 170rpx;
			height: 60rpx;
			background: #FFFFFF;
			border-radius: 30rpx;
			border: 2rpx solid #D0D0D0;
			margin-left: 524rpx;
			margin-top: 15rpx;
			@include flexlayout()
			text{
				font-size: 26rpx;
				font-family: PingFang-SC-Medium, PingFang-SC;
				font-weight: 500;
				color: #080F18;
			}
		}
	}
</style>
