<template>
	<view v-if="isShow">
		<view class="top">
			<view class="tops ddflex">
				<image :src="detail.pic" mode="aspectFill" class="act-img"></image>
				<view class="fflex">
					<view class="title tovers">{{detail.title}}</view>
					<view class="sta ddflex">
						<view class="area fflex ddflex" v-if="detail.address">
							<!-- <image src="../static/mine/images/dzico.png"></image> -->
							<view class="tover fflex">{{detail.address}}</view>
						</view>
						<!-- <view class="money"><text>￥</text>{{detail.money}}</view> -->
					</view>
				</view>
			</view>
			<view class="date">
				<view class="time ddflex"><!-- <image src="../static/mine/images/sjico.png"></image> -->报名时间：{{ detail.enlistStartTime }} - {{ detail.enlistEndTime }}</view>
				<view class="time ddflex"><!-- <image src="../static/mine/images/sjico.png"></image> -->活动时间：{{ detail.startTime }} - {{ detail.endTime }}</view>
			</view>
			<!-- <view class="piao ddflex">
				<view class="fflex">总计</view>
				<view class="num">x{{detail.enlistExtendDTOS.length}}</view>
				<view class="money"><text>￥</text>{{detail.actualMoney}}</view>
			</view>
			<view class="piao ddflex">
				<view class="fflex">实付款</view>
				<view class="money"><text>￥</text>{{detail.actualMoney}}</view>
			</view> -->
		</view>
		<view class="infos bgfff">
			<view class="tits">报名信息</view>
			<view class="li ddflex">
				<label>当前状态</label>
				<view class="flex" v-if="detail.enlistState == 0">未付款</view>
				<view class="flex" v-else>{{detail.enlistState == 2 ? '报名成功' : '报名失败'}}</view>
			</view>
			<view class="li ddflex">
				<label>活动时间</label>
				<view class="flex">{{detail.startTime}}</view>
			</view>
			<view class="li ats ddflex" v-if="detail.address">
				<label>活动地址</label>
				<view class="flex">{{detail.address}}</view>
			</view>
			<view class="li ats ddflex">
				<label>报名人员</label>
				<view class="flex">
					<view class="lis" v-for="(item,index) in detail.enlistExtendDTOS" :key="index">{{item.name}}{{item.phone}}</view>
				</view>
			</view>
		</view>
		<!-- <view class="infos bgfff">
			<view class="tits">订单信息</view>
			<view class="li ddflex">
				<label>订单编号</label>
				<view class="flex">{{detail.orderId}}</view>
			</view>
			<view class="li ddflex">
				<label>支付时间</label>
				<view class="flex">{{detail.createDate}}</view>
			</view>
		</view> -->
		<view class="btn" v-if="detail.enlistState == 0" @click="payOrder(options.orderId)">立即付款</view>
	</view>
</template>

<script>
const req = require('../../utils/request.js');
const api = require('../../utils/api.js');
const util = require('../../utils/util.js');
const requsetmessage = require('../../utils/requestmessage.js');
const app = getApp();
export default {
	components: {
	},
	data() {
		return {
			isShow: false,
			options: {},
			detail: {},
			isAdd: false,
			personList: [],
			name: '',
			phone: ''
		};
	},
	onLoad(options) {
		this.options = options;
		if(req.getStorage('personList')){
			this.personList = req.getStorage('personList')
		}
	},
	onShow() {
		this.getData(true);
	},
	methods: {
		getData(isShow){
			req.getRequest('/api/match/enlist/detailV2',{id: this.options.id},res => {
				this.detail = res;
				this.isShow = true;
				req.saveBehaviorNew(this.detail.matchId,7,4)
			},isShow);
		},
		formatTimeCommStr(dataStr) {
			return util.formatTimeCommStr(dataStr, 'M/D');
		},
		jumpUrl(url){
			uni.navigateTo({
				url: url
			})
		},
		async payOrder(id){
			await requsetmessage.remindActivity().then(res => {});
			req.payOrders(id,success =>{
				this.getData();
			})
		}
	}
};
</script>

<style>
	@import "./activityDet.css";
</style>
