msb/comprehensive.html
dong_bo0602 705173bf42 提交
2022-07-04 09:07:39 +08:00

187 lines
8.0 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 == '588555a2-cfce-426c-8f60-4f76e8e59842'}" @click="changeType('588555a2-cfce-426c-8f60-4f76e8e59842')">通知公告</div>
<div class="area-box" :class="{active: curType == '1e494b7f-d0e4-4baa-acfe-57268247e0e4'}" @click="changeType('1e494b7f-d0e4-4baa-acfe-57268247e0e4')">工作动态</div>
<div class="area-box" :class="{active: curType == '05501705-aa68-4ee9-a7bf-07f45d3a8e88'}" @click="changeType('05501705-aa68-4ee9-a7bf-07f45d3a8e88')">政务公开</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: '588555a2-cfce-426c-8f60-4f76e8e59842',
page: {
page: 1,
rows: 10,
newsDirectoriesId: '588555a2-cfce-426c-8f60-4f76e8e59842',
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>