<?php
/**
 * 活动审核详情
 * $Id: event_examine_input.php,v 1.1 2020/01/03 11:18:46  Exp $
 * @author lixq
 * @package manager.public_html
 **/

?>
<div id="change">
	<p class="edit_title">活动发布</p>
	<form id="form" name="event_examine_input" action="event_examine_result.php" method="post" enctype="multipart/form-data">
	<input type="hidden" name="id" value="<?=$id?>"/>
	<input type="hidden" name="status" value="NEW"/>
	<div class="edit_content">
		<p><b>活动发布人：</b><span class="begin_blank"><?=htmlspecialchars($volunteer_event_dat->author) ?></span></p>
		
		<p><b>宣传头像：</b></p>
		<img src="<?=$volunteer_event_dat->front_image?>" height="150px" alt="" style="margin-left: 110px;"/>
		<p><b>活动名称：</b><span class="begin_blank"><?=htmlspecialchars($volunteer_event_dat->title) ?></span></p>
		
		<p><b>活动介绍：</b><span class="begin_blank"><?=htmlspecialchars($volunteer_event_dat->comment) ?></span></p>
		
		<p><b>活动地点：</b><span class="begin_blank"><?=htmlspecialchars($volunteer_event_dat->position) ?></span></p>
		
		<p><b>征集范围：</b><span class="begin_blank">
		<?=!empty($volunteer_event_dat->province)?$volunteer_event_dat->province . $volunteer_event_dat->city .$volunteer_event_dat->district."范围内学校": ""?>&nbsp;
		<?=$volunteer_event_dat->include_social_user?"社会人士":""?>
		</span></p>
		
		<p><b>活动人数：</b><span class="begin_blank"><?=$volunteer_event_dat->max_member ==0 ?"不限制":$volunteer_event_dat->max_member?></span></p>
		
		<p><b>活动期限：</b><span class="begin_blank"><?=$volunteer_event_dat->start_time ." — ".$volunteer_event_dat->finish_time?></span></p>
		
    <p><b>活动时长：</b><span class="begin_blank"><?=htmlspecialchars($volunteer_event_dat->time_length) ?></span></p>
    
		<p><b>报名截止时间：</b><span class="begin_blank"><?=htmlspecialchars($volunteer_event_dat->enroll_time) ?></span></p>
		
		<p><b>活动负责人：</b><span class="begin_blank"><?=htmlspecialchars($volunteer_event_dat->leader_name) ?></span></p>
		
		<p><b>联系方式：</b><span class="begin_blank"><?=htmlspecialchars($volunteer_event_dat->leader_contact) ?></span></p>
		
		<p><b>集合地点：</b><span class="begin_blank"><?=htmlspecialchars($volunteer_event_dat->venue) ?></span></p>
		
		<p><b>集合时间：</b><span class="begin_blank"><?=htmlspecialchars($volunteer_event_dat->venue_time) ?></span></p>
		
		<p><b>状态：</b>
			<el-select v-model="status" size="small" style="margin-left: 10px;"@change="currentSel">
        <el-option
            v-for="item in status_list"
            :key="item.id"
            :label="item.title"
            :value="item.id">
        </el-option>
    	</el-select>
		</p>
		
	
		<br/><br/>
		<el-button type="primary" @click="edit()" class="edit_btn" style="margin-left: 110px;">编辑</el-button>
		<el-button type="primary" @click="back()" class="edit_btn">返回</el-button>		
		<br/><br/>
	</div>
	</form>
</div>

<script type="text/javascript">
	var v = new Vue({
		el:'#change',
		data:{
		  status_list:[{"id":"NEW","title":"未审核"},{"id":"OK","title":"审核通过"},{"id":"NG","title":"审核不通过"}],
			status:'NEW',
			title:''
		},
		methods:{
		  edit:function(){
				if(this.title && this.title != "未审核"){
  			  this.$confirm('是否状态更改为'+this.title+'?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            $("input[name='status']").val(this.status);
            $('#form').submit();
          }).catch(() => {
            this.$message({
              type: 'info',
              message: '已取消更改!'
            });          
          });
				}
			},
		  currentSel(selVal) {
			  let obj = {};
			  obj = this.status_list.find((item)=>{
			  	return item.id === selVal;
			  });
			  this.title = obj.title;
			},
			back:function(){
			  window.history.go(-1);
			}
		}
	})
</script>
