|
@@ -1,36 +1,47 @@
|
|
<template>
|
|
<template>
|
|
<div id="detail">
|
|
<div id="detail">
|
|
- <el-row>
|
|
|
|
|
|
+ <el-row style="background:#fff;min-height: 736px;">
|
|
<el-col :span="24" class="top">
|
|
<el-col :span="24" class="top">
|
|
<p class="title">{{ info.title }}</p>
|
|
<p class="title">{{ info.title }}</p>
|
|
- <p class="date">发表于:{{ info.date }}</p>
|
|
|
|
|
|
+ <p class="date">发表于:{{ info.meta && info.meta.createdAt ? new Date(info.meta.createdAt).toLocaleDateString() : '' || '' }}</p>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24" class="image">
|
|
<el-col :span="24" class="image">
|
|
- <el-image style="width:100%;height:195px;" :src="info.pic"></el-image>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="24" class="content">
|
|
|
|
- <p>{{ info.content }}</p>
|
|
|
|
|
|
+ <el-image style="width:100%;height:195px;" :src="info.pic ? info.pic : pic"></el-image>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
+ <el-col :span="24" class="content" v-html="info.content"> </el-col>
|
|
</el-row>
|
|
</el-row>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import { mapActions, mapState } from 'vuex';
|
|
export default {
|
|
export default {
|
|
name: 'detail',
|
|
name: 'detail',
|
|
props: {},
|
|
props: {},
|
|
components: {},
|
|
components: {},
|
|
data: () => ({
|
|
data: () => ({
|
|
- info: {
|
|
|
|
- title: '我校在吉林省高校就业指导课程教学大赛中取得优异成绩',
|
|
|
|
- date: '2019-11-21',
|
|
|
|
- pic: require('@/assets/logo.jpg'),
|
|
|
|
- content: '详情',
|
|
|
|
- },
|
|
|
|
|
|
+ info: {},
|
|
|
|
+ pic: require('@/assets/moren.jpg'),
|
|
}),
|
|
}),
|
|
- created() {},
|
|
|
|
|
|
+ created() {
|
|
|
|
+ console.log(this.$route.params.id);
|
|
|
|
+ if (this.$route.params.id) {
|
|
|
|
+ this.search();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
computed: {},
|
|
computed: {},
|
|
- methods: {},
|
|
|
|
|
|
+ methods: {
|
|
|
|
+ ...mapActions(['newsOperation']),
|
|
|
|
+ async search() {
|
|
|
|
+ let result = await this.newsOperation({ type: 'search', data: { id: this.$route.params.id } });
|
|
|
|
+ if (`${result.errcode}` === '0') {
|
|
|
|
+ console.log(result.data);
|
|
|
|
+ this.$set(this, `info`, result.data);
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(result.errmsg ? result.errmsg : 'error');
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ },
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
@@ -59,7 +70,9 @@ p {
|
|
.content {
|
|
.content {
|
|
padding: 0 10px 10px 10px;
|
|
padding: 0 10px 10px 10px;
|
|
}
|
|
}
|
|
-.content p {
|
|
|
|
|
|
+/deep/.content p {
|
|
|
|
+ padding: 0;
|
|
|
|
+ margin: 0;
|
|
color: rgb(70, 70, 70);
|
|
color: rgb(70, 70, 70);
|
|
font-family: 宋体;
|
|
font-family: 宋体;
|
|
font-size: 18px;
|
|
font-size: 18px;
|