|
|
<template>
|
|
|
<div class="news-box">
|
|
|
<h1>日韩风日韩风日韩风日韩风日韩风日韩风日韩风</h1>
|
|
|
<span class="icon icon-love"></span>
|
|
|
<span class="icon icon-love"></span>
|
|
|
<h1>{{article.articleTitle}}</h1>
|
|
|
<div class="status-bar">
|
|
|
<span class="icon icon-love"></span><span class="label">{{article.publishTime | formatUnixTime 'MM.DD HH:mm'}}</span>
|
|
|
<span class="icon icon-love"></span><span class="label">{{article.pageViews}}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="content-box">
|
|
|
<div v-for="(index, block) in content">
|
|
|
<content-block :block="block"></content-block>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div v-for="block in other">
|
|
|
<div>
|
|
|
<img :src="block.thumb | resize 213 134" width="107"/>
|
|
|
<h2></h2>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<style src="./css/detail.css"></style>
|
|
|
<script src="./js/detail.js"></script> |
|
|
<style>
|
|
|
h1 {
|
|
|
font-size: 43px;
|
|
|
font-weight: bold;
|
|
|
overflow: hidden;
|
|
|
margin-top: 36px;
|
|
|
margin-bottom: 0;
|
|
|
}
|
|
|
|
|
|
.news-box {
|
|
|
padding: 30px;
|
|
|
}
|
|
|
|
|
|
.content-box {
|
|
|
|
|
|
img {
|
|
|
width: 100%;
|
|
|
display: block;
|
|
|
}
|
|
|
|
|
|
p {
|
|
|
font-size: 28px;
|
|
|
}
|
|
|
|
|
|
.text-block {
|
|
|
padding: 30px;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.status-bar {
|
|
|
color: #ccc;
|
|
|
font-size: 24px;
|
|
|
margin-top: 30px;
|
|
|
|
|
|
span.icon {
|
|
|
margin-right: 12px;
|
|
|
}
|
|
|
|
|
|
span.label {
|
|
|
margin-right: 78px;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|
|
|
<script>
|
|
|
require('common/vue-filter');
|
|
|
|
|
|
module.exports = {
|
|
|
components: {
|
|
|
'content-block': require('./content-block.vue')
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
article: {},
|
|
|
content: {},
|
|
|
other: {}
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
const newsId = $('#app').data('newsId');
|
|
|
|
|
|
$.get(`/news/news_${newsId}.json`).then(result => {
|
|
|
const article = result[0], content = result[1], other = result[2];
|
|
|
|
|
|
if (article && article.code === 200 && article.data) {
|
|
|
this.article = article.data;
|
|
|
}
|
|
|
|
|
|
if (content && content.code === 200 && content.data) {
|
|
|
this.content = content.data;
|
|
|
}
|
|
|
|
|
|
if (other && other.code === 200 && content.data) {
|
|
|
this.other = other.data;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
</script> |
...
|
...
|
|