{extend name="default/users/base" /}
{block name="title"}首页-用户中心{__block__}{/block}
{block name="css"}
{/block}
{block name="content"}
  <div class="wst-user-head" style="margin-bottom:10px;">
        <input type="button" value="新增收货地址" class="addr-btn" onclick="location.href=WST.U('home/useraddress/edit')" />
        <label>你已经创建<em class="g g1">0</em>个收货地址,最多可以创建<em class="r">20</em>个</label>
  </div>

        <script id="address" type="text/html">
            {{# for(var i = 0, len = d.length; i < len; i++){ }}
            <table class='wst-addr'style="border-collapse:collapse;" >
               <tr style="background:#f5f5f5;height:36px;">
                 <td>&nbsp;&nbsp;{{d[i].userName}}—{{d[i].areaName1}}</td>
                 <td>
                 &nbsp;&nbsp;&nbsp;&nbsp;
                 {{# if(d[i].isDefault==1) { }}
                  <p class="default">默认地址</p>
                 {{# } }}
                 </td>
               </tr>


               <tr><td class="addr-title">收货人：</td>
                 <td>{{d[i].userName}}</td>
               </tr>
               <tr><td class="addr-title">所在地区：</td>
                 <td>{{d[i].areaName}}</td>
               </tr>
               <tr><td class="addr-title">地址：</td>
                 <td>{{d[i].userAddress}}</td>
               </tr>
               <tr><td class="addr-title">联系电话：</td>
                 <td>{{d[i].userPhone}}</td>
               </tr>

               <tr>
                 <td>&nbsp;</td>
                 <td class='edit'>
                   {{# if(d[i].isDefault!=1) { }}
                    <a href="javascript:setDefault({{ d[i].addressId }})" class="setdefault">设为默认</a>
                   {{# } }}
                   <a href="javascript:delAddress({{ d[i].addressId }},this)">删除</a>
                   <a href="javascript:editAddress({{ d[i].addressId }})">编辑</a>
                   <div class="wst-clear"></div>
                 </td>
               </tr>
            </table>
            {{# } }}
           </script>
           <div id="address_box" class="address_box">
              
           </div>
{/block}
{block name="js"}
<script type='text/javascript' src='__STYLE__/users/useraddress/useraddress.js?v={$v}'></script>
<script>
$(function(){
  listQuery();
});
</script>
{/block}
