index.jsp 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <%--
  2. Created by IntelliJ IDEA.
  3. User: 91476
  4. Date: 2019/12/9
  5. Time: 22:12
  6. To change this template use File | Settings | File Templates.
  7. --%>
  8. <%@ page contentType="text/html;charset=UTF-8" language="java" %>
  9. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
  10. <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
  11. <html lang="en">
  12. <head>
  13. <title>主页面</title>
  14. <!-- all css here -->
  15. <link rel="stylesheet" href="css/style.css">
  16. <link rel="stylesheet" href="css/bootstrap.css">
  17. <script src="js/jquery-3.3.1.min.js"></script>
  18. <script src="js/bootstrap.js"></script>
  19. <script>
  20. $(function() {
  21. $.get("ProductServlet/findProduct",{},function(data){
  22. var products="";
  23. for (var i=0; i<data.length;i++){
  24. var product = '<div class="col-xl-3 col-lg-4 col-md-6 col-sm-6">' +
  25. '<div class="product-wrapper mb-10">' +
  26. '<div class="product-img">' +
  27. '<a href="/Shop/ProductServlet?mid='+data[i].mid+'" target="_blank">' +
  28. '<img src="products/'+data[i].img+'" alt="">' +
  29. '</a>' +
  30. '</div>' +
  31. '<div class="product-content">' +
  32. '<h4><a href="/Shop/ProductServlet?mid='+data[i].mid+'" target="_blank">'+data[i].name+'</a></h4>' +
  33. '<div class="product-price">' +
  34. '<span class="new">$'+data[i].price+'</span>' +
  35. '</div>' +
  36. ' </div>' +
  37. '</div>' +
  38. '</div>';
  39. products +=product;
  40. }
  41. // if($("#products").val().indexof('undefined')>0){
  42. //
  43. // }
  44. $("#products").html(products);
  45. });
  46. });
  47. </script>
  48. </head>
  49. <%@ include file="head.jsp"%>
  50. <div class="slider-area">
  51. <div class="slider-active owl-dot-style owl-carousel">
  52. <div class="single-slider pt-100 pb-100 yellow-bg">
  53. <div class="container">
  54. <div class="row">
  55. <div class="col-lg-6 col-md-6 col-12 col-sm-7">
  56. <div class="slider-content slider-animated-1 pt-114">
  57. <h3 class="animated">We keep pets for pleasure.</h3>
  58. <h1 class="animated">Food & Vitamins <br>For all Pets</h1>
  59. <div class="slider-btn">
  60. <a class="animated" href="product-details.html">SHOP NOW</a>
  61. </div>
  62. </div>
  63. </div>
  64. <div class="col-lg-6 col-md-6 col-12 col-sm-5">
  65. <div class="slider-single-img slider-animated-1">
  66. <img class="animated" src="img/slider/slider-single-img.png" alt="">
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. <div class="food-category food-category-col pt-100 pb-60">
  74. <div class="container">
  75. <div class="row">
  76. <div class="col-lg-4 col-md-4">
  77. <div class="single-food-category cate-padding-1 text-center mb-30">
  78. <div class="single-food-hover-2">
  79. <img src="img/product/product-1.jpg" alt="">
  80. </div>
  81. <div class="single-food-content">
  82. <h3>Dogs Food</h3>
  83. </div>
  84. </div>
  85. </div>
  86. <div class="col-lg-4 col-md-4">
  87. <div class="single-food-category cate-padding-2 text-center mb-30">
  88. <div class="single-food-hover-2">
  89. <img src="img/product/product-2.jpg" alt="">
  90. </div>
  91. <div class="single-food-content">
  92. <h3>Cats Food</h3>
  93. </div>
  94. </div>
  95. </div>
  96. <div class="col-lg-4 col-md-4">
  97. <div class="single-food-category cate-padding-3 text-center mb-30">
  98. <div class="single-food-hover-2">
  99. <img src="img/product/product-3.jpg" alt="">
  100. </div>
  101. <div class="single-food-content">
  102. <h3>Fishs Food</h3>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. <div class="product-area pt-95 pb-70 gray-bg">
  110. <div class="container">
  111. <div class="section-title text-center mb-55">
  112. <h4>Most Populer</h4>
  113. <h2>Recent Products</h2>
  114. </div>
  115. <div class="row" id="products">
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. <jsp:include page="footer.jsp"></jsp:include>
  121. </body>
  122. </html>