<%@ page language="java" contentType="text/html; charset=UTF-8"
|
pageEncoding="UTF-8"%>
|
<%@ page import="java.util.*" %>
|
<%@ page import="java.math.*" %>
|
<%@ page import="com.yeshi.fanli.entity.bus.clazz.GoodsSecondClass" %>
|
<%@ page import="com.yeshi.fanli.entity.taobao.TaoBaoCoupon" %>
|
<%@ page import="com.yeshi.fanli.util.NumberUtil"%>
|
<%@ page import="com.yeshi.fanli.util.StringUtil"%>
|
<%@ page import="com.yeshi.fanli.util.BigDecimalUtil"%>
|
<!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>优惠券商品</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" />
|
<link href="//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
|
</head>
|
<style>
|
.wuxiao{
|
color: #999999;
|
text-decoration:line-through;
|
float: left;
|
}
|
.hongbao{
|
padding-left: 31px;
|
}
|
.returnTop{
|
border: 1px solid #999;
|
width: 40px;
|
height: 40px;
|
line-height: 36px;
|
text-align: center;
|
position: absolute;
|
bottom: 20px;
|
right: 20px;
|
z-index: 10;
|
color: #999;
|
font-size: 20px;
|
border-radius: 50%;
|
}
|
</style>
|
<body id="bid">
|
<div id="scrollTop" class="returnTop fa fa-chevron-up">
|
</div>
|
<div id="pullrefresh" class="mui-content mui-scroll-wrapper">
|
<div class="mui-scroll">
|
<ul class="list">
|
<%
|
List<TaoBaoCoupon> couponList = (List<TaoBaoCoupon>) request.getAttribute("couponList");
|
String proportion = (String)request.getAttribute("proportion");
|
double propDouble = Double.parseDouble(proportion);
|
BigDecimal propBig = new BigDecimal((double)(propDouble/100));
|
int lenth = couponList.size();
|
for(int i=0;i<lenth;i++){
|
TaoBaoCoupon tb = couponList.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){
|
cl="tm tb";
|
type="淘宝";
|
}else{
|
type = "天猫";
|
cl="tm";
|
}
|
String baoyou="";
|
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>
|
<%
|
BigDecimal quanPrice = tb.getQuanPrice();
|
BigDecimal zkPrice = tb.getZkPrice();
|
if(quanPrice.doubleValue() > 0 ){
|
%>
|
<p class="Price">券后价¥<i><%=NumberUtil.subZeroAndDot(((Double)quanPrice.doubleValue()).toString()) %></i></p>
|
<p class="Price wuxiao" ><%=NumberUtil.subZeroAndDot(((Double)zkPrice.doubleValue()).toString()) %></p>
|
<p class="Price hongbao">布心红包:¥<%=NumberUtil.subZeroAndDot(((BigDecimal)BigDecimalUtil.mul(quanPrice,propBig)).toString())%></p>
|
<%
|
}else{
|
|
%>
|
<p class="Price">¥<i><%=NumberUtil.subZeroAndDot(((Double)zkPrice.doubleValue()).toString()) %></i></p>
|
<p class="Price p2">布心红包:¥<i><%=NumberUtil.subZeroAndDot(((BigDecimal)BigDecimalUtil.mul(zkPrice,propBig)).toString())%></i></p>
|
<%
|
}
|
%>
|
<span>月销量:<%=sumStr %></span><span class="by"><%=baoyou%></span>
|
</div>
|
</a>
|
</li>
|
<%
|
}
|
%>
|
</ul>
|
</div>
|
</div>
|
<li class="no-border-t mubanli1" style="display: none;">
|
<a href="#">
|
<img />
|
<div class="text">
|
<span class="itype">
|
天猫
|
</span>
|
<strong></strong>
|
<p class="Price p1">¥<i></i></p>
|
<p class="Price p2">布心红包:¥<i></i></p>
|
<span class="yxl"></span><span class="by">包邮</span>
|
</div>
|
</a>
|
</li>
|
<li class="no-border-t mubanli2" style="display: none;">
|
<a href="#">
|
<img src="" />
|
<div class="text">
|
<span class="itype">
|
</span>
|
<strong></strong>
|
<p class="Price p1">券后价¥<i></i></p>
|
<p class="Price wuxiao" ></p>
|
<p class="Price hongbao">布心红包:¥</p>
|
<span class="yxl"></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 html1 = $(".mubanli1").prop("outerHTML");
|
var html2 = $(".mubanli2").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 count=10;
|
function pullupRefresh() {
|
var curWwwPath=window.document.location.href;
|
var flag=false;
|
setTimeout(function() {
|
if(flag){
|
return;
|
}
|
flag=true;
|
mui('#pullrefresh').pullRefresh().endPullupToRefresh((count < 10));
|
$.post("../client/getConpon",{"page":nextpage},function(data){
|
nextpage++;
|
if(data.code==0){
|
var tblist = data.data.taoBaoCouponList;
|
var proportion = data.data.proportion;
|
var len =tblist.length;
|
count=len;
|
var base64 = new Base64();
|
for (var i=0;i<len;i++) {
|
var tb = tblist[i];
|
var type = tb.type;
|
var cls="";
|
if(type==0){
|
type="淘宝";
|
cls="tm tb";
|
}else if(type==1){
|
type="天猫";
|
cls="tm";
|
}else{
|
type="";
|
}
|
var title = tb.title;
|
var entitle=base64.encode(title);
|
var zk = tb.zkPrice;
|
var quanPrice = tb.quanPrice;
|
var xl = tb.biz30day;
|
var auctionUrl = tb.auctionUrl;
|
if(xl >= 10000){
|
xl = (xl/10000).toFixed(2)+"万";
|
}
|
if(quanPrice > 0 ){
|
$('.list').append(html2);
|
var $curli = $('.list li:last');
|
$curli.find(".p1 i").text(parseFloat(quanPrice));
|
$curli.find(".wuxiao").text(parseFloat(zk));
|
$curli.find(".hongbao").text("布心红包:¥"+parseFloat(quanPrice * proportion/100));
|
$curli.removeClass("mubanli2");
|
}else{
|
$('.list').append(html1);
|
var $curli = $('.list li:last');
|
$curli.find(".p1 i").text(parseFloat(zk));
|
$curli.find(".p2 i").text(parseFloat(zk * proportion/100));
|
$curli.removeClass("mubanli1");
|
}
|
var by = "包邮";
|
$curli.find("a").attr("href","yestv://getgoodsdetail#"+tb.auctionId+"#"+auctionUrl+"#"+entitle);
|
$curli.find("img").attr("src",tb.pictUrl);
|
$curli.find(".itype").text(type);
|
$curli.find(".itype").addClass(cls);
|
$curli.find("strong").text(title);
|
$curli.find(".yxl").text("月销量:"+xl);
|
$curli.find(".by").text(by);
|
$curli.css("display","flex");
|
|
$curli.find("a").bind("tap",function(){
|
location.href=this.href;
|
});
|
}
|
}
|
flag=false;
|
mui('#pullrefresh').pullRefresh().endPullupToRefresh();
|
$('.list').find($('img')).height(imgH);
|
},'json');
|
},1000);
|
}
|
</script>
|
<script>
|
var imgH = $('.list li:first-of-type a').find($('img')).width();
|
$('.list').find($('img')).height(imgH);
|
$('.list').find($('img')).width(imgH);
|
|
// var imgH = $('.list li ').height();
|
// $('.list li').height(imgH);
|
|
$('#scrollTop').on('tap',function(){
|
mui('#pullrefresh').pullRefresh().scrollTo(0, 0, 400);//滚动到顶部
|
})
|
</script>
|
</html>
|