articleList.html
5.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>文章列表-{$tpshop_config.shop_info_store_title}</title>
<meta http-equiv="keywords" content="{$tpshop_config['shop_info_store_keyword']}" />
<meta name="description" content="{$tpshop_config['shop_info_store_desc']}" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<link rel="stylesheet" type="text/css" href="__STATIC__/css/kwj-m-lib.min.css" />
<link rel="stylesheet" type="text/css" href="__STATIC__/css/script.css" />
<link rel="stylesheet" type="text/css" href="__STATIC__/css/article.css" />
<script type="text/javascript" src="__PUBLIC__/js/layer/layer.js" ></script>
<script type="text/javascript" src="__STATIC__/js/jquery.js"></script>
</head>
<body style="background-color: #f5f8fa;">
<div class="info">
<div class="navBox">
<ul class="nav">
<li thistip="0" class="active">全部</li>
<foreach name="article_categroy" item="c" key="k">
<li thistip="{$c[cat_id]}">{$c[cat_name]}</li>
</foreach>
</ul>
</div>
<div>
<ul class="infoList">
</ul>
<div style="font-size:14px;text-align: center;color:#888;padding:15px 24px 10px; clear:both"> </div>
<div style="text-align: center"> <a href="javascript:void(0)" onclick="ajax_sourch_submit()" id="aword">点击加载更多</a></div>
<input type="hidden" name="hidtype" id="hidtype" value="0">
</div>
</div>
</body>
<input type="hidden" id="hidyunpath" name="hidyunpath" value="{:QCLOUD_IMGURL}">
</html>
<script type="text/javascript">
$(function(){
var getcatid={:I('get.categroy')};
if (getcatid!=null)
{
$(".nav li").removeClass("active");
$('.nav').find('li').each(function() {
if ($(this).attr("thistip")==getcatid)
{
$(this).addClass('active');
$("div[class^='cat_']").css("display","none");
$(".cat_"+$(this).attr("thistip").toString()).show();
}
})
}
page=0;
ajax_sourch_submit();
// ///滑动到底部事件
// $(document).unbind("scroll");
// $(document).bind("scroll", function (event) {
// if ($(document).scrollTop() >= $(document).height() - $(window).height() - 45) {
// // if (IsLoading == true) {
// // IsLoading = false;
// ajax_sourch_submit();
// // }
// }
// });
$(".nav li").click(function(){
$(".nav li").removeClass("active");
$(this).addClass("active");
$("div[class^='cat_']").css("display","none");
$(".cat_"+$(this).attr("thistip").toString()).show();
page=0;
ajax_sourch_submit();
});
});
var page=0;
/*** ajax 提交表单 查询订单列表结果*/
function ajax_sourch_submit()
{
categroy = $(".nav li.active").attr("thistip").toString();
url="/Mobile/article/articleList2/stoid/"+{:I('get.stoid')}+"/p/"+page+"/categroy/"+categroy+".html";
$.ajax({
type : "GET",
url:url,//+tab,
// data : $('#filter_form').serialize(),// 你的formid 搜索表单 序列化提交
success: function(data)
{
var html="";
if(data.state==0) {
$(".cat_" + categroy + " div input").attr("value", "");
$(".cat_" + categroy + " div input").attr("value", page);
if (page == 0) {
$(".cat_" + categroy + " #aword").html("没有数据");
} else {
$(".cat_" + categroy + " #aword").html("没有更多数据了");
}
}else {
$(".cat_" + categroy + " div input").attr("value", "");
$(".cat_" + categroy + " div input").attr("value", page);
for (i = 0; i < data.item.length; i++) {
var imgUrl=data.item[i]["thumb"];
var hidyunpath=$("#hidyunpath").val();
if(imgUrl==""){
imgUrl="__PUBLIC__/images/not_adv.jpg";
}
html+="<li><a href=\"/Mobile/Article/article/stoid/" + data.item[i]["store_id"] + "/article_id/" + data.item[i]["article_id"] + ".html\"><img class=\"spImg\" src=\""+hidyunpath+ imgUrl + "\"/><p class=\"infoTxt\"><span class=\"infoTit\">" + data.item[i]["title"] + "</span><span class=\"disb\">" + data.item[i]["description"] + "</span><span class=\"leftTxt\"><img class=\"leftImg\" src=\"__STATIC__/images/duser.png\" />" + data.item[i]["click"] + "</span><span class=\"rightTxt\"><img class=\"rightImg\" src=\"__STATIC__/images/txt.png\"/>详情</span></p></a></li>";
}
if (page == 0) {
$(".infoList").html(html);
}
else
{
$(".infoList").append(html);
}
page += 1;
//alert(data.page);
// alert(page);
if (data.page > page) {
// alert(1);
$("#aword").show();
}
else {
// alert(0);
$("#aword").hide();
}
}
}
});
}
</script>