<?php
/**
 * 募捐活动列表-数据详情
 * $Id: donations_detail_list.inc,v 1.1 2020/01/03 11:18:46  Exp $
 * @author lixq
 * @access public
 * @package manager.templates
 */

?>
<style type="text/css">
	.m-l{
		margin-left: 10px;
	}
</style>
<div id="classSetting">
	<div class="list_title">
		募捐活动-数据详情
	</div>
	<br/>
	<p>活动名称: <?=$donations_event_dat->title?></p>
	<p>已捐金额/目标金额: <?=floatval($donations_event_dat->money)?>元/<?=floatval($donations_event_dat->max_money)?>元</p>
	<h4>参与详情:</h4>
	<form id="search_form" action="donations_detail_list.php" method="post">
		<input type="hidden"  name="id" value="<?=$id?>"/>
		<input type="hidden"  name="status" value="<?=$status?>"/>
		用户姓名:<input type="text" value="<?=$name?>" name="name" class="el-input__inner input_100 m-l"/>&nbsp;&nbsp;
		捐助订单状态:
		<template>
      <el-select v-model="status" multiple placeholder="请选择">
        <el-option
          v-for="item in status_list"
          :key="item.name"
          :label="item.title"
          :value="item.name">
        </el-option>
      </el-select>
		</template>
	<el-button type="primary" @click="search()" class="edit_btn search_btn">检索</el-button>
	<el-button type="primary" @click="clear()" class="edit_btn search_btn">清空条件</el-button>
	</form>
  <br />
  <div style="background-color:#E6E3E3;height:1px;"></div>
  <br />
  <div class="result_list">
  	<el-table :data="tableData"  border>
  		<el-table-column  prop="user_name" label="用户姓名" width=""></el-table-column>
  		<el-table-column  prop="money" label="捐助金额" width=""></el-table-column>
  		<el-table-column  prop="status" label="状态" width=""></el-table-column>
  		<el-table-column  prop="comment" label="用户留言" width=""></el-table-column>
  	</el-table>
  </div>
</div>
<?
if ($user_donation_count > 0) {
?>
<!--page begin-->
<?
require_once("page_common.inc");
?>
<!--page end-->
<?
}
?>
<script type="text/javascript">
	var list=[];
	<?
	foreach ($user_donation_list as $tmp) {
	?>
		var data={
			id:<?=$tmp["id"] ?>,
			user_name:'<?=$tmp["user_name"]?>',
			money:'<?=floatval($tmp["money"])?>',
			comment:'<?=$tmp["comment"]?>',
			status:'<?=OrderStatus::getTitleByName($tmp["status"])?>',
		};
		list.push(data);
	<?
	}
	?>

	new Vue({
		el:'#classSetting',
		data:{
			tableData: list,
			status_list:<?=json_encode(OrderStatus::getList())?>,
			status:[<?=empty($status)?'':"'".implode("','", explode(",", $status))."'"?>]
		},
		methods:{
		  clear(){
		    $("input[name='name']").val("");
    	  this.status = "";
			},
		  search(){
			  $("input[name='status']").val(this.status);
				$("#search_form").submit();
			},
		}
		 
	})
</script>