<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; 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="{G_TEMPLATES_CSS}/mobile/comm.css?v=130715" rel="stylesheet" type="text/css" />
<link href="{G_TEMPLATES_CSS}/mobile/member.css?v=130726" rel="stylesheet" type="text/css" />
<script src="{G_TEMPLATES_JS}/mobile/jquery190.js" language="javascript" type="text/javascript"></script>
<script src="{G_TEMPLATES_JS}/jquery.Validform.min.js" language="javascript" type="text/javascript"></script>
<script id="pageJS" data="{G_TEMPLATES_JS}/mobile/OrderList.js" language="javascript" type="text/javascript"></script>
</head>
<body>
<div class="h5-1yyg-v1" id="loadingPicBlock">
    <header class="g-header">
        <div class="head-l">
	        <a href="javascript:;" onclick="history.go(-1)" class="z-HReturn"><s></s><b>返回</b></a>
        </div>
        <h2>收货地址</h2>
        <div class="head-r">
	        <a href="{WEB_PATH}/mobile/home" class="z-Member"></a>
        </div>
    </header>

    <input name="hidTotalCount" type="hidden" id="hidTotalCount" />
    <input name="hidPageMax" type="hidden" id="hidPageMax" />
    <section class="clearfix g-member g-goods">
        <article class="mt10 m-round">
            <script type="text/javascript" src="{G_TEMPLATES_JS}/mobile/area.js"></script>
            <script type="text/javascript">
            $(function(){       
                var demo=$(".registerform").Validform({
                    tiptype:2,
                    datatype:{
                        "tel":/^(([0\+]\d{2,3}-)?(0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$/,
                    },
                }); 
                demo.tipmsg.w["tel"]="请正确输入电话号码(区号、号码必填，用“-”隔开)";
                demo.addRule([
                {
                    ele:"#txt_ship_tel",
                    datatype:"tel",
                }]);
            });
            $(function(){
                $("#btnAddnewAddr").click(function(){
                    $("#div_consignee").show();
                    $("#btnAddnewAddr").hide();
                });
                $("#btn_consignee_cancle").click(function(){
                    $("#div_consignee").hide();
                    $("#btnAddnewAddr").show();
                });
            });
            $(function(){
                $(".xiugai").click(function(){
                    $("#btnAddnewAddr").hide();
                    $("#div_consignee").hide();
                });
                $("#btn_consignee_cancle2").click(function(){
                    $("#div_consignee2").hide();
                    $("#btnAddnewAddr").show();
                });
            });
            function update(id){    
                $("#div_consignee2").show();
                setup3();
                $("#registerform3").attr("action","{WEB_PATH}/mobile/home/updateddress/"+id);
                var str=$("#dizh_"+id).html();
                var spl=str.split(",");
                $("#province3").append('<option selected value="'+spl[0]+'">'+spl[0]+'</option>');
                $("#city3").append('<option selected value="'+spl[1]+'">'+spl[1]+'</option>');
                $("#county3").append('<option selected value="'+spl[1]+'">'+spl[1]+'</option>');
                $("#dizh2").val(spl[3]);
                $("#qqnb2").val($("#item_"+id).attr("qqnb"));
                if($("#sffh_"+id).html()==1){
                    $("#sffh21").attr("checked",'checked');
                }else if($("#sffh_"+id).html()==0){
                    $("#sffh22").attr("checked",'checked');
                }
                $("#mob2").val($("#item_"+id).attr("mob"));
                $("#yb2").val($("#item_"+id).attr("yb"));
                $("#shr2").val($("#item_"+id).attr("shr"));
                $("#div_consignee2").show(); 
            };
            function dell(id){
                if (confirm("您确认要删除该条信息吗？")){
                    window.location.href="{WEB_PATH}/mobile/home/deladdress/"+id;
                }
            }

            function setdf(id){
                if (confirm("您确认设置为默认地址？")){
                    window.location.href="{WEB_PATH}/mobile/home/setaddress/"+id;
                }
            }

            </script>
            <div class="R-content">
                                                <div id="addressListDiv" class="list-tab detailAddress gray01" style="">
                    <ul class="m-useraddresslst ">
                        <li class="pad"><span>详细地址</span><span>收货人</span><span>是否默认</span><span>操作</span></li>
                                 {wc:loop $dizhi $dz}
                               <li class="pad" id="item_{wc:$dz['id']}" qqnb="{wc:$dz['qq']}" shr="{wc:$dz['shouhuoren']}" yb="{wc:$dz['youbian']}" mob="{wc:$dz['mobile']}">
                                 <span  id="dizh_{wc:$dz['id']}">{wc:$dz['sheng']},{wc:$dz['shi']},{wc:$dz['xian']},{wc:$dz['jiedao']}</span>
                                 <span>{wc:$dz['shouhuoren']}</span>
                                 <span>  {wc:if $dz['default'] == 'Y'} 默认地址 {wc:else}<a class="xiugai" href="javascript:;"   onclick="setdf({wc:$dz['id']})" title="设为默认">设为默认</a> {wc:if:end} </span>
                                 <span>
                                    <a class="xiugai" href="javascript:;"   onclick="update({wc:$dz['id']})" title="修改">修改</a>
                                    <a class="xiugai" href="javascript:;"   onclick="dell({wc:$dz['id']})" title="删除">删除</a>
                                 </span>
                             </li>
                                  {wc:loop:end}             
                    </ul>     
                </div>
                                
            </div> 
    </section>
        <section class="clearfix g-member g-goods">
        <div class="add mt10 "><a  id="btnAddnewAddr" href="javascript:;" type="button" class="orangebut orgBtn"  style="display: block;">新增收货地址</a></div>
        <div id="div_consignee" class="addAddress" style="display:none;">
         <article class="mt10 m-round">
            
                
                 
                    <dl>添加收货地址</dl>
                    <form class="registerform" method="post" action="{WEB_PATH}/mobile/home/useraddress">
                    <table border="0" cellpadding="0" cellspacing="0" width="99%">
                    <tbody>
                    <tr>
                    
                        <td width="20%"><label>所在地区：</label><script>var s2=["province2","city2","county2"];</script></td>
                        <td  width="80%">
                            <select datatype="*" nullmsg="请选择有效的省市区" class="select" id="province2" runat="server" name="sheng"></select>
                            <select datatype="*" nullmsg="请选择有效的省市区" class="select" id="city2" runat="server" name="shi"></select>
                            <select datatype="*" nullmsg="请选择有效的省市区" class="select" id="county2" runat="server" name="xian"></select>
                            <em id="ship_address_valid_msg" class="red">*</em>  
                            <script type="text/javascript">setup2()</script>
                        </td>
                    </tr>
                    <tr>
                        <td><label>街道地址：</label></td>
                        <td>
                            <input datatype="*1-100" class="input" nullmsg="请填街道地址！" errormsg="范围在100之间！" name="jiedao" type="text" class="street" maxlength="100" />
                            <em id="ship_address_valid_msg" class="red">*</em>          
                        </td>
                    </tr>
                   
                   
                    <tr>
                        <td><label>收货人：</label></td>
                        <td>
                            <input  class="input"  datatype="*" nullmsg="收货人不能为空" name="shouhuoren" type="text" maxlength="20" id="txt_ship_name" class="inputTxt" value="">
                            <em class="red" id="ship_name_valid_msg">*</em>
                        </td>
                    </tr>
                    <tr>
                        <td><label>手机号码：</label></td>
                        <td>
                            <input  class="input"  datatype="m" nullmsg="手机号不能为空" errormsg="手机号不对" name="mobile" type="text"  class="inputTxt" maxlength="11">
                            <em id="ship_mb_valid_msg" class="red">*</em>
                        </td>
                    </tr>
                    <tr>
                        <td><label>是否发货：</label></td>
                        <td>
                            <input type="radio" name="shifoufahuo" value="1" />是，马上收货&nbsp;&nbsp;&nbsp;
                            <input type="radio" name="shifoufahuo" value="0" checked="checked" />否，暂时别发货
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <input style="margin-right:1%" name="submit" type="submit" class="orangebut" id="btn_consignee_save" value="保存" title="保存"> 
                            <input type="button" class="cancelBtn" value="取消" id="btn_consignee_cancle" title="取消">
                        </td>
                    </tr>
                    </tbody>
                    </table>
                    </form>
                
               
            </article>
            </div>
    </section>
         <section class="clearfix g-member g-goods">
        <article class="mt10 m-round">
            <div id="div_consignee2" class="addAddress" style="display:none;">
                <dl>修改收货地址</dl>
                <script>var s3=["province3","city3","county3"];</script>    
                 
                <form id="registerform3" class="registerform" method="post" >
                <table border="0" cellpadding="0" cellspacing="0" width="99%">
                <tbody>
                <tr>        
                    <td><label>所在地区：</label></td>
                    <td>
                        <select datatype="*" nullmsg="请选择有效的省市区" class="select" id="province3" runat="server" name="sheng"></select>
                        <select datatype="*" nullmsg="请选择有效的省市区" class="select" id="city3" runat="server" name="shi"></select>
                        <select datatype="*" nullmsg="请选择有效的省市区" class="select" id="county3" runat="server" name="xian" style="></select>
                        <em id="ship_address_valid_msg" class="red">*</em>              
                    </td>
                </tr>
                <tr>
                    <td><label>街道地址：</label></td>
                    <td>
                        <input  class="input" id="dizh2" datatype="*1-100" nullmsg="请填街道地址！" errormsg="范围在100之间！" name="jiedao" type="text" class="street" maxlength="100" />
                        <em id="ship_address_valid_msg" class="red">*</em>          
                    </td>
                </tr>
               
                <tr>
                    <td><label>收货人：</label></td>
                    <td>
                        <input id="shr2" class="input" datatype="*" nullmsg="收货人不能为空" name="shouhuoren" type="text" maxlength="20" class="inputTxt" value="">
                        <em class="red" id="ship_name_valid_msg">*</em>
                    </td>
                </tr>
                <tr>
                    <td><label>手机号码：</label></td>
                    <td>
                        <input  id="mob2" class="input" datatype="m" nullmsg="手机号不能为空" errormsg="手机号不对" name="mobile" type="text" value="" class="inputTxt" maxlength="11">
                        <em id="ship_mb_valid_msg" class="red">*</em>
                    </td>
                </tr>
                <tr>
                    <td><label>是否发货：</label></td>
                    <td colspan="2">
                        <input type="radio" id="sffh21" name="shifoufahuo" value="1" />是，马上收货&nbsp;
                        &nbsp;&nbsp;<input type="radio" id="sffh22" name="shifoufahuo" value="0" />否，暂时别发货
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <input style="margin-right:1%;" name="submit" type="submit" class="orangebut" id="btn_consignee_save" value="保存" title="保存"> 
                        <input type="button" class="cancelBtn" value="取消" id="btn_consignee_cancle2" title="取消">
                    </td>
                </tr>
                </tbody>
                </table>
                </form>
                 
            </div>
        </article>
    </section>
<div style="height:70px;"></div>      

{wc:templates "mobile/index","footer"}
<script language="javascript" type="text/javascript">
  var Path = new Object();
  Path.Skin="{G_TEMPLATES_STYLE}";
  Path.Webpath = "{WEB_PATH}";
  
var Base={head:document.getElementsByTagName("head")[0]||document.documentElement,Myload:function(B,A){this.done=false;B.onload=B.onreadystatechange=function(){if(!this.done&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){this.done=true;A();B.onload=B.onreadystatechange=null;if(this.head&&B.parentNode){this.head.removeChild(B)}}}},getScript:function(A,C){var B=function(){};if(C!=undefined){B=C}var D=document.createElement("script");D.setAttribute("language","javascript");D.setAttribute("type","text/javascript");D.setAttribute("src",A);this.head.appendChild(D);this.Myload(D,B)},getStyle:function(A,B){var B=function(){};if(callBack!=undefined){B=callBack}var C=document.createElement("link");C.setAttribute("type","text/css");C.setAttribute("rel","stylesheet");C.setAttribute("href",A);this.head.appendChild(C);this.Myload(C,B)}}
function GetVerNum(){var D=new Date();return D.getFullYear().toString().substring(2,4)+'.'+(D.getMonth()+1)+'.'+D.getDate()+'.'+D.getHours()+'.'+(D.getMinutes()<10?'0':D.getMinutes().toString().substring(0,1))}
Base.getScript('{G_TEMPLATES_JS}/js/mobile/Bottom.js?v='+GetVerNum());
</script>

</div>
</body>
</html>
