<template>
	<view class='container'>
		<!-- <u-tabs :list="tabList" lineHeight="0" :current="currentTab" @click="onChangeTab" :scrollable="true"
			lineColor="#FFF" :inactiveStyle="{'font-size': '28rpx', 'color': '#878787'}"
			:activeStyle="{'font-size': '32rpx', 'color': '#FFFFFF'}"></u-tabs> -->
		<view class="list">
			<scroll-view scroll-y @scrolltolower="scrolltolower" style="height: 100%;">
				<view v-for="(item,index) in list" :key="index" @click="tohdxq(item)">
					<view class="flex mlr-24 mb-30 br-20"
						style="color: #878787;background: #171717;position: relative;">
						<text
							style="position:absolute;top: 0;right: 0;width: 130rpx;height: 48rpx;line-height: 48rpx;text-align: center; background: #0F0F0F;border-radius: 0rpx 20rpx 0rpx 4rpx;color:#FE42C2;">
							{{item.state=='2'?'已结束':'进行中'}}
						</text>
						<image class="w-177 h-246 br-20" :src="$wskj.splitListOne(item.image)"></image>
						<view class="flex-column fs-28 mar-15" style="flex: 1;justify-content: space-around;">
							<text style="color: white;">{{item.name}}</text>
							<text style="color:#878787;font-size: 24rpx;">{{item.startTime}}</text>
							<text style="color:#F752C3;">{{item.mdmc}}</text>
						</view>
					</view>
				</view>
				<emptydata v-if="list.length == 0"></emptydata>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				currentTab: 0,
				tabList: [{
						name: '全部',
					},
					{
						name: '已结束',
					},
					{
						name: '已取消',
					}
				],
				list: [],
			};
		},
		onLoad(options) {
			this.getList()
		},
		computed: {


		},
		methods: {
			onChangeTab(e) {
				this.currentTab = e.index
				this.getList()
			},
			getList() {
				const params = {
					url: '/system/member/listEndedParty',
					method: "GET",
					data: {
						type: this.currentTab
					}
				}
				this.$request(params).then(res => {
					this.list = res.rows
				})
			},
			tohdxq(e) {
				if (e.state == 2) {
					this.$u.toast('该活动已结束')
					return
				}
				this.$wskj.to('/pagesMain/pages/hdxq?data=' + encodeURIComponent(JSON.stringify(e)))
			},
		},
	};
</script>

<style scoped>
	.container {
		height: 100%;
		height: 100%;
		background: #0F0F0F;
		display: flex;
		flex-direction: column;
	}

	.list {
		overflow: hidden;
		height: calc(100% - 60rpx);
	}
</style>