暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

order_address.htm 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. {include file="public/layout" /}
  2. <body class="bodystyle" style="overflow-x: hidden;padding: 0;min-width: 674px;background: #fff;">
  3. <style type="text/css">
  4. .ncap-form-default dd.opt { width: 79%; }
  5. .select-express {border: 1px solid red !important; color: red !important;}
  6. </style>
  7. <div id="append_parent"></div>
  8. <div id="ajaxwaitid"></div>
  9. <div class="page" style="width: 810px;margin: 0 auto;">
  10. <div class="flexigrid">
  11. <form class="form-horizontal" id="postForm">
  12. <input type="hidden" name="order_id" value="{$order_id}">
  13. <div class="ncap-form-default">
  14. <div>
  15. <dl class="row">
  16. <dt class="tit"> <label><em>*</em>收货人姓名</label> </dt>
  17. <dd class="opt"> <input type="text" value="{$address.consignee}" name="consignee" id="consignee" class="input-txt"> </dd>
  18. </dl>
  19. <dl class="row">
  20. <dt class="tit"> <label><em>*</em>收货人手机</label> </dt>
  21. <dd class="opt"> <input type="text" value="{$address.mobile}" name="mobile" id="mobile" class="input-txt"> </dd>
  22. </dl>
  23. <dl class="row">
  24. <dt class="tit"> <label><em>*</em>收货地址</label> </dt>
  25. <dd class="opt">
  26. <select name="province" id='province' style="width: 148px;" onchange="getSpecifyRegion(this, 'province');">
  27. <option value="0">请选择省份</option>
  28. {volist name="$provinceList" id="vo"}
  29. <option value="{$vo.id}" {eq name="$vo.id" value="$address.province"}selected{/eq}>{$vo.name}</option>
  30. {/volist}
  31. </select>
  32. <select name="city" id='city' style="width: 148px;" onchange="getSpecifyRegion(this, 'city');">
  33. <option value="0">请选择城市</option>
  34. {volist name="$cityList" id="vo"}
  35. <option value="{$vo.id}" {eq name="$vo.id" value="$address.city"}selected{/eq}>{$vo.name}</option>
  36. {/volist}
  37. </select>
  38. <select name="district" id='district' style="width: 148px;">
  39. <option value="0">请选择区/县</option>
  40. {volist name="$areaList" id="vo"}
  41. <option value="{$vo.id}" {eq name="$vo.id" value="$address.district"}selected{/eq}>{$vo.name}</option>
  42. {/volist}
  43. </select>
  44. </dd>
  45. </dl>
  46. <dl class="row">
  47. <dt class="tit"> <label><em>*</em>详细地址</label> </dt>
  48. <dd class="opt"> <textarea rows="5" cols="60" name="address" style="height:60px;">{$address.address}</textarea> </dd>
  49. </dl>
  50. </div>
  51. </div>
  52. <div class="ncap-form-default">
  53. <div class="bot" style="padding-bottom:0px;">
  54. <a href="JavaScript:void(0);" onclick="submitForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">修改保存</a>
  55. </div>
  56. </div>
  57. </form>
  58. </div>
  59. </div>
  60. <script type="text/javascript">
  61. // 关闭自身弹窗
  62. function closeIframes() {
  63. var parentObj = parent.layer.getFrameIndex(window.name);
  64. if (parentObj) parent.window.location.reload();
  65. }
  66. // 获取联动地址
  67. function getSpecifyRegion(obj, type) {
  68. var parent_id = $(obj).val();
  69. if (!parent_id > 0) return false;
  70. var url = "{:url('Shop/ajaxGetSpecifyRegion')}";
  71. $.ajax({
  72. url : url,
  73. data: {parent_id: parent_id, _ajax: 1},
  74. type:'post',
  75. dataType:'json',
  76. success:function(res) {
  77. if ('province' == type) {
  78. res.data = '<option value="0">请选择城市</option>'+ res.data;
  79. $('#city').empty().html(res.data);
  80. $('#district').empty().html('<option value="0">请选择县/区/镇</option>');
  81. } else if ('city' == type) {
  82. res.data = '<option value="0">请选择县/区/镇</option>'+ res.data;
  83. $('#district').empty().html(res.data);
  84. }
  85. },
  86. error : function(e) {
  87. layer.closeAll();
  88. layer.alert(e.responseText, {icon: 5});
  89. }
  90. });
  91. }
  92. // 表单提交
  93. function submitForm() {
  94. layer_loading('正在处理');
  95. $.ajax({
  96. type: "POST",
  97. url : "{:url('Shop/order_address', ['_ajax'=>1])}",
  98. data: $('#postForm').serialize(),
  99. dataType: 'json',
  100. success: function (res) {
  101. layer.closeAll();
  102. if (1 == res.code) {
  103. layer.msg(res.msg, {time: 1000}, function() {
  104. closeIframes();
  105. });
  106. } else {
  107. layer.alert(res.msg, {icon: 2, title: false, closeBtn: 0});
  108. }
  109. },
  110. error:function(e){
  111. layer.closeAll();
  112. layer.alert(e.responseText, {icon: 2, title: false, closeBtn: 0});
  113. }
  114. });
  115. }
  116. </script>