<template>
	<view>
		<!-- <view class=" mart10 marb20 alijus">
			<view class="font16 fcor333 paddtop5 paddbotm5  margle20  marRight20" v-for="(item,index) in status"
				@click="switchid(item)" :class="[statusid == item.id ? 'fcor089 borbtom fontwig6' : '']" :key="index">
				{{item.title}}
			</view>
		</view> -->

		<view class="mart20 width100">
			<view v-if="activityList == '' " class="mart60 fotct font14 fcor666">
				<image mode="widthFix" style="width: 70vw;" src="../../../static/img/noorder.png"></image>
			</view>
			<view class="width94 backcorfff border-r mart15" v-for="(item,index) in activityList" :key="index"
				@click="jumpactivitydetails(item.id)">
				<view class="notes">
					<view class="width100 margle">
						<view class="font18 fcor333 fontwig6">{{item.activityName}}</view>
						<view class="font14 fcor666 text2 paddtop5">{{item.comments}}</view>
						<!-- {{item.payTime | timeFormat('yyyy-mm-dd hh:mm:ss')}} -->
						<view class="font13 width80p fcoreb5 mart5">活动开始时间:
							{{item.effectiveStart | timeFormat('yyyy-mm-dd hh:mm:ss')}}
						</view>
						<view class="font13 width80p fcoreb5 mart5 paddbotm10">活动结束时间:
							{{item.effectiveEnd | timeFormat('yyyy-mm-dd hh:mm:ss')}}
						</view>
						<view class="otstatucs fcorFD7 font16" v-if="item.bankActivityRoster != null">已报名</view>
						<view class="otstatucs fcor999 font16" v-else>未报名</view>
					</view>

				</view>
			</view>
		</view>
	</view>
	</view>
</template>

<script>
	import {
		queryActivityList
	} from '../../../Utils/Api.js';
	export default {

		data() {
			return {
				status: [{
						id: 1,
						title: '未报名'
					},
					{
						id: 2,
						title: '审核中'
					}, {
						id: 3,
						title: '审核驳回'
					}, {
						id: 4,
						title: '已报名'
					}
				], //状态
				activityList: [], //权益活动列表

				statusid: 1, //当前状态
				isLoadMore: false, //是否加载中
				merId: '' // 商户id
			}
		},
		onLoad(options) {
			this.merId = options.id;
			this.queryActivityList();
		},
		methods: {
			//切换id
			switchid(item) {
				this.statusid = item.id;
			},
			//查询活动列表
			queryActivityList() {
				uni.showLoading({
					title: '加载中'
				})
				let datas = {
					"merId": this.merId
				}
				queryActivityList(datas).then(res => {
					uni.hideLoading();
					if (res.return_code == '000000') {
						this.activityList = res.return_data;
					} else {
						uni.showToast({
							title: res.return_msg,
							duration: 2000,
							icon: 'none'
						})
					}
				})
			},
			//去往活动详情
			jumpactivitydetails(item) {
				uni.navigateTo({
					url: '/pages/index/equity-activities-details/equity-activities-details?id=' + item +
						'&merid=' + this.merId
				})
			}
		}
	}
</script>

<style lang="scss">
	.borbtom {
		border-bottom: 3px solid #089bf5;
	}

	page {
		background-color: #f6f6f6;
	}

	.notes {
		width: calc(100% - 40rpx);
		display: flex;
		align-items: center;
		padding: 18px 18px 9px 18px;
	}

	.otstatucs {
		width: 60px;
	}
</style>