<%@page import="java.math.BigDecimal"%>
|
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
pageEncoding="UTF-8"%>
|
<%@ page import="java.util.*" %>
|
<%@ page import="com.yeshi.fanli.entity.bus.clazz.GoodsSecondClass" %>
|
<%@ page import="com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra" %>
|
<%@ page import="com.yeshi.fanli.util.NumberUtil"%>
|
<%@ page import="com.yeshi.fanli.util.StringUtil"%>
|
<!DOCTYPE html>
|
<html>
|
|
<head>
|
<meta charset="utf-8">
|
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
|
<title><%=request.getAttribute("title")%></title>
|
<link href="../client/css/mui.min.css" rel="stylesheet" />
|
<link rel="stylesheet" type="text/css" href="../client/css/base.css" />
|
<link rel="stylesheet" type="text/css" href="../client/css/style.css" />
|
</head>
|
|
<body>
|
<div id="pullrefresh" class="mui-content mui-scroll-wrapper">
|
<div class="mui-scroll">
|
<ul class="cont">
|
<%
|
List<GoodsSecondClass> goodsSecondClassList = (List<GoodsSecondClass>) request.getAttribute("goodsSecondClassList");
|
int len = goodsSecondClassList.size();
|
int slen=len-1;
|
if(len > 8){
|
slen=7;
|
}
|
for(int i=0;i<len;i++){
|
GoodsSecondClass gsc=goodsSecondClassList.get(i);
|
if(i<8){
|
%>
|
<li>
|
<a href="yestv://cate#<%=gsc.getId()%>#<%=StringUtil.getBase64String(gsc.getName())%>">
|
<img src="<%=gsc.getPicture() %>"/>
|
<p><%=gsc.getName()%></p>
|
</a>
|
</li>
|
<% }
|
else{
|
%>
|
<li style="display: none;">
|
<a href="yestv://cate#<%=gsc.getId()%>#<%=StringUtil.getBase64String(gsc.getName())%>">
|
<img src="<%=gsc.getPicture() %>"/>
|
<p><%=gsc.getName()%></p>
|
</a>
|
</li>
|
<%
|
}
|
}
|
%>
|
<!--<li>
|
<a href="#">
|
<img src="http://buxinimg.oss-cn-qingdao.aliyuncs.com/Tæ¤.png" />
|
<p>收起</p>
|
</a>
|
</li>-->
|
</ul>
|
<!--今日热门-->
|
<div class="title">
|
<h4>
|
今日热门
|
<i></i>
|
<i></i>
|
</h4>
|
</div>
|
<ul class="list">
|
<%
|
List<TaoBaoGoodsBriefExtra> taoBaoGoodsBriefExtraList= (List<TaoBaoGoodsBriefExtra>) request.getAttribute("taoBaoGoodsBriefExtraList");
|
int lenth = taoBaoGoodsBriefExtraList.size();
|
for(int i=0;i<lenth;i++){
|
TaoBaoGoodsBriefExtra tb = taoBaoGoodsBriefExtraList.get(i);%>
|
<li class="no-border-t">
|
<a href="yestv://getgoodsdetail#<%=tb.getAuctionId()%>#<%=tb.getAuctionUrl()%>#<%=StringUtil.getBase64String(tb.getTitle())%>">
|
<img src="<%=tb.getPictUrl()%>"/>
|
<div class="text">
|
<%
|
String type="";
|
String cl="";
|
if(tb.getShopType()==0){
|
type="";
|
}else if(tb.getShopType()==1){
|
type="淘宝";
|
cl="tm tb";
|
}else if(tb.getShopType()==2){
|
type = "天猫";
|
cl="tm";
|
}
|
boolean b = tb.isBaoyou();
|
String baoyou="";
|
if(b){
|
baoyou="包邮";
|
}
|
String sumStr="";
|
int sum =tb.getBiz30day();
|
if(sum >= 10000){
|
double sumDou=(double)sum/10000;
|
String sd = NumberUtil.get2PointNumber(sumDou);
|
sumStr = sd+"万";
|
}else{
|
sumStr = sum+sumStr;
|
}
|
%>
|
<span class="<%=cl%>">
|
<%=type %>
|
</span>
|
<strong><%=tb.getTitle() %></strong>
|
<p class="Price">¥<i><%=NumberUtil.subZeroAndDot(((BigDecimal)tb.getZkPrice()).toString()) %></i></p>
|
<p class="Price p2">布心红包:¥<i><%=NumberUtil.subZeroAndDot(((BigDecimal)(tb.getTaoBaoHongBaoInfo().getHongbao())).toString()) %></i></p>
|
<span>月销量:<%=sumStr %></span><span class="by"><%=baoyou%></span>
|
</div>
|
</a>
|
</li>
|
<%
|
}
|
%>
|
</ul>
|
</div>
|
</div>
|
<li class="no-border-t mubanli" style="display: none;">
|
<a href="#">
|
<img />
|
<div class="text">
|
<span class="itype">
|
天猫
|
</span>
|
<strong>加厚皮毛一体超级质感夹克</strong>
|
<p class="Price p1">¥<i>108</i></p>
|
<p class="Price p2">布心红包:¥<i>2</i></p>
|
<span class="yxl">月销量2.1万</span><span class="by">包邮</span>
|
</div>
|
</a>
|
</li>
|
</body>
|
<script src="../client/js/mui.min.js"></script>
|
<script type="text/javascript" src="../client/js/jquery-3.1.1.min.js" ></script>
|
<script src="../client/js/base64.js"></script>
|
<script>
|
var html = $(".mubanli").prop("outerHTML");
|
mui.init({
|
pullRefresh: {
|
container: '#pullrefresh',
|
down: {
|
callback: pulldownRefresh
|
},
|
up: {
|
contentrefresh: '正在加载...',
|
callback: pullupRefresh
|
}
|
}
|
});
|
var nextpage=2;
|
/*下拉刷新具体业务实现 */
|
function pulldownRefresh() {
|
setTimeout(function() {
|
location.replace(location.href);
|
mui('#pullrefresh').pullRefresh().endPulldownToRefresh();
|
// var str = '';
|
// for (var i = 0; i < 10; i++) {
|
// str += '<li class="no-border-t">'
|
// +'<a href="#">'
|
// +'<img src="img/list.jpg" />'
|
// +'<div class="text">'
|
// +'<span class="tm">'
|
// +'天猫'
|
// +'</span>'
|
// +'<strong>加厚皮毛一体超级质感夹克</strong>'
|
// +'<p class="Price">¥<i>108</i></p>'
|
// +'<p class="Price">蜜朵红包:¥2</p>'
|
// +'<span>月销量2.1万</span><span class="by">包邮</span>'
|
// +'</div>'
|
// +'</a>'
|
// +'</li>';
|
// }
|
// $('.list').html(str);
|
});
|
}
|
/*上拉加载具体业务实现 */
|
var count=10;
|
function pullupRefresh() {
|
var curWwwPath=window.document.location.href;
|
var key = getArgsFromHref(curWwwPath,"key");
|
key=decodeURI(key);
|
var flag=false;
|
setTimeout(function() {
|
if(flag){
|
return;
|
}
|
flag=true;
|
// mui('#pullrefresh').pullRefresh().endPullupToRefresh((count < 10));
|
$.post("../client/getHotGoods",{"key":key,"page":nextpage},function(data){
|
nextpage++;
|
if(data.code==0){
|
var tblist = data.data;
|
var len =tblist.length;
|
count=len;
|
// var html = $(".mubanli").prop("outerHTML");
|
var base64 = new Base64();
|
for (var i=0;i<len;i++) {
|
var tb = tblist[i];
|
var type = tb.shopType;
|
var cls="";
|
if(type==0){
|
type="";
|
}else if(type==1){
|
type="淘宝";
|
cls="tm tb";
|
}else if(type==2){
|
type="天猫";
|
cls="tm";
|
}
|
var title = tb.title;
|
var entitle=base64.encode(title);
|
var zk = tb.zkPrice;
|
var hb = tb.taoBaoHongBaoInfo.hongbao;
|
var xl = tb.biz30day;
|
var auctionUrl = tb.auctionUrl;
|
if(xl >= 10000){
|
xl = (xl/10000).toFixed(2)+"万";
|
}
|
var by = tb.baoyou?"包邮":"";
|
$('.list').append(html);
|
var $curli = $('.list li:last');
|
$curli.find("a").attr("href","yestv://getgoodsdetail#"+tb.auctionId+"#"+auctionUrl+"#"+entitle);
|
// $curli.find("a").attr("href","http://www.baidu.com");
|
$curli.find("img").attr("src",tb.pictUrl);
|
$curli.find(".itype").text(type);
|
$curli.find(".itype").addClass(cls);
|
$curli.find("strong").text(title);
|
$curli.find(".p1 i").text(parseFloat(zk));
|
$curli.find(".p2 i").text(parseFloat(hb));
|
$curli.find(".yxl").text("月销量:"+xl);
|
$curli.find(".by").text(by);
|
$curli.css("display","flex");
|
$curli.removeClass("mubanli");
|
|
$curli.find("a").bind("tap",function(){
|
location.href=this.href;
|
});
|
}
|
}
|
flag=false;
|
mui('#pullrefresh').pullRefresh().endPullupToRefresh();
|
$('.list').find($('img')).height(imgH);
|
$('.list').find($('img')).width(imgH);
|
},'json');
|
},1000);
|
}
|
</script>
|
<script>
|
function getArgsFromHref(sHref, sArgName) {
|
var args = sHref.split("?");
|
var retval = "";
|
|
if(args[0] == sHref) /*参数为空*/ {
|
return retval; /*无需做任何处理*/
|
}
|
var str = args[1];
|
args = str.split("&");
|
for(var i = 0; i < args.length; i++) {
|
str = args[i];
|
var arg = str.split("=");
|
if(arg.length <= 1) continue;
|
if(arg[0] == sArgName) retval = arg[1];
|
}
|
return retval;
|
}
|
</script>
|
<script>
|
var imgH = $('.list li:first-of-type a').find($('img')).width();
|
$('.list').find($('img')).height(imgH);
|
$('.list').find($('img')).width(imgH);
|
$(function(){
|
$($("a").not($(".cont a")[7])).bind('tap',function(){document.location.href=this.href});
|
var len = $('.cont li').length;
|
if(len >= 8){
|
$(".cont li").eq(7).addClass("active");
|
$('.cont a').eq(7).bind('tap',function(){document.location.href != this.href});
|
}
|
$(".cont li:last").css("display","none");
|
var arr = [];
|
if(len >= 8){
|
for (var i = 0; i < len; i++) {
|
if(i>=8){
|
arr.push(i);
|
$('.cont').find($('li').eq(7)).find('p').html('更多');
|
$('.cont').find($('li').eq(7)).find('img').attr("src","../client/img/more.png");
|
$('.cont').find($('li').eq(i)).hide();
|
$('.active').on('tap', function(){
|
$('.cont').find($('li')).show();
|
$('.cont').find($('li').eq(7)).find('p').html('<%=goodsSecondClassList.get(slen).getName()%>');
|
$('.cont').find($('li').eq(7)).find('img').attr("src","<%=goodsSecondClassList.get(slen).getPicture()%>");
|
$('.cont a').eq(7).bind('tap',function(){document.location.href = this.href});
|
});
|
// $('.cont').on('tap','li:last-of-type',function(){
|
// for (var j = 0; j < arr.length; j++) {
|
// $('.cont').find($('li').eq(arr[j])).hide();
|
// $('.cont').find($('li').eq(7)).find('p').html('更多');
|
// }
|
// $('.cont a').eq(7).bind('tap',function(){alert(1)});
|
// });
|
}
|
}
|
}
|
|
});
|
</script>
|
</html>
|