|
@@ -0,0 +1,151 @@
|
|
|
|
+<template>
|
|
|
|
+ <div id="detail">
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="24" class="main">
|
|
|
|
+ <el-col :span="24" class="top">
|
|
|
|
+ <top topType="2" @upBack="upBack"></top>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24" class="info" :style="{ height: clientHeight + 'px' }">
|
|
|
|
+ <el-col :span="24" class="one">
|
|
|
|
+ <info :detailInfo="detailInfo"></info>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24" class="two">
|
|
|
|
+ <el-tabs v-model="active">
|
|
|
|
+ <el-tab-pane label="用户评论" name="first">
|
|
|
|
+ <comment :list="commentList"></comment>
|
|
|
|
+ </el-tab-pane>
|
|
|
|
+ </el-tabs>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24" class="foot">
|
|
|
|
+ <el-col :span="8" class="button"><i class="el-icon-position"></i>分享</el-col>
|
|
|
|
+ <el-col :span="8" class="button"><i class="el-icon-chat-line-round"></i>评论</el-col>
|
|
|
|
+ <el-col :span="8" class="button"><i class="el-icon-thumb"></i>点赞</el-col>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import info from './parts/info.vue';
|
|
|
|
+import comment from './parts/comment.vue';
|
|
|
|
+import top from '@/layout/common/top.vue';
|
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
|
+export default {
|
|
|
|
+ name: 'detail',
|
|
|
|
+ props: {},
|
|
|
|
+ components: {
|
|
|
|
+ info,
|
|
|
|
+ comment,
|
|
|
|
+ top,
|
|
|
|
+ },
|
|
|
|
+ data: function() {
|
|
|
|
+ return {
|
|
|
|
+ clientHeight: '',
|
|
|
|
+ // 话题正文
|
|
|
|
+ detailInfo: {
|
|
|
|
+ content:
|
|
|
|
+ '文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容',
|
|
|
|
+ origin: '文章来源',
|
|
|
|
+ renew_time: '2021-02-01 10:00:00',
|
|
|
|
+ type: '0',
|
|
|
|
+ imgUrl: [
|
|
|
|
+ { name: '图片名称', url: require('@a/news1.jpg') },
|
|
|
|
+ { name: '图片名称1', url: require('@a/news1.jpg') },
|
|
|
|
+ { name: '图片名称2', url: require('@a/news1.jpg') },
|
|
|
|
+ ],
|
|
|
|
+ fileUrl: require('@a/video1.mp4'),
|
|
|
|
+ },
|
|
|
|
+ // 评论
|
|
|
|
+ active: 'first',
|
|
|
|
+ // 用户评论列表
|
|
|
|
+ commentList: [
|
|
|
|
+ {
|
|
|
|
+ icon: require('@a/system.png'),
|
|
|
|
+ name: '测试用户',
|
|
|
|
+ content: '你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好',
|
|
|
|
+ renew_time: '2021-02-01 10:00:00',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ icon: require('@a/system.png'),
|
|
|
|
+ name: '测试用户1',
|
|
|
|
+ content: '你好1',
|
|
|
|
+ renew_time: '2021-02-01 10:00:00',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ icon: require('@a/system.png'),
|
|
|
|
+ name: '测试用户2',
|
|
|
|
+ content: '你好2',
|
|
|
|
+ renew_time: '2021-02-01 10:00:00',
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ async created() {
|
|
|
|
+ await this.search();
|
|
|
|
+ },
|
|
|
|
+ mounted() {
|
|
|
|
+ let clientHeight = (document.documentElement.clientHeight || document.body.clientHeight) - 80;
|
|
|
|
+ this.$set(this, `clientHeight`, clientHeight);
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ search({ skip = 0, limit = 10, ...info } = {}) {},
|
|
|
|
+ // 返回上一页
|
|
|
|
+ upBack() {
|
|
|
|
+ this.$router.push({ path: '/community/index' });
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ ...mapState(['user']),
|
|
|
|
+ },
|
|
|
|
+ metaInfo() {
|
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
|
+ },
|
|
|
|
+ watch: {},
|
|
|
|
+};
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="less" scoped>
|
|
|
|
+.main {
|
|
|
|
+ .top {
|
|
|
|
+ height: 40px;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ border-bottom: 1px solid #f1f1f1;
|
|
|
|
+ }
|
|
|
|
+ .info {
|
|
|
|
+ overflow-x: hidden;
|
|
|
|
+ overflow-y: auto;
|
|
|
|
+ background-color: #f1f1f1;
|
|
|
|
+ .one {
|
|
|
|
+ background-color: #ffffff;
|
|
|
|
+ margin: 6px 0;
|
|
|
|
+ }
|
|
|
|
+ .two {
|
|
|
|
+ padding: 0 10px;
|
|
|
|
+ min-height: 50px;
|
|
|
|
+ background-color: #ffffff;
|
|
|
|
+ /deep/.el-tabs__header {
|
|
|
|
+ margin: 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .foot {
|
|
|
|
+ height: 40px;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ background-color: #ffffff;
|
|
|
|
+ border-top: 1px solid #f1f1f1;
|
|
|
|
+ padding: 10px 0;
|
|
|
|
+ .button {
|
|
|
|
+ text-align: center;
|
|
|
|
+ height: 20px;
|
|
|
|
+ border-right: 1px solid #ccc;
|
|
|
|
+ line-height: 20px;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ }
|
|
|
|
+ .button:last-child {
|
|
|
|
+ border-right: none;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|