<template>
	<div>
		<common ref="common" @asynCallBack="asynCallBack"></common>
		<top-header :pageTitle="pageTitle"></top-header>

		<div class="mui-content">
			<div class="vongi-hddat-tit">
				<h1 v-text="detail.title"></h1>
				<h5>活动起止日期：{{detail.startTime.substr(0,10)}} 至 {{detail.endTime.substr(0,10)}}</h5>
			</div>
			<div class="vongi-hddat-text">
				<div v-for="(item,index) in contentList" class="vongi-hddat-cont">
					<p><img :src="item.picture" width="100%" /></p>
					<p v-html="item.detail"></p>
				</div>
				<div class="vongi-hddat-cont vongi-hddat-center">
					<!-- <p><img src="~$project/assets/img/huodoma.png" width="40%" /></p>
					<p>咨询热线：13687155078</p> -->
					<p>本活动发起人：{{detail.roomNumber}}业主 {{detail.applicant}}</p>
				</div>
			</div>
		</div>

		<loading :visible="isLoading"></loading>
	</div>
</template>

<script>
	import * as API_Activity from '@/apis/Master/activity'
	import Common from '$project/components/Common.vue'
	import Loading from '$project/components/Loading.vue'
	import TopHeader from '$project/components/TopHeader.vue'
	import {
		mapGetters,
		mapMutations
	} from 'vuex'
	import {
		isJSON,
	} from '$project/utils'
	export default {
		name: 'MasterActivityMyInfo',
		components: {
			Common,
			Loading,
			TopHeader,
		},
		data() {
			return {
				isLoading: false,

				pageTitle: '活动详情',

				id: this.$route.query.id,
				detail: {
					startTime: '',
					endTime: ''
				},
			}
		},
		created() {},
		methods: {
			//获取详情
			getInfo() {
				this.isLoading = true;
				API_Activity.getActivityInfo(this.id).then(response => {
					this.isLoading = false;
					this.detail = response;
				}).catch(error => {
					this.isLoading = false;
					mui.toast(error);
				})
			},
			//获取审核状态
			getStatusName(status) {
				let statusArr = ['待审核', '已批准', '未批准'];
				return statusArr[status];
			},
			asynCallBack() {

			},
		},
		mounted() {
			document.body.style.backgroundColor = '#fff';
			this.getInfo();
		},
		destroyed() {
			document.body.style.backgroundColor = '';
		},
		computed: {
			contentList: {
				// getter
				get: function() {
					if(isJSON(this.detail.content)){
						return JSON.parse(this.detail.content);
					}else{
						return [];
					}
				},
				// setter
				set: function(newValue) {
					console.log(newValue)
				}
			},
			...mapGetters({
				openId: 'wx_openid',
				token: 'token',
				person_data: 'person_data',
				person_popedom: 'person_popedom',
			})
		}
	}
</script>

<style scoped src="$project/assets/css/xpwyfyy.css"></style>
<style src="$project/assets/css/iconfont.css"></style>
<style>
</style>
