You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
322 lines
12 KiB
322 lines
12 KiB
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
|
|
<div id="consignee">
|
|
<form action="javascript:;" method="get" name="theForm" id="theForm" onsubmit="addUpdate_Consignee(this)">
|
|
<div style="padding-left: 12px;" name="consignee-form" id="consignee-form" class="consignee-form">
|
|
<input type="hidden" name="consigneeParam.id" id="consignee_form_id">
|
|
<input type="hidden" name="consigneeParam.type" id="consignee_type">
|
|
<div id="name_div" class="list">
|
|
<span class="label">
|
|
<em>*</em>收货人:
|
|
</span>
|
|
<div class="field">
|
|
<input type="text" value="{$consignee.consignee}" maxlength="20" name="consignee" id="consignee_name" class="textbox">
|
|
<span id="consigneeNameNote" class="status error hide">请您填写收货人姓名</span>
|
|
</div>
|
|
</div>
|
|
<div id="area_div" class="list select-address">
|
|
<span class="label">
|
|
<em>
|
|
*
|
|
</em>
|
|
所在地区:
|
|
</span>
|
|
<div class="field">
|
|
<span id="span_area" class="fl">
|
|
<select name="country" id="selCountries_{$sn}" onchange="region.changed(this, 1, 'selProvinces_{$sn}')" style="border:1px solid #abadb3;">
|
|
<option value="0">{$please_select}{$name_of_region[0]}</option>
|
|
<!-- {foreach from=$country_list item=country} -->
|
|
<option value="{$country.region_id}" {if $consignee.country eq $country.region_id}selected{/if}>{$country.region_name}</option>
|
|
<!-- {/foreach} -->
|
|
</select>
|
|
<select name="province" id="selProvinces_{$sn}" onchange="region.changed(this, 2, 'selCities_{$sn}')" style="border:1px solid #abadb3;">
|
|
<option value="0">{$please_select}{$name_of_region[1]}</option>
|
|
<!-- {foreach from=$province_list item=province} -->
|
|
<option value="{$province.region_id}" {if $consignee.province eq $province.region_id}selected{/if}>{$province.region_name}</option>
|
|
<!-- {/foreach} -->
|
|
</select>
|
|
<select name="city" id="selCities_{$sn}" onchange="region.changed(this, 3, 'selDistricts_{$sn}')" style="border:1px solid #abadb3;">
|
|
<option value="0">{$please_select}{$name_of_region[2]}</option>
|
|
<!-- {foreach from=$city_list item=city} -->
|
|
<option value="{$city.region_id}" {if $consignee.city eq $city.region_id}selected{/if}>{$city.region_name}</option>
|
|
<!-- {/foreach} -->
|
|
</select>
|
|
<select name="district" id="selDistricts_{$sn}" {if !$district_list}style="display:none;"{/if} style="border:1px solid #abadb3;">
|
|
<option value="0">{$please_select}{$name_of_region[3]}</option>
|
|
<!-- {foreach from=$district_list item=district} -->
|
|
<option value="{$district.region_id}" {if $consignee.district eq $district.region_id}selected{/if}>{$district.region_name}</option>
|
|
<!-- {/foreach} -->
|
|
</select>
|
|
</span>
|
|
<span id="consigneeEreaNote" class="status error hide"></span>
|
|
</div>
|
|
</div>
|
|
<div id="address_div" class="list full-address">
|
|
<span class="label">
|
|
<em>
|
|
*
|
|
</em>
|
|
详细地址:
|
|
</span>
|
|
<div class="field">
|
|
<span id="areaNameTxt" class="fl selected-address">
|
|
</span>
|
|
<input type="text" maxlength="50" name="address" value="{$consignee.address}" id="consignee_address" class="textbox">
|
|
<span id="consigneeAddressNote" class="status error hide">请您填写收货详细地址</span>
|
|
</div>
|
|
</div>
|
|
<div id="call_div" class="list">
|
|
<span class="label">
|
|
<em>
|
|
*
|
|
</em>
|
|
手机号码:
|
|
</span>
|
|
<div class="field">
|
|
<div class="phone">
|
|
<input type="text" maxlength="11" name="mobile" value="{$consignee.mobile}" id="consignee_mobile" class="textbox">
|
|
<span class="fl" style="line-height:25px;"> 固定电话:</span>
|
|
<input type="text" maxlength="20" value="{$consignee.tel}" name="tel" id="consignee_phone" class="textbox">
|
|
<span id="consigneeMobileTelNote" class="status error hide">请您填写收货人手机号码或电话号码</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="email_div" class="list">
|
|
<span class="label"><em></em>邮箱:</span>
|
|
<div class="field">
|
|
<input type="text" maxlength="50" name="email" value="{$consignee.email}" id="consignee_email" class="textbox">
|
|
<span id="emailNote" class="status error hide">请您填写邮箱</span>
|
|
</div>
|
|
</div>
|
|
<div id="email_div" class="list">
|
|
<span class="label">
|
|
<em></em>
|
|
地址别名:
|
|
</span>
|
|
<div class="field">
|
|
<input type="text" maxlength="50" value="{$consignee.sign_building}" name="sign_building" id="consignee_sign_building" class="textbox">
|
|
<font style="font-size:12px; color:#999">设置一个易记的名称,如:"送到家里"、"送到公司" </font><span id="consigneeAliasNote" class="status error hide">请您填写地址别名</span>
|
|
</div>
|
|
</div>
|
|
<div id="email_div" class="list">
|
|
<span class="label">
|
|
<em>
|
|
|
|
</em>
|
|
邮编:
|
|
</span>
|
|
<div class="field">
|
|
<input type="text" maxlength="50" name="zipcode" value="{$consignee.zipcode}" id="consignee_zipcode" class="textbox">
|
|
<span class="form-tip">
|
|
|
|
</span>
|
|
</div>
|
|
<span id="consigneeZipcodeNote" class="status error">
|
|
</span>
|
|
</div>
|
|
<div id="email_div" class="list">
|
|
<span class="label">
|
|
<em>
|
|
</em>
|
|
最佳送货时间:
|
|
</span>
|
|
<div class="field">
|
|
<input type="text" value="{$consignee.best_time}" maxlength="50" name="best_time" id="consignee_best_time" class="textbox">
|
|
<span class="form-tip">
|
|
|
|
</span>
|
|
</div>
|
|
<span id="consigneeBestTimeNote" class="status error">
|
|
</span>
|
|
</div>
|
|
<div class="form-btn group" style="background:#fff;">
|
|
<input name="address_id" value="{$consignee.address_id}" type="hidden">
|
|
<input name="onSubmit" value="保存收货人信息" type="submit" class="btnConsignee">
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<script type="text/javascript">
|
|
function addUpdate_Consignee(frm){
|
|
|
|
var info_return = 0;
|
|
var csg = new Object;
|
|
|
|
csg.consignee = frm.elements['consignee'].value;
|
|
csg.country = frm.elements['country'].value;
|
|
csg.province = frm.elements['province'].value;
|
|
csg.city = frm.elements['city'].value;
|
|
csg.district = frm.elements['district'].value;
|
|
csg.address = frm.elements['address'].value;
|
|
csg.mobile = frm.elements['mobile'].value;
|
|
csg.tel = frm.elements['tel'].value;
|
|
csg.mobile = frm.elements['mobile'].value;
|
|
csg.email = frm.elements['email'].value;
|
|
csg.zipcode = frm.elements['zipcode'].value;
|
|
csg.sign_building = frm.elements['sign_building'].value;
|
|
csg.best_time = frm.elements['best_time'].value;
|
|
csg.address_id = frm.elements['address_id'].value;
|
|
|
|
if(csg.consignee == ''){
|
|
return_address_judge('consigneeNameNote', 0);
|
|
info_return = 1;
|
|
}else if(csg.country == 0){
|
|
|
|
return_address_judge('consigneeEreaNote', 0);
|
|
$('#consigneeEreaNote').html(" 请选择所在国家");
|
|
info_return = 1;
|
|
|
|
}else if(csg.province == 0){
|
|
|
|
return_address_judge('consigneeEreaNote', 0);
|
|
$('#consigneeEreaNote').html(" 请选择所在省份");
|
|
info_return = 1;
|
|
|
|
}else if(csg.city == 0){
|
|
|
|
return_address_judge('consigneeEreaNote', 0);
|
|
$('#consigneeEreaNote').html(" 请选择所在市");
|
|
info_return = 1;
|
|
|
|
}else if(!$('#selDistricts_').is(":hidden")){
|
|
|
|
if(csg.district == 0){
|
|
return_address_judge('consigneeEreaNote', 0);
|
|
$('#consigneeEreaNote').html(" 请选择所在区域");
|
|
info_return = 1;
|
|
}else{
|
|
info_return = 2;
|
|
}
|
|
}else{
|
|
info_return = 2;
|
|
}
|
|
|
|
if(info_return == 2){
|
|
if(csg.address == ''){
|
|
return_address_judge('consigneeNameNote', 1);
|
|
return_address_judge('consigneeEreaNote', 1);
|
|
|
|
return_address_judge('consigneeAddressNote', 0);
|
|
info_return = 1;
|
|
}else if(csg.mobile == ''){
|
|
return_address_judge('consigneeAddressNote', 1);
|
|
|
|
return_address_judge('consigneeMobileTelNote', 0);
|
|
info_return = 1;
|
|
if(csg.tel == ''){
|
|
return_address_judge('consigneeMobileTelNote', 0);
|
|
info_return = 1;
|
|
}else{
|
|
if(!Utils.isTel(csg.tel) && csg.tel.length > 0){
|
|
return_address_judge('consigneeMobileTelNote', 0);
|
|
$('#consigneeMobileTelNote').html(" 您输入的邮件地址不是一个合法的邮件地址");
|
|
info_return = 1;
|
|
}else{
|
|
info_return = 3;
|
|
}
|
|
}
|
|
}else{
|
|
if(!Utils.isTel(csg.mobile) || csg.mobile.length != 11){
|
|
return_address_judge('consigneeMobileTelNote', 0);
|
|
$('#consigneeMobileTelNote').html(" 手机号码不合法");
|
|
info_return = 1;
|
|
}else if(!Utils.isTel(csg.tel) && csg.tel.length > 0){
|
|
return_address_judge('consigneeMobileTelNote', 0);
|
|
$('#consigneeMobileTelNote').html(" 电话号码不合法");
|
|
info_return = 1;
|
|
}else{
|
|
info_return = 3;
|
|
}
|
|
}
|
|
}
|
|
|
|
if(info_return == 3){
|
|
return_address_judge('consigneeMobileTelNote', 1);
|
|
if(csg.email != '' && !Utils.isEmail(csg.email)){
|
|
return_address_judge('emailNote', 0);
|
|
$('#emailNote').html(" 您输入的邮件地址不是一个合法的邮件地址");
|
|
info_return = 1;
|
|
}else{
|
|
$('#emailNote').html(" ");
|
|
info_return = 0;
|
|
}
|
|
}
|
|
|
|
if(info_return == 0){
|
|
Ajax.call('flow.php', 'step=insert_Consignee&csg=' + $.toJSON(csg), addUpdate_ConsigneeResponse, 'POST', 'JSON');
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
function addUpdate_ConsigneeResponse(result){
|
|
if(result.error > 0){
|
|
if(result.error == 2){
|
|
alert(result.message);
|
|
location.href = "user.php";
|
|
}
|
|
|
|
if(result.error == 4){
|
|
$('#consignee_list').html(result.content);
|
|
}
|
|
|
|
}else{
|
|
$('#consignee_list').html(result.content);
|
|
$('#goods_inventory').html(result.goods_list);//送货清单
|
|
$('#ECS_ORDERTOTAL').html(result.order_total);//费用汇总
|
|
}
|
|
|
|
$('#new_address').remove();
|
|
$('#edit_address').remove();
|
|
|
|
if(result.error == 4){
|
|
var ok_title,cl_title;
|
|
var width = 455;
|
|
var height = 58;
|
|
var divId = "address_div_id";
|
|
|
|
ok_title = "确定";
|
|
cl_title = "取消";
|
|
|
|
var content = '<div id="' + divId + '">' +
|
|
'<div class="tip-box icon-box">' +
|
|
'<span class="warn-icon m-icon"></span>' +
|
|
'<div class="item-fore">' +
|
|
'<h3 class="rem ftx-04">' + result.message + '</h3>' +
|
|
'</div>' +
|
|
'</div>' +
|
|
'</div>';
|
|
|
|
pb({
|
|
id:divId,
|
|
title:"信息提示",
|
|
width:width,
|
|
height:height,
|
|
ok_title:ok_title, //按钮名称
|
|
cl_title:cl_title, //按钮名称
|
|
content:content, //调取内容
|
|
drag:false,
|
|
foot:true,
|
|
onOk:function(){
|
|
$('#' + divId).remove();
|
|
},
|
|
onCancel:function(){
|
|
$('#' + divId).remove();
|
|
}
|
|
});
|
|
|
|
$('.pb-ok').addClass('color_df3134');
|
|
}
|
|
|
|
$('#pb-mask').remove();
|
|
$('#shipping_list').html(result.shipping_content);
|
|
}
|
|
|
|
function return_address_judge(obj, type){
|
|
if(type == 0){
|
|
$('#'+obj).removeClass("hide").addClass("show");
|
|
}else if(type == 1){
|
|
$('#'+obj).removeClass("show").addClass("hide");
|
|
}
|
|
}
|
|
</script>
|