2 Star 3 Fork 4

神秘博士/HuaTeng

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
page_news.html 5.95 KB
一键复制 编辑 原始数据 按行查看 历史
神秘博士 提交于 2020-06-02 14:26 . release
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>公司新闻-北京华腾橡塑乳胶制品有限公司</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/all.min.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="flex-container news">
#include('inc/top.html')
<div class="container-fluid">
<div class="intobg"></div>
</div>
<div class="container text-center pb-2">
<h2 class="product-title">公司新闻</h2>
<p class="product-subtitle">Company News</p>
</div>
#--#ArticleEnhancePage(categoryId=1,tagid=2,where=C.get("year") && C.get("year")!="all"?" where date_format(created,'%Y') = '"+C.get("year")+"'":null)--#
<div class="container-fluid eq-bg">
<div class="container pt-4 mb-3">
<div class="row newslist">
<div class="col-9 line">
<form>
<div class="form-row">
<div class="col-4">
<select class="form-control" name="year" id="year">
<option value="0">所有年份</option>
#ArticlePageCustomSQLPage(sql="SELECT DATE_FORMAT(modified,'%Y')as y FROM article GROUP BY DATE_FORMAT(modified,'%Y')")
#for(e : ArticlePageCustomSQLPage.list)
<option value="#(e.y)">#(e.y)</option>
#end
#end
</select>
</div>
<div class="col-4">
<input type="button" value="查询" onclick="find('year');" class="btn btn-primary">
</div>
</div>
</form>
<ul id="app">
<li v-for="entry in list">
<a :href="entry.url">{{ entry.title }}</a>
<span>{{ entry.created }}</span>
<p class="content" v-html="entry.summary"></p>
</li>
</ul>
<a href="javascript:next()" class="btn btn-outline-primary">加载更多&nbsp;<i class="fas fa-plus-square"></i></a>
</div>
<div class="col-3 text-secondary pl-4">
<!--<h4>北京华腾橡塑乳胶制品有限公司</h4>
<p class="title">乳胶</p>
<p>电话:+86-10-815025533</p>
<p>+86-10-81502536</p>
<p>传真:+86-10-81502534</p>
<p><a href="mailto:[email protected]">[email protected]</a></p>
<p><a href="mailto:[email protected]">[email protected]</a></p>
<p><br></p>
<p class="title">橡胶(主要类型的塑料片材,制品,钓鱼靴,钓鱼裤)</p>
<p>电话:+86-10-81501071</p>
<p>+86-10-81501073</p>
<p><a href="mailto:[email protected]">[email protected]</a></p>
<p><a href="mailto:[email protected]">[email protected]</a></p>
<p><a href="mailto:[email protected]">[email protected]</a></p>-->
#ArticleEnhancePage(categoryId=9,pageSize=3)
#for(article : ArticleEnhancePage.list)
<div>
<p class="title">#(article.title ??)</p>
<div>
#(article.content ??)
</div>
</div>
<hr>
#end
#end
</div>
</div>
</div>
</div>
</div>
<!--bottom-->
#include('inc/footer.html')
<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/vue.min.js"></script>
<script src="js/popper.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script>
var page = 1;
var pageMax;
var app = new Vue({
el: '#app',
data: {
list:[]
}
});
function find(id){
page = 1
app.list=[];
getdata(page,$("#"+id).val());
}
function next(year){
page++;
getdata(page,year);
}
function getdata(p,year){
var url = "/articleWebApi/getJsonWhereYear";
pm = {
page:p,
pageSize:5,
categoryId:1,
year:year
}
if(pageMax!="" && page > pageMax){
alert("没有更多数据了!")
return;
}
$.post(url,pm,function(e){
pageMax = e.totalPage;
for(var i in e.list){
app.list.push(e.list[i]);
}
});
}
getdata(1,null);
</script>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/d1anjie/HuaTeng.git
[email protected]:d1anjie/HuaTeng.git
d1anjie
HuaTeng
HuaTeng
master

搜索帮助