1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php
/**
* 慈善募捐活动列表
* $Id: donations_event_list.inc,v 1.1 2015/10/08 11:18:50 wanggb Exp $
* @author lixq
* @access public
* @package manager.templates
*/
?>
<div id="classSetting">
<div class="list_title">募捐活动列表<el-button type="primary" style="margin-right: 10px;" @click="addEvent()">募捐活动发布</el-button></div>
<br />
<div class="result_list" style="padding-left: 100px;">
<div class="block" v-for="tmp in tableData" >
<table style="border-spacing:10px">
<tr>
<td rowspan="4" style="width: 125px;height: 125px;position: relative;">
<a href="javascript:void(0);"@click="toDetail(tmp)"><el-image class="list_img" :src="tmp.front_image" style="object-fit: contain;"></el-image></a>
</td>
</tr>
<tr>
<td>
<span><a href="javascript:void(0);"@click="toDetail(tmp)" style="color:#000;">{{tmp.title}}</a></span>
<el-tag :type="tmp.status_type" v-if="tmp.status !=''" style="line-height:18px;height:18px;padding:0px;margin-left:5px;" effect="dark">{{tmp.status}}</el-tag>
<el-tag :type="tmp.time_status" v-if="tmp.status ==''" style="line-height:18px;height:18px;padding:0px;margin-left:5px;" effect="dark">{{tmp.event_status}}</el-tag>
</td>
</tr>
<tr>
<td>
<span>募捐时间: </span>{{tmp.start_time}} — {{tmp.finish_time}}
<el-button type="primary"size="mini" @click="editChange(tmp)" style="margin-left: 50px;">修改</el-button>
<el-button type="primary"size="mini" @click="deleteRow(tmp)">删除</el-button>
<el-button type="primary"size="mini" @click="handleDetail(tmp)">查看数据</el-button>
</td>
</tr>
<tr>
<td>
<span>拟募捐金额: </span>{{tmp.max_money}}元 <span>已募捐金额: </span>{{tmp.money}}元 <span>
</td>
</tr>
</table>
<div style="background-color:#E6E3E3;height:1px;">
</div>
</div>
<div v-if="tableData.length == 0"class="list_title"> <br/><br/>暂无数据</div>
</div>
</div>
<?
if ($donations_event_count > 0) {
?>
<!--page begin-->
<?
require_once ("page_common.inc");
?>
<!--page end-->
<?
}
?>
<script type="text/javascript">
var list=[];
<?
foreach ( $donations_event_list as $tmp ) {
?>
var data={
id:<?=$tmp->id?>,
title:'<?=$tmp->title?>',
start_time:'<?=date("Y-m-d ",strtotime($tmp->start_time))?>',
finish_time:'<?=date("Y-m-d ",strtotime($tmp->finish_time))?>',
front_image:'<?=$tmp->front_image?>',
max_money:'<?=floatval($tmp->max_money)?>',
money:'<?=floatval($tmp->money)?>',
time_status:'<?=date("Y-m-d H:i:s") > $tmp->finish_time?"info":(date("Y-m-d H:i:s") < $tmp->start_time?"success":"")?>',
event_status:'<?=date("Y-m-d H:i:s") > $tmp->finish_time?"已结束":(date("Y-m-d H:i:s") < $tmp->start_time?"未开始":"进行中")?>',
status:'<?=$tmp->status=="NEW"?"未审核":($tmp->status=="NG"?"审核未通过":($tmp->status=="FINISH"?"活动结束":""))?>',
status_type:'<?=$tmp->status=="NEW"?"warning":($tmp->status=="NG"?"danger":($tmp->status=="FINISH"?"info":""))?>'
};
list.push(data);
<?
}
?>
new Vue({
el:'#classSetting',
data:{
tableData: list
},
methods:{
addEvent(){
window.location.href='donations_edit_input.php?action_type=new';
},
editChange(row) {
window.location.href='donations_edit_input.php?action_type=edit&id='+row.id;
},
handleDetail(row){
window.location.href='donations_detail_list.php?id='+row.id;
},
toDetail(row){
window.location.href='donations_dat_detail.php?id='+row.id;
},
deleteRow(rows) {
this.$confirm('是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$message({
type: 'success',
message: '删除成功!'
});
// rows.splice(index, 1);
window.location.href='donations_delete_result.php?id='+rows.id;
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
},
}
})
</script>