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

143 lines
6.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="heritage">
<div class="heritage-box" v-for="item in heritageList" @click="goDetail(item.intangibleLibraryId)">
<div class="heritage-box-left">
<img :src="requestUrl + 'library/route/file/downloadfile/true/' + item.libraryCover" alt="">
</div>
<div class="heritage-box-right">
<h3>{{item.libraryTitle}}</h3>
<p>{{item.libraryApplyTime}}</p>
<span>非遗级别:{{item.libraryLevel}}级</span>
<p>所属地区:{{item.libraryArea}}</p>
</div>
</div>
<div class="load-more" v-if="haveMore && heritageList && heritageList.length > 0" @click="loadMore">加载更多</div>
</div>
<div class="bottom-nav">
<div class="bottom-nav-box">
<div class="nav-icon" @click="goBottomNav('1')"></div>
<span>首页</span>
</div>
<div class="bottom-nav-box" @click="goBottomNav('2')">
<div class="nav-icon"></div>
<span>活动</span>
</div>
<div class="bottom-nav-box" @click="goBottomNav('3')">
<div class="nav-icon"></div>
<span>场馆</span>
</div>
<div class="bottom-nav-box active">
<div class="nav-icon"></div>
<span>文化</span>
</div>
</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: {
requestUrl: 'http://219.159.20.131:8081/',
page: {
page: 1,
rows: 10
},
heritageList: [],
haveMore: true,
isLoading: true
},
methods: {
getHeritageList: function () {
var self = this
self.isLoading = true
doGetForm(self.requestUrl + 'library/app/intangiblelibrary/listpageintangiblelibraryrelease', 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].libraryApplyTime = data.rows[i].libraryApplyTime.split(' ')[0]
data.rows[i].libraryCover = data.rows[i].libraryCover.split(',')[0]
}
self.heritageList = data.rows
if (data.rows.length == self.page.rows) {
self.haveMore = true
self.isLoading = false
} else {
self.haveMore = false
self.isLoading = false
}
} else {
self.heritageList = []
self.haveMore = false
self.isLoading = false
}
} else {
if (data.rows.length > 0) {
for (let i = 0; i < data.rows.length; i++) {
data.rows[i].libraryApplyTime = data.rows[i].libraryApplyTime.split(' ')[0]
data.rows[i].libraryCover = data.rows[i].libraryCover.split(',')[0]
}
self.heritageList.push(data.rows[i])
if (data.rows.length == self.page.rows) {
self.haveMore = true
self.isLoading = false
} else {
self.haveMore = false
self.isLoading = false
}
} else {
self.page.page--
self.haveMore = false
self.isLoading = false
layer.msg('暂无更多')
}
}
})
},
// 底部导航
goBottomNav: function (nav) {
if (nav == '2') {
window.location.href = 'activity.html'
} else if (nav == '1') {
window.location.href = 'index.html'
} else {
window.location.href = 'venue.html'
}
},
loadMore: function () {
if (!this.isLoading) {
this.page.page++
this.getHeritageList()
}
},
goDetail: function (id) {
if (!this.isLoading) {
window.location.href = 'culture-detail.html?id=' + id
}
}
},
mounted: function () {
this.getHeritageList()
}
})
</script>
</body>
</html>