189 lines
8.3 KiB
HTML
189 lines
8.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
|
|
<title>Title</title>
|
|
<link rel="stylesheet" href="css/reset.css">
|
|
<link rel="stylesheet" href="css/style.css">
|
|
<script src="js/rem.js"></script>
|
|
</head>
|
|
<body>
|
|
<div id="app" v-cloak>
|
|
<div class="area">
|
|
<!-- <div class="area-box" v-for="type in typeList" :class="{active: curType == type.newsDirectoriesId}" @click="changeType(type.newsDirectoriesId)">{{type.directoriesName}}</div>-->
|
|
<div class="area-box" :class="{active: curType == 'b5d03555-52c8-4562-b162-1ed19da533bc'}" @click="changeType('b5d03555-52c8-4562-b162-1ed19da533bc')">热门景区</div>
|
|
<div class="area-box" :class="{active: curType == '3e0931bc-9e9e-4f10-ba47-b9f914958667'}" @click="changeType('3e0931bc-9e9e-4f10-ba47-b9f914958667')">归园田居</div>
|
|
<div class="area-box" :class="{active: curType == 'a62bbdf6-d95c-480a-80d4-effc4016b412'}" @click="changeType('a62bbdf6-d95c-480a-80d4-effc4016b412')">精品路线</div>
|
|
<div class="area-box" :class="{active: curType == '5f489c72-4f11-4b3a-a01c-05fde2900d21'}" @click="changeType('5f489c72-4f11-4b3a-a01c-05fde2900d21')">食客行</div>
|
|
<div class="area-box" :class="{active: curType == '10a06f60-a37f-48ee-a356-4d9b2d5a40b8'}" @click="changeType('10a06f60-a37f-48ee-a356-4d9b2d5a40b8')">旅行社</div>
|
|
</div>
|
|
<!-- <div class="area news-area">-->
|
|
<!-- <div class="area-box" :class="{active: page.county == ''}" @click="loadAll">全部</div>-->
|
|
<!-- <div class="area-box" v-for="area in areaList" :class="{active: page.county == area.areaId}" @click="changeArea(area.areaId,area.areaLevel)">{{area.areaName}}</div>-->
|
|
<!-- </div>-->
|
|
<div class="news-list" :style="{'margin-top': toTop}" v-if="newsList && newsList.length > 0">
|
|
<div class="news-list-box" v-for="news in newsList" @click="goDetail(news.newsContentLink, news.templateRecordUrl, news.newsContentType, news.newsContentContent)">
|
|
<img :src="requestUrl + 'news/route/file/downloadfile/true/' + news.newsContentCoverList" alt="">
|
|
<div class="news-list-info">
|
|
<h3>{{news.newsContentTitle}}</h3>
|
|
<p>作者:{{news.newsContentAuthor}}</p>
|
|
</div>
|
|
</div>
|
|
<div class="load-more" v-if="haveMore && newsList && newsList.length > 0" @click="loadMore">加载更多</div>
|
|
</div>
|
|
<div class="no-data" v-else>
|
|
<img src="image/no-data.png" alt="">
|
|
</div>
|
|
<div class="loading" v-if="isLoading">
|
|
<img src="image/loading.gif" alt="">
|
|
</div>
|
|
</div>
|
|
<script src="js/vue.js"></script>
|
|
<script src="js/jquery-2.1.4.min.js"></script>
|
|
<script src="js/ajax.js"></script>
|
|
<script src="js/layer/layer.js"></script>
|
|
<script>
|
|
var vue = new Vue({
|
|
el: '#app',
|
|
data: {
|
|
areaList: [],
|
|
typeList: [],
|
|
newsList: [],
|
|
curType: 'b5d03555-52c8-4562-b162-1ed19da533bc',
|
|
page: {
|
|
page: 1,
|
|
rows: 10,
|
|
newsDirectoriesId: 'b5d03555-52c8-4562-b162-1ed19da533bc',
|
|
county: ''
|
|
},
|
|
requestUrl: 'http://219.159.20.131:8081/',
|
|
haveMore: true,
|
|
isLoading: false,
|
|
toTop: ''
|
|
},
|
|
methods: {
|
|
getAreaList: function () {
|
|
var self = this
|
|
doGetForm(self.requestUrl + 'usercenter/app/dataarea/listareabyparentidrelease/110889', {}, null, function (code, data) {
|
|
self.areaList = data
|
|
})
|
|
},
|
|
changeArea: function (id, lv) {
|
|
if (!this.isLoading) {
|
|
var level = parseInt(lv) + 1
|
|
level = 'area' + level
|
|
this.page.county = id
|
|
this.page[level] = id
|
|
this.page.page = 1
|
|
this.haveMore = true
|
|
this.getNewsList()
|
|
}
|
|
},
|
|
getTypeList: function () {
|
|
var self = this
|
|
doGetForm(self.requestUrl + 'news/app/newsdirectories/listnewsdirectoriesrelease', {
|
|
directoriesParentId: self.page.newsDirectoriesId
|
|
}, {}, function (code, data) {
|
|
self.typeList = data
|
|
self.curType = data[0].newsDirectoriesId
|
|
self.page.newsDirectoriesId = data[0].newsDirectoriesId
|
|
self.getNewsList()
|
|
})
|
|
},
|
|
changeType: function (type) {
|
|
if (!this.isLoading) {
|
|
this.curType = type
|
|
this.page.newsDirectoriesId = type
|
|
this.page.page = 1
|
|
this.haveMore = true
|
|
this.getNewsList()
|
|
}
|
|
},
|
|
getNewsList: function () {
|
|
var self = this
|
|
self.isLoading = true
|
|
doGetForm(self.requestUrl + 'news/app/newscontent/listpagenewscontentrelease', self.page, {}, function (code, data) {
|
|
if (self.page.page == '1') {
|
|
if (data.rows.length > 0) {
|
|
for (let i = 0; i < data.rows.length; i++) {
|
|
data.rows[i].newsContentCoverList = data.rows[i].newsContentCoverList[0].contentCoverId
|
|
self.newsList.push(data.rows[i])
|
|
}
|
|
self.newsList = data.rows
|
|
if (data.rows.length > 0) {
|
|
self.haveMore = true
|
|
self.isLoading = false
|
|
} else {
|
|
self.haveMore = false
|
|
self.isLoading = false
|
|
}
|
|
return
|
|
} else {
|
|
self.newsList = []
|
|
self.haveMore = false
|
|
self.isLoading = false
|
|
}
|
|
} else {
|
|
if (data.rows.length > 0) {
|
|
for (let i = 0; i < data.rows.length; i++) {
|
|
data.rows[i].newsContentCoverList = data.rows[i].newsContentCoverList[0].contentCoverId
|
|
self.newsList.push(data.rows[i])
|
|
}
|
|
self.haveMore = true
|
|
self.isLoading = false
|
|
} else {
|
|
self.page.page--
|
|
self.haveMore = false
|
|
self.isLoading = false
|
|
layer.msg('暂无更多')
|
|
}
|
|
}
|
|
|
|
})
|
|
},
|
|
loadMore: function () {
|
|
if (!this.isLoading) {
|
|
this.page.page++
|
|
this.getNewsList()
|
|
}
|
|
},
|
|
loadAll: function () {
|
|
if (!this.isLoading) {
|
|
var self = this
|
|
this.page = {
|
|
page: 1,
|
|
rows: 10,
|
|
newsDirectoriesId: self.curType,
|
|
county: ''
|
|
}
|
|
this.haveMore = true
|
|
this.getNewsList()
|
|
}
|
|
},
|
|
// 新闻详情
|
|
goDetail: function (link, url, type, outlink) {
|
|
if (!this.isLoading) {
|
|
if (type === '6') {
|
|
window.open(outlink)
|
|
} else {
|
|
if (link) {
|
|
window.open(link)
|
|
} else {
|
|
window.location.href = this.requestUrl + url
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted: function () {
|
|
// this.page.newsDirectoriesId = window.location.search.replace('?','').split('=')[1]
|
|
// this.getAreaList()
|
|
// this.getTypeList()
|
|
this.getNewsList()
|
|
this.toTop = $('.area').height() + 'px'
|
|
}
|
|
})
|
|
</script>
|
|
</body>
|
|
</html> |