|
@@ -1,29 +1,69 @@
|
|
|
<template>
|
|
|
<div id="detail">
|
|
|
<el-row>
|
|
|
- <el-col :span="24">
|
|
|
- 详情
|
|
|
+ <el-col :span="24" class="index">
|
|
|
+ <el-col :span="24" class="top">
|
|
|
+ <topInfo :topTitle="pageTitle"></topInfo>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="main">
|
|
|
+ <detailInfo :roomInfo="roomInfo"></detailInfo>
|
|
|
+ </el-col>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import topInfo from '@/layout/public/top.vue';
|
|
|
+import detailInfo from '@/layout/live/detailInfo.vue';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: room } = createNamespacedHelpers('room');
|
|
|
export default {
|
|
|
name: 'detail',
|
|
|
props: {},
|
|
|
- components: {},
|
|
|
+ components: {
|
|
|
+ topInfo,
|
|
|
+ detailInfo,
|
|
|
+ },
|
|
|
data: function() {
|
|
|
- return {};
|
|
|
+ return {
|
|
|
+ roomInfo: {},
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ console.log(this.id, this.name);
|
|
|
+ this.searchInfo();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...room(['query', 'delete', 'update', 'fetch']),
|
|
|
+ async searchInfo() {
|
|
|
+ let res = await this.fetch(this.id);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `roomInfo`, res.data);
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
- created() {},
|
|
|
- methods: {},
|
|
|
computed: {
|
|
|
- ...mapState(['user']),
|
|
|
+ id() {
|
|
|
+ return this.$route.query.id;
|
|
|
+ },
|
|
|
+ name() {
|
|
|
+ return this.$route.query.name;
|
|
|
+ },
|
|
|
pageTitle() {
|
|
|
return `${this.$route.meta.title}`;
|
|
|
},
|
|
|
+ mainTitle() {
|
|
|
+ let meta = this.$route.meta;
|
|
|
+ let main = meta.title || '';
|
|
|
+ let sub = meta.sub || '';
|
|
|
+ return `${main}${sub}`;
|
|
|
+ },
|
|
|
+ keyWord() {
|
|
|
+ let meta = this.$route.meta;
|
|
|
+ let main = meta.title || '';
|
|
|
+ return main;
|
|
|
+ },
|
|
|
},
|
|
|
metaInfo() {
|
|
|
return { title: this.$route.meta.title };
|