412 lines
15 KiB
HTML
412 lines
15 KiB
HTML
<!doctype html>
|
||
<html>
|
||
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width" />
|
||
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
|
||
<title>批发订单</title>
|
||
<link rel="stylesheet" type="text/css" href="/css/api.css" />
|
||
<link rel="stylesheet" type="text/css" href="/css/content.css" />
|
||
<link rel="stylesheet" type="text/css" href="/css/switch.css" />
|
||
<script type="text/javascript" src="/scripts/jquery-2.0.2.min.js"></script>
|
||
<script type="text/javascript" src="/scripts/jquery.cookie.min.js"></script>
|
||
<script type="text/javascript" src="/scripts/iscroll.js"></script>
|
||
<script type="text/javascript" src="/script/main.js?t=0"></script>
|
||
<script type="text/javascript" src="/layer/layer.js"></script>
|
||
<script type="text/javascript" src="/Scripts/long.js"></script>
|
||
<script type="text/javascript" src="/script/moment.js"></script>
|
||
<script type="text/javascript" src="/script/api.js"></script>
|
||
<style type="text/css">
|
||
html, body {
|
||
overflow: hidden;
|
||
}
|
||
|
||
#wrapper {
|
||
flex: 1;
|
||
overflow-y: auto;
|
||
-webkit-overflow-scrolling: touch;
|
||
}
|
||
|
||
.pullDown {
|
||
position: absolute;
|
||
top: -1.25rem;
|
||
left: 0;
|
||
width: 100%;
|
||
z-index: 100;
|
||
text-align: center;
|
||
display: none;
|
||
}
|
||
|
||
.pullUp {
|
||
position: absolute;
|
||
bottom: -1.25rem;
|
||
left: 0;
|
||
width: 100%;
|
||
z-index: 100;
|
||
text-align: center;
|
||
display: none;
|
||
}
|
||
|
||
.pullDown.loading, .pullUp.loading, .pullDown.refresh, .pullUp.refresh {
|
||
display: block;
|
||
}
|
||
</style>
|
||
<script type="text/javascript">
|
||
var userId = null;
|
||
var LoginId = null;
|
||
var CartId = null;
|
||
var opentimes = null;
|
||
var t = 1;
|
||
var AutoPay = 0;
|
||
var myScroll = null;
|
||
var pullDown = 1; // 下拉刷新避免多次执行
|
||
var pullUp = 1; // 上拉加载避免多次执行
|
||
var downHeight = 0;
|
||
var upHeight = 0;
|
||
var isload = true;//设置是否终止滚动加载
|
||
var curScrollHeight = 0;//当前滚动位置
|
||
var curCount = 1;//计数器,防止滚动时重复执行加载下一页
|
||
$(document).ready(function () {
|
||
userId = getlocalStorage("userId");
|
||
LoginId = getlocalStorage("LoginId");
|
||
CartId = getlocalStorage("CartId");
|
||
/*$(".tab a").on("click", function () {
|
||
var num = $(this).index();
|
||
$(this).addClass("on").siblings().removeClass("on");
|
||
t = num;
|
||
rdata(1);
|
||
$("#wrapper").animate({ scrollTop: 0 }, 500);
|
||
});*/
|
||
var dParam = $.getUrlParam("t");
|
||
if (dParam != null) {
|
||
t = dParam;
|
||
}
|
||
//$(".tab a").eq(t).addClass("on").siblings().removeClass("on");
|
||
opentimes = setInterval(function () {
|
||
var selectqydatas = getlocalStorage("yydd_refresh");
|
||
if (selectqydatas != null) {
|
||
rdata(1);
|
||
clearlocalStorage("yydd_refresh");
|
||
}
|
||
}, 1000);
|
||
rdata(1);
|
||
|
||
|
||
|
||
|
||
});
|
||
function onScroll() {
|
||
if (myScroll != null) {
|
||
myScroll.destroy();
|
||
myScroll = null;
|
||
}
|
||
myScroll = new IScroll('#wrapper', {
|
||
probeType: 2,
|
||
fadeScrollbars: false
|
||
});
|
||
|
||
|
||
myScroll.on('scroll', function () {
|
||
var y = myScroll.y;
|
||
downHeight = $(".pullDown").height();
|
||
upHeight = $(".pullUp").height();
|
||
// 下拉加载
|
||
if (y >= downHeight && pullDown) {
|
||
$(".pullDown").addClass("refresh").html("松开刷新...");
|
||
myScroll.minScrollY = downHeight;
|
||
pullDown = 0;
|
||
}
|
||
if (y <= downHeight && y >= 0 && !pullDown) {
|
||
$(".pullDown").removeClass("refresh").html("下拉刷新...");
|
||
pullDown = 1;
|
||
myScroll.minScrollY = 0;
|
||
}
|
||
|
||
// 上拉刷新
|
||
var maxHeight = myScroll.maxScrollY;
|
||
if (y < (maxHeight - upHeight) && pullUp) {
|
||
$(".pullUp").addClass("loading").html("松开加载...");
|
||
myScroll.maxScrollY = maxHeight - upHeight;
|
||
pullUp = 0;
|
||
}
|
||
if (y > maxHeight && y < (maxHeight + upHeight) && !pullUp) {
|
||
$(".pullUp").removeClass("loading").html("上拉加载...");
|
||
myScroll.maxScrollY = maxHeight + upHeight;
|
||
pullUp = 1;
|
||
}
|
||
});
|
||
|
||
myScroll.on('scrollEnd', function () {
|
||
if ($(".pullDown").hasClass("refresh")) {
|
||
$(".pullDown").text("正在刷新...");
|
||
opentimes = setTimeout(function () {
|
||
clearInterval(opentimes);
|
||
rdata(1);
|
||
$(".pullDown").removeClass("refresh").html("下拉刷新...");
|
||
pullDown = 1;
|
||
myScroll.refresh();
|
||
}, 2000);
|
||
|
||
}
|
||
|
||
if ($(".pullUp").hasClass("loading")) {
|
||
$(".pullUp").text("正在加载...");
|
||
opentimes = setTimeout(function () {
|
||
clearInterval(opentimes);
|
||
rdata(0);
|
||
myScroll.refresh();
|
||
}, 1000);
|
||
}
|
||
});
|
||
|
||
myScroll.on('refresh', function () {
|
||
$(".pullUp").removeClass("loading").html("上拉加载...");
|
||
pullUp = 1;
|
||
});
|
||
}
|
||
function onScroll0() {
|
||
isload = true;//设置是否终止滚动加载
|
||
curScrollHeight = 0;//当前滚动位置
|
||
curCount = 1;//计数器,防止滚动时重复执行加载下一页
|
||
$("#wrapper").scroll(function () {
|
||
var pageHeight = $("#sysnew").height();
|
||
var showHeight = $("#wrapper").height();
|
||
var scrollHeight = $("#wrapper").scrollTop();
|
||
|
||
if (curScrollHeight - scrollHeight < 10 && curScrollHeight > 0) {
|
||
if (curCount == 1 && isload) {
|
||
|
||
rdata(0);
|
||
}
|
||
curCount++; //加载下一页后计数器+1
|
||
}
|
||
if (curScrollHeight < scrollHeight) {
|
||
curScrollHeight = pageHeight - showHeight;//滚动到页面底部时,重设当前滚动位置
|
||
curCount = 1;
|
||
}
|
||
|
||
});
|
||
}
|
||
|
||
function rdata(ag) {
|
||
userId = getlocalStorage("userId");
|
||
LoginId = getlocalStorage("LoginId");
|
||
var Start = $("#sysnew .databox").length;
|
||
if (ag == 1) {
|
||
Start = 0;
|
||
}
|
||
$(".ajaxLoader").removeClass("uhide");
|
||
$.ajax({
|
||
type: 'GET',
|
||
url: "/apiajax.ashx",
|
||
data: "&action=getyyddlist&ifweb=1&t=" + t + "&Start=" + Start + "&userId=" + (userId != null ? userId : "") + "&LoginId=" + (LoginId != null ? LoginId : ""),
|
||
dataType: "JSON",
|
||
error: function (xhr, type) {
|
||
tishi3("发生错误:" + JSON.stringify(xhr));
|
||
},
|
||
success: function (data) {
|
||
|
||
|
||
if (data) {
|
||
if (data.status == 1) {
|
||
if (ag == 1) {
|
||
if (t == 0) {
|
||
$("#mjbox").removeClass("uhide");
|
||
$("#tsmsg").removeClass("uhide");
|
||
} else {
|
||
$("#mjbox").addClass("uhide");
|
||
$("#tsmsg").addClass("uhide");
|
||
}
|
||
AutoPay = data.AutoPay;
|
||
//$("#tsmsg").html(data.tsmsg);
|
||
//getAutoPay();
|
||
}
|
||
var html = "";
|
||
if (data.data.length > 0) {
|
||
var html = "";
|
||
for (i = 0; i < data.data.length; i++) {
|
||
var bifshow = 0;
|
||
if (ag == 0) {
|
||
if ($("#databox_" + data.data[i].id).length == 0) {
|
||
bifshow = 1;
|
||
}
|
||
} else {
|
||
bifshow = 1;
|
||
}
|
||
if (bifshow == 1) {
|
||
html += addMsg(data.data[i]);
|
||
|
||
}
|
||
}
|
||
if (ag == 1 || ag == 2) {
|
||
$("#sysnew").html(html);
|
||
if (ag == 1) {
|
||
onScroll0();
|
||
}
|
||
} else {
|
||
$("#sysnew").append(html);
|
||
}
|
||
|
||
$(".more_box").html("");
|
||
} else {
|
||
if (Start > 0) {
|
||
if (Start > 10) {
|
||
$(".more_box").html("亲!找不到更多了");
|
||
}
|
||
} else {
|
||
$('#sysnew').html("");
|
||
$(".more_box").html("亲,暂无信息!");
|
||
}
|
||
}
|
||
$(".ajaxLoader").addClass("uhide");
|
||
} else {
|
||
|
||
tishi3(data.msg);
|
||
$(".ajaxLoader").addClass("uhide");
|
||
if (data.msg == "您未登录") {
|
||
//$api.rmStorage("userId");
|
||
//$api.rmStorage("LoginId");
|
||
}
|
||
}
|
||
} else {
|
||
tishi3("网络错误!");
|
||
$(".ajaxLoader").addClass("uhide");
|
||
}
|
||
}
|
||
});
|
||
|
||
}
|
||
function addMsg(param) {
|
||
var html = '';
|
||
|
||
html = '<div class="datas-item" id="databox_' + param.id + '" onclick="onview(' + param.id + ',\'' + param.strseef + '\',' + param.orderid + ')">'
|
||
|
||
+ '<div class="name">'
|
||
+ '<div>¥' + param.money0 + '</div>'
|
||
+ '<div class="time">' + judgetime(param.time1) + '</div>'
|
||
+ '</div>'
|
||
+ '<div class="zt">' + param.strseef + '</div>'
|
||
+ '<div class="faifeito">'
|
||
+ '<image src="../image/faifeito.png"></image>'
|
||
+ '</div>'
|
||
+ '</div>';
|
||
|
||
return html;
|
||
}
|
||
function onview(id, seef, orderid) {
|
||
if (orderid > 0) {
|
||
onlink("myorders_info.html?orderid=" + orderid);
|
||
} else {
|
||
onlink("yydd_view.html?id=" + id);
|
||
}
|
||
}
|
||
|
||
function onkeyword() {
|
||
var key = fTrim($api.val($api.dom("#keyword0")));
|
||
if (key != "") {
|
||
$api.setStorage("search_keyword", key);
|
||
onlink("mobile/shop_search.html");
|
||
} else {
|
||
tishi3("搜索关键字不能为空");
|
||
}
|
||
}
|
||
function onSwitch() {
|
||
if ($(".am-switch").hasClass("am-active")) {
|
||
AutoPay = 0;
|
||
} else {
|
||
AutoPay = 1;
|
||
}
|
||
onSetAutoPay();
|
||
}
|
||
function getAutoPay() {
|
||
if (AutoPay == 1) {
|
||
$(".am-switch").addClass("am-active");
|
||
} else {
|
||
$(".am-switch").removeClass("am-active");
|
||
}
|
||
}
|
||
function onSetAutoPay() {
|
||
var autotit = "取消";
|
||
if (AutoPay == 1) {
|
||
autotit = "授权";
|
||
}
|
||
var index_ = layer.confirm("您确认是否要" + autotit + "LC自动付款?", {
|
||
title: autotit + "提示",
|
||
btn: ['是', '否'] //按钮
|
||
}, function () {
|
||
|
||
$.ajax({
|
||
type: 'POST',
|
||
url: "/apiajax.ashx?ifweb=1",
|
||
data: { "action": "SetAutoPay", "userId": encodeURI(userId), "LoginId": encodeURI(LoginId), "IFAuto": AutoPay },
|
||
//data: "&action=login&username=" + username + "&password=" + psd + "&ttype=" + t,
|
||
dataType: "json",
|
||
error: function (xhr) {
|
||
tishi3("发生错误:" + JSON.stringify(xhr));
|
||
},
|
||
success: function (data) {
|
||
|
||
layer.close(index_);
|
||
if (data) {
|
||
if (data.status == 1) {
|
||
tishi3(data.msg);
|
||
AutoPay = data.AutoPay;
|
||
getAutoPay();
|
||
} else {
|
||
tishi3(data.msg);
|
||
}
|
||
} else {
|
||
tishi3("网络异常,请稍后重试")
|
||
}
|
||
}
|
||
});
|
||
}, function () {
|
||
layer.close(index_);
|
||
rdata(1);
|
||
}
|
||
);
|
||
}
|
||
</script>
|
||
</head>
|
||
|
||
<body class="wrap">
|
||
<header>
|
||
<!--<div class="tab flex-around">
|
||
<a class="on">新零售订单</a>
|
||
<a>批发订单</a>
|
||
|
||
|
||
</div>-->
|
||
|
||
<a>批发订单</a>
|
||
</header>
|
||
<section class="ub-f1" id="wrapper">
|
||
<div id="wrapper_content">
|
||
<p class="pullDown">下拉刷新...</p>
|
||
|
||
<div class="clear"></div>
|
||
<div class="ub ub-ver datas-box" id="sysnew">
|
||
|
||
</div>
|
||
<div class="clear"></div>
|
||
<div class="more_box"></div>
|
||
<div class="clear"></div>
|
||
<p class="pullUp">上拉加载...</p>
|
||
|
||
</div>
|
||
|
||
</section>
|
||
<footer>
|
||
<iframe name="footer" src="footer.html?t=1" style="width:100%;height:100%;" frameBorder="0" scrolling="no"></iframe>
|
||
</footer>
|
||
<div class="ajaxLoader ub ub-ac uhide" onclick="reload()">
|
||
<div class="ub ub-ac ub-ver"><img src="image/load.gif" /><br>正在加载...</div>
|
||
</div>
|
||
|
||
</body>
|
||
|
||
|
||
|
||
</html>
|