-
Notifications
You must be signed in to change notification settings - Fork 84
/
latest-product.php
executable file
·514 lines (439 loc) · 22.2 KB
/
latest-product.php
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
<!DOCTYPE html>
<!--[if IE 9]>
<html lang="en" class="ie9"> <![endif]-->
<!--[if IE 8]>
<html lang="en" class="ie8"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<head>
<meta charset="utf-8">
<title>杭州北望生物技术有限公司 | 最新产品</title>
<meta name="description" content="杭州北望生物技术有限公司网站">
<meta name="author" content="杭城小刘">
<!-- Mobile Meta -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Favicon -->
<link rel="shortcut icon" href="style/images/img/favicon.ico">
<!-- Web Fonts -->
<link
href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700,300&subset=latin,latin-ext'
rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=PT+Serif' rel='stylesheet' type='text/css'>
<!-- Bootstrap core CSS -->
<link href="style/css/bootstrap.css" rel="stylesheet">
<!-- Font Awesome CSS -->
<link href="style/css/font-awesome.css" rel="stylesheet">
<!-- Fontello CSS -->
<link href="style/css/fontello.css" rel="stylesheet">
<!-- Plugins -->
<link href="style/css/settings.css" media="screen" rel="stylesheet">
<link href="style/css/extralayers.css" media="screen" rel="stylesheet">
<link href="style/css/magnific-popup.css" rel="stylesheet">
<link href="style/css/animations.css" rel="stylesheet">
<link href="style/css/owl.carousel.css" rel="stylesheet">
<!-- iDea core CSS file -->
<link href="style/css/style.css" rel="stylesheet">
<!-- Style Switcher Styles (Remove these two lines) -->
<link href="#" data-style="styles" rel="stylesheet">
<link href="style/css/style-switcher.css" rel="stylesheet">
<!-- Custom css -->
<link href="style/css/custom.css" rel="stylesheet">
<script src="http://cdn.bootcss.com/jquery/2.0.3/jquery.min.js"></script>
<script src="http://cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script>
<!--.php5 shim and Respond.js for IE8 support of.php5 elements and media queries -->
<!--[if lt IE 9]>
<script src="style/js.php5shiv.min.js"></script>
<script src="style/js/respond.min.js"></script>
<![endif]-->
</head>
<!-- body classes:
"boxed": boxed layout mode e.g. <body class="boxed">
"pattern-1 ... pattern-9": background patterns for boxed layout mode e.g. <body class="boxed pattern-1">
-->
<body class="front no-trans">
<!-- scrollToTop -->
<!-- ================ -->
<div class="scrollToTop"><i class="icon-up-open-big"></i></div>
<!-- page wrapper start -->
<!-- ================ -->
<div class="page-wrapper">
<!-- header-top start (Add "dark" class to .header-top in order to enable dark header-top e.g <div class="header-top dark">) -->
<!-- ================ -->
<!-- header-top end -->
<!-- header start classes:
fixed: fixed navigation mode (sticky menu) e.g. <header class="header fixed clearfix">
dark: dark header version e.g. <header class="header dark clearfix">
================ -->
<?php
require_once "controller/Header.php";
$header = Header::getInstance();
$header->headerGenerate(3,1);
?>
<!-- header end -->
<!-- banner start -->
<!-- ================ -->
<div class="banner shop-banner">
<!-- slideshow start -->
<!-- ================ -->
<div class="slideshow white-bg">
<!-- slider revolution start -->
<!-- ================ -->
<div class="slider-banner-container">
<div class="slider-banner">
<ul>
<!-- slide 1 start -->
<li data-transition="fade" data-slotamount="7" data-masterspeed="1000"
data-saveperformance="on" data-title="Slide 1">
<!-- main image -->
<img src="style/images/slider-shop-slide-1.jpg" alt="slidebg1"
data-bgposition="center top" data-bgfit="cover" data-bgrepeat="no-repeat">
<!-- Translucent background -->
<div class="tp-caption light-translucent-bg"
data-x="center"
data-y="bottom"
data-speed="800"
data-start="0"
style="background-color:rgba(255,255,255,0.4);">
</div>
<!-- LAYER NR. 1 -->
<div class="tp-caption very_large_text hidden-sm black sfl tp-resizeme"
data-x="center"
data-y="150"
data-speed="200"
data-start="0"
data-end="10000"
data-endspeed="200"
data-splitin="chars"
data-elementdelay="0.07"
data-endelementdelay="0.1"
data-splitout="chars">新增3种产品
</div>
<!-- LAYER NR. 2 -->
<div class="tp-caption tp-resizeme hidden-sm sfb"
data-x="center"
data-y="230"
data-speed="700"
data-start="600"
data-end="10000"
data-endspeed="600"><a href="latest-product.php" class="btn btn-dark">立即查看 <i
class="fa fa-angle-right pl-10"></i></a>
</div>
</li>
<!-- slide 1 end -->
<!-- slide 2 start -->
<li data-transition="fade" data-slotamount="7" data-masterspeed="1000"
data-saveperformance="on" data-title="Slide 2">
<!-- main image -->
<img src="style/images/slider-shop-slide-2.jpg" alt="slidebg1"
data-bgposition="center top" data-bgfit="cover" data-bgrepeat="no-repeat">
<!-- Translucent background -->
<div class="tp-caption light-translucent-bg"
data-x="center"
data-y="bottom"
data-speed="800"
data-start="0"
style="background-color:rgba(255,255,255,0.4);">
</div>
<!-- LAYER NR. 1 -->
<div class="tp-caption very_large_text hidden-sm sft black tp-resizeme"
data-x="center"
data-y="150"
data-speed="700"
data-start="200"
data-end="10000"
data-endspeed="600">甄品选购
</div>
<!-- LAYER NR. 2 -->
<div class="tp-caption tp-resizeme hidden-sm sfb"
data-x="center"
data-y="230"
data-speed="700"
data-start="600"
data-end="10000"
data-endspeed="600"><a href="features-product.php" class="btn btn-dark">立即购买 <i
class="fa fa-angle-right pl-10"></i></a>
</div>
</li>
<!-- slide 2 end -->
</ul>
</div>
</div>
<!-- slider revolution end -->
</div>
<!-- slideshow end -->
<div class="sorting-filters">
<div class="container">
<form class="form-inline">
<div class="form-group">
<label>分类</label>
<select class="form-control" id="order">
<option value="">--请选择--</option>
<option value="price">价格</option>
<option value="sales">销量</option>
</select>
</div>
<div class="form-group">
<label>排序</label>
<select class="form-control" id="direction">
<option value="">--请选择--</option>
<option value="ASC">升序</option>
<option value="DESC">降序</option>
</select>
</div>
<div class="form-group">
<label>价格 ¥ (最低/最高)</label>
<div class="row grid-space-10">
<div class="col-sm-6">
<input type="text" class="form-control" id="startPrice">
</div>
<div class="col-sm-6">
<input type="text" class="form-control col-xs-6" id="endPrice">
</div>
</div>
</div>
<div class="form-group">
<label>产品类别</label>
<select class="form-control" id="productBigKind">
<option value="">--请选择--</option>
<option value="药检试剂">药检试剂</option>
<option value="生化酶">生化酶</option>
<option value="检测试剂">检测试剂</option>
<option value="消毒用试剂">消毒用试剂</option>
<option value="细胞因子">细胞因子</option>
<option value="其它产品">其它产品</option>
<option value="检测试纸卡">检测试纸卡</option>
<option value="速测盒">速测盒</option>
<option value="检测仪器">检测仪器</option>
</select>
</div>
<div class="form-group">
<a id="search" class="btn btn-default">查询</a>
</div>
</form>
</div>
</div>
</div>
<!-- banner end -->
<!-- main-container start -->
<!-- ================ -->
<section class="main-container">
<div class="container">
<div class="row">
<!-- main start -->
<!-- ================ -->
<div class="main col-md-12">
<!-- page-title start -->
<!-- ================ -->
<h1 class="page-title">普通产品</h1>
<div class="separator-2"></div>
<!-- page-title end -->
<!-- shop items start -->
<div class="masonry-grid-fitrows row grid-space-20" id="shopZone">
</div>
<!-- shop items end -->
<div class="clearfix"></div>
<!-- pagination start -->
<ul class="pagination">
</ul>
<!-- pagination end -->
</div>
<!-- main end -->
</div>
</div>
</section>
<!-- main-container end -->
<!-- section start -->
<!-- ================ -->
<!-- section end -->
<!-- section start -->
<!-- ================ -->
<!-- section end -->
<!-- section start -->
<!-- ================ -->
<!-- section end -->
<!-- footer start (Add "light" class to #footer in order to enable light footer) -->
<!-- ================ -->
<?php
require_once "controller/Footer.php";
?>
<!-- footer end -->
</div>
<!-- page-wrapper end -->
<!-- JavaScript files placed at the end of the document so the pages load faster
================================================== -->
<!-- Jquery and Bootstap core js files -->
<script type="text/javascript" src="style/js/jquery.min.js"></script>
<script type="text/javascript" src="style/js/bootstrap.min.js"></script>
<!-- Modernizr javascript -->
<script type="text/javascript" src="style/js/modernizr.js"></script>
<!-- jQuery REVOLUTION Slider -->
<script type="text/javascript" src="style/js/jquery.themepunch.tools.min.js"></script>
<script type="text/javascript" src="style/js/jquery.themepunch.revolution.min.js"></script>
<!-- Isotope javascript -->
<script type="text/javascript" src="style/js/isotope.pkgd.min.js"></script>
<!-- Owl carousel javascript -->
<script type="text/javascript" src="style/js/owl.carousel.js"></script>
<!-- Magnific Popup javascript -->
<script type="text/javascript" src="style/js/jquery.magnific-popup.min.js"></script>
<!-- Appear javascript -->
<script type="text/javascript" src="style/js/jquery.appear.js"></script>
<!-- Count To javascript -->
<script type="text/javascript" src="style/js/jquery.countTo.js"></script>
<!-- Parallax javascript -->
<script src="style/js/jquery.parallax-1.1.3.js"></script>
<!-- Contact form -->
<script src="style/js/jquery.validate.js"></script>
<!-- SmoothScroll javascript -->
<script type="text/javascript" src="style/js/jquery.browser.js"></script>
<script type="text/javascript" src="style/js/SmoothScroll.js"></script>
<!-- Initialization of Plugins -->
<script type="text/javascript" src="style/js/template.js"></script>
<!-- Custom Scripts -->
<script type="text/javascript" src="style/js/custom.js"></script>
<!-- Color Switcher (Remove these lines) -->
<script type="text/javascript" src="style/js/style-switcher.js"></script>
<!-- Color Switcher End -->
<script>
var $page = 1;
function updateUI($this,page) {
$(".pagination li").each(function () {
$(this).removeClass("active");
});
$($this).parent().addClass("active");
$page = page;
refreshView(page);
}
function refreshView(page) {
var $node = $("#shopZone");
$node.empty();
//加载产品列表
$.ajax({
dataType: "json",
type: "get",
url: "controller/productlist.php?type=普通商品&page="+$page,
success: function (data) {
if (data.code == 200) {
var datas = data.data.datas;
if(datas.length <= 0){
$('<div class="row center-block" style="margin: 10px;" >喵~没找到相关的商品哦。</div>').appendTo($node);
return ;
}
for (var i = 0; i < datas.length; i++) {
console.log(datas[i].id);
$('<div class="col-md-3 col-sm-6 masonry-grid-item">' +
'<div class="listing-item">' +
'<div class="overlay-container">' +
'<img src="'+ datas[i].image1 + '" alt="">' +
'<a href="productDetail.php?id='+datas[i].id+'&type=普通商品" class="overlay small">' +
'<i class="fa fa-plus"></i>' +
'<span>查看详情</span>' +
'</a>' +
'</div>' +
'<div class="listing-item-body clearfix">' +
'<h3 class="title"><a href="productDetail.php?id='+datas[i].id+'&type=普通商品">' + datas[i].productName + '</a></h3>' +
'<p>' + datas[i].unit + '</p>' +
'<span class="price">¥' + datas[i].price + '</span>' +
'<div class="elements-list pull-right">' +
'<a href="productDetail.php?id='+datas[i].id+'&type=普通商品" class="wishlist" title="wishlist"><i class="fa fa-heart-o"></i></a>' +
'<a href="productDetail.php?id='+datas[i].id+'&type=普通商品"><i class="fa fa-shopping-cart pr-10"></i>加入购物车</a>' +
'</div>' +
'</div>' +
'</div>' +
'</div>').appendTo($node);
}
$node.css("height","auto");
if(page != "" && page != 0){
return ;
}
var $pagetarget = $(".pagination");
$pagetarget.empty();
var pages = Math.ceil(data.data.totals/28);
for(var $i=0;$i<pages+2;$i++){
if($i == 0){
$('<li><a>«</a></li>').appendTo($pagetarget);
}else if($i == 1){
$('<li class="active"><a onclick="updateUI(this,1);">1 <span class="sr-only">(current)</span></a></li>').appendTo($pagetarget);
}else if($i == pages+1){
$('<li><a>»</a></li>').appendTo($pagetarget);
}else{
$('<li><a onclick="updateUI(this,'+$i+');">'+$i+'</a></li>').appendTo($pagetarget);
}
}
}
},
error: function (code, message, data) {
alert("发生错误:" + message);
}
});
}
refreshView(0);
$("#search").click(function(){
var order = $("#order").val();
var startPrice = $("#startPrice").val();
var endPrice = $("#endPrice").val();
var direction = $("#direction").val();
var productBigKind = $("#productBigKind").val();
var page = 1;
var $node = $("#shopZone");
$node.empty();
$.ajax({
dataType: "json",
type: "get",
url: "controller/productlist.php?type=普通商品&order="+order+"&startPrice="+startPrice+"&endPrice="+endPrice+"&direction="+direction+"&productBigKind="+productBigKind+"&page="+page,
success: function (data) {
if (data.code == 200) {
var $pagetarget = $(".pagination");
var datas = data.data.datas;
if(datas.length <= 0){
$pagetarget.empty();
$('<div class="row center-block" style="margin: 10px;" >喵~没找到相关的商品哦。</div>').appendTo($node);
$node.css("height","auto");
return ;
}
for (var i = 0; i < datas.length; i++) {
$('<div class="col-md-3 col-sm-6 masonry-grid-item">' +
'<div class="listing-item">' +
'<div class="overlay-container">' +
'<img src="'+ datas[i].image1 + '" alt="">' +
'<a href="productDetail.php?id='+datas[i].id+'&type=普通商品" class="overlay small">' +
'<i class="fa fa-plus"></i>' +
'<span>查看详情</span>' +
'</a>' +
'</div>' +
'<div class="listing-item-body clearfix">' +
'<h3 class="title"><a href="productDetail.php?id='+datas[i].id+'&type=普通商品">' + datas[i].productName + '</a></h3>' +
'<p>' + datas[i].unit + '</p>' +
'<span class="price">¥' + datas[i].price + '</span>' +
'<div class="elements-list pull-right">' +
'<a href="productDetail.php?id='+datas[i].id+'&type=普通商品" class="wishlist" title="wishlist"><i class="fa fa-heart-o"></i></a>' +
'<a href="productDetail.php?id='+datas[i].id+'&type=普通商品"><i class="fa fa-shopping-cart pr-10"></i>加入购物车</a>' +
'</div>' +
'</div>' +
'</div>' +
'</div>').appendTo($node);
}
$node.css("height","auto");
$pagetarget.empty();
var pages = Math.ceil(data.data.totals/28);
for(var $i=0;$i<pages+2;$i++){
if($i == 0){
$('<li><a>«</a></li>').appendTo($pagetarget);
}else if($i == 1){
$('<li class="active"><a onclick="updateUI(this,1);">1 <span class="sr-only">(current)</span></a></li>').appendTo($pagetarget);
}else if($i == pages+1){
$('<li><a>»</a></li>').appendTo($pagetarget);
}else{
$('<li><a onclick="updateUI(this,'+$i+');">'+$i+'</a></li>').appendTo($pagetarget);
}
}
}
},
error: function (code, message, data) {
alert("发生错误:" + message);
}
});
});
</script>
</body>
</html>