|
@@ -9,7 +9,7 @@
|
9
|
9
|
<preview-form :activity="activity" :paragraph="activity_paragraph"></preview-form>
|
10
|
10
|
</div>
|
11
|
11
|
<div class="edit-panel">
|
12
|
|
- <edit-form :activity="activity" :paragraph="activity_paragraph"></edit-form>
|
|
12
|
+ <edit-form ref="edit_form" :activity="activity" :paragraph="activity_paragraph"></edit-form>
|
13
|
13
|
</div>
|
14
|
14
|
</div>
|
15
|
15
|
</div>
|
|
@@ -20,6 +20,7 @@
|
20
|
20
|
import BreadCrumb from "@/scrm_pages/components/bread-crumb";
|
21
|
21
|
import PreviewForm from "@/scrm_pages/marketing_tool/components/edit_activity_preview_form"
|
22
|
22
|
import EditForm from "@/scrm_pages/marketing_tool/components/edit_activity_edit_form"
|
|
23
|
+import { fetchActivity } from "@/api/activity/activity"
|
23
|
24
|
|
24
|
25
|
export default {
|
25
|
26
|
name: "ActivityPublish",
|
|
@@ -48,11 +49,47 @@ export default {
|
48
|
49
|
sign_up_notice: "",
|
49
|
50
|
},
|
50
|
51
|
activity_paragraph: {
|
|
52
|
+ id: 0,
|
51
|
53
|
title: "",
|
52
|
54
|
content: "",
|
53
|
55
|
}
|
54
|
56
|
}
|
55
|
57
|
},
|
|
58
|
+ created() {
|
|
59
|
+ var id = this.$route.query.id
|
|
60
|
+ if (id != undefined) {
|
|
61
|
+ fetchActivity(id).then(rs => {
|
|
62
|
+ var resp = rs.data
|
|
63
|
+ if (resp.state == 1) {
|
|
64
|
+ // console.log(resp.data)
|
|
65
|
+ var activity = resp.data.activity
|
|
66
|
+ this.activity.id = activity.id
|
|
67
|
+ this.activity.poster_photo = activity.poster_photo
|
|
68
|
+ this.activity.title = activity.title
|
|
69
|
+ this.activity.subtitle = activity.subtitle
|
|
70
|
+ this.activity.address = activity.address
|
|
71
|
+ this.activity.limit_num = activity.limit_num
|
|
72
|
+ this.activity.sign_up_deadline = activity.sign_up_deadline * 1000
|
|
73
|
+ this.activity.start_time = activity.start_time * 1000
|
|
74
|
+ this.activity.phone_number = activity.phone_number
|
|
75
|
+ this.activity.sign_up_notice = activity.sign_up_notice
|
|
76
|
+
|
|
77
|
+ var paragraph = resp.data.paragraph
|
|
78
|
+ this.activity_paragraph.id = paragraph.id
|
|
79
|
+ this.activity_paragraph.title = paragraph.title
|
|
80
|
+ this.activity_paragraph.content = paragraph.content
|
|
81
|
+
|
|
82
|
+ this.$refs.edit_form.initForms()
|
|
83
|
+
|
|
84
|
+ } else {
|
|
85
|
+ this.$message.error(resp.msg)
|
|
86
|
+ }
|
|
87
|
+
|
|
88
|
+ }).catch(err => {
|
|
89
|
+ this.$message.error(err)
|
|
90
|
+ })
|
|
91
|
+ }
|
|
92
|
+ },
|
56
|
93
|
}
|
57
|
94
|
</script>
|
58
|
95
|
|