Files
littleTiger/template/mobile/rainbow/index/news_list.html
2019-02-28 19:48:21 +08:00

135 lines
4.2 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>新闻-{$tpshop_config['shop_info_store_title']}</title>
<link href="__PUBLIC__/static/css/tp-base.css" rel="stylesheet"/>
<link href="__PUBLIC__/static/css/tp-m-package.css" rel="stylesheet"/>
<script src="__PUBLIC__/static/js/jquery-1.9.1-min.js" type="text/javascript"></script>
<script src="__STATIC__/js/mobile-util.js" type="text/javascript" charset="utf-8"></script>
<script src="__PUBLIC__/static/js/swipeSlide.min.js" type="text/javascript"></script>
<script src="/template/mobile/rainbow/static/js/layer.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/global.js"></script>
<script src="__PUBLIC__/static/js/tp-drag-join-module.js"></script>
<script type="text/javascript" src="__PUBLIC__/static/js/layui/layui.js?v=2.3.0"></script>
<script src="__PUBLIC__/static/js/layuifun.js"></script>
</head>
<body>
<div class="classreturn loginsignup ">
<div class="content">
<div class="ds-in-bl return">
<a id="[back]" href="javascript:history.back(-1)"><img src="__STATIC__/images/return.png" alt="返回"></a>
</div>
<div class="ds-in-bl search center">
<span>新闻列表</span>
</div>
</div>
</div>
<div class="hot-tea hot-tea-lists newlist-con">
<div class="hottea-list newlist-item" id="news_list">
</div>
</div>
</body>
<script type="text/javascript">
// 商品详情页 滚动到一定位置固定定位
$(window).scroll(function () {
if ($(window).scrollTop() <= 10) {
$(".tpd-search-tm").css({
"opacity": "0",
"background": "#000"
});
$(".tpd-search-warp>.tpd-logo").css({
"background": "none"
})
$(".tpd-search-warp").css({
"position": "relative"
})
$(".tpd-personal-warp>span").css({
"color": "#666666"
})
} else {
$(".tpd-search-tm").css({
"background": "#de181b",
"opacity": "0.9"
});
$(".tpd-search-warp>.tpd-logo").css({
"background-color": "#fff"
})
$(".tpd-search-warp").css({
"position": "fixed"
})
$(".tpd-personal-warp>span").css({
"color": "#ffffff"
})
}
});
</script>
<script type="text/javascript">
// 设置单文本字体大小
$(".fontSizes").each(function () {
var numSize = $(this).attr("txtnav_fonts");
var pointNum = numSize * 2 / 46.875;
$(this).css("font-size", pointNum.toFixed(4) + "rem")
})
</script>
<script type="text/javascript">
var where_news = {
page:1
};
$(function(){
show_msg_12();
})
// 新闻
function show_msg_12() {
var to = '#news_list';
var from = '#tpl_msg_12';
var url = "{:U('Mobile/Index/ajax_news_list')}";
ajax_html_tpl(url, where_news, from, to);
}
function ajax_html_tpl(url, where, from, to) {
$(to).html('')
$.ajax({
type: "POST",
url: url,
data: where,
dataType: "json",
success: function (res) {
console.log('ajax_html_tpl', res)
if (res.status == 1) {
// 展示
html_tpl(from, to, res)
} else {
console.log('ajax_html_tpl status=0', res)
//alert('获取动态失败,请稍等再试!');
}
}
});
}
</script>
<script id="tpl_msg_12" type="text/html" desc="新闻">
<ul>
{{# layui.each(d.result, function(index, item){ }}
<li><a href="/api/news/news_detail.html?news_id={{item.article_id}}">
<div class="carlist-img fl"><img src="{{item.thumb}}"></div>
<div class="carlist-txt fr">
<b>{{item.title}}</b>
{{item.content}}
<span><em>{{item.cat_name}}</em><img src="/public/static/images/icon-fire.png"><i>{{formatDate(item.publish_time)}}</i></span>
</div>
</a></li>
{{# }); }}
</ul>
</script>
</html>