123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- ##tlayout("wap/layout.htm",{head_title:"收货地址"}){
- <div class="body">
- <div class="pay_choose">
- <form action="/wap/user/updateAddress" method="post" id="submit_form">
- <div class="tip_title">用户信息</div>
- <div class="wells_row wells_row_notomargin">
- <div class="wells_item wells_item_input">
- <span class="wells_item_hd wells_item_hd_w5"><span style="color: red;">*</span>收件人</span>
- <span class="right_title right_title_w100">
- <input type="text" class="weui_input" placeholder="请输入收件人" name="take_name" value="${user.take_name!}" />
- </span>
- </div>
- <div class="wells_item wells_item_input">
- <span class="wells_item_hd wells_item_hd_w5"><span style="color: red;">*</span>手机号</span>
- <span class="right_title right_title_w100">
- <input type="tel" class="weui_input" placeholder="请输入手机号" name="take_phone" value="${user.take_phone!}" />
- </span>
- </div>
- <div class="wells_item wells_item_input">
- <span class="wells_item_hd wells_item_hd_w5">邮编</span>
- <span class="right_title right_title_w100">
- <input type="text" class="weui_input" placeholder="请输入邮编" name="take_post_code" value="${user.take_post_code!}" />
- </span>
- </div>
- </div>
- <div class="tip_title"><span style="color: red;">*</span>地区</div>
- <div class="wells_row wells_row_notomargin">
- <div class="wells_item wells_item_nopadding" id="area_list">
- <div class="weui-cell weui-cell_select">
- <div class="weui-cell__bd">
- <select class="weui-select" onchange="changeArea(this)" name="take_area_id" id="area_list_1">
- <option value="">--请选择--</option>
- ##for(_item in area_list!){
- <option value="${_item.id!}">${_item.name!}</option>
- ##}
- </select>
- </div>
- </div>
- </div>
- <div class="wells_item wells_item_nopadding">
- <textarea class="weui_textarea" name="take_address" placeholder="请输入详细地址" style="padding:10px 0;">${user.take_address!}</textarea>
- </div>
- </div>
- </form>
- </div>
- <div class="weui_btn_area">
- <a href="javascript:void(0)" onclick="submitForm()" class="weui_btn btn_success">保存</a>
- </div>
- </div>
- <a href="/wap" class="goback"><span>首页</span></a>
- <script>
- $(document).ready(function(){
- ##if(exist("area") && area!=null){
- ##if(area.level==1){
- $("#area_list_1").val("${area_1!}");
- ##}else if(area.level==2){
- $("#area_list_1").val("${area_1!}");
- $.post("/shop/getArea",{id:"${area_1!}"},function(data){
- if(data.success){
- if(data.area_list!=null && data.area_list.length!=0){
- $("#area_list_1").removeAttr("name");
- var html="";
- html+="<div class='weui-cell weui-cell_select'>";
- html+="<div class='weui-cell__bd'>";
- html+="<select class='weui-select' onchange='changeArea(this)' name='take_area_id' id='area_list_2'>";
- html+="<option value=''>--请选择--</option>";
- $.each(data.area_list,function(index, array){
- html+="<option value=" + array["id"] + ">" + array["name"] + "</option>";
- });
- html+="</select>";
- html+="</div>";
- html+="</div>";
- $("#area_list").append(html);
- $("#area_list_2").val("${area_2!}");
- }else{
- $("#area_list_1").attr("name", "take_area_id");
- }
- }else{
- alert(data.msg);
- }
- });
- ##}else{
- $("#area_list_1").val("${area_1!}");
- $.post("/shop/getArea",{id:"${area_1!}"},function(data){
- if(data.success){
- if(data.area_list!=null && data.area_list.length!=0){
- $("#area_list_1").removeAttr("name");
- var html="";
- html+="<div class='weui-cell weui-cell_select'>";
- html+="<div class='weui-cell__bd'>";
- html+="<select class='weui-select' onchange='changeArea(this)' name='take_area_id' id='area_list_2'>";
- html+="<option value=''>--请选择--</option>";
- $.each(data.area_list,function(index, array){
- html+="<option value=" + array["id"] + ">" + array["name"] + "</option>";
- });
- html+="</select>";
- html+="</div>";
- html+="</div>";
- $("#area_list").append(html);
- $("#area_list_2").val("${area_2!}");
- $.post("/shop/getArea",{id:"${area_2!}"},function(data_1){
- if(data_1.success){
- if(data_1.area_list!=null && data_1.area_list.length!=0){
- $("#area_list_2").removeAttr("name");
- var html="";
- html+="<div class='weui-cell weui-cell_select'>";
- html+="<div class='weui-cell__bd'>";
- html+="<select class='weui-select' onchange='changeArea(this)' name='take_area_id' id='area_list_3'>";
- html+="<option value=''>--请选择--</option>";
- $.each(data_1.area_list,function(index, array){
- html+="<option value=" + array["id"] + ">" + array["name"] + "</option>";
- });
- html+="</select>";
- html+="</div>";
- html+="</div>";
- $("#area_list").append(html);
- $("#area_list_3").val("${area_3!}");
- }else{
- $("#area_list_2").attr("name", "take_area_id");
- }
- }else{
- alert(data.msg);
- }
- });
- }else{
- $("#area_list_1").attr("name", "take_area_id");
- }
- }else{
- alert(data.msg);
- }
- });
- ##}
- ##}
- });
- function changeArea(object){
-
- $(object).parent().parent().nextAll().remove();
- if($(object).val()!=null && $(object).val()!=""){
- $.post("/wap/shop/getArea",{id:$(object).val()},function(data){
- if(data.success){
- if(data.area_list!=null && data.area_list.length!=0){
- $(object).removeAttr("name");
- var html="";
- html+="<div class='weui-cell weui-cell_select'>";
- html+="<div class='weui-cell__bd'>";
- html+="<select class='weui-select' onchange='changeArea(this)' name='take_area_id' id='area_list_" + ($("#area_list").find("select").length + 1) + "'>";
- html+="<option value=''>--请选择--</option>";
- $.each(data.area_list,function(index, array){
- html+="<option value=" + array["id"] + ">" + array["name"] + "</option>";
- });
- html+="</select>";
- html+="</div>";
- html+="</div>";
- $("#area_list").append(html);
- }else{
- $(object).attr("name", "take_area_id");
- }
- }else{
- alert(data.msg);
- }
- });
- }
- }
- function submitForm(){
-
- $('#submit_form').ajaxSubmit({
- success: function(data){
- alert(data.msg);
- if(data.success){
- ##if(type==1){
- window.location.href="/wap/shop/ordersMsg";
- ##}else{
- location.reload();
- ##}
- }
- }
- });
- }
- </script>
- ##}
|