<template>
	<view>
		<view>
			<scroll-view scroll-x class="bg-white nav text-center" style="height: 100vh;">
				<view :class="index==TabCur?'cu-item text-blue cur':'cu-item'" v-for="(item,index) in list" :key="index" @click="tabSelect"
				 :data-id="index" style="">
					{{item.name}}
					<text v-if="index == 0">({{notUsed}})</text>
					<text v-if="index == 1">({{used}})</text>
					<text v-if="index == 2">({{invalid}})</text>
				</view>
				<view class="coupon-List" v-if="TabCur == 0">
					<view style="text-align: right;">
						<text>使用规则 ></text>
					</view>
					<view>
						<u-card :title="title" :sub-title="subTitle" :thumb="thumb">
							<view class="" slot="body">
								<view class="u-body-item u-flex u-border-bottom u-col-between u-p-t-0">
									<view class="u-body-item-title u-line-2">瓶身描绘的牡丹一如你初妆，冉冉檀香透过窗心事我了然，宣纸上走笔至此搁一半</view>
									<image src="https://img11.360buyimg.com/n7/jfs/t1/94448/29/2734/524808/5dd4cc16E990dfb6b/59c256f85a8c3757.jpg"
									 mode="aspectFill"></image>
								</view>
								<view class="u-body-item u-flex u-row-between u-p-b-0">
									<view class="u-body-item-title u-line-2">釉色渲染仕女图韵味被私藏，而你嫣然的一笑如含苞待放</view>
									<image src="https://img12.360buyimg.com/n7/jfs/t1/102191/19/9072/330688/5e0af7cfE17698872/c91c00d713bf729a.jpg"
									 mode="aspectFill"></image>
								</view>
							</view>
							<view class="" slot="foot">
								<u-icon name="chat-fill" size="34" color="" label="30评论"></u-icon>
							</view>
						</u-card>
					</view>
				</view>
				<view v-else-if="TabCur == 1">


				</view>
				<view v-else="TabCur == 2">


				</view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	export default {
		// mounted() {
		// 	this.notUsed = 0
		// },
		data() {
			return {
				notUsed: 1, //未使用
				used: 2, //已使用
				invalid: 3, //过期

				TabCur: 0,
				list: [{
					name: '未使用',
				}, {
					name: '已使用',
				}, {
					name: '已过期',
				}],
				// 因为内部的滑动机制限制，请将tabs组件和swiper组件的current用不同变量赋值
				current: 0, // tabs组件的current值，表示当前活动的tab选项
				swiperCurrent: 0, // swiper组件的current值，表示当前那个swiper-item是活动的

				title: '素胚勾勒出青花，笔锋浓转淡',
				subTitle: '2020-05-15',
				thumb: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg',
			};
		},
		methods: {
			tabSelect(e) {
				this.TabCur = e.currentTarget.dataset.id
				console.log(this.TabCur)
			}
		},
		onShow() {

		}
	};
</script>
<style>
	.coupon-List {
		height: 100%;
		width: 100%;
		background-color: #f9f9f9;
		padding: 20rpx 20rpx 0 20rpx;
	}

	/*卡片*/
	.u-card-wrap {
		background-color: $u-bg-color;
		padding: 1px;
	}

	.u-body-item {
		font-size: 32rpx;
		color: #333;
		padding: 20rpx 10rpx;
	}

	.u-body-item image {
		width: 120rpx;
		flex: 0 0 120rpx;
		height: 120rpx;
		border-radius: 8rpx;
		margin-left: 12rpx;
	}
</style>
