content.vue
2.64 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
<template>
<div class="content-wrap">
<div class="container edit-container" style="min-height: 520px !important">
<p class="edit-title" id="basic">{{ contentTitle }}</p>
<component :is="currentComponent" ref="componentRef" :merchantChannelId="merchantChannelId" :topicId="topicId" :channelType="channelType"></component>
</div>
<GLFooter>
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleSave">确定</el-button>
</GLFooter>
</div>
</template>
<script>
import { mapActions, mapMutations } from 'vuex'
import carChannel from './components/carChannel.vue'
import membrane from './components/membrane.vue'
import activity from './components/activity.vue'
import certificate from './components/certificate.vue'
export default {
name: 'content',
components: {
carChannel,
membrane,
activity,
certificate
},
data() {
return {
contentTitle: '',
merchantChannelId: this.$route.query.merchantChannelId ? this.$route.query.merchantChannelId : '', //门店频道id
topicId: this.$route.query.topicId ? this.$route.query.topicId : '', //频道主题ID
channelType: this.$route.query.channelType ? this.$route.query.channelType : '', //频道类型
currentComponent: 'carChannel',
relateStoreVisible: false // 选择门店
}
},
created() {
let { $title } = this.$route.query
this.contentTitle = $title ? $title : '新增内容'
//判断显示模块
this.judgeModule()
//获取视频
this.getTencentcloudmedialist()
//编辑获取详情
if (this.topicId) {
this.getTopicDetail({ topicId: this.topicId })
} else {
this.SET_TOPIC_DETAIL({ topicDetail: '' })
}
},
methods: {
...mapActions({
getTencentcloudmedialist: 'channel/getTencentcloudmedialist',
getTopicDetail: 'channel/getTopicDetail'
}),
...mapMutations({
SET_TOPIC_DETAIL: 'channel/SET_TOPIC_DETAIL'
}),
judgeModule() {
let arr = {
'-1': 'certificate',
1: 'carChannel',
2: 'membrane',
3: 'activity',
4: 'activity'
}
this.currentComponent = arr[this.channelType]
},
handleCancel() {
this.$router.go(-1)
},
handleSave() {
this.$refs.componentRef.handleSave()
}
}
}
</script>
<style scoped lang='scss'>
.content-wrap {
.container {
min-height: 680px;
padding: 0px 0px 20px;
margin-bottom: 16px;
}
.edit-title {
font-size: 16px;
font-weight: 600;
height: 58px;
line-height: 58px;
border-bottom: 1px solid #e7eaec;
margin: 0 0 32px 0;
padding: 0 0 0 20px;
}
}
</style>