ActiveDialog.vue
3.0 KB
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
<template>
<!-- 活动名称弹窗 -->
<div>
<div class="comment_dialog clearfix">
<el-dialog
:title="activeList.name"
:visible="activeVisible"
:close-on-click-modal="false"
@update:visible="v=>$emit('update:activeVisible',v)"
>
<!-- 评语 -->
<div class="comment_content clearfix">
<!-- 活动举办者 -->
<div class="comment_single clearfix">
<div class="active_title">活动举办者:</div>
<div class="active_content">{{activeList.school_name}}</div>
</div>
<!-- 活动时间 -->
<div class="comment_single clearfix">
<div class="active_title">活动时间:</div>
<div class="active_content">{{activeList.starttime | date}} —— {{activeList.endtime | date}}</div>
</div>
<!-- 活动地点 -->
<div class="comment_single clearfix">
<div class="active_title">活动地点:</div>
<div class="active_content">{{activeList.address}}</div>
</div>
<!-- 活动介绍 -->
<div class="comment_single clearfix">
<div class="active_title">活动介绍:</div>
<div class="active_content active_color active_three">{{activeList.description}}</div>
</div>
<!-- 活动内容 -->
<div class="comment_single clearfix top">
<div class="active_title">活动内容:</div>
<div class="active_content active_color">{{activeList.content}}</div>
</div>
<!-- 备注 -->
<div class="comment_single clearfix top">
<div class="active_title">备注:</div>
<div class="active_content active_color">{{activeList.remark}}</div>
</div>
<div
class="active_btn"
@click="signUp"
:class="{signed:sign_btn == 1}"
>{{sign_btn == 0?'立即报名':'已报名'}}</div>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
import { post } from "@/api/http";
export default {
props: ["activeVisible", "activityId"],
data() {
return {
activeList: "",
sign_btn: 0,
id: ""
};
},
methods: {
// 报名
signUp() {
let url = "/api/activity/joinActivity";
let params = {
id: this.id
};
post(url, params)
.then(res => {
this.sign_btn = 1;
this.$parent.getActivityList();
this.$emit('update:activeVisible',false)
});
},
// 学生活动详情
getActivityDetail() {
let url = "/api/activity/getActivityDetail";
let params = {
id: this.id
};
post(url, params).then(res => {
this.activeList = res.activity;
});
}
},
mounted() {
this.id = this.activityId;
if (this.id) {
this.getActivityDetail();
}
}
};
</script>
<style scoped>
@import "../../../../style/personal.css";
.top {
margin-top: 2px;
}
</style>