|
|
<template>
|
|
|
<resources v-bind:content-code.sync="contentCode"></resources>
|
|
|
<div v-infinite-scroll="getNewsList()" infinite-scroll-disabled="scrollDisabled">
|
|
|
<div v-for="news in newsList" class="news-box">
|
|
|
<div v-for="editorial in editorialList" class="editorial-box">
|
|
|
<div class="img">
|
|
|
<a href='{{"/news/" + news.id}}'>
|
|
|
<img v-lazy="news.src | resize 750 470" alt="" />
|
|
|
<a href='{{"/editorial/" + editorial.id + ".html"}}'>
|
|
|
<img v-lazy="editorial.src | resize 750 470" alt="" />
|
|
|
</a>
|
|
|
</div>
|
|
|
<div class="title"><a href='{{"/news/" + news.id}}'>{{news.title}}</a></div>
|
|
|
<div class="news-des">
|
|
|
{{news.intro}}
|
|
|
<div class="title"><a href='{{"/editorial/" + editorial.id + ".html"}}'>{{editorial.title}}</a></div>
|
|
|
<div class="editorial-des">
|
|
|
{{editorial.intro}}
|
|
|
</div>
|
|
|
<hr>
|
|
|
<div class="bottom clearfix">
|
|
|
<span class="icon time-icon"></span>
|
|
|
<span class="time">{{news.publishTime}}</span>
|
|
|
<span class="icon icon-share share" @click="share(news.title, news.intro, news.src, news.share.url)"></span>
|
|
|
<span class="time">{{editorial.publishTime}}</span>
|
|
|
<span class="icon icon-share share" @click="share(editorial.title, editorial.intro, editorial.src, editorial.share.url)"></span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<style>
|
|
|
.news-box {
|
|
|
.editorial-box {
|
|
|
background: #f6f6f6;
|
|
|
|
|
|
.img {
|
...
|
...
|
@@ -42,7 +42,7 @@ |
|
|
padding: 10px 20px;
|
|
|
}
|
|
|
|
|
|
.news-des {
|
|
|
.editorial-des {
|
|
|
background: #fff;
|
|
|
padding: 10px 20px;
|
|
|
color: #939393;
|
...
|
...
|
@@ -77,8 +77,8 @@ |
|
|
module.exports = {
|
|
|
data() {
|
|
|
return {
|
|
|
contentCode: contentCode.news[qs.channel || 'all'],
|
|
|
newsList: [],
|
|
|
contentCode: contentCode.editorial[qs.channel || 'all'],
|
|
|
editorialList: [],
|
|
|
page: 0,
|
|
|
scrollDisabled: false
|
|
|
};
|
...
|
...
|
@@ -93,17 +93,17 @@ |
|
|
/* 获取资讯列表数据 */
|
|
|
getNewsList() {
|
|
|
$.post({
|
|
|
url: '/news/list.json',
|
|
|
url: '/editorial/list.json',
|
|
|
data: {
|
|
|
page: this.page++,
|
|
|
channel: qs.channel || 'all'
|
|
|
}
|
|
|
}).done(result => {
|
|
|
if (result.code === 200) {
|
|
|
if (this.newsList.length > 0 && result.data.list.length > 0) {
|
|
|
this.$set('newsList', this.newsList.concat(result.data.list));
|
|
|
if (this.editorialList.length > 0 && result.data.list.length > 0) {
|
|
|
this.$set('editorialList', this.editorialList.concat(result.data.list));
|
|
|
} else {
|
|
|
this.newsList = result.data.list;
|
|
|
this.editorialList = result.data.list;
|
|
|
}
|
|
|
} else {
|
|
|
this.scrollDisabled = true;
|
...
|
...
|
|