<template>
	<view class="box">

		<view class="top">
			<view class="activityName">{{activity.ActivityName}}</view>
			<view class="stateBox">
				<view class="jinxing" v-if="activity.state=='进行中'">进行中</view>
				<view class="jieshu" v-if="activity.state=='已结束'">已结束</view>
				<view class="weiqiyong" v-if="activity.state=='未启用'">未启用</view>
				<view class="weiqiyong" v-if="activity.state=='未开始'">未开始</view>
				<view class="date" v-if="activity.StartTime">
					{{activity.StartTime.slice(0,10)}}-{{activity.EndTime.slice(0,10)}}</view>
			</view>
		</view>

		

		<view class="contentBox">
			
			<view class="title">活动数据</view>
			<view class="countBox">
				<view class="left">
					<view class="count">
						<view class="num">{{itemData.sumnum}}</view>
						<view class="name">报名人数</view>
					</view>
					<view class="count">
						<view class="num">{{itemData.num}}</view>
						<view class="name">已核销人数</view>
					</view>
					<view class="count">
						<view class="num">{{itemData.accessnumber}}</view>
						<view class="name">浏览人数</view>
					</view>
				</view>
				<view>
					<view class="count">
						<view class="num">{{itemData.employees?itemData.employees:'暂无'}}</view>
						<view class="name">最多推广员工</view>
					</view>
					<view class="count">
						<view class="num" style="color: #FF4F00;">{{itemData.rate}}</view>
						<view class="name">核销率</view>
					</view>
				</view>
			</view>
			
			
		</view>


		

	</view>
</template>

<script>
	
	export default {
		
		data() {
			return {
				activity: {},
				page: 1,
				itemData: {},
				

			}
		},
		onLoad(opt) {
			this.activity = JSON.parse(opt.activity);
			console.log('activity==', this.activity);
			this.page = 1
			this.myOrderCoupon()
		},
		methods: {

			

			myOrderCoupon() {
				uni.showLoading({
					title: '加载中'
				})
				this.$http('openH5SetTheGuest/getDetails', {
					id: this.activity.ID,
					
				}, 'GET').then(res => {
					uni.hideLoading();
					// var list = res.data.Items
					var list = res.data
					
					

					if (this.page == 1) {
						this.itemData = list
					} else {
						this.itemData = this.itemData.concat(list)
					}

					



				})
			},


		},

		// 下拉刷新 上拉加载更多
		onPullDownRefresh() {
			this.page = 1
			this.myOrderCoupon()
			setTimeout(function() {
				uni.stopPullDownRefresh();
			}, 1000);
		},
		onReachBottom() {
			// this.page++;
			this.myOrderCoupon()
		},
	}
</script>

<style>
	.box {
		min-height: 100vh;
		background-color: #F4F5F7;
		width: 100vw;
	}

	.top {
		padding: 30rpx 24rpx;
		background-color: #FFFFFF;
	}

	.activityName {
		font-size: 30rpx;
		font-weight: bold;
		color: #333333;
		line-height: 42rpx;
	}

	.stateBox {
		margin-top: 4rpx;
		display: flex;
		align-items: center;
	}

	.jinxing {

		font-size: 22rpx;
		color: #00A040;
		line-height: 30rpx;
		width: 74rpx;
		height: 30rpx;
		background: #F2FBF6;
		border-radius: 4rpx;
	}

	.jieshu {
		font-size: 22rpx;
		color: #FF6010;
		line-height: 30rpx;
		width: 74rpx;
		height: 30rpx;
		background: #FFECE3;
		border-radius: 4rpx;
	}
	.weiqiyong{
		font-size: 22rpx;
		color: #3C3C3C;
		line-height: 30rpx;
		width: 74rpx;
		height: 30rpx;
		background: #F4F5F7;
		border-radius: 4rpx;
	}

	.date {
		height: 30rpx;
		font-size: 22rpx;
		color: #999999;
		line-height: 30rpx;
		margin-left: 15rpx;
	}

	

	.contentBox {
		padding: 30rpx 24rpx;
		height: calc(100vh - 170rpx);
		margin-top: 20rpx;
		background-color: #FFFFFF;
	}
	.title{
		
		height: 45rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #3C3C3C;
		line-height: 45rpx;
	}
	.countBox{
		padding: 50rpx 50rpx;
		background-color: #FFFFFF;
		display: flex;
	}
	.left{
		margin-right: 62rpx;
	}
	.count{
		width: 262rpx;
		height: 83rpx;
		background: #F7F7F7;
		border-radius: 10rpx;
		border: 1rpx solid #EEEEEE;
		margin-bottom: 30rpx;
		padding: 26rpx 5rpx;
	}
	.num{
		
		height: 50rpx;
		font-size: 36rpx;
		font-weight: 500;
		color: #3C3C3C;
		line-height: 50rpx;
		text-align: center;
	}
	.name{
		height: 33rpx;
		font-size: 24rpx;
		font-weight: 400;
		color: #999999;
		line-height: 33rpx;
		text-align: center;
	}


	.noMore {
		text-align: center;
		line-height: 50rpx;
		color: #999999;
		font-size: 28rpx;
	}
</style>
