index.jsp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
  3. <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
  4. <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
  5. <%
  6. String path = request.getContextPath();
  7. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort() + path+"/";
  8. request.setAttribute("contextPath", basePath);
  9. String redirectUrl= request.getParameter("redirectUrl");
  10. request.setAttribute("redirectUrl", redirectUrl);
  11. %>
  12. <!DOCTYPE html>
  13. <html lang="en">
  14. <head>
  15. <base href="<%=basePath%>">
  16. <meta charset="UTF-8">
  17. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  18. <meta name="apple-mobile-web-app-capable" content="yes">
  19. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  20. <meta name="format-detection" content="telephone=no">
  21. <title>首页</title>
  22. <script src="${contextPath }app/lib/flexible.js"></script>
  23. <script type="text/javascript" src="<%=basePath %>res/js/jquery.min.js"></script>
  24. <script type="text/javascript" src="<%=basePath %>res/js/layer/layer.min.js"></script>
  25. <link rel="stylesheet" href="${contextPath }app/lib/flexible.css">
  26. <link rel="stylesheet" href="${contextPath }app/lib/swiper-4.3.2.min.css" />
  27. <link rel="stylesheet" href="${contextPath }app/css/basem.css">
  28. <link rel="stylesheet" href="${contextPath }app/css/public.css">
  29. <link rel="stylesheet" href="${contextPath }app/css/index.css">
  30. </head>
  31. <body>
  32. <header>
  33. <div class="fl"><a href="#"><img src="${contextPath }app/img/logo@2x.png" alt=""></a></div>
  34. <a href="${contextPath }web/messageWebCtl/message.cs?userId=${USER.id}" class="fr"><img src="${contextPath }app/img/xiaox@2x.png" alt="">
  35. ${MESSAGE_COUNT=="0"?"":"<span></span>"}
  36. </a>
  37. </header>
  38. <div class="main">
  39. <!--导航 -->
  40. <div class="swiper-container">
  41. <div class="swiper-wrapper">
  42. <c:forEach var="imglist" varStatus="status" items="${imglist}">
  43. <div class="swiper-slide">
  44. <c:choose>
  45. <c:when test="${imglist.advType=='1' }">
  46. <a href="${imglist.advSrc}"><img src="${imglist.advPic}" alt=""></a>
  47. </c:when>
  48. <c:otherwise>
  49. <img src="${imglist.advPic}" alt="">
  50. </c:otherwise>
  51. </c:choose>
  52. </div>
  53. </c:forEach>
  54. </div>
  55. <!-- 如果需要分页器 -->
  56. <div class="swiper-pagination"></div>
  57. </div>
  58. <!-- 首页大导航 -->
  59. <nav>
  60. <ul class="oneul">
  61. <li>
  62. <a href="${contextPath}web/mgmOrder/recommendlist.cs">
  63. <img src="${contextPath }app/img/tuij@2x.png" alt="">
  64. <span>推介记录</span>
  65. </a>
  66. </li>
  67. <li>
  68. <a href="${contextPath }web/mgmInviteRecordCtl/me_invite.cs">
  69. <img src="${contextPath }app/img/haoy@2x.png" alt="">
  70. <span>邀请好友</span>
  71. </a>
  72. </li>
  73. <li>
  74. <a href="${contextPath}web/news/newsList.cs">
  75. <img src="${contextPath }app/img/gongg@2x.png" alt="">
  76. <span>集团公告</span>
  77. </a>
  78. </li>
  79. </ul>
  80. </nav>
  81. </div>
  82. <div class="wrap">
  83. <div class="kind">
  84. <div class="scrollNav">
  85. <ul class="kindul tabs">
  86. <c:forEach var="cg" varStatus="status" items="${category }">
  87. <li <c:if test="${status.index == 0 }">class="default"</c:if> ><%-- onclick="replace('${cg.id}', '${cg.num}', '${cg.type}', '${cg.twotype}', '2', '1')" --%>
  88. <a href="javascript:void(0);">
  89. ${cg.name }
  90. <%-- --%>
  91. </a>
  92. <input type="hidden" value="${cg.id}" id="categoryid" type="hidden"/>
  93. <input type="hidden" value="${cg.num}" id="num" type="hidden"/>
  94. <input type="hidden" value="${cg.type}" id="type" type="hidden"/>
  95. <input type="hidden" value="${cg.twotype}" id="twotype" type="hidden"/>
  96. </li>
  97. </c:forEach>
  98. <%-- <li class="kindMore">
  99. <a href="#">
  100. <img src="${contextPath }app/img/xian@2x.png" class="xian" alt="">
  101. <img src="${contextPath }app/img/tianz@2x.png" alt="">
  102. </a>
  103. </li> --%>
  104. </ul>
  105. </div>
  106. <script type="text/javascript">
  107. function morep(){
  108. var iobj = $('.tabs .default');
  109. if(typeof(iobj) != "undefined"){
  110. var categoryid = iobj.children("#categoryid").val();
  111. var num = iobj.children("#num").val();
  112. var type = iobj.children("#type").val();
  113. var twotype = iobj.children("#twotype").val();
  114. window.location.href = "<%=basePath%>web/mgmProduct/more.cs?categoryid="+categoryid+"&num="+num+"&type="+type+"&twotype="+twotype+"&page=1&ismore=1";
  115. }
  116. }
  117. </script>
  118. <!-- 房产推介 -->
  119. <div class="referrals swiper-container2" style="overflow: hidden;">
  120. <div class="swiper-wrapper" style="height:auto">
  121. <div class="swiper-slide">
  122. <div class="hot">
  123. <img src="${contextPath }app/img/hot@2x.png" alt="">
  124. <a href="javascript:void(0);" onclick="morep();">全部产品<img src="${contextPath }app/img/jinr@2x.png" alt=""></a>
  125. </div>
  126. <ul>
  127. <c:forEach var="p" varStatus="status" items="${pager}">
  128. <c:forEach var="p1" varStatus="status" items="${p.pager.results }">
  129. <li>
  130. <a href="<%=basePath%>web/mgmProduct/detail.cs?productid=${p1.id }&plat=H5">
  131. <label class="mycheck hide">
  132. <input type="checkbox" value="1" value="" />
  133. <div class="option"></div><!--该div盛放的是优化后的按钮图片-->
  134. </label>
  135. <div class="referinfo">
  136. <img src="${p1.productImg }" alt="">
  137. <div class="referCont">
  138. <p class="refertit">${p1.productName }</p>
  139. <p>
  140. <span class="designation graytxt">${p1.productRemark }</span>
  141. <c:if test="${p1.commissionRate != '0' }">
  142. <span class="commission">佣金:${p1.commissionRate }%</span>
  143. </c:if>
  144. </p>
  145. <p>
  146. <span class="designation graytxt">价格:</span>
  147. <span class="price">${p1.productPrice }</span>
  148. </p>
  149. <p>
  150. <span class="designation graytxt">类型:</span>
  151. <span class="graytxt">${p1.gc }</span>
  152. </p>
  153. </div>
  154. </div>
  155. </a>
  156. <div class="buy">
  157. <a href="<%=basePath %>web/mgmProduct/buyNow.cs?productId=${p1.id }" class="buygo">立即购买</a>
  158. <a href="<%=basePath %>web/mgmProduct/recommend.cs?productids=${p1.id }" class="buyt">我要推介</a>
  159. </div>
  160. </li>
  161. </c:forEach>
  162. </c:forEach>
  163. </ul>
  164. <div class="seemore">
  165. <a href="javascript:void(0)" onclick="morep();">
  166. <img src="${contextPath }app/img/shangp@2x.png" alt="">
  167. 查看更多商品
  168. <img src="${contextPath }app/img/jinr@2x.png" alt="" >
  169. </a>
  170. </div>
  171. </div>
  172. <c:forEach var="cg" varStatus="status" items="${category }">
  173. <c:if test="${status.index > 0 }">
  174. <div class="swiper-slide">
  175. <div class="hot">
  176. <img src="${contextPath }app/img/hot@2x.png" alt="">
  177. <a href="javascript:void(0);" onclick="morep();">全部产品<img src="${contextPath }app/img/jinr@2x.png" alt=""></a>
  178. </div>
  179. <ul>
  180. <li>
  181. <p style="text-align:center" num='1'>正在加载中。。。</p>
  182. </li>
  183. </ul>
  184. <div class="seemore">
  185. <a href="javascript:void(0)" onclick="morep();">
  186. <img src="${contextPath }app/img/shangp@2x.png" alt="">
  187. 查看更多商品
  188. <img src="${contextPath }app/img/jinr@2x.png" alt="" >
  189. </a>
  190. </div>
  191. </div>
  192. </c:if>
  193. </c:forEach>
  194. </div>
  195. </div>
  196. </div>
  197. </div>
  198. <footer>
  199. <a href="<%=basePath %>web/mgmUserCtl/index.cs" class="active">
  200. <img src="${contextPath }app/img/shouye@2x.png" class="img1">
  201. <img src="${contextPath }app/img/shouygao@2x.png" class="img2">
  202. <p>首页</p>
  203. </a>
  204. <a href="<%=basePath%>web/mgmProduct/followList.cs?page=1">
  205. <img src="${contextPath }app/img/guanz@2x.png" class="img1">
  206. <img src="${contextPath }app/img/guanzgao@2x.png" class="img2">
  207. <p>关注</p>
  208. </a>
  209. <a href="${contextPath}web/mgmOrder/getOrderList.cs">
  210. <img src="${contextPath }app/img/jindu@2x.png" class="img1">
  211. <img src="${contextPath }app/img/jindgao@2x.png" class="img2">
  212. <p>进度</p>
  213. </a>
  214. <a href="${contextPath }web/meWebCtl/me.cs" >
  215. <img src="${contextPath }app/img/my.png" class="img1">
  216. <img src="${contextPath }app/img/wode@2x.png" class="img2">
  217. <p>我的</p>
  218. </a>
  219. </footer>
  220. </body>
  221. <script src="${contextPath }app/lib/swiper-4.3.2.min.js"></script>
  222. <script type="text/javascript" src="${contextPath }app/lib/jquery.min.js"></script>
  223. <script type="text/javascript" src="${contextPath }app/js/public.js"></script>
  224. <script>
  225. var mySwiper = new Swiper ('.swiper-container', {
  226. autoplay:true,//等同于以下设置
  227. autoplay: {
  228. delay: 3000,
  229. stopOnLastSlide: false,
  230. disableOnInteraction: true,
  231. },
  232. loop: true,
  233. // 分页器
  234. pagination: {
  235. el: '.swiper-pagination',
  236. }
  237. })
  238. function replace(categoryid, num, type, twotype, ismore, page){
  239. var products = $('.swiper-container2 .swiper-wrapper .swiper-slide').eq($(".tabs .default").index());
  240. if(products.children('ul').children('li').eq(0).children('p').attr('num') == '1'){
  241. $.ajax({
  242. type: "GET",
  243. url: "<%=basePath%>web/mgmProduct/now.cs",
  244. data: {
  245. categoryid:categoryid,
  246. num: num,
  247. type: type,
  248. twotype: twotype,
  249. ismore: ismore,
  250. page: page
  251. },
  252. dataType: "json",
  253. success: function(data){
  254. products.children('ul').html("");
  255. var html="";
  256. data.forEach(function(value,index,array){
  257. value.pager.results.forEach(function(value,index,array){
  258. html += "<li>";
  259. html += "<a href='<%=basePath%>web/mgmProduct/detail.cs?productid="+value.id+"&plat=H5'>";
  260. html += "<label class='mycheck hide'>";
  261. html += "<input type='checkbox' value='1' value='' />";
  262. html += "<div class='option'></div>";
  263. html += "</label>";
  264. html += "<div class='referinfo'>";
  265. html += "<img src='"+value.productImg +"' alt=''>";
  266. html += "<div class='referCont'>";
  267. html += "<p class='refertit'>"+value.productName +"</p>";
  268. html += "<p>";
  269. html += "<span class='designation graytxt'>"+value.productRemark +"</span>";
  270. if(value.commissionRate != '0'){
  271. html += "<span class='commission'>佣金:"+value.commissionRate+ "%</span>";
  272. }
  273. html += "</p>";
  274. html += "<p>";
  275. html += "<span class='designation graytxt'>价格:</span>";
  276. html += "<span class='price'>"+value.productPrice +"</span>";
  277. html += "</p>";
  278. html += "<p>";
  279. html += "<span class='designation graytxt'>类型:</span>";
  280. html += "<span class='graytxt'>"+value.gc +"</span>";
  281. html += "</p>";
  282. html += "</div>";
  283. html += "</div>";
  284. html += "</a>";
  285. html += "<div class='buy'>";
  286. html += "<a href='<%=basePath %>web/mgmProduct/buyNow.cs?productId="+value.id +"' class='buygo'>立即购买</a>";
  287. html += "<a href='<%=basePath %>web/mgmProduct/recommend.cs?productids="+value.id+"' class='buyt'>我要推介</a>";
  288. html += "</div>";
  289. html += "</li>";
  290. });
  291. });
  292. products.children('ul').html(html);
  293. $(".tabs .default").click();
  294. }
  295. });
  296. }
  297. }
  298. var mySwiper2 = new Swiper('.kind .swiper-container2',{
  299. autoHeight: true,
  300. on:{
  301. slideChangeTransitionStart: function(){
  302. $(".tabs .default").removeClass('default');
  303. $(".tabs li").eq(mySwiper2.activeIndex).addClass('default');
  304. var iobj = $('.tabs .default');
  305. if(typeof(iobj) != "undefined"){
  306. var categoryid = iobj.children("#categoryid").val();
  307. var num = iobj.children("#num").val();
  308. var type = iobj.children("#type").val();
  309. var twotype = iobj.children("#twotype").val();
  310. replace(categoryid, num, type, twotype, "2", "1");
  311. }
  312. //上面导航列表同时滚动
  313. var w = 0;
  314. $(".tabs li").each(function(){
  315. w = w + $(this).width();
  316. if($(this).attr('class').indexOf('default') >= 0){
  317. return false;
  318. }
  319. });
  320. $(".scrollNav").scrollLeft(w);
  321. }
  322. }
  323. });
  324. $(".tabs li").click(function(e){
  325. e.preventDefault();
  326. $(".tabs .default").removeClass('default');
  327. $(this).addClass('default');
  328. mySwiper2.slideTo($(this).index());
  329. });
  330. $(".tabs li").click(function(e){
  331. e.preventDefault();
  332. });
  333. </script>
  334. </html>