123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515 |
- <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
- <%
- String path = request.getContextPath();
- String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort() + path+"/";
- request.setAttribute("contextPath", basePath);
-
- String redirectUrl= request.getParameter("redirectUrl");
- request.setAttribute("redirectUrl", redirectUrl);
- %>
- <!DOCTYPE html>
- <html>
- <head>
- <base href="<%=basePath%>">
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black">
- <meta name="format-detection" content="telephone=no">
- <title>更多${flname }</title>
- <script src="<%=basePath %>app/lib/flexible.js"></script>
- <link rel="stylesheet" href="<%=basePath %>app/lib/flexible.css">
- <link rel="stylesheet" href="<%=basePath %>app/lib/swiper-4.3.2.min.css" />
- <link rel="stylesheet" href="<%=basePath %>app/css/basem.css">
- <link rel="stylesheet" href="<%=basePath %>app/css/public.css">
- <link rel="stylesheet" href="<%=basePath %>app/css/index.css">
- <link rel="stylesheet" href="<%=basePath %>app/css/logome.css">
- </head>
- <body>
- <div class="xzMore" style="overflow: hidden;">
- <div class="titbox blubg">
- <a class="titreturn fl" href="javascript:void(0)" onclick="back()"><img src="<%=basePath %>app/img/fanhui16@2x.png" alt=""></a>
- <h1 id="h1name"><c:if test="${!data.pager.isEmpty() }">${data.pager[0].name }</c:if></h1>
- <c:if test="${!data.pager.isEmpty() && data.pager[0].type == '2' }">
- <a href="#" class="check">
- <img src="<%=basePath %>app/img/pil@2x.png" alt="">
- <span class="smtxt" num="1">多选推介</span>
- </a>
- </c:if>
- <script type="text/javascript">
- function back(){
- window.history.go(-1);
- }
- </script>
- </div>
- <div class="top50">
- <c:if test="${fn:length(data.category) > 0 }">
- <div class="scrollNav">
- <ul class="kindul tabs">
- <c:forEach var="cg" varStatus="status" items="${data.category }">
- <li <c:if test="${status.index == 0 }">class="default"</c:if> ><!-- onclick="replace('${cg.id}', '${cg.num}', '${cg.type}', '${cg.twotype}', '2', '1', '${cg.name }')" -->
- <a href="javascript:void(0);">
- ${cg.name }
- <%-- <c:if test="${status.index == 0 }"><i></i></c:if> --%>
- </a>
- <input type="hidden" value="${cg.id}" id="categoryid" type="hidden"/>
- <input type="hidden" value="${cg.num}" id="num" type="hidden"/>
- <input type="hidden" value="${cg.type}" id="type" type="hidden"/>
- <input type="hidden" value="${cg.twotype}" id="twotype" type="hidden"/>
- <input type="hidden" value="${cg.name}" id="name" type="hidden"/>
- </li>
- </c:forEach>
- </ul>
- </div>
- </c:if>
- <script type="text/javascript">
- function replace(categoryid, num, type, twotype, ismore, page, name, iscity){
- $("#h1name").text(name);
-
- var sslide = $('.swiper-container2 .swiper-wrapper .swiper-slide');
- var products = sslide.eq($('.tabs .default').index());
- var baseparam = products.children('.baseparam');
- var li = products.children('ul').children('li').eq(0);
- if(li.children('p').attr('num') == '1' || iscity == '1'){
- $.ajax({
- type: "GET",
- url: "<%=basePath%>web/mgmProduct/now.cs",
- data: {
- categoryid:categoryid,
- num: num,
- type: type,
- twotype: twotype,
- ismore: ismore,
- page: page,
- cityCode:$('#cityCode').val()
- },
- dataType: "json",
- success: function(data){
- products.children('ul').html("");
-
- var html="";
- data.forEach(function(value,index,array){
- baseparam.children(".categoryid").val(value.id);
- baseparam.children(".num").val(value.num);
- baseparam.children(".name").val(value.name);
- baseparam.children(".type").val(value.type);
- baseparam.children(".twotype").val(value.twotype);
- baseparam.children(".page").val(value.pager.page);
- baseparam.children(".pageTotal").val(value.pager.pageTotal);
- value.pager.results.forEach(function(value,index,array){
- html += "<li>";
- html += "<a href='<%=basePath%>web/mgmProduct/detail.cs?productid="+value.id+"&plat=H5'>";
- html += "<label class='mycheck hide'>";
- html += "<input type='hidden' class='mid' value='"+value.id+"' />";
- html += "<input type='checkbox' name='checkid' value='1' value='' />";
- html += "<div class='option'></div>";
- html += "</label>";
- html += "<div class='referinfo'>";
- html += "<img src='"+value.productImg +"' alt=''>";
- html += "<div class='referCont'>";
- html += "<p class='refertit'>"+value.productName +"</p>";
- html += "<p>";
- html += "<span class='designation graytxt'>"+value.productRemark +"</span>";
- if(value.commissionRate != '0'){
- html += "<span class='commission'>佣金:"+value.commissionRate+ "%</span>";
- }
- html += "</p>";
- html += "<p>";
- html += "<span class='designation graytxt'>价格:</span>";
- html += "<span class='price'>"+value.productPrice +"</span>";
- html += "</p>";
- html += "<p>";
- html += "<span class='designation graytxt'>类型:</span>";
- html += "<span class='graytxt'>"+value.gc +"</span>";
- html += "</p>";
- html += "</div>";
- html += "</div>";
- html += "</a>";
- html += "<div class='buy'>";
- html += "<a href='<%=basePath %>web/mgmProduct/buyNow.cs?productId="+value.id +"' class='buygo'>立即购买</a>";
- html += "<a href='<%=basePath %>web/mgmProduct/recommend.cs?productids="+value.id+"' class='buyt'>我要推介</a>";
- html += "</div>";
- html += "</li>";
-
- });
- });
- products.children('ul').html(html);
- $('.tabs .default').click();
- }
- });
- }
-
- }
- </script>
- </div>
- <!-- 房产推介 -->
- <div class="referrals swiper-container2">
- <div class="swiper-wrapper" style="height:auto">
- <div class="swiper-slide">
-
- <c:forEach var="p" varStatus="status" items="${data.pager}">
- <div class="baseparam">
- <input class="categoryid" type="hidden" value="${p.id }">
- <input class="num" type="hidden" value="${p.num }">
- <input class="name" type="hidden" value="${p.name }">
- <input class="type" type="hidden" value="${p.type }">
- <input class="twotype" type="hidden" value="${p.twotype }">
- <input class="page" type="hidden" value="${p.pager.page }">
- <input class="pageTotal" type="hidden" value="${p.pager.pageTotal }">
- </div>
- </c:forEach>
- <ul>
- <c:forEach var="p" varStatus="status" items="${data.pager}">
- <c:forEach var="p1" varStatus="status" items="${p.pager.results }">
- <li>
- <a href="<%=basePath%>web/mgmProduct/detail.cs?productid=${p1.id }&plat=H5">
- <label class="mycheck hide">
- <input type="hidden" class="mid" value="${p1.id }" />
- <input type="checkbox" name="checkid" value="1" value="" />
- <div class="option"></div><!--该div盛放的是优化后的按钮图片-->
- </label>
-
- <div class="referinfo">
- <img src="${p1.productImg }" alt="">
- <div class="referCont">
- <p class="refertit">${p1.productName }</p>
- <p>
- <span class="designation graytxt">${p1.productRemark }</span>
- <c:if test="${p1.commissionRate != '0' }"><span class="commission">佣金:${p1.commissionRate }%</span></c:if>
- </p>
- <p>
- <span class="designation graytxt">价格:</span>
- <span class="price">${p1.productPrice }</span>
- </p>
- <p>
- <span class="designation graytxt">类型:</span>
- <span class="graytxt">${p1.gc }</span>
- </p>
- </div>
- </div>
- </a>
- <div class="buy">
- <a href="<%=basePath %>web/mgmProduct/buyNow.cs?productId=${p1.id }" class="buygo">立即购买</a>
- <a href="<%=basePath %>web/mgmProduct/recommend.cs?productids=${p1.id }" class="buyt">我要推介</a>
- </div>
- </li>
- </c:forEach>
- </c:forEach>
- </ul>
- <div class="nomore">
- 没有更多了。。。
- </div>
- </div>
-
-
- <c:forEach var="cg" varStatus="status" items="${data.category }">
- <c:if test="${status.index != 0 }">
- <div class="swiper-slide">
- <div class="baseparam">
- <input class="categoryid" type="hidden" value="">
- <input class="num" type="hidden" value="">
- <input class="type" type="hidden" value="">
- <input class="twotype" type="hidden" value="">
- <input class="name" type="hidden" value="">
- <input class="page" type="hidden" value="">
- <input class="pageTotal" type="hidden" value="">
- </div>
- <ul>
- <li>
- <p style="text-align:center" num='1'>正在加载中。。。</p>
- </li>
- </ul>
- <div class="nomore">
- 没有更多了。。。
- </div>
- </div>
- </c:if>
-
- </c:forEach>
-
- </div>
- </div>
-
-
-
- <c:if test="${data.pager[0].type == '1' }">
- <a href="#" class="checkCity"><img src="<%=basePath %>app/img/xuanzecs@2x.png"></a>
- </c:if>
- <input id="cityCode" value="" type="hidden"/>
- </div>
- <!-- 城市弹窗 -->
- <div class="cityMask hide">
- <div class="titbox blubg">
- <a class="titreturn left" href="javascript:void(0)" onclick="backper()"><img src="<%=basePath %>app/img/fanhui16@2x.png" alt=""></a>
- <h1>选择城市</h1>
- </div>
- <div class="top50">
- <ul class="cityul">
- <li>
- <a href="#">
- 北京
- <img src="<%=basePath %>app/img/fanh3@2x.png" alt="">
- </a>
- </li>
-
- </ul>
-
- </div>
- </div>
- </body>
- <script src="<%=basePath %>app/lib/swiper-4.3.2.min.js"></script>
- <script type="text/javascript" src="<%=basePath %>res/js/jquery.min.js"></script>
- <script type="text/javascript" src="<%=basePath %>res/js/layer/layer.min.js"></script>
- <script type="text/javascript" src="<%=basePath %>app/js/public.js"></script>
- <script type="text/javascript">
- $(".check").click(function(){
- var num = $(this).find("span").attr("num");
- if(num == "1"){
- $(this).find("span").html("批量推介");
- $(this).find("span").attr("num", "2");
- $(".mycheck").removeClass("hide");
- }else if(num == "2"){
- var ids = "";
- var all = $('input:checkbox[name="checkid"]:checked');
- if(all.length == 0){
- layer.msg("请选择要推介的产品");
- return false;
- }
- all.each(function(index){
- if(index == 0){
- ids += $(this).parent().children('.mid').val();
- }else{
- ids += "," + $(this).parent().children('.mid').val();
- }
- });
-
- window.location.href = '<%=basePath%>web/mgmProduct/recommend.cs?productids=' + ids;
- }
- })
- $(function(){
- // 滚动刷新
-
- if(typeof(kindul) == "undefined"){
- var totalheight=0 ;
- var totalheight2=0 ;
- $(window).unbind('scroll').scroll(function(){
- totalheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop());
- totalheight2=parseInt($(document).height());
-
- // 页数,每页展示10个,请求的地址
- var url = '<%=basePath%>web/mgmProduct/now.cs';
-
- var sslide = $('.swiper-container2 .swiper-wrapper .swiper-slide');
- var products = sslide.eq($('.tabs .default').index());
-
- var baseparam = products.children('.baseparam');
- var categoryid = baseparam.children(".categoryid").val();
- var num = baseparam.children(".num").val();
- var type = baseparam.children(".type").val();
- var twotype = baseparam.children(".twotype").val();
- var page = baseparam.children(".page").val();
- var pageTotal = baseparam.children(".pageTotal").val();
-
- if(parseInt(page)>0 && parseInt(page) < parseInt(pageTotal)){
- products.children(".nomore").text("下拉加载更多");
- }else{
- products.children(".nomore").text("没有更多了。。。");
- }
-
-
- if( totalheight2 == parseInt(totalheight)){
-
- var li = products.children('ul').children('li').eq(0);
- if(li.children('p').attr('num') != '1'){
- if(parseInt(page)>0 && parseInt(page) < parseInt(pageTotal)){
- page = parseInt(page) + 1;
- products.children(".nomore").text("下拉加载更多");
- }else{
- products.children(".nomore").text("没有更多了。。。");
- return false;
-
- }
-
- $.ajax({
- type: 'POST',
- url: url + '?page=' + page + '&ismore=2&categoryid=' + categoryid + '&type='+type+'&num='+num+'&twotype='+twotype+'&cityCode='+$('#cityCode').val(),
- dataType: 'json',
- success: function (data) {
-
- var html="";
- data.forEach(function(value,index,array){
- baseparam.children(".categoryid").val(value.id);
- baseparam.children(".num").val(value.num);
- baseparam.children(".name").val(value.name);
- baseparam.children(".type").val(value.type);
- baseparam.children(".twotype").val(value.twotype);
- baseparam.children(".page").val(value.pager.page);
- baseparam.children(".pageTotal").val(value.pager.pageTotal);
- value.pager.results.forEach(function(value,index,array){
- html += "<li>";
- html += "<a href='<%=basePath%>web/mgmProduct/detail.cs?productid="+value.id+"&plat=H5'>";
- html += "<label class='mycheck hide'>";
- html += "<input type='hidden' class='mid' value='"+value.id+"' />";
- html += "<input type='checkbox' name='checkid' value='1' value='' />";
- html += "<div class='option'></div>";
- html += "</label>";
- html += "<div class='referinfo'>";
- html += "<img src='"+value.productImg +"' alt=''>";
- html += "<div class='referCont'>";
- html += "<p class='refertit'>"+value.productName +"</p>";
- html += "<p>";
- html += "<span class='designation graytxt'>"+value.productRemark +"</span>";
- if(value.commissionRate != '0'){
- html += "<span class='commission'>佣金:"+value.commissionRate+ "%</span>";
- }
- html += "</p>";
- html += "<p>";
- html += "<span class='designation graytxt'>价格:</span>";
- html += "<span class='price'>"+value.productPrice +"</span>";
- html += "</p>";
- html += "<p>";
- html += "<span class='designation graytxt'>类型:</span>";
- html += "<span class='graytxt'>"+value.gc +"</span>";
- html += "</p>";
- html += "</div>";
- html += "</div>";
- html += "</a>";
- html += "<div class='buy'>";
- html += "<a href='<%=basePath %>web/mgmProduct/buyNow.cs?productId="+value.id +"' class='buygo'>立即购买</a>";
- html += "<a href='<%=basePath %>web/mgmProduct/recommend.cs?productids="+value.id+"' class='buyt'>我要推介</a>";
- html += "</div>";
- html += "</li>";
-
- });
- });
- products.children('ul').html(products.children('ul').html() + html);
- $('.tabs .default').click();
- }
- });
- }
- }
- });
- }
- });
-
- $(".checkCity").click(function(){
- $(".cityul").html('');
- $.get('<%=basePath%>area/getProvice.cs',function(data){
- var html = "";
- for(var i in data){
- html += "<li onclick='proclick(\""+data[i].code+"\")'>";
- html += "<a href='javascript:void(0)'>";
- html += data[i].name;
- html += " <img src='<%=basePath %>app/img/fanh3@2x.png' alt=''>";
- html += "</a>";
- html += "</li>";
- }
- $(".cityul").html(html);
- });
- $(".xzMore").hide();
- $(".cityMask").show();
- })
-
- function proclick(code){
- var html = "";
- $.get('<%=basePath%>area/getByParentCode.cs',{'param': code}, function(data){
- for(var i in data){
- html += "<li onclick='cityclick(\""+data[i].code+"\")'>";
- html += "<a href='javascript:void(0)'>";
- html += data[i].name;
- html += " <img src='<%=basePath %>app/img/fanh3@2x.png' alt=''>";
- html += "</a>";
- html += "</li>";
- }
- $(".cityul").html(html);
- });
- }
-
- function cityclick(code){
- $(".xzMore").show();
- $(".cityMask").hide();
- $("#cityCode").val(code);
-
- var sslide = $('.swiper-container2 .swiper-wrapper .swiper-slide');
- var products = sslide.eq($('.tabs .default').index());
- var baseparam = products.children('.baseparam');
-
- var categoryid = baseparam.children(".categoryid").val();
- var num = baseparam.children(".num").val();
- var name = baseparam.children(".name").val();
- var type = baseparam.children(".type").val();
- var twotype = baseparam.children(".twotype").val();
- var page = baseparam.children(".page").val();
- var pageTotal = baseparam.children(".pageTotal").val();
- //最后一个参数是1代表是城市首次检索
- replace(categoryid, num, type, twotype, '2', '1', name, '1');
- }
-
- function backper(){
- $(".xzMore").show();
- $(".cityMask").hide();
- }
-
-
-
-
- var mySwiper2 = new Swiper('.xzMore .swiper-container2',{
- autoHeight: true,
- on:{
- slideChangeTransitionStart: function(){
- $(".tabs .default").removeClass('default');
- $(".tabs li").eq(mySwiper2.activeIndex).addClass('default');
- var iobj = $('.tabs .default');
- if(typeof(iobj) != "undefined"){
- var categoryid = iobj.children("#categoryid").val();
- var num = iobj.children("#num").val();
- var type = iobj.children("#type").val();
- var twotype = iobj.children("#twotype").val();
- var name = iobj.children("#name").val();
- //最后一个参数是1代表是城市首次检索
- replace(categoryid, num, type, twotype, "2", "1", name, '0');
- }else{
- var name = iobj.children("#name").val();
- $("#h1name").text(name);
- }
-
- //每次滑动页面初始化多选按钮
- $("input:checkbox").removeAttr("checked");
- $(".mycheck").removeClass("hide");
- $(".mycheck").addClass("hide");
- $(".check").find("span").html("多选推介");
- $(".check").find("span").attr("num", "1");
- //上面导航列表同时滚动
- var w = 0;
- $(".tabs li").each(function(){
- w = w + $(this).width();
- if($(this).attr('class').indexOf('default') >= 0){
- return false;
- }
- });
- $(".scrollNav").scrollLeft(w);
- }
- }
- });
- $(".tabs li").click(function(e){
- e.preventDefault();
- $(".tabs .default").removeClass('default');
- $(this).addClass('default');
- mySwiper2.slideTo($(this).index());
- });
- $(".tabs li").click(function(e){
- e.preventDefault();
- });
- </script>
- </html>
|