<!--{include file="<!--{$oetplpath}-->widget_header.tpl"}-->
<div class="oemarry_main">
  <!--{include file="<!--{$oetplpath}-->widget_menu.tpl"}-->
  <div class="oem_uright">
  
	<div class="oe_mine_box">
	  <ul>
	    <li><a href="<!--{$oefile}-->&c=profile">个人信息</a></li>
		<li><a href="<!--{$oefile}-->&c=profile&a=edit">修改资料</a></li>
		<li><a href="<!--{$oefile}-->&c=profile&a=editpass">修改密码</a></li>
		<li><a href="<!--{$oefile}-->&c=rz">认证中心</a></li>
		<li><a href="<!--{$oefile}-->&c=address" class="_current">收货地址</a></li>
	  </ul>
	  <div class="clear"></div>
	</div>
	
	<div class="oe_widget_center">
	  
	  <!--{if $a == "run"}-->
	  <h3 class="oe_f_title">我常用的收货地址<span><i>|</i></span></h3>
	  <table class="oe_table_list table_cs">
		<tr>
	      <th width="15%">姓名</th>
		  <th width="20%">省份/城市</th>
		  <th width="20%">地址</th>
		  <th width="10%">邮编</th>
		  <th width="15%">电话</th>
		  <th>操作</th>
	    </tr>
		<!--{if empty($address)}-->
		<tr>
		  <td class="text_center" colspan="6">没有找到符合条件的信息</td>
		</tr>
		<!--{else}-->
		<!--{foreach $address as $volist}-->
		<tr>
		  <td><!--{$volist.contname}--></td>
		  <td>
		    <!--{area type='text' value=$volist.area1}--> 
			<!--{area type='text' value=$volist.area2}-->
			<!--{area type='text' value=$volist.area3}-->
		  </td>
		  <td><!--{$volist.street}--></td>
		  <td><!--{$volist.zipcode}--></td>
		  <td><!--{$volist.contphone}--></td>
		  <td>
		  <!--{if $volist.isdefault == '1'}-->
		  <font color="#ff6600">默认地址</font>
		  <!--{else}-->
		  <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=setdefault&id=<!--{$volist.addrid}-->">设置为默认</a>
		  <!--{/if}-->
		  <br />
		  <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=edit&id=<!--{$volist.addrid}-->">修改</a> | 
		  <a href="javascript:;" f="onedel" data-url="<!--{$oefile}-->&c=<!--{$c}-->&a=del&id=<!--{$volist.addrid}-->">删除</a>
		  </td>
		</tr>
		<!--{/foreach}-->
		<!--{/if}-->

	  </table>
	  
	  <div class="oe_unfold_cont">
	    <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=add">+ 添加收货地址</a>
	  </div>
	  <!--{/if}-->


	  <!--{if $a == "add"}-->
	  <h3 class="oe_f_title">添加收货地址<span><i>|</i>带*号必填</span></h3>
	  <form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post" />
	  <input type="hidden" name="a" id="a" value="saveadd" />
	  <table class="oe_table_info">
		<tr>
		  <th align="right" width="15%">收货人姓名：<font color="red">*</font></th>
		  <td width="85%">
			<input type="text" name="contname" id="contname" class="input-150" />
		  </td>
		</tr>
		<tr>
		  <th align="right">所在地区：<font color="red">*</font></th>
		  <td>
			<!--{area type='select' name='area' depth='1' child='1' text='=请选择='}-->
			<span id="json_area2">
			  <select name="area2" id="area2"><option value="">=请选择=</option></select>
			</span>
			<span id="json_area3">
			  <select name="area3" id="area3"><option value="">=请选择=</option></select>
			</span>
		  </td>
		</tr>
		<tr>
		  <th align="right">街道/地址：<font color="red">*</font></th>
		  <td>
			<input type="text" name="street" id="street" class="input-b" /> （不需要填写省/市）
		  </td>
		</tr>
		<tr>
		  <th align="right">邮政编码：</th>
		  <td>
			<input type="text" name="zipcode" id="zipcode" class="input-150" />
		  </td>
		</tr>
		<tr>
		  <th align="right">联系电话：<font color="red">*</font></th>
		  <td>
			<input type="text" name="contphone" id="contphone" class="input-150" /> （手机或固定电话）
		  </td>
		</tr>
		<tr>
		  <th></th>
		  <td>
			<input type="button" id="btn_post" class="submit_btn1" value="添加保存" /> 
		  </td>
		</tr>
	  </table>
	  </form>
	  <script type="text/javascript">
	  $(function(){
		$("#btn_post").bind("click", function(){
			if ($("#contname").val().length == 0) {
				ToastShow("请填写收货人姓名");
				return false;
			}
			if ($("#area1").find("option:selected").val() < 1) {
				ToastShow("请选择所在地区");
				return false;
			}
			if ($("#area2").find("option:selected").val() < 1) {
				ToastShow("请选择所在地区");
				return false;
			}
			if ($("#street").val().length == 0) {
				ToastShow("请填写街道/地址");
				return false;
			}
			if ($("#contphone").val().length == 0) {
				ToastShow("请填写联系电话");
				return false;
			}
			$("#myform").submit();
		});
	  });
	  </script>
	  <!--{/if}-->



	  <!--{if $a == "edit"}-->
	  <h3 class="oe_f_title">编辑收货地址<span><i>|</i>带*号必填</span></h3>
	  <form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post" />
	  <input type="hidden" name="a" id="a" value="saveedit" />
	  <input type="hidden" name="id" id="id" value="<!--{$id}-->" />
	  <table class="oe_table_info">
		<tr>
		  <th align="right" width="15%">收货人姓名：<font color="red">*</font></th>
		  <td width="85%">
			<input type="text" name="contname" id="contname" class="input-150" value="<!--{$address.contname}-->" />
		  </td>
		</tr>
		<tr>
		  <th align="right">所在地区：<font color="red">*</font></th>
		  <td>
			<!--{area type='select' name='area' depth='1' child='1' text='=请选择=' value=$address.area1}-->
			<span id="json_area2">
			  <!--{if $address.area1 > 0}-->
			  <!--{area type='select' name='area' depth='2' child='1' text='=请选择=' parentid=$address.area1 value=$address.area2}-->
			  <!--{else}-->
			  <select name="area2" id="area2"><option value="">=请选择=</option></select>
			  <!--{/if}-->
			</span>
			<span id="json_area3">
			  <!--{if $address.area2 > 0}-->
			  <!--{area type='select' name='area' depth='3' child='1' text='=请选择=' parentid=$address.area2 value=$address.area3}-->
			  <!--{else}-->
			  <select name="area3" id="area3"><option value="">=请选择=</option></select>
			  <!--{/if}-->
			</span>
		  </td>
		</tr>
		<tr>
		  <th align="right">街道/地址：<font color="red">*</font></th>
		  <td>
			<input type="text" name="street" id="street" class="input-b" value="<!--{$address.street}-->" /> （不需要填写省/市）
		  </td>
		</tr>
		<tr>
		  <th align="right">邮政编码：</th>
		  <td>
			<input type="text" name="zipcode" id="zipcode" class="input-150" value="<!--{$address.zipcode}-->" />
		  </td>
		</tr>
		<tr>
		  <th align="right">联系电话：<font color="red">*</font></th>
		  <td>
			<input type="text" name="contphone" id="contphone" class="input-150" value="<!--{$address.contphone}-->" /> （手机或固定电话）
		  </td>
		</tr>
		<tr>
		  <th></th>
		  <td>
			<input type="button" id="btn_post" class="submit_btn1" value="编辑保存" /> 
		  </td>
		</tr>
	  </table>
	  </form>
	  <script type="text/javascript">
	  $(function(){
		$("#btn_post").bind("click", function(){
			if ($("#contname").val().length == 0) {
				ToastShow("请填写收货人姓名");
				return false;
			}
			if ($("#area1").find("option:selected").val() < 1) {
				ToastShow("请选择所在地区");
				return false;
			}
			if ($("#area2").find("option:selected").val() < 1) {
				ToastShow("请选择所在地区");
				return false;
			}
			if ($("#street").val().length == 0) {
				ToastShow("请填写街道/地址");
				return false;
			}
			if ($("#contphone").val().length == 0) {
				ToastShow("请填写联系电话");
				return false;
			}
			$("#myform").submit();
		});
	  });
	  </script>
	  <!--{/if}-->


	</div>
	<!--//oe_widget_center End-->

  </div>
  <!--//oem_uright End-->
  <div class="clear"></div>

</div>
<!--{include file="<!--{$oetplpath}-->widget_footer.tpl"}-->
</body>
</html>