539 lines
21 KiB
HTML
539 lines
21 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" />
|
|
<script type="text/javascript" src="/scripts/jquery-3.4.1.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/area.js?t=0"></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;
|
|
}
|
|
|
|
.dbtnbox {
|
|
margin: 0 auto;
|
|
width: 100%;
|
|
text-align: center;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.dbtnbox input[type='button'] {
|
|
height: 3.5em;
|
|
line-height: 3.5em;
|
|
border-radius: 0;
|
|
}
|
|
|
|
.uploadpic_btn {
|
|
position: absolute;
|
|
width: 5em;
|
|
height: 5em;
|
|
right: 0;
|
|
top: 0;
|
|
opacity: 0;
|
|
filter: alpha(opacity=0);
|
|
}
|
|
</style>
|
|
<script type="text/javascript">
|
|
var userId = null;
|
|
var LoginId = null;
|
|
var CartId = null;
|
|
var opentimes = null;
|
|
var strguiges = null;
|
|
var ZSubTotal = 0;
|
|
var yunfeis = null;
|
|
var yunfei = 0;
|
|
var peitype = 0, addressId = 0;
|
|
var id = 0, viewId = 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");
|
|
strguiges = getlocalStorage("strguiges");
|
|
var dParam = $.getUrlParam("id");
|
|
if (dParam != null) {
|
|
id = dParam;
|
|
}
|
|
dParam = $.getUrlParam("viewId");
|
|
if (dParam != null) {
|
|
viewId = dParam;
|
|
}
|
|
opentimes = setInterval(function () {
|
|
var selectaddress = getlocalStorage("yydd_lqcp0_selectaddress")
|
|
if (selectaddress != null) {
|
|
var aaddress = selectaddress.split(",");
|
|
showAdr(aaddress[0], aaddress[1], aaddress[2], aaddress[3], aaddress[4], aaddress[5], aaddress[6]);
|
|
clearlocalStorage("yydd_lqcp0_selectaddress");
|
|
}
|
|
}, 1000);
|
|
rdata();
|
|
});
|
|
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();
|
|
$(".pullDown").removeClass("refresh").html("下拉刷新...");
|
|
pullDown = 1;
|
|
myScroll.refresh();
|
|
}, 2000);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
myScroll.on('refresh', function () {
|
|
$(".pullUp").removeClass("loading").html("上拉加载...");
|
|
pullUp = 1;
|
|
});
|
|
}
|
|
|
|
function rdata() {
|
|
var datas = {
|
|
action: "gettihuoview",
|
|
userId: userId,
|
|
LoginId: LoginId,
|
|
viewId: viewId,
|
|
id: id,
|
|
strguiges: strguiges,
|
|
}
|
|
$(".ajaxLoader").removeClass("uhide");
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: "/apiajax.ashx?ifweb=1",
|
|
data: datas,
|
|
dataType: "JSON",
|
|
error: function (xhr, type) {
|
|
tishi3("发生错误:" + JSON.stringify(xhr));
|
|
},
|
|
success: function (data) {
|
|
|
|
|
|
if (data) {
|
|
if (data.status == 1) {
|
|
var html = "";
|
|
|
|
html += "<div class=\"ub ub-ac productlist\"><ul class=\"ub ub-ac ub-ver\">";
|
|
|
|
html += "<li id=\"cartbox0\">";
|
|
html += "<span class=\"limg\"><img src=\"" + data.showpic + "\" /></span>";
|
|
html += "<span class=\"rname\"><span class=\"prodName\">" + data.prodName + "</span>";
|
|
html += "<span class=\"je ulev-4\"> 数量:<em>1</em></span>";
|
|
html += "</span></li>";
|
|
|
|
html += "</ul></div>";
|
|
|
|
if (data.address.length > 0) {
|
|
var detail = getname(data.address[0].Province, data.address[0].City, data.address[0].County) + data.address[0].detail;
|
|
showAdr(data.address[0].id, data.address[0].Province, data.address[0].City, data.address[0].County, data.address[0].contact, data.address[0].tel, detail);
|
|
}
|
|
if (data.addresss.length > 0) {
|
|
$("#contact1").html(data.addresss[0].contact);
|
|
$("#tel1").html(data.addresss[0].tel);
|
|
$("#address1").html(data.addresss[0].address);
|
|
}
|
|
|
|
$(".floor-product").html(html);
|
|
|
|
$("#cart_Total_title").html("总价(包含运费):¥");
|
|
yunfeis = data.yunfeis;
|
|
yunfei = data.yunfei;
|
|
gettxtje();
|
|
$(".ajaxLoader").addClass("uhide");
|
|
} else {
|
|
|
|
tishi3(data.msg);
|
|
$(".ajaxLoader").addClass("uhide");
|
|
if (data.msg == "您未登录") {
|
|
$api.rmStorage("userId");
|
|
$api.rmStorage("LoginId");
|
|
onlink("/");
|
|
}
|
|
}
|
|
} else {
|
|
tishi3("网络错误!");
|
|
$(".ajaxLoader").addClass("uhide");
|
|
}
|
|
}
|
|
});
|
|
|
|
}
|
|
function Shop_Total0(price) {
|
|
var cart_Total = $("#cart_Total");
|
|
$(cart_Total).html(price);
|
|
}
|
|
function onpeitype(id) {
|
|
$("#peitypebox div#peitype" + + (id == 1 ? 0 : 1)).removeClass("hover");
|
|
$("#openAddress" + (id == 1 ? 0 : 1)).addClass("uhide");
|
|
$("#peitypebox div#peitype" + id).addClass("hover");
|
|
$("#openAddress" + id).removeClass("uhide");
|
|
peitype = id;
|
|
}
|
|
function onpaytype(id) {
|
|
$("#paytypebox div.hover").removeClass("hover");
|
|
$("#paytypebox div#paytype" + id).addClass("hover");
|
|
paytype = id;
|
|
}
|
|
|
|
function gettxtje() {
|
|
|
|
if (peitype == 0) {
|
|
Shop_Total0(parseFloat(ZSubTotal) + parseFloat(yunfei));
|
|
}
|
|
}
|
|
|
|
function openAddress() {
|
|
setlocalStorage("qygm", 3);
|
|
onlink("myaddress.html");
|
|
|
|
}
|
|
|
|
function onshowzfzh(t) {
|
|
if (t == 0) {
|
|
$("#zfzh").css("display", "block");
|
|
} else {
|
|
$("#zfzh").css("display", "none");
|
|
}
|
|
}
|
|
function showAdr(Id, province, city, county, contact, tel, detail) {
|
|
addressId = Id;
|
|
$("#contact").html(contact);
|
|
$("#tel").html(tel);
|
|
$("#address").html(detail);
|
|
$("#hidprovince").val(province);
|
|
$("#hidcity").val(city);
|
|
$("#hidcounty").val(county);
|
|
if (yunfeis != null) {
|
|
if (yunfeis.length > 0) {
|
|
for (var j = 0; j < yunfeis.length; j++) {
|
|
if (province == yunfeis[j].ProvinceID) {
|
|
|
|
yunfei = yunfeis[j].yunfei;
|
|
gettxtje();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function showqygm() {
|
|
Shop_qygm();
|
|
}
|
|
function Shop_qygm() {
|
|
var name = "";
|
|
var tel = "";
|
|
var Guests = fTrim($('#explain').val());
|
|
var b = true;
|
|
if (peitype == 1) {
|
|
name = fTrim($("#txtname").val());
|
|
tel = fTrim($("#txttel").val());
|
|
if (name == "") {
|
|
tishi3('联系人不能为空');
|
|
$("#txtname").focus();
|
|
b = false;
|
|
}
|
|
if (b) {
|
|
if (tel == "") {
|
|
tishi3('联系电话不能为空');
|
|
$("#txttel").focus();
|
|
b = false;
|
|
}
|
|
}
|
|
if (b) {
|
|
if (agentid == 0) {
|
|
tishi3('暂无取货地址');
|
|
b = false;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
if (addressId == 0) {
|
|
tishi3("收货地址未选择!");
|
|
b = false;
|
|
}
|
|
|
|
}
|
|
if (b) {
|
|
var index_ = layer.confirm('您确认要下单领取吗?', {
|
|
title: "确认领取",
|
|
btn: ['确认', '点错了'] //按钮
|
|
}, function () {
|
|
if ($(".ajaxLoader.uhide").length > 0) {
|
|
$(".ajaxLoader").removeClass("uhide");
|
|
$("#savebtn").attr("disabled");
|
|
$("#savebtn").val("请稍候...");
|
|
var datas = {
|
|
action: "tihuo",
|
|
userId: userId,
|
|
LoginId: LoginId,
|
|
pid: viewId,
|
|
id: id,
|
|
strguiges: strguiges,
|
|
peitype: peitype,
|
|
addressId: addressId,
|
|
Guests: Guests,
|
|
name: name,
|
|
tel: tel,
|
|
}
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: "/apiajax.ashx?ifweb=1",
|
|
data: datas,
|
|
dataType: "json",
|
|
error: function (xhr) {
|
|
tishi3("发生错误:" + JSON.stringify(xhr));
|
|
},
|
|
success: function (data) {
|
|
|
|
if (data.status == 1) {
|
|
tishi3("领取成功");
|
|
setlocalStorage("Blindbox_refresh", 1);
|
|
setlocalStorage("zhuanhuan_refresh", 1);
|
|
var closeInterval = setInterval(function () {
|
|
$("#savebtn").removeAttr("disabled");
|
|
$("#savebtn").val("确认领取");
|
|
history.go(-2);
|
|
clearInterval(closeInterval);
|
|
}, 300);
|
|
|
|
} else {
|
|
tishi3(data.msg);
|
|
$("#savebtn").removeAttr("disabled");
|
|
$("#savebtn").val("确认领取");
|
|
}
|
|
$(".ajaxLoader").addClass("uhide");
|
|
|
|
}
|
|
});
|
|
}
|
|
}
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
</head>
|
|
|
|
<body class="wrap">
|
|
<header>
|
|
<div class="ub">
|
|
<div class="nav-btn" id="nav-left" style=" margin:0; padding:0; padding-top:0.2em; min-width:4em" onclick="closeWin()">
|
|
|
|
<img src="../image/faifei.png" style="margin-left:0; margin-top:0em; height:1.2em;width:1.2em;" />
|
|
|
|
|
|
</div>
|
|
<h1 class="ub-f1">
|
|
确认领取
|
|
</h1>
|
|
<div class="nav-btn blue" id="nav-right" style=" margin:0; padding:0; min-width:1em; ">
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<section class="ub-f1" id="wrapper">
|
|
|
|
<div id="wrapper_content">
|
|
|
|
<p class="pullDown">下拉刷新...</p>
|
|
<div class="clear"></div>
|
|
<div style="padding:0.8em;">
|
|
<div class="ub" style="padding: 0.8em 1em;background-color: #FFFFFF;box-sizing: border-box;">
|
|
<div class="pay_box" id="peitypebox">
|
|
<span class="pay_type">配送方式:</span>
|
|
<div class='hover' id="peitype0" onclick="onpeitype(0)" data-id="0"><img src="../image/kdps.png" />快递配送</div>
|
|
<div id="peitype1" class="rtype" onclick="onpeitype(1)" data-id="1"><img src="../image/smzq.png" />上门自取</div>
|
|
</div>
|
|
</div>
|
|
<div class="ub" style="padding: 0.8em 1em;background-color: #FFFFFF;margin-bottom: .5em;box-sizing: border-box;" id="openAddress0" onclick="openAddress()">
|
|
<div class="ub ub-ver ub-f1">
|
|
<div class="ub ub-hor" style="color:#3D3D3D;line-height: 2em;margin:0;">
|
|
<div class="ub ">
|
|
收货人:
|
|
|
|
</div>
|
|
<div class="ub" id="contact"></div>
|
|
<div class="ub " id="tel"></div>
|
|
<input type="hidden" id="hidprovince" value="" />
|
|
<input type="hidden" id="hidcity" value="" />
|
|
<input type="hidden" id="hidcounty" value="" />
|
|
</div>
|
|
|
|
<div class="ub ulev-1" style="color:#808080;line-height: 1.4em;margin-top: .5em;padding: 0 1em;box-sizing: border-box;">
|
|
<img class="" src="../image/Pin-Assistor.png" style="width:1.2em" />
|
|
<div id="address" style="width:80%;margin: 0 1em;"></div>
|
|
<div class="ub ub-ac ub-pc" style="margin-right:1.4em; margin-top:0em; width: 1.2em; height:1.2em;"><img style="width: 1.2em;" src="../image/faifeito.png" /></div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="ub ub-ver uhide" style="padding: 0.8em 1em;background-color: #FFFFFF;margin-bottom: .5em;box-sizing: border-box;" id="openAddress1">
|
|
<div class="address_box_qhr">
|
|
<input type="text" id="txtname" placeholder="请填写取货人" />
|
|
<input type="text" class="txttel" id="txttel" placeholder="请填写手机号" />
|
|
</div>
|
|
<div class="ub ub-ver ub-f1">
|
|
<div class="ub ub-hor" style="color:#3D3D3D;line-height: 2em;margin:0;">
|
|
<div class="ub ">
|
|
收货人:
|
|
|
|
</div>
|
|
<div class="ub" id="contact1"></div>
|
|
<div class="ub " id="tel1"></div>
|
|
</div>
|
|
|
|
<div class="ub ulev-1" style="color:#808080;line-height: 1.4em;margin-top: .5em;padding:0;box-sizing: border-box;">
|
|
<div class="assistor">
|
|
<img class="" src="../image/Pin-Assistor.png" />
|
|
</div>
|
|
<div id="address1" class="ub ub-f1 address1"></div>
|
|
<!--<div class="ub ub-ac ub-pc" style="margin-right:1.4em; margin-top:0em; width: 1.2em; height:1.2em;"><img style="width: 1.2em;" src="../image/faifeito.png" /></div>-->
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="ub ub-ac" style="padding: 0.8em 1em;background-color: #FFFFFF;box-sizing: border-box;">
|
|
<div class="ub" style="padding:1em 0; padding-right:0;">
|
|
备注留言:
|
|
</div>
|
|
<div class="ub ub-ac ub-pc uinput3 ub-f1" style="margin:0;padding:0;" ">
|
|
<textarea id="explain" style="margin:0;padding:0.2em; width:100%;height: 4em;" placeholder="请留言告诉卖家您的要求" onfocus="placeholder='';" onblur="$api.val($api.dom('#explain'))==''?placeholder='说点什么吧':placeholder=''"></textarea>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="ub ub-ver floor-product">
|
|
|
|
</div>
|
|
<div class="clear"></div>
|
|
<div class="more_box"></div>
|
|
|
|
</div>
|
|
<div class="clear"></div>
|
|
<p class="pullUp">上拉加载...</p>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
<footer class="" style=" width:100%; background-color: #FFFFFF; padding:0;">
|
|
<div class="cartbox">
|
|
<div class="cartmbox">
|
|
<div class="leftbox">
|
|
<span id="cart_Total_title"></span>
|
|
<span class="cart_Total" id="cart_Total"></span>
|
|
</div>
|
|
<div class="rightbox">
|
|
<input id="savebtn" type="button" onclick="showqygm();" value="确认领取" class="input_shopdh">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</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>
|