Files
g.hnyhua.cn/Mtxfw.VipSite/mobile/ztaddress.html
2026-02-07 15:48:27 +08:00

333 lines
13 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-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/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;
}
.searchbox {
margin: 0;
border-bottom: 0;
padding:0.8em;
box-sizing:border-box;
}
.searchbox .searchto {
margin: 0;
padding: 0;
width:100%;
height:100%;
box-sizing: border-box;
background-color: #fff;
border-radius: 0 0 0.7em 0.7em;
border: 1px solid #c9931e;
border-top: 0;
overflow:hidden;
}
.searchbox .searchto0 {
margin: 0;
padding: 0;
box-sizing: border-box;
background-color: #fff;
border-radius: 0.7em 0.7em 0 0;
border: 1px solid #c9931e;
border-bottom: 0;
overflow: hidden;
}
.searchbox .searchto0 select {
width: 32%;
border: 0;
border-radius:0;
background-color:#eeeeee;
}
.searchbox .inpubox {
background-color: #fff;
border-top: 1px solid #c9931e;
}
.searchbox .inpubox #keyword {
background-color: #fff;
border: 0;
}
.searchbox .icobox {
border: 0;
}
</style>
<script type="text/javascript">
var userId = null;
var LoginId = null;
var CartId = null;
var opentimes = null;
var ztpids="";
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");
ztpids = getlocalStorage("ztpids");
rdata(1);
getareadata();
});
var pid = "", cid = "", qid = "";
function onc(v) {
var value = $(".select" + v + "").find("option:selected").val();
if (v == 5) {
show_city_info("", $("#city"), value, $("#county"));
}
if (v == 6) {
show_County_info("", $("#county"), $("#province").val(), value);
}
if (v == 7) {
try {
show_trading_info("", $("#trading"), $("#province").val(), $("#city").val(), value);
} catch (err) {
alert(err);
}
}
}
function getareadata() {
show_province_info(pid, $("#province"), $("#city"), $("#county"));
if (cid != "") {
show_city_info(cid, $("#city"), pid, $("#county"));
}
if (qid != "") {
show_County_info(qid, $("#county"), $("#province").val(), cid);
}
show_trading_info(tid, $("#trading"), $("#province").val(), $("#city").val(), qid);
}
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 longitude = getlocalStorage("longitude");
var latitude = getlocalStorage("latitude");
var keyword = fTrim($("#keyword").val());
var province = ($("#province option").length > 0 ? $("#province").val() : "");
var city = ($("#city option").length>0 ? $("#city").val():"");
var county = ($("#county option").length > 0 ?$("#county").val():"");
var Start = $("#sysnew .databox").length;
if (ag == 1) {
Start = 0;
}
$(".ajaxLoader").removeClass("uhide");
$.ajax({
type: 'POST',
url: "/apiajax.ashx?ifweb=1",
data: { action: "getZTAddress", Start: Start, ztpids: ztpids, province: province, city: city, county: county, keyword:keyword,userId:(userId != null ? userId : ""),LoginId:(LoginId != null ? LoginId : ""),longitude:(longitude != null ? longitude : ""),latitude:(latitude != null ? latitude : "")},
dataType: "JSON",
error: function (xhr, type) {
tishi3("发生错误:" + JSON.stringify(xhr));
},
success: function (data) {
if (data) {
if (data.status == 1) {
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].addressId).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(address) {
var qyStr = "";
qyStr += '<div class="selectaddress_btn " onclick="select(\'' + address.addressId + '\')">'
+ '选择' + '</div>';
var detail = getname(address.province, address.city, address.county, address.IFFill, address.Tradingarea) + address.address;
var html = '<div id="databox_' + address.addressId + '" contact="' + address.contact + '" tel="' + address.tel + '" detail="' + detail + '" class="ub ub-f1 ub-ver cbgw databox" style="margin-bottom: .8em;">'
+ '<div class="ub ub-ver padding1" onclick="select(\'' + address.addressId + '\')">'
+ '<div class="contact">'
+ '<div class="uinl"> 收货人:</div>'
+ '<div class="uinl a_contact">'
+ address.contact + '</div>'
+ ' <div class="ufr a_tel">'
+ address.tel + '</div>'
+ '</div>'
+ '<div class="ub ulev-1 detail_a a_addr" >'
+ '收货地址:' + detail + '</div>'
+ '</div>'
+ '<div class="ub" style="border-top: 1px solid #F5F5F5;color:#808080;">'
+ qyStr
+ '</div>'
+ '</div>'
+ '</div>'
return html;
}
function select(id) {
var type = getlocalStorage("ztaddress_type");
var address_ = $("#databox_" + id);
var detail = $(address_).attr("detail");
setlocalStorage("zt_selectaddress" + type, id + "," + $(address_).attr("contact") + "," + $(address_).attr("tel") + "," + detail);
parent.layer.closeAll();
}
</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:3em" onclick="parent.layer.closeAll();">
<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:3em; padding-right:1em;">
</div>
</div>
</header>
<section class="ub-f1" id="wrapper">
<div class="searchbox">
<div class="searchto0">
<select name="select_p" id="province" class="select5" onchange="onc(5)">
<option value="-1">--省--</option>
</select>
<select name="select_c" id="city" class="select6" onchange="onc(6)">
<option value="-1">--市--</option>
</select>
<select name="select_q" class="select7" id="county" onchange="onc(7)">
<option value="-1">--县区--</option>
</select>
</div>
<div class="searchto">
<div class="inpubox">
<input id="keyword" placeholder="请输入自提点名称或电话" />
</div><div class="icobox" onclick="rdata(1)"><img src="../image/searchto2.png" style="width: 1.6em;margin-top: .5em; margin-left: 1.5em;" /></div>
</div>
</div>
<div class="clear"></div>
<div class="maxcontent" style="padding:0.8em; box-sizing:border-box;">
<div class="ub ub-ver" id="sysnew"> </div>
</div>
</section>
<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>